/*! For license information please see community.bundle.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.TFWeb=t(require("react"),require("react-dom")):e.TFWeb=t(e.React,e.ReactDOM)}(this,((e,t)=>(()=>{var n={2066:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),a=c(i),s=c(n(2));function c(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==r(t)&&"function"!=typeof t?e:t}(this,Object.getPrototypeOf(t).call(this,e));return n.onDocMouseTouchMove=n.onDocMouseTouchMove.bind(n),n.onDocMouseTouchEnd=n.onDocMouseTouchEnd.bind(n),n.onImageLoad=n.onImageLoad.bind(n),n.onComponentMouseTouchDown=n.onComponentMouseTouchDown.bind(n),n.onComponentKeyDown=n.onComponentKeyDown.bind(n),n.onCropMouseTouchDown=n.onCropMouseTouchDown.bind(n),n.state={crop:n.nextCropState(n.props.crop),polygonId:n.getRandomInt(1,9e5)},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+r(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){if(document.addEventListener("mousemove",this.onDocMouseTouchMove),document.addEventListener("touchmove",this.onDocMouseTouchMove),document.addEventListener("mouseup",this.onDocMouseTouchEnd),document.addEventListener("touchend",this.onDocMouseTouchEnd),document.addEventListener("touchcancel",this.onDocMouseTouchEnd),this.imageRef.complete||this.imageRef.readyState)if(0===this.imageRef.naturalWidth){var e=this.imageRef.src;this.imageRef.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",this.imageRef.src=e}else this.onImageLoad(this.imageRef)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){if(e.crop){var t=this.nextCropState(e.crop);t.aspect&&(t=this.ensureAspectDimensions(t,this.imageRef)),this.cropInvalid=this.isCropInvalid(t),this.setState({crop:t})}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousemove",this.onDocMouseTouchMove),document.removeEventListener("touchmove",this.onDocMouseTouchMove),document.removeEventListener("mouseup",this.onDocMouseTouchEnd),document.removeEventListener("touchend",this.onDocMouseTouchEnd),document.removeEventListener("touchcancel",this.onDocMouseTouchEnd)}},{key:"onDocMouseTouchMove",value:function(e){if(!this.props.disabled&&this.mouseDownOnCrop){e.preventDefault();var t=this.state.crop,n=this.evData,r=this.getClientPos(e);n.isResize&&t.aspect&&n.cropOffset&&(r.y=this.straightenYPath(r.x));var o=r.x-n.clientStartX;n.xDiffPc=o/n.imageWidth*100;var i=r.y-n.clientStartY;n.yDiffPc=i/n.imageHeight*100,n.isResize?this.resizeCrop():this.dragCrop(),this.cropInvalid=!1,this.props.onChange&&this.props.onChange(t,this.getPixelCrop(t)),this.setState({crop:t})}}},{key:"onCropMouseTouchDown",value:function(e){if(!this.props.disabled){e.preventDefault();var t=this.state.crop,n=this.getClientPos(e);this.componentRef.focus();var r=e.target.dataset.ord,o="nw"===r||"w"===r||"sw"===r,i="nw"===r||"n"===r||"ne"===r,a=void 0;t.aspect&&(a=this.getElementOffset(this.cropSelectRef)),this.evData={imageWidth:this.imageRef.width,imageHeight:this.imageRef.height,clientStartX:n.x,clientStartY:n.y,cropStartWidth:t.width,cropStartHeight:t.height,cropStartX:o?t.x+t.width:t.x,cropStartY:i?t.y+t.height:t.y,xInversed:o,yInversed:i,xCrossOver:o,yCrossOver:i,startXCrossOver:o,startYCrossOver:i,isResize:e.target!==this.cropSelectRef,ord:r,cropOffset:a},this.mouseDownOnCrop=!0}}},{key:"onComponentMouseTouchDown",value:function(e){if((e.target===this.imageCopyRef||e.target===this.cropWrapperRef)&&!this.props.disabled){e.preventDefault();var t=!0===this.props.keepSelection?{}:this.state.crop,n=this.getClientPos(e);this.componentRef.focus();var r=this.getElementOffset(this.imageRef),o=(n.x-r.left)/this.imageRef.width*100,i=(n.y-r.top)/this.imageRef.height*100;t.x=o,t.y=i,t.width=0,t.height=0,this.evData={imageWidth:this.imageRef.width,imageHeight:this.imageRef.height,clientStartX:n.x,clientStartY:n.y,cropStartWidth:t.width,cropStartHeight:t.height,cropStartX:t.x,cropStartY:t.y,xInversed:!1,yInversed:!1,xCrossOver:!1,yCrossOver:!1,startXCrossOver:!1,startYCrossOver:!1,isResize:!0,ord:"nw"},this.mouseDownOnCrop=!0,this.setState({newCropIsBeingDrawn:!0})}}},{key:"onComponentKeyDown",value:function(e){var n=this;if(!this.props.disabled){var r=e.which,o=this.state.crop,i=!1;o.width&&o.height&&(r===t.arrowKey.left?(o.x-=t.nudgeStep,i=!0):r===t.arrowKey.right?(o.x+=t.nudgeStep,i=!0):r===t.arrowKey.up?(o.y-=t.nudgeStep,i=!0):r===t.arrowKey.down&&(o.y+=t.nudgeStep,i=!0),i&&(e.preventDefault(),o.x=this.clamp(o.x,0,100-o.width),o.y=this.clamp(o.y,0,100-o.height),this.setState({crop:o},(function(){n.props.onChange&&n.props.onChange(o,n.getPixelCrop(o)),n.props.onComplete&&n.props.onComplete(o,n.getPixelCrop(o))}))))}}},{key:"onDocMouseTouchEnd",value:function(){if(!this.props.disabled&&this.mouseDownOnCrop){var e=this.state.crop;this.cropInvalid=this.isCropInvalid(e),this.mouseDownOnCrop=!1,this.props.onComplete&&this.props.onComplete(e,this.getPixelCrop(e)),this.setState({newCropIsBeingDrawn:!1})}}},{key:"getPixelCrop",value:function(e){return{x:Math.round(this.imageRef.naturalWidth*(e.x/100)),y:Math.round(this.imageRef.naturalHeight*(e.y/100)),width:Math.round(this.imageRef.naturalWidth*(e.width/100)),height:Math.round(this.imageRef.naturalHeight*(e.height/100))}}},{key:"getPolygonValues",value:function(e){var t=this.state.crop,n=[t.x,t.y],r=[t.x+t.width,t.y],o=[t.x,t.y+t.height],i=[t.x+t.width,t.y+t.height];return e?(n=this.arrayDividedBy100(n),r=this.arrayDividedBy100(r),o=this.arrayDividedBy100(o),i=this.arrayDividedBy100(i)):(n=this.arrayToPercent(n),r=this.arrayToPercent(r),o=this.arrayToPercent(o),i=this.arrayToPercent(i)),{top:{left:n,right:r},bottom:{left:o,right:i}}}},{key:"getCropStyle",value:function(){return{top:this.state.crop.y+"%",left:this.state.crop.x+"%",width:this.state.crop.width+"%",height:this.state.crop.height+"%"}}},{key:"getEllipseValues",value:function(e){var t=this.state.crop,n=t.width/2,r=t.height/2,o=t.x+n,i=t.y+r;return e?(n/=100,r/=100,o/=100,i/=100):(n+="%",r+="%",o+="%",i+="%"),{cx:o,cy:i,rx:n,ry:r}}},{key:"getPolygonClipPath",value:function(){var e=this.getPolygonValues(),t=e.top,n=e.bottom;return"polygon("+t.left+", "+t.right+", "+n.right+", "+n.left+")"}},{key:"getEllipseClipPath",value:function(){var e=this.getEllipseValues();return"ellipse("+e.rx+" "+e.ry+" at "+e.cx+" "+e.cy+")"}},{key:"getElementOffset",value:function(e){var t=e.getBoundingClientRect(),n=document.documentElement;return{top:t.top+window.pageYOffset-n.clientTop,left:t.left+window.pageXOffset-n.clientLeft}}},{key:"getClientPos",value:function(e){var t=void 0,n=void 0;return e.touches?(t=e.touches[0].pageX,n=e.touches[0].pageY):(t=e.pageX,n=e.pageY),{x:t,y:n}}},{key:"getNewSize",value:function(){var e=this.state.crop,t=this.evData,n=t.imageWidth/t.imageHeight,r=t.cropStartWidth+t.xDiffPc;t.xCrossOver&&(r=Math.abs(r));var o=this.props.maxWidth;this.state.newCropIsBeingDrawn||(o=["nw","w","sw"].indexOf(t.inversedXOrd||t.ord)>-1?t.cropStartX:100-t.cropStartX,o=this.clamp(o,100,this.props.maxWidth)),r=this.clamp(r,this.props.minWidth||0,o);var i=void 0;i=e.aspect?r/e.aspect*n:t.cropStartHeight+t.yDiffPc,t.yCrossOver&&(i=Math.min(Math.abs(i),t.cropStartY));var a=this.props.maxHeight;return this.state.newCropIsBeingDrawn||(a=["nw","n","ne"].indexOf(t.inversedYOrd||t.ord)>-1?t.cropStartY:100-t.cropStartY,a=this.clamp(a,100,this.props.maxHeight)),i=this.clamp(i,this.props.minHeight||0,a),e.aspect&&(r=this.clamp(i*e.aspect/n,0,100)),{width:r,height:i}}},{key:"getRandomInt",value:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},{key:"getPolygonId",value:function(){return"ReactCropClipPolygon-"+this.state.polygonId}},{key:"dragCrop",value:function(){var e=this.state.crop,t=this.evData;e.x=this.clamp(t.cropStartX+t.xDiffPc,0,100-e.width),e.y=this.clamp(t.cropStartY+t.yDiffPc,0,100-e.height)}},{key:"resizeCrop",value:function(){var e=this.state.crop,n=this.evData,r=n.ord;n.xInversed&&(n.xDiffPc-=2*n.cropStartWidth),n.yInversed&&(n.yDiffPc-=2*n.cropStartHeight);var o=this.getNewSize(),i=n.cropStartX,a=n.cropStartY;n.xCrossOver&&(i=e.x+(e.width-o.width)),n.yCrossOver&&(a=!1===n.lastYCrossover?e.y-o.height:e.y+(e.height-o.height)),e.x=this.clamp(i,0,100-o.width),e.y=this.clamp(a,0,100-o.height),e.aspect||t.xyOrds.indexOf(r)>-1?(e.width=o.width,e.height=o.height):t.xOrds.indexOf(r)>-1?e.width=o.width:t.yOrds.indexOf(r)>-1&&(e.height=o.height),n.lastYCrossover=n.yCrossOver,this.crossOverCheck()}},{key:"straightenYPath",value:function(e){var t=this.evData,n=t.ord,r=t.cropOffset,o=t.cropStartWidth/100*t.imageWidth,i=t.cropStartHeight/100*t.imageHeight,a=void 0,s=void 0;return"nw"===n||"se"===n?(a=i/o,s=r.top-r.left*a):(a=-i/o,s=r.top+(i-r.left*a)),a*e+s}},{key:"onImageLoad",value:function(e){var t=this.state.crop;t.aspect&&(t=this.ensureAspectDimensions(t,e),this.cropInvalid=this.isCropInvalid(t),this.setState({crop:t})),this.props.onImageLoaded&&this.props.onImageLoaded(t,e,this.getPixelCrop(t))}},{key:"arrayDividedBy100",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?" ":arguments[1];return e.map((function(e){return e/100})).join(t)}},{key:"arrayToPercent",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?" ":arguments[1];return e.map((function(e){return e+"%"})).join(t)}},{key:"createCropSelection",value:function(){var e=this,t=this.getCropStyle(),n=this.state.crop.aspect,r=this.props.ellipse;return a.default.createElement("div",{ref:function(t){e.cropSelectRef=t},style:t,className:"ReactCrop--crop-selection",onMouseDown:this.onCropMouseTouchDown,onTouchStart:this.onCropMouseTouchDown},a.default.createElement("div",{className:"ReactCrop--drag-bar ord-n","data-ord":"n"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-e","data-ord":"e"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-s","data-ord":"s"}),a.default.createElement("div",{className:"ReactCrop--drag-bar ord-w","data-ord":"w"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-nw","data-ord":"nw"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-n","data-ord":"n"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-ne","data-ord":"ne"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-e","data-ord":"e"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-se","data-ord":"se"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-s","data-ord":"s"}),r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-sw","data-ord":"sw"}),n&&!r?null:a.default.createElement("div",{className:"ReactCrop--drag-handle ord-w","data-ord":"w"}))}},{key:"isCropInvalid",value:function(e){return!e.width||!e.height}},{key:"nextCropState",value:function(e){var n=(0,s.default)({},t.defaultCrop,e);return this.cropInvalid=this.isCropInvalid(n),n}},{key:"clamp",value:function(e,t,n){return Math.min(Math.max(e,t),n)}},{key:"crossOverCheck",value:function(){var e=this.evData;(!e.xCrossOver&&-Math.abs(e.cropStartWidth)-e.xDiffPc>=0||e.xCrossOver&&-Math.abs(e.cropStartWidth)-e.xDiffPc<=0)&&(e.xCrossOver=!e.xCrossOver),(!e.yCrossOver&&-Math.abs(e.cropStartHeight)-e.yDiffPc>=0||e.yCrossOver&&-Math.abs(e.cropStartHeight)-e.yDiffPc<=0)&&(e.yCrossOver=!e.yCrossOver);var t=e.xCrossOver!==e.startXCrossOver,n=e.yCrossOver!==e.startYCrossOver;e.inversedXOrd=!!t&&this.inverseOrd(e.ord),e.inversedYOrd=!!n&&this.inverseOrd(e.ord)}},{key:"inverseOrd",value:function(e){var t=void 0;return"n"===e?t="s":"ne"===e?t="sw":"e"===e?t="w":"se"===e?t="nw":"s"===e?t="n":"sw"===e?t="ne":"w"===e?t="e":"nw"===e&&(t="se"),t}},{key:"ensureAspectDimensions",value:function(e,t){var n=t.naturalWidth/t.naturalHeight,r=(0,s.default)({},e);return r.width?r.height=r.width/r.aspect*n:r.height&&(r.width=r.height*r.aspect/n),r.y+r.height>100&&(r.height=100-r.y,r.width=r.height*r.aspect/n),r.x+r.width>100&&(r.width=100-r.x,r.height=r.width/r.aspect*n),r}},{key:"renderSvg",value:function(){var e=void 0;if(this.props.ellipse)e=a.default.createElement("ellipse",this.getEllipseValues(!0));else{var t=this.getPolygonValues(!0),n=t.top,r=t.bottom;e=a.default.createElement("polygon",{points:n.left+", "+n.right+", "+r.right+", "+r.left})}return a.default.createElement("svg",{width:"0",height:"0",style:{position:"absolute"}},a.default.createElement("defs",null,a.default.createElement("clipPath",{id:this.getPolygonId(),clipPathUnits:"objectBoundingBox"},e)))}},{key:"render",value:function(){var e=this,t=void 0,n=void 0;this.cropInvalid||(t=this.createCropSelection(),n={WebkitClipPath:this.props.ellipse?this.getEllipseClipPath():this.getPolygonClipPath(),clipPath:'url("#'+this.getPolygonId()+'")'});var r=["ReactCrop"];return this.state.newCropIsBeingDrawn&&r.push("ReactCrop-new-crop"),this.state.crop.aspect&&r.push("ReactCrop-fixed-aspect"),this.props.ellipse&&r.push("ReactCrop-ellipse"),this.props.disabled&&r.push("ReactCrop--disabled"),a.default.createElement("div",{ref:function(t){e.componentRef=t},className:r.join(" "),onTouchStart:this.onComponentMouseTouchDown,onMouseDown:this.onComponentMouseTouchDown,tabIndex:"1",onKeyDown:this.onComponentKeyDown},this.renderSvg(),a.default.createElement("img",{ref:function(t){e.imageRef=t},crossOrigin:"anonymous",className:"ReactCrop--image",src:this.props.src,onLoad:function(t){e.onImageLoad(t.target)},alt:""}),a.default.createElement("div",{className:"ReactCrop--crop-wrapper",ref:function(t){e.cropWrapperRef=t}},a.default.createElement("img",{ref:function(t){e.imageCopyRef=t},className:"ReactCrop--image-copy",src:this.props.src,style:n,alt:""}),t),this.props.children)}}]),t}(i.Component);l.defaultProps={disabled:!1,maxWidth:100,maxHeight:100},l.xOrds=["e","w"],l.yOrds=["n","s"],l.xyOrds=["nw","ne","se","sw"],l.arrowKey={left:37,up:38,right:39,down:40},l.nudgeStep=.2,l.defaultCrop={x:0,y:0,width:0,height:0,aspect:!1},e.exports=l},function(e,t){e.exports=n(4639)},function(e,t){e.exports=n(2525)}])},1998:e=>{"use strict";var t="%[a-f0-9]{2}",n=new RegExp(t,"gi"),r=new RegExp("("+t+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],o(n),o(r))}function i(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=r.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var o=i(n[0]);o!==n[0]&&(t[n[0]]=o)}n=r.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),s=0;s<a.length;s++){var c=a[s];e=e.replace(new RegExp(c,"g"),t[c])}return e}(e)}}},1857:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function s(e,n,c){(c=c||{}).arrayMerge=c.arrayMerge||o,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=r;var l=Array.isArray(n);return l===Array.isArray(e)?l?c.arrayMerge(e,n,c):function(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(a(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return s;var n=t.customMerge(e);return"function"==typeof n?n:s}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}(e,n,c):r(n,c)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return s(e,n,t)}),{})};var c=s;e.exports=c},590:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(403),a=n(490),s=n(2104),c=n(6207),l=n(4702),u=n(7077),f=n(462),p=n(6130),h=n(3941),d=n(2351),y=p("draft_tree_data_support"),m=y?c:s,v=h.List,b=h.Repeat,g={insertAtomicBlock:function(e,t,n){var o=e.getCurrentContent(),s=e.getSelection(),c=l.removeRange(o,s,"backward"),p=c.getSelectionAfter(),h=l.splitBlock(c,p),d=h.getSelectionAfter(),g=l.setBlockType(h,d,"atomic"),w=a.create({entity:t}),E={key:f(),type:"atomic",text:n,characterList:v(b(w,n.length))},S={key:f(),type:"unstyled"};y&&(E=r({},E,{nextSibling:S.key}),S=r({},S,{prevSibling:E.key}));var O=[new m(E),new m(S)],_=i.createFromArray(O),k=l.replaceWithFragment(g,d,_),C=k.merge({selectionBefore:s,selectionAfter:k.getSelectionAfter().set("hasFocus",!0)});return u.push(e,C,"insert-fragment")},moveAtomicBlock:function(e,t,n,r){var o,i=e.getCurrentContent(),a=e.getSelection();if("before"===r||"after"===r){var s=i.getBlockForKey("before"===r?n.getStartKey():n.getEndKey());o=d(i,t,s,r)}else{var c=l.removeRange(i,n,"backward"),f=c.getSelectionAfter(),p=c.getBlockForKey(f.getFocusKey());if(0===f.getStartOffset())o=d(c,t,p,"before");else if(f.getEndOffset()===p.getLength())o=d(c,t,p,"after");else{var h=l.splitBlock(c,f),y=h.getSelectionAfter(),m=h.getBlockForKey(y.getFocusKey());o=d(h,t,m,"before")}}var v=o.merge({selectionBefore:a,selectionAfter:o.getSelectionAfter().set("hasFocus",!0)});return u.push(e,v,"move-block")}};e.exports=g},403:(e,t,n)=>{"use strict";var r=n(3941).OrderedMap,o={createFromArray:function(e){return r(e.map((function(e){return[e.getKey(),e]})))}};e.exports=o},3593:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(9572),i=n(2023),a=n(3941),s=a.List,c=a.Repeat,l=a.Record,u=function(){return!0},f=l({start:null,end:null}),p=l({start:null,end:null,decoratorKey:null,leaves:null}),h={generate:function(e,t,n){var r=t.getLength();if(!r)return s.of(new p({start:0,end:0,decoratorKey:null,leaves:s.of(new f({start:0,end:0}))}));var i=[],a=n?n.getDecorations(t,e):s(c(null,r)),l=t.getCharacterList();return o(a,d,u,(function(e,t){var n,r,c,h;i.push(new p({start:e,end:t,decoratorKey:a.get(e),leaves:(n=l.slice(e,t).toList(),r=e,c=[],h=n.map((function(e){return e.getStyle()})).toList(),o(h,d,u,(function(e,t){c.push(new f({start:e+r,end:t+r}))})),s(c))}))})),s(i)},fromJS:function(e){var t=e.leaves,n=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["leaves"]);return new p(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},n,{leaves:null!=t?s(Array.isArray(t)?t:i(t)).map((function(e){return f(e)})):null}))}};function d(e,t){return e===t}e.exports=h},490:(e,t,n)=>{"use strict";var r=n(3941),o=r.Map,i=r.OrderedSet,a=r.Record,s=i(),c={style:s,entity:null},l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=r.prototype;return a.getStyle=function(){return this.get("style")},a.getEntity=function(){return this.get("entity")},a.hasStyle=function(e){return this.getStyle().includes(e)},r.applyStyle=function(e,t){var n=e.set("style",e.getStyle().add(t));return r.create(n)},r.removeStyle=function(e,t){var n=e.set("style",e.getStyle().remove(t));return r.create(n)},r.applyEntity=function(e,t){var n=e.getEntity()===t?e:e.set("entity",t);return r.create(n)},r.create=function(e){if(!e)return u;var t=o({style:s,entity:null}).merge(e),n=f.get(t);if(n)return n;var i=new r(t);return f=f.set(t,i),i},r.fromJS=function(e){var t=e.style,n=e.entity;return new r({style:Array.isArray(t)?i(t):t,entity:Array.isArray(n)?i(n):n})},r}(a(c)),u=new l,f=o([[o(c),u]]);l.EMPTY=u,e.exports=l},8938:(e,t,n)=>{"use strict";var r=n(3941).List,o=function(){function e(e){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"_decorators",void 0),this._decorators=e.slice()}var t=e.prototype;return t.getDecorations=function(e,t){var n=Array(e.getText().length).fill(null);return this._decorators.forEach((function(r,o){var i=0;(0,r.strategy)(e,(function(e,t){(function(e,t,n){for(var r=t;r<n;r++)if(null!=e[r])return!1;return!0})(n,e,t)&&(function(e,t,n,r){for(var o=t;o<n;o++)e[o]=r}(n,e,t,o+"."+i),i++)}),t)})),r(n)},t.getComponentForKey=function(e){var t=parseInt(e.split(".")[0],10);return this._decorators[t].component},t.getPropsForKey=function(e){var t=parseInt(e.split(".")[0],10);return this._decorators[t].props},e}();e.exports=o},2104:(e,t,n)=>{"use strict";var r=n(490),o=n(9572),i=n(3941),a=i.List,s=i.Map,c=i.OrderedSet,l=i.Record,u=i.Repeat,f=c(),p=function(e){var t,n;function i(t){return e.call(this,function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(u(r.EMPTY,n.length))),e}(t))||this}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=i.prototype;return s.getKey=function(){return this.get("key")},s.getType=function(){return this.get("type")},s.getText=function(){return this.get("text")},s.getCharacterList=function(){return this.get("characterList")},s.getLength=function(){return this.getText().length},s.getDepth=function(){return this.get("depth")},s.getData=function(){return this.get("data")},s.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():f},s.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},s.findStyleRanges=function(e,t){o(this.getCharacterList(),h,e,t)},s.findEntityRanges=function(e,t){o(this.getCharacterList(),d,e,t)},i}(l({key:"",type:"unstyled",text:"",characterList:a(),depth:0,data:s()}));function h(e,t){return e.getStyle()===t.getStyle()}function d(e,t){return e.getEntity()===t.getEntity()}e.exports=p},6207:(e,t,n)=>{"use strict";var r=n(490),o=n(9572),i=n(3941),a=i.List,s=i.Map,c=i.OrderedSet,l=i.Record,u=i.Repeat,f=c(),p={parent:null,characterList:a(),data:s(),depth:0,key:"",text:"",type:"unstyled",children:a(),prevSibling:null,nextSibling:null},h=function(e,t){return e.getStyle()===t.getStyle()},d=function(e,t){return e.getEntity()===t.getEntity()},y=function(e){if(!e)return e;var t=e.characterList,n=e.text;return n&&!t&&(e.characterList=a(u(r.EMPTY,n.length))),e},m=function(e){var t,n;function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;return e.call(this,y(t))||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i=r.prototype;return i.getKey=function(){return this.get("key")},i.getType=function(){return this.get("type")},i.getText=function(){return this.get("text")},i.getCharacterList=function(){return this.get("characterList")},i.getLength=function(){return this.getText().length},i.getDepth=function(){return this.get("depth")},i.getData=function(){return this.get("data")},i.getInlineStyleAt=function(e){var t=this.getCharacterList().get(e);return t?t.getStyle():f},i.getEntityAt=function(e){var t=this.getCharacterList().get(e);return t?t.getEntity():null},i.getChildKeys=function(){return this.get("children")},i.getParentKey=function(){return this.get("parent")},i.getPrevSiblingKey=function(){return this.get("prevSibling")},i.getNextSiblingKey=function(){return this.get("nextSibling")},i.findStyleRanges=function(e,t){o(this.getCharacterList(),h,e,t)},i.findEntityRanges=function(e,t){o(this.getCharacterList(),d,e,t)},r}(l(p));e.exports=m},5481:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(403),a=n(490),s=n(2104),c=n(6207),l=n(4688),u=n(4680),f=n(462),p=n(2023),h=n(6130),d=n(3941),y=n(2140),m=d.List,v=d.Record,b=d.Repeat,g=d.Map,w=d.OrderedMap,E=v({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}),S=h("draft_tree_data_support")?c:s,O=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var s=o.prototype;return s.getEntityMap=function(){return l},s.getBlockMap=function(){return this.get("blockMap")},s.getSelectionBefore=function(){return this.get("selectionBefore")},s.getSelectionAfter=function(){return this.get("selectionAfter")},s.getBlockForKey=function(e){return this.getBlockMap().get(e)},s.getKeyBefore=function(e){return this.getBlockMap().reverse().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getKeyAfter=function(e){return this.getBlockMap().keySeq().skipUntil((function(t){return t===e})).skip(1).first()},s.getBlockAfter=function(e){return this.getBlockMap().skipUntil((function(t,n){return n===e})).skip(1).first()},s.getBlockBefore=function(e){return this.getBlockMap().reverse().skipUntil((function(t,n){return n===e})).skip(1).first()},s.getBlocksAsArray=function(){return this.getBlockMap().toArray()},s.getFirstBlock=function(){return this.getBlockMap().first()},s.getLastBlock=function(){return this.getBlockMap().last()},s.getPlainText=function(e){return this.getBlockMap().map((function(e){return e?e.getText():""})).join(e||"\n")},s.getLastCreatedEntityKey=function(){return l.__getLastCreatedEntityKey()},s.hasText=function(){var e=this.getBlockMap();return e.size>1||escape(e.first().getText()).replace(/%u200B/g,"").length>0},s.createEntity=function(e,t,n){return l.__create(e,t,n),this},s.mergeEntityData=function(e,t){return l.__mergeData(e,t),this},s.replaceEntityData=function(e,t){return l.__replaceData(e,t),this},s.addEntity=function(e){return l.__add(e),this},s.getEntity=function(e){return l.__get(e)},s.getAllEntities=function(){return l.__getAll()},s.loadWithEntities=function(e){return l.__loadWithEntities(e)},o.createFromBlockArray=function(e,t){var n=Array.isArray(e)?e:e.contentBlocks,r=i.createFromArray(n),a=r.isEmpty()?new u:u.createEmpty(r.first().getKey());return new o({blockMap:r,entityMap:t||l,selectionBefore:a,selectionAfter:a})},o.createFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,n=e.split(t),r=n.map((function(e){return e=y(e),new S({key:f(),text:e,type:"unstyled",characterList:m(b(a.EMPTY,e.length))})}));return o.createFromBlockArray(r)},o.fromJS=function(e){return new o(r({},e,{blockMap:w(e.blockMap).map(o.createContentBlockFromJS),selectionBefore:new u(e.selectionBefore),selectionAfter:new u(e.selectionAfter)}))},o.createContentBlockFromJS=function(e){var t=e.characterList;return new S(r({},e,{data:g(e.data),characterList:null!=t?m((Array.isArray(t)?t:p(t)).map((function(e){return a.fromJS(e)}))):void 0}))},o}(E);e.exports=O},7286:(e,t,n)=>{"use strict";var r=n(490),o=n(3941).Map,i={add:function(e,t,n){return a(e,t,n,!0)},remove:function(e,t,n){return a(e,t,n,!1)}};function a(e,t,n,i){var a=e.getBlockMap(),s=t.getStartKey(),c=t.getStartOffset(),l=t.getEndKey(),u=t.getEndOffset(),f=a.skipUntil((function(e,t){return t===s})).takeUntil((function(e,t){return t===l})).concat(o([[l,a.get(l)]])).map((function(e,t){var o,a;s===l?(o=c,a=u):(o=t===s?c:0,a=t===l?u:e.getLength());for(var f,p=e.getCharacterList();o<a;)f=p.get(o),p=p.set(o,i?r.applyStyle(f,n):r.removeStyle(f,n)),o++;return e.set("characterList",p)}));return e.merge({blockMap:a.merge(f),selectionBefore:t,selectionAfter:t})}e.exports=i},8057:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(5306),i=n(9704),a=n(2189),s=n(3941),c=n(7081),l=n(3946),u=s.Map,f={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},p=o.isBrowser("IE <= 11"),h=function(){function e(e){var t=this;r(this,"observer",void 0),r(this,"container",void 0),r(this,"mutations",void 0),r(this,"onCharData",void 0),this.container=e,this.mutations=u();var n=a(e);n.MutationObserver&&!p?this.observer=new n.MutationObserver((function(e){return t.registerMutations(e)})):this.onCharData=function(e){e.target instanceof Node||c(!1),t.registerMutation({type:"characterData",target:e.target})}}var t=e.prototype;return t.start=function(){this.observer?this.observer.observe(this.container,f):this.container.addEventListener("DOMCharacterDataModified",this.onCharData)},t.stopAndFlushMutations=function(){var e=this.observer;e?(this.registerMutations(e.takeRecords()),e.disconnect()):this.container.removeEventListener("DOMCharacterDataModified",this.onCharData);var t=this.mutations;return this.mutations=u(),t},t.registerMutations=function(e){for(var t=0;t<e.length;t++)this.registerMutation(e[t])},t.getMutationTextContent=function(e){var t=e.type,n=e.target,r=e.removedNodes;if("characterData"===t){if(""!==n.textContent)return p?n.textContent.replace("\n",""):n.textContent}else if("childList"===t){if(r&&r.length)return"";if(""!==n.textContent)return n.textContent}return null},t.registerMutation=function(e){var t=this.getMutationTextContent(e);if(null!=t){var n=l(i(e.target));this.mutations=this.mutations.set(n,t)}},e}();e.exports=h},7722:(e,t,n)=>{"use strict";var r=n(4639),o=n(5935),i=(0,n(3941).Map)({"header-one":{element:"h1"},"header-two":{element:"h2"},"header-three":{element:"h3"},"header-four":{element:"h4"},"header-five":{element:"h5"},"header-six":{element:"h6"},section:{element:"section"},article:{element:"article"},"unordered-list-item":{element:"li",wrapper:r.createElement("ul",{className:o("public/DraftStyleDefault/ul")})},"ordered-list-item":{element:"li",wrapper:r.createElement("ol",{className:o("public/DraftStyleDefault/ol")})},blockquote:{element:"blockquote"},atomic:{element:"figure"},"code-block":{element:"pre",wrapper:r.createElement("pre",{className:o("public/DraftStyleDefault/pre")})},unstyled:{element:"div",aliasedElements:["p"]}});e.exports=i},8742:e=>{"use strict";e.exports={BOLD:{fontWeight:"bold"},CODE:{fontFamily:"monospace",wordWrap:"break-word"},ITALIC:{fontStyle:"italic"},STRIKETHROUGH:{textDecoration:"line-through"},UNDERLINE:{textDecoration:"underline"}}},7704:(e,t,n)=>{"use strict";var r=n(590),o=n(403),i=n(490),a=n(8938),s=n(2104),c=n(5481),l=n(7722),u=n(8742),f=n(628),p=n(8610),h=n(4688),d=n(4702),y=n(7927),m=n(7077),v=n(72),b=n(1451),g=n(509),w=n(4680),E=n(1694),S=n(3702),O=n(462),_=n(6164),k=n(5452),C={Editor:f,EditorBlock:p,EditorState:m,CompositeDecorator:a,Entity:h,EntityInstance:y,BlockMapBuilder:o,CharacterMetadata:i,ContentBlock:s,ContentState:c,RawDraftContentState:b,SelectionState:w,AtomicBlockUtils:r,KeyBindingUtil:v,Modifier:d,RichUtils:g,DefaultDraftBlockRenderMap:l,DefaultDraftInlineStyle:u,convertFromHTML:n(9405),convertFromRaw:S,convertToRaw:E,genKey:O,getDefaultKeyBinding:_,getVisibleSelectionRect:k};e.exports=C},628:(e,t,n)=>{"use strict";var r=n(7002);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){s(e,t,n[t])}))}return e}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var l=n(7722),u=n(8742),f=n(4495),p=n(3922),h=n(2006),d=n(5601),y=n(4359),m=n(9027),v=n(6512),b=n(7077),g=n(4639),w=n(5754),E=n(4234),S=n(5306),O=n(5935),_=n(462),k=n(6164),C=n(3020),P=n(6130),j=n(7081),T=n(5435),x=n(3946),R=S.isBrowser("IE"),D=!R,N={edit:d,composite:f,drag:h,cut:null,render:null},M=!1,I=function(e){function t(){return e.apply(this,arguments)||this}c(t,e);var n=t.prototype;return n.render=function(){return null},n.componentDidMount=function(){this._update()},n.componentDidUpdate=function(){this._update()},n._update=function(){var e=this.props.editor;e._latestEditorState=this.props.editorState,e._blockSelectEvents=!0},t}(g.Component),A=function(e){function t(t){var n;return s(a(n=e.call(this,t)||this),"_blockSelectEvents",void 0),s(a(n),"_clipboard",void 0),s(a(n),"_handler",void 0),s(a(n),"_dragCount",void 0),s(a(n),"_internalDrag",void 0),s(a(n),"_editorKey",void 0),s(a(n),"_placeholderAccessibilityID",void 0),s(a(n),"_latestEditorState",void 0),s(a(n),"_latestCommittedEditorState",void 0),s(a(n),"_pendingStateFromBeforeInput",void 0),s(a(n),"_onBeforeInput",void 0),s(a(n),"_onBlur",void 0),s(a(n),"_onCharacterData",void 0),s(a(n),"_onCompositionEnd",void 0),s(a(n),"_onCompositionStart",void 0),s(a(n),"_onCopy",void 0),s(a(n),"_onCut",void 0),s(a(n),"_onDragEnd",void 0),s(a(n),"_onDragOver",void 0),s(a(n),"_onDragStart",void 0),s(a(n),"_onDrop",void 0),s(a(n),"_onInput",void 0),s(a(n),"_onFocus",void 0),s(a(n),"_onKeyDown",void 0),s(a(n),"_onKeyPress",void 0),s(a(n),"_onKeyUp",void 0),s(a(n),"_onMouseDown",void 0),s(a(n),"_onMouseUp",void 0),s(a(n),"_onPaste",void 0),s(a(n),"_onSelect",void 0),s(a(n),"editor",void 0),s(a(n),"editorContainer",void 0),s(a(n),"focus",void 0),s(a(n),"blur",void 0),s(a(n),"setMode",void 0),s(a(n),"exitCurrentMode",void 0),s(a(n),"restoreEditorDOM",void 0),s(a(n),"setClipboard",void 0),s(a(n),"getClipboard",void 0),s(a(n),"getEditorKey",void 0),s(a(n),"update",void 0),s(a(n),"onDragEnter",void 0),s(a(n),"onDragLeave",void 0),s(a(n),"_handleEditorContainerRef",(function(e){n.editorContainer=e,n.editor=null!==e?e.firstChild:null})),s(a(n),"focus",(function(e){var t=n.props.editorState,r=t.getSelection().getHasFocus(),o=n.editor;if(o){var i=E.getScrollParent(o),a=e||C(i),s=a.x,c=a.y;T(o)||j(!1),o.focus(),i===window?window.scrollTo(s,c):w.setTop(i,c),r||n.update(b.forceSelection(t,t.getSelection()))}})),s(a(n),"blur",(function(){var e=n.editor;e&&(T(e)||j(!1),e.blur())})),s(a(n),"setMode",(function(e){var t=n.props,r=t.onPaste,o=t.onCut,a=t.onCopy,s=i({},N.edit);r&&(s.onPaste=r),o&&(s.onCut=o),a&&(s.onCopy=a);var c=i({},N,{edit:s});n._handler=c[e]})),s(a(n),"exitCurrentMode",(function(){n.setMode("edit")})),s(a(n),"restoreEditorDOM",(function(e){n.setState({contentsKey:n.state.contentsKey+1},(function(){n.focus(e)}))})),s(a(n),"setClipboard",(function(e){n._clipboard=e})),s(a(n),"getClipboard",(function(){return n._clipboard})),s(a(n),"update",(function(e){n._latestEditorState=e,n.props.onChange(e)})),s(a(n),"onDragEnter",(function(){n._dragCount++})),s(a(n),"onDragLeave",(function(){n._dragCount--,0===n._dragCount&&n.exitCurrentMode()})),n._blockSelectEvents=!1,n._clipboard=null,n._handler=null,n._dragCount=0,n._editorKey=t.editorKey||_(),n._placeholderAccessibilityID="placeholder-"+n._editorKey,n._latestEditorState=t.editorState,n._latestCommittedEditorState=t.editorState,n._onBeforeInput=n._buildHandler("onBeforeInput"),n._onBlur=n._buildHandler("onBlur"),n._onCharacterData=n._buildHandler("onCharacterData"),n._onCompositionEnd=n._buildHandler("onCompositionEnd"),n._onCompositionStart=n._buildHandler("onCompositionStart"),n._onCopy=n._buildHandler("onCopy"),n._onCut=n._buildHandler("onCut"),n._onDragEnd=n._buildHandler("onDragEnd"),n._onDragOver=n._buildHandler("onDragOver"),n._onDragStart=n._buildHandler("onDragStart"),n._onDrop=n._buildHandler("onDrop"),n._onInput=n._buildHandler("onInput"),n._onFocus=n._buildHandler("onFocus"),n._onKeyDown=n._buildHandler("onKeyDown"),n._onKeyPress=n._buildHandler("onKeyPress"),n._onKeyUp=n._buildHandler("onKeyUp"),n._onMouseDown=n._buildHandler("onMouseDown"),n._onMouseUp=n._buildHandler("onMouseUp"),n._onPaste=n._buildHandler("onPaste"),n._onSelect=n._buildHandler("onSelect"),n.getEditorKey=function(){return n._editorKey},n.state={contentsKey:0},n}c(t,e);var r=t.prototype;return r._buildHandler=function(e){var t=this;return function(n){if(!t.props.readOnly){var r=t._handler&&t._handler[e];r&&(y?y((function(){return r(t,n)})):r(t,n))}}},r._showPlaceholder=function(){return!!this.props.placeholder&&!this.props.editorState.isInCompositionMode()&&!this.props.editorState.getCurrentContent().hasText()},r._renderPlaceholder=function(){if(this._showPlaceholder()){var e={text:x(this.props.placeholder),editorState:this.props.editorState,textAlignment:this.props.textAlignment,accessibilityID:this._placeholderAccessibilityID};return g.createElement(m,e)}return null},r._renderARIADescribedBy=function(){var e=this.props.ariaDescribedBy||"",t=this._showPlaceholder()?this._placeholderAccessibilityID:"";return e.replace("{{editor_id_placeholder}}",t)||void 0},r.render=function(){var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,a=e.customStyleFn,s=e.customStyleMap,c=e.editorState,l=e.preventScroll,f=e.readOnly,h=e.textAlignment,d=e.textDirectionality,y=O({"DraftEditor/root":!0,"DraftEditor/alignLeft":"left"===h,"DraftEditor/alignRight":"right"===h,"DraftEditor/alignCenter":"center"===h}),m=this.props.role||"textbox",v="combobox"===m?!!this.props.ariaExpanded:null,b={blockRenderMap:t,blockRendererFn:n,blockStyleFn:r,customStyleMap:i({},u,s),customStyleFn:a,editorKey:this._editorKey,editorState:c,preventScroll:l,textDirectionality:d};return g.createElement("div",{className:y},this._renderPlaceholder(),g.createElement("div",{className:O("DraftEditor/editorContainer"),ref:this._handleEditorContainerRef},g.createElement("div",{"aria-activedescendant":f?null:this.props.ariaActiveDescendantID,"aria-autocomplete":f?null:this.props.ariaAutoComplete,"aria-controls":f?null:this.props.ariaControls,"aria-describedby":this._renderARIADescribedBy(),"aria-expanded":f?null:v,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-multiline":this.props.ariaMultiline,"aria-owns":f?null:this.props.ariaOwneeID,autoCapitalize:this.props.autoCapitalize,autoComplete:this.props.autoComplete,autoCorrect:this.props.autoCorrect,className:O({notranslate:!f,"public/DraftEditor/content":!0}),contentEditable:!f,"data-testid":this.props.webDriverTestID,onBeforeInput:this._onBeforeInput,onBlur:this._onBlur,onCompositionEnd:this._onCompositionEnd,onCompositionStart:this._onCompositionStart,onCopy:this._onCopy,onCut:this._onCut,onDragEnd:this._onDragEnd,onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onDragOver:this._onDragOver,onDragStart:this._onDragStart,onDrop:this._onDrop,onFocus:this._onFocus,onInput:this._onInput,onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onKeyUp:this._onKeyUp,onMouseUp:this._onMouseUp,onPaste:this._onPaste,onSelect:this._onSelect,ref:this.props.editorRef,role:f?null:m,spellCheck:D&&this.props.spellCheck,style:{outline:"none",userSelect:"text",WebkitUserSelect:"text",whiteSpace:"pre-wrap",wordWrap:"break-word"},suppressContentEditableWarning:!0,tabIndex:this.props.tabIndex},g.createElement(I,{editor:this,editorState:c}),g.createElement(p,o({},b,{key:"contents"+this.state.contentsKey})))))},r.componentDidMount=function(){this._blockSelectEvents=!1,!M&&P("draft_ods_enabled")&&(M=!0,v.initODS()),this.setMode("edit"),R&&(this.editor?this.editor.ownerDocument.execCommand("AutoUrlDetect",!1,!1):n.g.execCommand("AutoUrlDetect",!1,!1))},r.componentDidUpdate=function(){this._blockSelectEvents=!1,this._latestEditorState=this.props.editorState,this._latestCommittedEditorState=this.props.editorState},t}(g.Component);s(A,"defaultProps",{ariaDescribedBy:"{{editor_id_placeholder}}",blockRenderMap:l,blockRendererFn:function(){return null},blockStyleFn:function(){return""},keyBindingFn:k,readOnly:!1,spellCheck:!1,stripPastedStyles:!1}),e.exports=A},8610:(e,t,n)=>{"use strict";var r=n(7002);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(8757),c=n(5044),l=n(4639),u=n(5754),f=n(4234),p=n(3172),h=n(1644),d=n(5935),y=n(6076),m=n(3020),v=n(448),b=n(7081),g=n(5435),w=n(3946),E=function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t},S=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return a(i(t=e.call.apply(e,[this].concat(r))||this),"_node",void 0),t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var S=r.prototype;return S.shouldComponentUpdate=function(e){return this.props.block!==e.block||this.props.tree!==e.tree||this.props.direction!==e.direction||E(e.selection,e.block.getKey())&&e.forceSelection},S.componentDidMount=function(){if(!this.props.preventScroll){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var n=this._node;if(null!=n){var r,o=f.getScrollParent(n),i=m(o);if(o===window){var a=y(n);(r=a.y+a.height-v().height)>0&&window.scrollTo(i.x,i.y+r+10)}else g(n)||b(!1),(r=n.offsetHeight+n.offsetTop-(o.offsetTop+o.offsetHeight+i.y))>0&&u.setTop(o,u.getTop(o)+r+10)}}}},S._renderChildren=function(){var e=this,t=this.props.block,n=t.getKey(),r=t.getText(),i=this.props.tree.size-1,a=E(this.props.selection,n);return this.props.tree.map((function(u,f){var d=u.get("leaves");if(0===d.size)return null;var y=d.size-1,m=d.map((function(o,u){var p=c.encode(n,f,u),h=o.get("start"),d=o.get("end");return l.createElement(s,{key:p,offsetKey:p,block:t,start:h,selection:a?e.props.selection:null,forceSelection:e.props.forceSelection,text:r.slice(h,d),styleSet:t.getInlineStyleAt(h),customStyleMap:e.props.customStyleMap,customStyleFn:e.props.customStyleFn,isLast:f===i&&u===y})})).toArray(),v=u.get("decoratorKey");if(null==v)return m;if(!e.props.decorator)return m;var b=w(e.props.decorator),g=b.getComponentForKey(v);if(!g)return m;var E=b.getPropsForKey(v),S=c.encode(n,f,0),O=d.first().get("start"),_=d.last().get("end"),k=r.slice(O,_),C=t.getEntityAt(u.get("start")),P=h.getHTMLDirIfDifferent(p.getDirection(k),e.props.direction),j={contentState:e.props.contentState,decoratedText:k,dir:P,start:O,end:_,blockKey:n,entityKey:C,offsetKey:S};return l.createElement(g,o({},E,j,{key:S}),m)})).toArray()},S.render=function(){var e=this,t=this.props,n=t.direction,r=t.offsetKey,o=d({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===n,"public/DraftStyleDefault/rtl":"RTL"===n});return l.createElement("div",{"data-offset-key":r,className:o,ref:function(t){return e._node=t}},this._renderChildren())},r}(l.Component);e.exports=S},7045:(e,t,n)=>{"use strict";var r=n(7002);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){s(e,t,n[t])}))}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c=n(9793),l=n(5044),u=n(4639),f=n(5754),p=n(4234),h=n(6076),d=n(3020),y=n(448),m=n(3941),v=n(7081),b=n(5435),g=(m.List,function(e,t){return e.getAnchorKey()===t||e.getFocusKey()===t}),w=function(e,t){var n=t.get(e.getType())||t.get("unstyled"),r=n.wrapper;return{Element:n.element||t.get("unstyled").element,wrapperTemplate:r}},E=function(e,t){var n=t(e);return n?{CustomComponent:n.component,customProps:n.props,customEditable:n.editable}:{}},S=function(e,t,n,r,o,i){var s={"data-block":!0,"data-editor":t,"data-offset-key":n,key:e.getKey(),ref:i},c=r(e);return c&&(s.className=c),void 0!==o.customEditable&&(s=a({},s,{contentEditable:o.customEditable,suppressContentEditableWarning:!0})),s},O=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return s(i(t=e.call.apply(e,[this].concat(r))||this),"wrapperRef",u.createRef()),t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var m=r.prototype;return m.shouldComponentUpdate=function(e){var t=this.props,n=t.block,r=t.direction,o=t.tree,i=!n.getChildKeys().isEmpty(),a=n!==e.block||o!==e.tree||r!==e.direction||g(e.selection,e.block.getKey())&&e.forceSelection;return i||a},m.componentDidMount=function(){var e=this.props.selection,t=e.getEndKey();if(e.getHasFocus()&&t===this.props.block.getKey()){var n=this.wrapperRef.current;if(n){var r,o=p.getScrollParent(n),i=d(o);if(o===window){var a=h(n);(r=a.y+a.height-y().height)>0&&window.scrollTo(i.x,i.y+r+10)}else{b(n)||v(!1);var s=n;(r=s.offsetHeight+s.offsetTop-(o.offsetHeight+i.y))>0&&f.setTop(o,f.getTop(o)+r+10)}}}},m.render=function(){var e=this,t=this.props,n=t.block,i=t.blockRenderMap,s=t.blockRendererFn,f=t.blockStyleFn,p=t.contentState,h=t.decorator,d=t.editorKey,y=t.editorState,m=t.customStyleFn,v=t.customStyleMap,b=t.direction,O=t.forceSelection,_=t.selection,k=t.tree,C=null;n.children.size&&(C=n.children.reduce((function(t,n){var o=l.encode(n,0,0),c=p.getBlockForKey(n),h=E(c,s),m=h.CustomComponent||r,v=w(c,i),b=v.Element,g=v.wrapperTemplate,O=S(c,d,o,f,h,null),_=a({},e.props,{tree:y.getBlockTree(n),blockProps:h.customProps,offsetKey:o,block:c});return t.push(u.createElement(b,O,u.createElement(m,_))),!g||function(e,t){var n=e.getNextSiblingKey();return!!n&&t.getBlockForKey(n).getType()===e.getType()}(c,p)||function(e,t,n){var r=[],o=!0,i=!1,a=void 0;try{for(var s,c=n.reverse()[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var f=s.value;if(f.type!==t)break;r.push(f)}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}n.splice(n.indexOf(r[0]),r.length+1);var p=r.reverse(),h=p[0].key;n.push(u.cloneElement(e,{key:"".concat(h,"-wrap"),"data-offset-key":l.encode(h,0,0)},p))}(g,b,t),t}),[]));var P=n.getKey(),j=l.encode(P,0,0),T=E(n,s),x=T.CustomComponent,R=null!=x?u.createElement(x,o({},this.props,{tree:y.getBlockTree(P),blockProps:T.customProps,offsetKey:j,block:n})):u.createElement(c,{block:n,children:C,contentState:p,customStyleFn:m,customStyleMap:v,decorator:h,direction:b,forceSelection:O,hasSelection:g(_,P),selection:_,tree:k});if(n.getParentKey())return R;var D=w(n,i).Element,N=S(n,d,j,f,T,this.wrapperRef);return u.createElement(D,N,R)},r}(u.Component);e.exports=O},4495:(e,t,n)=>{"use strict";var r=n(8057),o=n(4702),i=n(5044),a=n(7077),s=n(9119),c=n(5306),l=n(8762),u=n(4489),f=n(9938),p=n(3522),h=n(3946),d=c.isBrowser("IE"),y=!1,m=!1,v=null,b={onCompositionStart:function(e){m=!0,function(e){v||(v=new r(u(e))).start()}(e)},onCompositionEnd:function(e){y=!1,m=!1,setTimeout((function(){y||b.resolveComposition(e)}),20)},onSelect:l,onKeyDown:function(e,t){if(!m)return b.resolveComposition(e),void e._onKeyDown(t);t.which!==s.RIGHT&&t.which!==s.LEFT||t.preventDefault()},onKeyPress:function(e,t){t.which===s.RETURN&&t.preventDefault()},resolveComposition:function(e){if(!m){var t=h(v).stopAndFlushMutations();v=null,y=!0;var n=a.set(e._latestEditorState,{inCompositionMode:!1});if(e.exitCurrentMode(),t.size){var r=n.getCurrentContent();t.forEach((function(e,t){var s=i.decode(t),c=s.blockKey,l=s.decoratorKey,u=s.leafKey,f=n.getBlockTree(c).getIn([l,"leaves",u]),h=f.start,d=f.end,y=n.getSelection().merge({anchorKey:c,focusKey:c,anchorOffset:h,focusOffset:d,isBackward:!1}),m=p(r,y),v=r.getBlockForKey(c).getInlineStyleAt(h);r=o.replaceText(r,y,e,v,m),n=a.set(n,{currentContent:r})}));var s=f(n,u(e)).selectionState;e.restoreEditorDOM();var c=d?a.forceSelection(n,s):a.acceptSelection(n,s);e.update(a.push(c,r,"insert-characters"))}else e.update(n)}}};e.exports=b},4337:(e,t,n)=>{"use strict";var r=n(7002);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){a(e,t,n[t])}))}return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=n(8610),c=n(5044),l=n(4639),u=n(5935),f=n(7022),p=n(3946),h=function(e,t,n,r){return u({"public/DraftStyleDefault/unorderedListItem":"unordered-list-item"===e,"public/DraftStyleDefault/orderedListItem":"ordered-list-item"===e,"public/DraftStyleDefault/reset":n,"public/DraftStyleDefault/depth0":0===t,"public/DraftStyleDefault/depth1":1===t,"public/DraftStyleDefault/depth2":2===t,"public/DraftStyleDefault/depth3":3===t,"public/DraftStyleDefault/depth4":t>=4,"public/DraftStyleDefault/listLTR":"LTR"===r,"public/DraftStyleDefault/listRTL":"RTL"===r})},d=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=r.prototype;return a.shouldComponentUpdate=function(e){var t=this.props.editorState,n=e.editorState;if(t.getDirectionMap()!==n.getDirectionMap())return!0;if(t.getSelection().getHasFocus()!==n.getSelection().getHasFocus())return!0;var r=n.getNativelyRenderedContent(),o=t.isInCompositionMode(),i=n.isInCompositionMode();if(t===n||null!==r&&n.getCurrentContent()===r||o&&i)return!1;var a=t.getCurrentContent(),s=n.getCurrentContent(),c=t.getDecorator(),l=n.getDecorator();return o!==i||a!==s||c!==l||n.mustForceSelection()},a.render=function(){for(var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,a=e.customStyleMap,u=e.customStyleFn,d=e.editorState,y=e.editorKey,m=e.preventScroll,v=e.textDirectionality,b=d.getCurrentContent(),g=d.getSelection(),w=d.mustForceSelection(),E=d.getDecorator(),S=p(d.getDirectionMap()),O=b.getBlocksAsArray(),_=[],k=null,C=null,P=0;P<O.length;P++){var j=O[P],T=j.getKey(),x=j.getType(),R=n(j),D=void 0,N=void 0,M=void 0;R&&(D=R.component,N=R.props,M=R.editable);var I=v||S.get(T),A=c.encode(T,0,0),L={contentState:b,block:j,blockProps:N,blockStyleFn:r,customStyleMap:a,customStyleFn:u,decorator:E,direction:I,forceSelection:w,offsetKey:A,preventScroll:m,selection:g,tree:d.getBlockTree(T)},B=t.get(x)||t.get("unstyled"),F=B.wrapper,U=B.element||t.get("unstyled").element,K=j.getDepth(),q="";r&&(q=r(j)),"li"===U&&(q=f(q,h(x,K,C!==F||null===k||K>k,I)));var V=D||s,z={className:q,"data-block":!0,"data-editor":y,"data-offset-key":A,key:T};void 0!==M&&(z=i({},z,{contentEditable:M,suppressContentEditableWarning:!0}));var W=l.createElement(U,z,l.createElement(V,o({},L,{key:T})));_.push({block:W,wrapperTemplate:F,key:T,offsetKey:A}),k=F?j.getDepth():null,C=F}for(var H=[],$=0;$<_.length;){var J=_[$];if(J.wrapperTemplate){var G=[];do{G.push(_[$].block),$++}while($<_.length&&_[$].wrapperTemplate===J.wrapperTemplate);var Q=l.cloneElement(J.wrapperTemplate,{key:J.key+"-wrap","data-offset-key":J.offsetKey},G);H.push(Q)}else H.push(J.block),$++}return l.createElement("div",{"data-contents":"true"},H)},r}(l.Component);e.exports=d},3922:(e,t,n)=>{"use strict";var r=n(6130)("draft_tree_data_support");e.exports=n(r?6086:4337)},6086:(e,t,n)=>{"use strict";var r=n(7002);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i=n(7045),a=n(5044),s=n(4639),c=n(3946),l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var l=r.prototype;return l.shouldComponentUpdate=function(e){var t=this.props.editorState,n=e.editorState;if(t.getDirectionMap()!==n.getDirectionMap())return!0;if(t.getSelection().getHasFocus()!==n.getSelection().getHasFocus())return!0;var r=n.getNativelyRenderedContent(),o=t.isInCompositionMode(),i=n.isInCompositionMode();if(t===n||null!==r&&n.getCurrentContent()===r||o&&i)return!1;var a=t.getCurrentContent(),s=n.getCurrentContent(),c=t.getDecorator(),l=n.getDecorator();return o!==i||a!==s||c!==l||n.mustForceSelection()},l.render=function(){for(var e=this.props,t=e.blockRenderMap,n=e.blockRendererFn,r=e.blockStyleFn,l=e.customStyleMap,u=e.customStyleFn,f=e.editorState,p=e.editorKey,h=e.textDirectionality,d=f.getCurrentContent(),y=f.getSelection(),m=f.mustForceSelection(),v=f.getDecorator(),b=c(f.getDirectionMap()),g=[],w=d.getBlocksAsArray()[0];w;){var E=w.getKey(),S={blockRenderMap:t,blockRendererFn:n,blockStyleFn:r,contentState:d,customStyleFn:u,customStyleMap:l,decorator:v,editorKey:p,editorState:f,forceSelection:m,selection:y,block:w,direction:h||b.get(E),tree:f.getBlockTree(E)},O=(t.get(w.getType())||t.get("unstyled")).wrapper;g.push({block:s.createElement(i,o({key:E},S)),wrapperTemplate:O,key:E,offsetKey:a.encode(E,0,0)});var _=w.getNextSiblingKey();w=_?d.getBlockForKey(_):null}for(var k=[],C=0;C<g.length;){var P=g[C];if(P.wrapperTemplate){var j=[];do{j.push(g[C].block),C++}while(C<g.length&&g[C].wrapperTemplate===P.wrapperTemplate);var T=s.cloneElement(P.wrapperTemplate,{key:P.key+"-wrap","data-offset-key":P.offsetKey},j);k.push(T)}else k.push(P.block),C++}return s.createElement("div",{"data-contents":"true"},k)},r}(s.Component);e.exports=l},1908:(e,t,n)=>{"use strict";var r=n(7002);function o(){return o=r||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}var i=n(5044),a=n(4639),s=n(3172),c=n(1644),l=function(e){var t,n;function r(){return e.apply(this,arguments)||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.prototype.render=function(){var e=this.props,t=e.block,n=e.children,r=e.contentState,l=e.decorator,u=e.decoratorKey,f=e.direction,p=e.leafSet,h=e.text,d=t.getKey(),y=p.get("leaves"),m=l.getComponentForKey(u),v=l.getPropsForKey(u),b=i.encode(d,parseInt(u,10),0),g=h.slice(y.first().get("start"),y.last().get("end")),w=c.getHTMLDirIfDifferent(s.getDirection(g),f);return a.createElement(m,o({},v,{contentState:r,decoratedText:g,dir:w,key:b,entityKey:t.getEntityAt(p.get("start")),offsetKey:b}),n)},r}(a.Component);e.exports=l},2006:(e,t,n)=>{"use strict";var r=n(1045),o=n(4702),i=n(7077),a=n(9704),s=n(8681),c=n(5711),l=n(7546),u=n(2189),f=n(8231),p=n(3946),h={onDragEnd:function(e){e.exitCurrentMode(),d(e)},onDrop:function(e,t){var n=new r(t.nativeEvent.dataTransfer),u=e._latestEditorState,h=function(e,t){var n=null,r=null,o=s(e.currentTarget);if("function"==typeof o.caretRangeFromPoint){var i=o.caretRangeFromPoint(e.x,e.y);n=i.startContainer,r=i.startOffset}else{if(!e.rangeParent)return null;n=e.rangeParent,r=e.rangeOffset}n=p(n),r=p(r);var c=p(a(n));return l(t,c,r,c,r)}(t.nativeEvent,u);if(t.preventDefault(),e._dragCount=0,e.exitCurrentMode(),null!=h){var m=n.getFiles();if(m.length>0){if(e.props.handleDroppedFiles&&f(e.props.handleDroppedFiles(h,m)))return;c(m,(function(t){t&&e.update(y(u,h,t))}))}else{var v=e._internalDrag?"internal":"external";e.props.handleDrop&&f(e.props.handleDrop(h,n,v))||(e._internalDrag?e.update(function(e,t){var n=o.moveText(e.getCurrentContent(),e.getSelection(),t);return i.push(e,n,"insert-fragment")}(u,h)):e.update(y(u,h,n.getText()))),d(e)}}}};function d(e){e._internalDrag=!1;var t=e.editorContainer;if(t){var n=new MouseEvent("mouseup",{view:u(t),bubbles:!0,cancelable:!0});t.dispatchEvent(n)}}function y(e,t,n){var r=o.insertText(e.getCurrentContent(),t,n,e.getCurrentInlineStyle());return i.push(e,r,"insert-fragment")}e.exports=h},5601:(e,t,n)=>{"use strict";var r=n(5306),o=n(7571),i=n(1014),a=n(3905),s=n(1435),c=n(548),l=n(6241),u=n(1301),f=n(2906),p=n(4089),h=n(8881),d=n(8257),y=n(8762),m=r.isBrowser("Chrome"),v=r.isBrowser("Firefox"),b=m||v?y:function(e){},g={onBeforeInput:o,onBlur:i,onCompositionStart:a,onCopy:s,onCut:c,onDragOver:l,onDragStart:u,onFocus:f,onInput:p,onKeyDown:h,onPaste:d,onSelect:y,onMouseUp:b,onKeyUp:b};e.exports=g},4359:(e,t,n)=>{"use strict";var r=n(1346).unstable_flushControlled;e.exports=r},8757:(e,t,n)=>{"use strict";var r=n(7002);function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(6642),s=n(4639),c=n(7081),l=n(6959),u=n(2337).setDraftEditorSelection,f=function(e){var t,n;function f(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return i(o(t=e.call.apply(e,[this].concat(r))||this),"leaf",void 0),t}n=e,(t=f).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var p=f.prototype;return p._setSelection=function(){var e=this.props.selection;if(null!=e&&e.getHasFocus()){var t=this.props,n=t.block,r=t.start,o=t.text,i=n.getKey(),a=r+o.length;if(e.hasEdgeWithin(i,r,a)){var s=this.leaf;s||c(!1);var f,p=s.firstChild;p||c(!1),p.nodeType===Node.TEXT_NODE?f=p:l(p)?f=s:(f=p.firstChild)||c(!1),u(e,f,i,r,a)}}},p.shouldComponentUpdate=function(e){var t=this.leaf;return t||c(!1),t.textContent!==e.text||e.styleSet!==this.props.styleSet||e.forceSelection},p.componentDidUpdate=function(){this._setSelection()},p.componentDidMount=function(){this._setSelection()},p.render=function(){var e=this,t=this.props.block,n=this.props.text;n.endsWith("\n")&&this.props.isLast&&(n+="\n");var o=this.props,i=o.customStyleMap,c=o.customStyleFn,l=o.offsetKey,u=o.styleSet,f=u.reduce((function(e,t){var n={},o=i[t];return void 0!==o&&e.textDecoration!==o.textDecoration&&(n.textDecoration=[e.textDecoration,o.textDecoration].join(" ").trim()),r(e,o,n)}),{});if(c){var p=c(u,t);f=r(f,p)}return s.createElement("span",{"data-offset-key":l,ref:function(t){return e.leaf=t},style:f},s.createElement(a,null,n))},f}(s.Component);e.exports=f},9793:(e,t,n)=>{"use strict";var r=n(1908),o=n(8757),i=n(5044),a=n(3941),s=n(4639),c=n(5935),l=(a.List,function(e){var t,n;function a(){return e.apply(this,arguments)||this}return n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,a.prototype.render=function(){var e=this.props,t=e.block,n=e.contentState,a=e.customStyleFn,l=e.customStyleMap,u=e.decorator,f=e.direction,p=e.forceSelection,h=e.hasSelection,d=e.selection,y=e.tree,m=t.getKey(),v=t.getText(),b=y.size-1,g=this.props.children||y.map((function(e,c){var y=e.get("decoratorKey"),g=e.get("leaves"),w=g.size-1,E=g.map((function(e,n){var r=i.encode(m,c,n),u=e.get("start"),f=e.get("end");return s.createElement(o,{key:r,offsetKey:r,block:t,start:u,selection:h?d:null,forceSelection:p,text:v.slice(u,f),styleSet:t.getInlineStyleAt(u),customStyleMap:l,customStyleFn:a,isLast:y===b&&n===w})})).toArray();return y&&u?s.createElement(r,{block:t,children:E,contentState:n,decorator:u,decoratorKey:y,direction:f,leafSet:e,text:v,key:c}):E})).toArray();return s.createElement("div",{"data-offset-key":i.encode(m,0,0),className:c({"public/DraftStyleDefault/block":!0,"public/DraftStyleDefault/ltr":"LTR"===f,"public/DraftStyleDefault/rtl":"RTL"===f})},g)},a}(s.Component));e.exports=l},9027:(e,t,n)=>{"use strict";var r=n(4639),o=n(5935),i=function(e){var t,n;function i(){return e.apply(this,arguments)||this}n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var a=i.prototype;return a.shouldComponentUpdate=function(e){return this.props.text!==e.text||this.props.editorState.getSelection().getHasFocus()!==e.editorState.getSelection().getHasFocus()},a.render=function(){var e=this.props.editorState.getSelection().getHasFocus(),t=o({"public/DraftEditorPlaceholder/root":!0,"public/DraftEditorPlaceholder/hasFocus":e});return r.createElement("div",{className:t},r.createElement("div",{className:o("public/DraftEditorPlaceholder/inner"),id:this.props.accessibilityID,style:{whiteSpace:"pre-wrap"}},this.props.text))},i}(r.Component);e.exports=i},6642:(e,t,n)=>{"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(4639),a=n(5306),s=n(7081),c=n(9509),l=a.isBrowser("IE <= 11"),u=function(e){var t,n;function a(t){var n;return o(r(n=e.call(this,t)||this),"_forceFlag",void 0),o(r(n),"_node",void 0),n._forceFlag=!1,n}n=e,(t=a).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var u=a.prototype;return u.shouldComponentUpdate=function(e){var t=this._node,n=""===e.children;c(t)||s(!1);var r=t;return n?!function(e){return l?"\n"===e.textContent:"BR"===e.tagName}(r):r.textContent!==e.children},u.componentDidMount=function(){this._forceFlag=!this._forceFlag},u.componentDidUpdate=function(){this._forceFlag=!this._forceFlag},u.render=function(){var e,t=this;return""===this.props.children?this._forceFlag?(e=function(e){return t._node=e},l?i.createElement("span",{key:"A","data-text":"true",ref:e},"\n"):i.createElement("br",{key:"A","data-text":"true",ref:e})):function(e){return l?i.createElement("span",{key:"B","data-text":"true",ref:e},"\n"):i.createElement("br",{key:"B","data-text":"true",ref:e})}((function(e){return t._node=e})):i.createElement("span",{key:this._forceFlag?"A":"B","data-text":"true",ref:function(e){return t._node=e}},this.props.children)},a}(i.Component);e.exports=u},6512:e=>{"use strict";e.exports={initODS:function(){},handleExtensionCausedError:function(){}}},4688:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(7927),i=n(3941),a=n(7081),s=n(5634),c=(0,i.Map)(),l=s();function u(e,t){console.warn("WARNING: "+e+' will be deprecated soon!\nPlease use "'+t+'" instead.')}var f={getLastCreatedEntityKey:function(){return u("DraftEntity.getLastCreatedEntityKey","contentState.getLastCreatedEntityKey"),f.__getLastCreatedEntityKey()},create:function(e,t,n){return u("DraftEntity.create","contentState.createEntity"),f.__create(e,t,n)},add:function(e){return u("DraftEntity.add","contentState.addEntity"),f.__add(e)},get:function(e){return u("DraftEntity.get","contentState.getEntity"),f.__get(e)},__getAll:function(){return c},__loadWithEntities:function(e){c=e,l=s()},mergeData:function(e,t){return u("DraftEntity.mergeData","contentState.mergeEntityData"),f.__mergeData(e,t)},replaceData:function(e,t){return u("DraftEntity.replaceData","contentState.replaceEntityData"),f.__replaceData(e,t)},__getLastCreatedEntityKey:function(){return l},__create:function(e,t,n){return f.__add(new o({type:e,mutability:t,data:n||{}}))},__add:function(e){return l=s(),c=c.set(l,e),l},__get:function(e){var t=c.get(e);return t||a(!1),t},__mergeData:function(e,t){var n=f.__get(e),o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},n.getData(),t),i=n.set("data",o);return c=c.set(e,i),i},__replaceData:function(e,t){var n=f.__get(e).set("data",t);return c=c.set(e,n),n}};e.exports=f},7927:(e,t,n)=>{"use strict";var r=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.getType=function(){return this.get("type")},o.getMutability=function(){return this.get("mutability")},o.getData=function(){return this.get("data")},r}((0,n(3941).Record)({type:"TOKEN",mutability:"IMMUTABLE",data:Object}));e.exports=r},3688:e=>{"use strict";e.exports={getRemovalRange:function(e,t,n,r,o){var i=n.split(" ");i=i.map((function(e,t){if("forward"===o){if(t>0)return" "+e}else if(t<i.length-1)return e+" ";return e}));for(var a,s=r,c=null,l=null,u=0;u<i.length;u++){if(e<(a=s+i[u].length)&&s<t)null!==c||(c=s),l=a;else if(null!==c)break;s=a}var f=r+n.length,p=c===r,h=l===f;return(!p&&h||p&&!h)&&("forward"===o?l!==f&&l++:c!==r&&c--),{start:c,end:l}}}},3405:e=>{"use strict";e.exports={logBlockedSelectionEvent:function(){return null},logSelectionStateFailure:function(){return null}}},4702:(e,t,n)=>{"use strict";var r=n(490),o=n(7286),i=n(9717),a=n(8655),s=n(9845),c=n(3941),l=n(9657),u=n(3163),f=n(7081),p=n(2356),h=n(4511),d=n(4217),y=n(8124),m=c.OrderedSet,v={replaceText:function(e,t,n,o,i){var a=h(e,t),s=d(a,t),c=r.create({style:o||m(),entity:i||null});return u(s,s.getSelectionAfter(),n,c)},insertText:function(e,t,n,r,o){return t.isCollapsed()||f(!1),v.replaceText(e,t,n,r,o)},moveText:function(e,t,n){var r=s(e,t),o=v.removeRange(e,t,"backward");return v.replaceWithFragment(o,n,r)},replaceWithFragment:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA",o=h(e,t),i=d(o,t);return l(i,i.getSelectionAfter(),n,r)},removeRange:function(e,t,n){var r,o,i,s;t.getIsBackward()&&(t=t.merge({anchorKey:t.getFocusKey(),anchorOffset:t.getFocusOffset(),focusKey:t.getAnchorKey(),focusOffset:t.getAnchorOffset(),isBackward:!1})),r=t.getAnchorKey(),o=t.getFocusKey(),i=e.getBlockForKey(r),s=e.getBlockForKey(o);var c=t.getStartOffset(),l=t.getEndOffset(),u=i.getEntityAt(c),f=s.getEntityAt(l-1);if(r===o&&u&&u===f){var p=a(e.getEntityMap(),i,s,t,n);return d(e,p)}var y=h(e,t);return d(y,t)},splitBlock:function(e,t){var n=h(e,t),r=d(n,t);return y(r,r.getSelectionAfter())},applyInlineStyle:function(e,t,n){return o.add(e,t,n)},removeInlineStyle:function(e,t,n){return o.remove(e,t,n)},setBlockType:function(e,t,n){return p(e,t,(function(e){return e.merge({type:n,depth:0})}))},setBlockData:function(e,t,n){return p(e,t,(function(e){return e.merge({data:n})}))},mergeBlockData:function(e,t,n){return p(e,t,(function(e){return e.merge({data:e.getData().merge(n)})}))},applyEntity:function(e,t,n){var r=h(e,t);return i(r,t,n)}};e.exports=v},5044:e=>{"use strict";var t="-",n={encode:function(e,n,r){return e+t+n+t+r},decode:function(e){var n=e.split(t).reverse(),r=n[0],o=n[1];return{blockKey:n.slice(2).reverse().join(t),decoratorKey:parseInt(o,10),leafKey:parseInt(r,10)}}};e.exports=n},5252:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(2104),i=n(6207),a=n(9405),s=n(462),c=n(1539),l=n(6130),u=n(3941),f=n(2140),p=u.List,h=u.Repeat,d=l("draft_tree_data_support"),y=d?i:o,m={processHTML:function(e,t){return a(e,c,t)},processText:function(e,t,n){return e.reduce((function(e,o,i){o=f(o);var a=s(),c={key:a,type:n,text:o,characterList:p(h(t,o.length))};if(d&&0!==i){var l=i-1;c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},c,{prevSibling:(e[l]=e[l].merge({nextSibling:a})).getKey()})}return e.push(new y(c)),e}),[])}};e.exports=m},1111:(e,t,n)=>{"use strict";var r="\\s|(?![_])"+n(6156).getPunctuation(),o=new RegExp("^(?:"+r+")*(?:['‘’]|(?!"+r+").)*(?:(?!"+r+").)"),i=new RegExp("(?:(?!"+r+").)(?:['‘’]|(?!"+r+").)*(?:"+r+")*$");function a(e,t){var n=t?i.exec(e):o.exec(e);return n?n[0]:e}var s={getBackward:function(e){return a(e,!0)},getForward:function(e){return a(e,!1)}};e.exports=s},9532:e=>{"use strict";var t={stringify:function(e){return"_"+String(e)},unstringify:function(e){return e.slice(1)}};e.exports=t},2780:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(462),a=n(7081),s=function(e){if(!e||!e.type)return!1;var t=e.type;return"unordered-list-item"===t||"ordered-list-item"===t},c={fromRawTreeStateToRawState:function(e){var t=e.blocks,n=[];return Array.isArray(t)||a(!1),Array.isArray(t)&&t.length?(function(e,t){for(var o=[].concat(e).reverse();o.length;){var i=o.pop();u=void 0,u=r({},l=i),s(l)&&(u.depth=u.depth||0,function(e){Array.isArray(e.children)&&(e.children=e.children.map((function(t){return t.type===e.type?r({},t,{depth:(e.depth||0)+1}):t})))}(l),null!=l.children&&l.children.length>0)||(delete u.children,n.push(u));var c=i.children;Array.isArray(c)||a(!1),o=o.concat([].concat(c.reverse()))}var l,u}(t),e.blocks=n,r({},e,{blocks:n})):e},fromRawStateToRawTreeState:function(e){var t=[],n=[];return e.blocks.forEach((function(e){var o=s(e),a=e.depth||0,c=r({},e,{children:[]});if(o){var l=n[0];if(null==l&&0===a)t.push(c);else if(null==l||l.depth<a-1){var u={key:i(),text:"",depth:a-1,type:e.type,children:[],entityRanges:[],inlineStyleRanges:[]};n.unshift(u),1===a?t.push(u):null!=l&&l.children.push(u),u.children.push(c)}else if(l.depth===a-1)l.children.push(c);else{for(;null!=l&&l.depth>=a;)n.shift(),l=n[0];a>0?l.children.push(c):t.push(c)}}else t.push(c)})),r({},e,{blocks:t})}};e.exports=c},9067:(e,t,n)=>{"use strict";n(2264),e.exports={isValidBlock:function(e,t){var n=e.getKey(),r=e.getParentKey();if(null!=r&&!t.get(r).getChildKeys().includes(n))return!1;if(!e.getChildKeys().map((function(e){return t.get(e)})).every((function(e){return e.getParentKey()===n})))return!1;var o=e.getPrevSiblingKey();if(null!=o&&t.get(o).getNextSiblingKey()!==n)return!1;var i=e.getNextSiblingKey();return(null==i||t.get(i).getPrevSiblingKey()===n)&&!(null!==i&&null!==o&&o===i||""!=e.text&&e.getChildKeys().size>0)},isConnectedTree:function(e){var t=e.toArray().filter((function(e){return null==e.getParentKey()&&null==e.getPrevSiblingKey()}));if(1!==t.length)return!1;for(var n=0,r=t.shift().getKey(),o=[];null!=r;){var i=e.get(r),a=i.getChildKeys(),s=i.getNextSiblingKey();if(a.size>0){null!=s&&o.unshift(s);var c=a.map((function(t){return e.get(t)})).find((function(e){return null==e.getPrevSiblingKey()}));if(null==c)return!1;r=c.getKey()}else r=null!=i.getNextSiblingKey()?i.getNextSiblingKey():o.shift();n++}return n===e.size},isValidTree:function(e){var t=this;return!!e.toArray().every((function(n){return t.isValidBlock(n,e)}))&&this.isConnectedTree(e)}}},2461:(e,t,n)=>{"use strict";var r,o=n(2573),i=n(3941),a=n(3946),s=i.OrderedMap,c={getDirectionMap:function(e,t){r?r.reset():r=new o;var n=e.getBlockMap(),c=n.valueSeq().map((function(e){return a(r).getDirection(e.getText())})),l=s(n.keySeq().zip(c));return null!=t&&i.is(t,l)?t:l}};e.exports=c},7077:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(3593),a=n(5481),s=n(2461),c=n(4680),l=n(3941),u=l.OrderedSet,f=l.Record,p=l.Stack,h=l.OrderedMap,d=l.List,y=f({allowUndo:!0,currentContent:null,decorator:null,directionMap:null,forceSelection:!1,inCompositionMode:!1,inlineStyleOverride:null,lastChangeType:null,nativelyRenderedContent:null,redoStack:p(),selection:null,treeMap:null,undoStack:p()}),m=function(){t.createEmpty=function(e){return this.createWithText("",e)},t.createWithText=function(e,n){return t.createWithContent(a.createFromText(e),n)},t.createWithContent=function(e,n){if(0===e.getBlockMap().count())return t.createEmpty(n);var r=e.getBlockMap().first().getKey();return t.create({currentContent:e,undoStack:p(),redoStack:p(),decorator:n||null,selection:c.createEmpty(r)})},t.create=function(e){var n=e.currentContent,o=r({},e,{treeMap:b(n,e.decorator),directionMap:s.getDirectionMap(n)});return new t(new y(o))},t.fromJS=function(e){return new t(new y(r({},e,{directionMap:null!=e.directionMap?h(e.directionMap):e.directionMap,inlineStyleOverride:null!=e.inlineStyleOverride?u(e.inlineStyleOverride):e.inlineStyleOverride,nativelyRenderedContent:null!=e.nativelyRenderedContent?a.fromJS(e.nativelyRenderedContent):e.nativelyRenderedContent,redoStack:null!=e.redoStack?p(e.redoStack.map((function(e){return a.fromJS(e)}))):e.redoStack,selection:null!=e.selection?new c(e.selection):e.selection,treeMap:null!=e.treeMap?h(e.treeMap).map((function(e){return d(e).map((function(e){return i.fromJS(e)}))})):e.treeMap,undoStack:null!=e.undoStack?p(e.undoStack.map((function(e){return a.fromJS(e)}))):e.undoStack,currentContent:a.fromJS(e.currentContent)})))},t.set=function(e,n){return new t(e.getImmutable().withMutations((function(t){var r=t.get("decorator"),o=r;null===n.decorator?o=null:n.decorator&&(o=n.decorator);var a=n.currentContent||e.getCurrentContent();if(o!==r){var s,c=t.get("treeMap");return s=o&&r?function(e,t,n,r,o){return n.merge(t.toSeq().filter((function(t){return r.getDecorations(t,e)!==o.getDecorations(t,e)})).map((function(t){return i.generate(e,t,r)})))}(a,a.getBlockMap(),c,o,r):b(a,o),void t.merge({decorator:o,treeMap:s,nativelyRenderedContent:null})}a!==e.getCurrentContent()&&t.set("treeMap",function(e,t,n,r){var o=e.getCurrentContent().set("entityMap",n),a=o.getBlockMap();return e.getImmutable().get("treeMap").merge(t.toSeq().filter((function(e,t){return e!==a.get(t)})).map((function(e){return i.generate(o,e,r)})))}(e,a.getBlockMap(),a.getEntityMap(),o)),t.merge(n)})))};var e=t.prototype;function t(e){o(this,"_immutable",void 0),this._immutable=e}return e.toJS=function(){return this.getImmutable().toJS()},e.getAllowUndo=function(){return this.getImmutable().get("allowUndo")},e.getCurrentContent=function(){return this.getImmutable().get("currentContent")},e.getUndoStack=function(){return this.getImmutable().get("undoStack")},e.getRedoStack=function(){return this.getImmutable().get("redoStack")},e.getSelection=function(){return this.getImmutable().get("selection")},e.getDecorator=function(){return this.getImmutable().get("decorator")},e.isInCompositionMode=function(){return this.getImmutable().get("inCompositionMode")},e.mustForceSelection=function(){return this.getImmutable().get("forceSelection")},e.getNativelyRenderedContent=function(){return this.getImmutable().get("nativelyRenderedContent")},e.getLastChangeType=function(){return this.getImmutable().get("lastChangeType")},e.getInlineStyleOverride=function(){return this.getImmutable().get("inlineStyleOverride")},t.setInlineStyleOverride=function(e,n){return t.set(e,{inlineStyleOverride:n})},e.getCurrentInlineStyle=function(){var e=this.getInlineStyleOverride();if(null!=e)return e;var t=this.getCurrentContent(),n=this.getSelection();return n.isCollapsed()?function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r>0?o.getInlineStyleAt(r-1):o.getLength()?o.getInlineStyleAt(0):w(e,n)}(t,n):function(e,t){var n=t.getStartKey(),r=t.getStartOffset(),o=e.getBlockForKey(n);return r<o.getLength()?o.getInlineStyleAt(r):r>0?o.getInlineStyleAt(r-1):w(e,n)}(t,n)},e.getBlockTree=function(e){return this.getImmutable().getIn(["treeMap",e])},e.isSelectionAtStartOfContent=function(){var e=this.getCurrentContent().getBlockMap().first().getKey();return this.getSelection().hasEdgeWithin(e,0,0)},e.isSelectionAtEndOfContent=function(){var e=this.getCurrentContent().getBlockMap().last(),t=e.getLength();return this.getSelection().hasEdgeWithin(e.getKey(),t,t)},e.getDirectionMap=function(){return this.getImmutable().get("directionMap")},t.acceptSelection=function(e,t){return v(e,t,!1)},t.forceSelection=function(e,t){return t.getHasFocus()||(t=t.set("hasFocus",!0)),v(e,t,!0)},t.moveSelectionToEnd=function(e){var n=e.getCurrentContent().getLastBlock(),r=n.getKey(),o=n.getLength();return t.acceptSelection(e,new c({anchorKey:r,anchorOffset:o,focusKey:r,focusOffset:o,isBackward:!1}))},t.moveFocusToEnd=function(e){var n=t.moveSelectionToEnd(e);return t.forceSelection(n,n.getSelection())},t.push=function(e,n,r){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.getCurrentContent()===n)return e;var i=s.getDirectionMap(n,e.getDirectionMap());if(!e.getAllowUndo())return t.set(e,{currentContent:n,directionMap:i,lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:o,inlineStyleOverride:null});var a=e.getSelection(),c=e.getCurrentContent(),l=e.getUndoStack(),u=n;a!==c.getSelectionAfter()||g(e,r)?(l=l.push(c),u=u.set("selectionBefore",a)):"insert-characters"!==r&&"backspace-character"!==r&&"delete-character"!==r||(u=u.set("selectionBefore",c.getSelectionBefore()));var f=e.getInlineStyleOverride(),h=["adjust-depth","change-block-type","split-block"];-1===h.indexOf(r)&&(f=null);var d={currentContent:u,directionMap:i,undoStack:l,redoStack:p(),lastChangeType:r,selection:n.getSelectionAfter(),forceSelection:o,inlineStyleOverride:f};return t.set(e,d)},t.undo=function(e){if(!e.getAllowUndo())return e;var n=e.getUndoStack(),r=n.peek();if(!r)return e;var o=e.getCurrentContent(),i=s.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:i,undoStack:n.shift(),redoStack:e.getRedoStack().push(o),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"undo",nativelyRenderedContent:null,selection:o.getSelectionBefore()})},t.redo=function(e){if(!e.getAllowUndo())return e;var n=e.getRedoStack(),r=n.peek();if(!r)return e;var o=e.getCurrentContent(),i=s.getDirectionMap(r,e.getDirectionMap());return t.set(e,{currentContent:r,directionMap:i,undoStack:e.getUndoStack().push(o),redoStack:n.shift(),forceSelection:!0,inlineStyleOverride:null,lastChangeType:"redo",nativelyRenderedContent:null,selection:r.getSelectionAfter()})},e.getImmutable=function(){return this._immutable},t}();function v(e,t,n){return m.set(e,{selection:t,forceSelection:n,nativelyRenderedContent:null,inlineStyleOverride:null})}function b(e,t){return e.getBlockMap().map((function(n){return i.generate(e,n,t)})).toOrderedMap()}function g(e,t){return t!==e.getLastChangeType()||"insert-characters"!==t&&"backspace-character"!==t&&"delete-character"!==t}function w(e,t){var n=e.getBlockMap().reverse().skipUntil((function(e,n){return n===t})).skip(1).skipUntil((function(e,t){return e.getLength()})).first();return n?n.getInlineStyleAt(n.getLength()-1):u()}e.exports=m},72:(e,t,n)=>{"use strict";var r=n(5306),o=n(6731),i=r.isPlatform("Mac OS X"),a={isCtrlKeyCommand:function(e){return!!e.ctrlKey&&!e.altKey},isOptionKeyCommand:function(e){return i&&e.altKey},usesMacOSHeuristics:function(){return i},hasCommandModifier:function(e){return i?!!e.metaKey&&!e.altKey:a.isCtrlKeyCommand(e)},isSoftNewlineEvent:o};e.exports=a},1451:()=>{},509:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(798),a=n(3946),s={currentBlockContainsLink:function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=n.getEntityMap();return n.getBlockForKey(t.getAnchorKey()).getCharacterList().slice(t.getStartOffset(),t.getEndOffset()).some((function(e){var t=e.getEntity();return!!t&&"LINK"===r.__get(t).getType()}))},getCurrentBlockType:function(e){var t=e.getSelection();return e.getCurrentContent().getBlockForKey(t.getStartKey()).getType()},getDataObjectForLinkURL:function(e){return{url:e.toString()}},handleKeyCommand:function(e,t,n){switch(t){case"bold":return s.toggleInlineStyle(e,"BOLD");case"italic":return s.toggleInlineStyle(e,"ITALIC");case"underline":return s.toggleInlineStyle(e,"UNDERLINE");case"code":return s.toggleCode(e);case"backspace":case"backspace-word":case"backspace-to-start-of-line":return s.onBackspace(e);case"delete":case"delete-word":case"delete-to-end-of-block":return s.onDelete(e);default:return null}},insertSoftNewline:function(e){var t=r.insertText(e.getCurrentContent(),e.getSelection(),"\n",e.getCurrentInlineStyle(),null),n=o.push(e,t,"insert-characters");return o.forceSelection(n,t.getSelectionAfter())},onBackspace:function(e){var t=e.getSelection();if(!t.isCollapsed()||t.getAnchorOffset()||t.getFocusOffset())return null;var n=e.getCurrentContent(),r=t.getStartKey(),i=n.getBlockBefore(r);if(i&&"atomic"===i.getType()){var a=n.getBlockMap().delete(i.getKey()),c=n.merge({blockMap:a,selectionAfter:t});if(c!==n)return o.push(e,c,"remove-range")}var l=s.tryToRemoveBlockStyle(e);return l?o.push(e,l,"change-block-type"):null},onDelete:function(e){var t=e.getSelection();if(!t.isCollapsed())return null;var n=e.getCurrentContent(),i=t.getStartKey(),a=n.getBlockForKey(i).getLength();if(t.getStartOffset()<a)return null;var s=n.getBlockAfter(i);if(!s||"atomic"!==s.getType())return null;var c=t.merge({focusKey:s.getKey(),focusOffset:s.getLength()}),l=r.removeRange(n,c,"forward");return l!==n?o.push(e,l,"remove-range"):null},onTab:function(e,t,n){var r=t.getSelection(),a=r.getAnchorKey();if(a!==r.getFocusKey())return t;var s=t.getCurrentContent(),c=s.getBlockForKey(a),l=c.getType();if("unordered-list-item"!==l&&"ordered-list-item"!==l)return t;e.preventDefault();var u=c.getDepth();if(!e.shiftKey&&u===n)return t;var f=i(s,r,e.shiftKey?-1:1,n);return o.push(t,f,"adjust-depth")},toggleBlockType:function(e,t){var n=e.getSelection(),i=n.getStartKey(),s=n.getEndKey(),c=e.getCurrentContent(),l=n;if(i!==s&&0===n.getEndOffset()){var u=a(c.getBlockBefore(s));s=u.getKey(),l=l.merge({anchorKey:i,anchorOffset:n.getStartOffset(),focusKey:s,focusOffset:u.getLength(),isBackward:!1})}if(c.getBlockMap().skipWhile((function(e,t){return t!==i})).reverse().skipWhile((function(e,t){return t!==s})).some((function(e){return"atomic"===e.getType()})))return e;var f=c.getBlockForKey(i).getType()===t?"unstyled":t;return o.push(e,r.setBlockType(c,l,f),"change-block-type")},toggleCode:function(e){var t=e.getSelection(),n=t.getAnchorKey(),r=t.getFocusKey();return t.isCollapsed()||n!==r?s.toggleBlockType(e,"code-block"):s.toggleInlineStyle(e,"CODE")},toggleInlineStyle:function(e,t){var n=e.getSelection(),i=e.getCurrentInlineStyle();if(n.isCollapsed())return o.setInlineStyleOverride(e,i.has(t)?i.remove(t):i.add(t));var a,s=e.getCurrentContent();return a=i.has(t)?r.removeInlineStyle(s,n,t):r.applyInlineStyle(s,n,t),o.push(e,a,"change-inline-style")},toggleLink:function(e,t,n){var i=r.applyEntity(e.getCurrentContent(),t,n);return o.push(e,i,"apply-entity")},tryToRemoveBlockStyle:function(e){var t=e.getSelection(),n=t.getAnchorOffset();if(t.isCollapsed()&&0===n){var o=t.getAnchorKey(),i=e.getCurrentContent(),a=i.getBlockForKey(o).getType(),s=i.getBlockBefore(o);if("code-block"===a&&s&&"code-block"===s.getType()&&0!==s.getLength())return null;if("unstyled"!==a)return r.setBlockType(i,t,"unstyled")}return null}};e.exports=s},2633:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(9845),a=n(3946),s=null,c={cut:function(e){var t=e.getCurrentContent(),n=e.getSelection(),c=null;if(n.isCollapsed()){var l=n.getAnchorKey(),u=t.getBlockForKey(l).getLength();if(u===n.getAnchorOffset()){var f=t.getKeyAfter(l);if(null==f)return e;c=n.set("focusKey",f).set("focusOffset",0)}else c=n.set("focusOffset",u)}else c=n;c=a(c),s=i(t,c);var p=r.removeRange(t,c,"forward");return p===t?e:o.push(e,p,"remove-range")},paste:function(e){if(!s)return e;var t=r.replaceWithFragment(e.getCurrentContent(),e.getSelection(),s);return o.push(e,t,"insert-fragment")}};e.exports=c},4680:(e,t,n)=>{"use strict";var r=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.serialize=function(){return"Anchor: "+this.getAnchorKey()+":"+this.getAnchorOffset()+", Focus: "+this.getFocusKey()+":"+this.getFocusOffset()+", Is Backward: "+String(this.getIsBackward())+", Has Focus: "+String(this.getHasFocus())},o.getAnchorKey=function(){return this.get("anchorKey")},o.getAnchorOffset=function(){return this.get("anchorOffset")},o.getFocusKey=function(){return this.get("focusKey")},o.getFocusOffset=function(){return this.get("focusOffset")},o.getIsBackward=function(){return this.get("isBackward")},o.getHasFocus=function(){return this.get("hasFocus")},o.hasEdgeWithin=function(e,t,n){var r=this.getAnchorKey(),o=this.getFocusKey();if(r===o&&r===e){var i=this.getStartOffset(),a=this.getEndOffset();return t<=i&&i<=n||t<=a&&a<=n}if(e!==r&&e!==o)return!1;var s=e===r?this.getAnchorOffset():this.getFocusOffset();return t<=s&&n>=s},o.isCollapsed=function(){return this.getAnchorKey()===this.getFocusKey()&&this.getAnchorOffset()===this.getFocusOffset()},o.getStartKey=function(){return this.getIsBackward()?this.getFocusKey():this.getAnchorKey()},o.getStartOffset=function(){return this.getIsBackward()?this.getFocusOffset():this.getAnchorOffset()},o.getEndKey=function(){return this.getIsBackward()?this.getAnchorKey():this.getFocusKey()},o.getEndOffset=function(){return this.getIsBackward()?this.getAnchorOffset():this.getFocusOffset()},r.createEmpty=function(e){return new r({anchorKey:e,anchorOffset:0,focusKey:e,focusOffset:0,isBackward:!1,hasFocus:!1})},r}((0,n(3941).Record)({anchorKey:"",anchorOffset:0,focusKey:"",focusOffset:0,isBackward:!1,hasFocus:!1}));e.exports=r},798:e=>{"use strict";e.exports=function(e,t,n,r){var o=t.getStartKey(),i=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil((function(e,t){return t===o})).takeUntil((function(e,t){return t===i})).concat([[i,a.get(i)]]).map((function(e){var t=e.getDepth()+n;return t=Math.max(0,Math.min(t,r)),e.set("depth",t)}));return a=a.merge(s),e.merge({blockMap:a,selectionBefore:t,selectionAfter:t})}},1655:(e,t,n)=>{"use strict";var r=n(490);e.exports=function(e,t,n,o){for(var i=t,a=e.getCharacterList();i<n;)a=a.set(i,r.applyEntity(a.get(i),o)),i++;return e.set("characterList",a)}},9717:(e,t,n)=>{"use strict";var r=n(1655),o=n(3941);e.exports=function(e,t,n){var i=e.getBlockMap(),a=t.getStartKey(),s=t.getStartOffset(),c=t.getEndKey(),l=t.getEndOffset(),u=i.skipUntil((function(e,t){return t===a})).takeUntil((function(e,t){return t===c})).toOrderedMap().merge(o.OrderedMap([[c,i.get(c)]])).map((function(e,t){var o=t===a?s:0,i=t===c?l:e.getLength();return r(e,o,i,n)}));return e.merge({blockMap:i.merge(u),selectionBefore:t,selectionAfter:t})}},1694:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(2104),i=n(6207),a=n(9532),s=n(7037),c=n(2e3),l=n(7081),u=function(e,t){return{key:e.getKey(),text:e.getText(),type:e.getType(),depth:e.getDepth(),inlineStyleRanges:c(e),entityRanges:s(e,t),data:e.getData().toObject()}};e.exports=function(e){var t={entityMap:{},blocks:[]};return t=function(e,t){var n=t.entityMap,s=[],c={},f={},p=0;return e.getBlockMap().forEach((function(e){e.findEntityRanges((function(e){return null!==e.getEntity()}),(function(t){var r=e.getEntityAt(t),o=a.stringify(r);f[o]||(f[o]=r,n[o]="".concat(p),p++)})),function(e,t,n,a){if(e instanceof o)n.push(u(e,t));else{e instanceof i||l(!1);var s=e.getParentKey(),c=a[e.getKey()]=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},u(e,t),{children:[]});s?a[s].children.push(c):n.push(c)}}(e,n,s,c)})),{blocks:s,entityMap:n}}(e,t),t=function(e,t){var n=t.blocks,r=t.entityMap,o={};return Object.keys(r).forEach((function(t,n){var r=e.getEntity(a.unstringify(t));o[n]={type:r.getType(),mutability:r.getMutability(),data:r.getData()}})),{blocks:n,entityMap:o}}(e,t),t}},9405:(e,t,n)=>{"use strict";var r;function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=n(490),s=n(2104),c=n(6207),l=n(7722),u=n(4688),f=n(6831),p=n(5935),h=n(462),d=n(1539),y=n(6130),m=n(3941),v=m.List,b=m.Map,g=m.OrderedSet,w=n(285),E=n(6959),S=n(5435),O=n(132),_=y("draft_tree_data_support"),k=new RegExp("\r","g"),C=new RegExp("\n","g"),P=new RegExp("^\n","g"),j=new RegExp("&nbsp;","g"),T=new RegExp("&#13;?","g"),x=new RegExp("&#8203;?","g"),R=["bold","bolder","500","600","700","800","900"],D=["light","lighter","normal","100","200","300","400"],N=["className","href","rel","target","title"],M=["alt","className","height","src","width"],I=(i(r={},p("public/DraftStyleDefault/depth0"),0),i(r,p("public/DraftStyleDefault/depth1"),1),i(r,p("public/DraftStyleDefault/depth2"),2),i(r,p("public/DraftStyleDefault/depth3"),3),i(r,p("public/DraftStyleDefault/depth4"),4),r),A=b({b:"BOLD",code:"CODE",del:"STRIKETHROUGH",em:"ITALIC",i:"ITALIC",s:"STRIKETHROUGH",strike:"STRIKETHROUGH",strong:"BOLD",u:"UNDERLINE",mark:"HIGHLIGHT"}),L=function(e){var t={};return e.mapKeys((function(e,n){var r=[n.element];void 0!==n.aliasedElements&&r.push.apply(r,n.aliasedElements),r.forEach((function(n){void 0===t[n]?t[n]=e:"string"==typeof t[n]?t[n]=[t[n],e]:t[n].push(e)}))})),b(t)},B=function(e){return S(e)&&e.style.fontFamily.includes("monospace")?"CODE":null},F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Object.keys(I).some((function(n){e.classList.contains(n)&&(t=I[n])})),t},U=function(e){if(!w(e))return!1;var t=e;if(!t.href||"http:"!==t.protocol&&"https:"!==t.protocol&&"mailto:"!==t.protocol&&"tel:"!==t.protocol)return!1;try{return new f(t.href),!0}catch(e){return!1}},K=function(e){if(!O(e))return!1;var t=e;return!(!t.attributes.getNamedItem("src")||!t.attributes.getNamedItem("src").value)},q=function(e,t){if(!S(e))return t;var n=e,r=n.style.fontWeight,o=n.style.fontStyle,i=n.style.textDecoration;return t.withMutations((function(e){R.indexOf(r)>=0?e.add("BOLD"):D.indexOf(r)>=0&&e.remove("BOLD"),"italic"===o?e.add("ITALIC"):"normal"===o&&e.remove("ITALIC"),"underline"===i&&e.add("UNDERLINE"),"line-through"===i&&e.add("STRIKETHROUGH"),"none"===i&&(e.remove("UNDERLINE"),e.remove("STRIKETHROUGH"))}))},V=function(e){return"ul"===e||"ol"===e},z=function(){function e(e,t){i(this,"characterList",v()),i(this,"currentBlockType","unstyled"),i(this,"currentDepth",0),i(this,"currentEntity",null),i(this,"currentText",""),i(this,"wrapper",null),i(this,"blockConfigs",[]),i(this,"contentBlocks",[]),i(this,"entityMap",u),i(this,"blockTypeMap",void 0),i(this,"disambiguate",void 0),this.clear(),this.blockTypeMap=e,this.disambiguate=t}var t=e.prototype;return t.clear=function(){this.characterList=v(),this.blockConfigs=[],this.currentBlockType="unstyled",this.currentDepth=0,this.currentEntity=null,this.currentText="",this.entityMap=u,this.wrapper=null,this.contentBlocks=[]},t.addDOMNode=function(e){var t;return this.contentBlocks=[],this.currentDepth=0,(t=this.blockConfigs).push.apply(t,this._toBlockConfigs([e],g())),this._trimCurrentText(),""!==this.currentText&&this.blockConfigs.push(this._makeBlockConfig()),this},t.getContentBlocks=function(){return 0===this.contentBlocks.length&&(_?this._toContentBlocks(this.blockConfigs):this._toFlatContentBlocks(this.blockConfigs)),{contentBlocks:this.contentBlocks,entityMap:this.entityMap}},t._makeBlockConfig=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key||h(),n=o({key:t,type:this.currentBlockType,text:this.currentText,characterList:this.characterList,depth:this.currentDepth,parent:null,children:v(),prevSibling:null,nextSibling:null,childConfigs:[]},e);return this.characterList=v(),this.currentBlockType="unstyled",this.currentText="",n},t._toBlockConfigs=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=o.nodeName.toLowerCase();if("body"===i||V(i)){this._trimCurrentText(),""!==this.currentText&&n.push(this._makeBlockConfig());var a=this.currentDepth,s=this.wrapper;V(i)&&(this.wrapper=i,V(s)&&this.currentDepth++),n.push.apply(n,this._toBlockConfigs(Array.from(o.childNodes),t)),this.currentDepth=a,this.wrapper=s}else{var c=this.blockTypeMap.get(i);if(void 0===c)if("#text"!==i)if("br"!==i)if(K(o))this._addImgNode(o,t);else if(U(o))this._addAnchorNode(o,n,t);else{var l=t;A.has(i)&&(l=l.add(A.get(i))),l=q(o,l);var u=B(o);null!=u&&(l=l.add(u)),n.push.apply(n,this._toBlockConfigs(Array.from(o.childNodes),l))}else this._addBreakNode(o,t);else this._addTextNode(o,t);else{this._trimCurrentText(),""!==this.currentText&&n.push(this._makeBlockConfig());var f=this.currentDepth,p=this.wrapper;if(this.wrapper="pre"===i?"pre":this.wrapper,"string"!=typeof c&&(c=this.disambiguate(i,this.wrapper)||c[0]||"unstyled"),!_&&S(o)&&("unordered-list-item"===c||"ordered-list-item"===c)){var d=o;this.currentDepth=F(d,this.currentDepth)}var y=h(),m=this._toBlockConfigs(Array.from(o.childNodes),t);this._trimCurrentText(),n.push(this._makeBlockConfig({key:y,childConfigs:m,type:c})),this.currentDepth=f,this.wrapper=p}}}return n},t._appendText=function(e,t){var n;this.currentText+=e;var r=a.create({style:t,entity:this.currentEntity});this.characterList=(n=this.characterList).push.apply(n,Array(e.length).fill(r))},t._trimCurrentText=function(){var e=this.currentText.length,t=e-this.currentText.trimLeft().length,n=this.currentText.trimRight().length,r=this.characterList.findEntry((function(e){return null!==e.getEntity()}));(t=void 0!==r?Math.min(t,r[0]):t)>(n=void 0!==(r=this.characterList.reverse().findEntry((function(e){return null!==e.getEntity()})))?Math.max(n,e-r[0]):n)?(this.currentText="",this.characterList=v()):(this.currentText=this.currentText.slice(t,n),this.characterList=this.characterList.slice(t,n))},t._addTextNode=function(e,t){var n=e.textContent;""===n.trim()&&"pre"!==this.wrapper&&(n=" "),"pre"!==this.wrapper&&(n=(n=n.replace(P,"")).replace(C," ")),this._appendText(n,t)},t._addBreakNode=function(e,t){E(e)&&this._appendText("\n",t)},t._addImgNode=function(e,t){if(O(e)){var n=e,r={};M.forEach((function(e){var t=n.getAttribute(e);t&&(r[e]=t)})),this.currentEntity=this.entityMap.__create("IMAGE","IMMUTABLE",r),y("draftjs_fix_paste_for_img")?"presentation"!==n.getAttribute("role")&&this._appendText("📷",t):this._appendText("📷",t),this.currentEntity=null}},t._addAnchorNode=function(e,t,n){if(w(e)){var r=e,o={};N.forEach((function(e){var t=r.getAttribute(e);t&&(o[e]=t)})),o.url=new f(r.href).toString(),this.currentEntity=this.entityMap.__create("LINK","MUTABLE",o||{}),t.push.apply(t,this._toBlockConfigs(Array.from(e.childNodes),n)),this.currentEntity=null}},t._toContentBlocks=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.length-1,r=0;r<=n;r++){var i=e[r];i.parent=t,i.prevSibling=r>0?e[r-1].key:null,i.nextSibling=r<n?e[r+1].key:null,i.children=v(i.childConfigs.map((function(e){return e.key}))),this.contentBlocks.push(new c(o({},i))),this._toContentBlocks(i.childConfigs,i.key)}},t._hoistContainersInBlockConfigs=function(e){var t=this;return v(e).flatMap((function(e){return"unstyled"!==e.type||""!==e.text?[e]:t._hoistContainersInBlockConfigs(e.childConfigs)}))},t._toFlatContentBlocks=function(e){var t=this;this._hoistContainersInBlockConfigs(e).forEach((function(e){var n=t._extractTextFromBlockConfigs(e.childConfigs),r=n.text,i=n.characterList;t.contentBlocks.push(new s(o({},e,{text:e.text+r,characterList:e.characterList.concat(i)})))}))},t._extractTextFromBlockConfigs=function(e){for(var t=e.length-1,n="",r=v(),o=0;o<=t;o++){var i=e[o];n+=i.text,r=r.concat(i.characterList),""!==n&&"unstyled"!==i.type&&(n+="\n",r=r.push(r.last()));var a=this._extractTextFromBlockConfigs(i.childConfigs);n+=a.text,r=r.concat(a.characterList)}return{text:n,characterList:r}},e}();e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l,r=t(e=e.trim().replace(k,"").replace(j," ").replace(T,"").replace(x,""));if(!r)return null;var o=L(n),i=function(e,t){return"li"===e?"ol"===t?"ordered-list-item":"unordered-list-item":null};return new z(o,i).addDOMNode(r).getContentBlocks()}},3702:(e,t,n)=>{"use strict";function r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){o(e,t,n[t])}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(2104),a=n(6207),s=n(5481),c=n(4688),l=n(2780),u=(n(9067),n(4680)),f=n(7157),p=n(9398),h=n(1239),d=n(462),y=n(6130),m=n(3941),v=n(7081),b=y("draft_tree_data_support"),g=m.List,w=m.Map,E=m.OrderedMap,S=function(e,t){var n=e.key,r=e.type,o=e.data;return{text:e.text,depth:e.depth||0,type:r||"unstyled",key:n||d(),data:w(o),characterList:O(e,t)}},O=function(e,t){var n=e.text,o=e.entityRanges,i=e.inlineStyleRanges,a=o||[];return f(h(n,i||[]),p(n,a.filter((function(e){return t.hasOwnProperty(e.key)})).map((function(e){return r({},e,{key:t[e.key]})}))))},_=function(e){return r({},e,{key:e.key||d()})},k=function(e,t,n){var o=t.map((function(e){return r({},e,{parentRef:n})}));return e.concat(o.reverse())};e.exports=function(e){Array.isArray(e.blocks)||v(!1);var t=function(e){var t=e.entityMap,n={};return Object.keys(t).forEach((function(e){var r=t[e],o=r.type,i=r.mutability,a=r.data;n[e]=c.__create(o,i,a||{})})),n}(e),n=function(e,t){var n=e.blocks.find((function(e){return Array.isArray(e.children)&&e.children.length>0})),o=b&&!n?l.fromRawStateToRawTreeState(e).blocks:e.blocks;if(!b)return function(e,t){return E(e.map((function(e){var n=new i(S(e,t));return[n.getKey(),n]})))}(n?l.fromRawTreeStateToRawState(e).blocks:o,t);var s=function(e,t){return e.map(_).reduce((function(n,o,i){Array.isArray(o.children)||v(!1);var s=o.children.map(_),c=new a(r({},S(o,t),{prevSibling:0===i?null:e[i-1].key,nextSibling:i===e.length-1?null:e[i+1].key,children:g(s.map((function(e){return e.key})))}));n=n.set(c.getKey(),c);for(var l=k([],s,c);l.length>0;){var u=l.pop(),f=u.parentRef,p=f.getChildKeys(),h=p.indexOf(u.key),d=Array.isArray(u.children);if(!d){d||v(!1);break}var y=u.children.map(_),m=new a(r({},S(u,t),{parent:f.getKey(),children:g(y.map((function(e){return e.key}))),prevSibling:0===h?null:p.get(h-1),nextSibling:h===p.size-1?null:p.get(h+1)}));n=n.set(m.getKey(),m),l=k(l,y,m)}return n}),E())}(o,t);return s}(e,t),o=n.isEmpty()?new u:u.createEmpty(n.first().getKey());return new s({blockMap:n,entityMap:t,selectionBefore:o,selectionAfter:o})}},7157:(e,t,n)=>{"use strict";var r=n(490),o=n(3941).List;e.exports=function(e,t){var n=e.map((function(e,n){var o=t[n];return r.create({style:e,entity:o})}));return o(n)}},9398:(e,t,n)=>{"use strict";var r=n(7027).substr;e.exports=function(e,t){var n=Array(e.length).fill(null);return t&&t.forEach((function(t){for(var o=r(e,0,t.offset).length,i=o+r(e,t.offset,t.length).length,a=o;a<i;a++)n[a]=t.key})),n}},1239:(e,t,n)=>{"use strict";var r=n(7027),o=n(3941).OrderedSet,i=r.substr,a=o();e.exports=function(e,t){var n=Array(e.length).fill(a);return t&&t.forEach((function(t){for(var r=i(e,0,t.offset).length,o=r+i(e,t.offset,t.length).length;r<o;)n[r]=n[r].add(t.style),r++})),n}},4249:e=>{"use strict";e.exports={notEmptyKey:function(e){return null!=e&&""!=e}}},7571:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(5306),a=n(3522),s=n(8231),c=n(8727),l=n(3946),u=n(1574),f=i.isBrowser("Firefox");function p(e,t,n,i,a){var s=r.replaceText(e.getCurrentContent(),e.getSelection(),t,n,i);return o.push(e,s,"insert-characters",a)}e.exports=function(e,t){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e._latestEditorState,r=t.data;if(r)if(e.props.handleBeforeInput&&s(e.props.handleBeforeInput(r,n,t.timeStamp)))t.preventDefault();else{var i=n.getSelection(),h=i.getStartOffset(),d=i.getAnchorKey();if(!i.isCollapsed())return t.preventDefault(),void e.update(p(n,r,n.getCurrentInlineStyle(),a(n.getCurrentContent(),n.getSelection()),!0));var y,m=p(n,r,n.getCurrentInlineStyle(),a(n.getCurrentContent(),n.getSelection()),!1),v=!1;if(v||(v=c(e._latestCommittedEditorState)),!v){var b=n.getBlockTree(d),g=m.getBlockTree(d);v=b.size!==g.size||b.zip(g).some((function(e){var t=e[0],n=e[1],o=t.get("start"),i=o+(o>=h?r.length:0),a=t.get("end"),s=a+(a>=h?r.length:0),c=n.get("start"),l=n.get("end"),u=n.get("decoratorKey");return t.get("decoratorKey")!==u||t.get("leaves").size!==n.get("leaves").size||i!==c||s!==l||null!=u&&l-c!=a-o}))}if(v||(y=r,v=f&&("'"==y||"/"==y)),v||(v=l(m.getDirectionMap()).get(d)!==l(n.getDirectionMap()).get(d)),v)return t.preventDefault(),m=o.set(m,{forceSelection:!0}),void e.update(m);m=o.set(m,{nativelyRenderedContent:m.getCurrentContent()}),e._pendingStateFromBeforeInput=m,u((function(){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0)}))}}},1014:(e,t,n)=>{"use strict";var r=n(7077),o=n(1089),i=n(2402);e.exports=function(e,t){var n=t.currentTarget.ownerDocument;if(!Boolean(e.props.preserveSelectionOnBlur)&&i(n)===n.body){var a=n.defaultView.getSelection(),s=e.editor;1===a.rangeCount&&o(s,a.anchorNode)&&o(s,a.focusNode)&&a.removeAllRanges()}var c=e._latestEditorState,l=c.getSelection();if(l.getHasFocus()){var u=l.set("hasFocus",!1);e.props.onBlur&&e.props.onBlur(t),e.update(r.acceptSelection(c,u))}}},3905:(e,t,n)=>{"use strict";var r=n(7077);e.exports=function(e,t){e.setMode("composite"),e.update(r.set(e._latestEditorState,{inCompositionMode:!0})),e._onCompositionStart(t)}},1435:(e,t,n)=>{"use strict";var r=n(1295);e.exports=function(e,t){e._latestEditorState.getSelection().isCollapsed()?t.preventDefault():e.setClipboard(r(e._latestEditorState))}},548:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(4234),a=n(1295),s=n(3020),c=n(9404);e.exports=function(e,t){var n,l=e._latestEditorState,u=l.getSelection(),f=t.target;if(u.isCollapsed())t.preventDefault();else{if(c(f)){var p=f;n=s(i.getScrollParent(p))}var h=a(l);e.setClipboard(h),e.setMode("cut"),setTimeout((function(){e.restoreEditorDOM(n),e.exitCurrentMode(),e.update(function(e){var t=r.removeRange(e.getCurrentContent(),e.getSelection(),"forward");return o.push(e,t,"remove-range")}(l))}),0)}}},6241:e=>{"use strict";e.exports=function(e,t){e.setMode("drag"),t.preventDefault()}},1301:e=>{"use strict";e.exports=function(e){e._internalDrag=!0,e.setMode("drag")}},2906:(e,t,n)=>{"use strict";var r=n(7077),o=n(5306);e.exports=function(e,t){var n=e._latestEditorState,i=n.getSelection();if(!i.getHasFocus()){var a=i.set("hasFocus",!0);e.props.onFocus&&e.props.onFocus(t),o.isBrowser("Chrome < 60.0.3081.0")?e.update(r.forceSelection(n,a)):e.update(r.acceptSelection(n,a))}}},4089:(e,t,n)=>{"use strict";var r=n(4702),o=n(5044),i=n(7077),a=n(5306),s=n(4249).notEmptyKey,c=n(9704),l=n(8281),u=n(3946),f=a.isEngine("Gecko");e.exports=function(e,t){void 0!==e._pendingStateFromBeforeInput&&(e.update(e._pendingStateFromBeforeInput),e._pendingStateFromBeforeInput=void 0);var n=e.editor.ownerDocument.defaultView.getSelection(),a=n.anchorNode,p=n.isCollapsed,h=(null==a?void 0:a.nodeType)!==Node.TEXT_NODE&&(null==a?void 0:a.nodeType)!==Node.ELEMENT_NODE;if(null!=a&&!h){if(a.nodeType===Node.TEXT_NODE&&(null!==a.previousSibling||null!==a.nextSibling)){var d=a.parentNode;if(null==d)return;a.nodeValue=d.textContent;for(var y=d.firstChild;null!=y;y=y.nextSibling)y!==a&&d.removeChild(y)}var m=a.textContent,v=e._latestEditorState,b=u(c(a)),g=o.decode(b),w=g.blockKey,E=g.decoratorKey,S=g.leafKey,O=v.getBlockTree(w).getIn([E,"leaves",S]),_=O.start,k=O.end,C=v.getCurrentContent(),P=C.getBlockForKey(w),j=P.getText().slice(_,k);if(m.endsWith("\n\n")&&(m=m.slice(0,-1)),m!==j){var T,x,R,D,N=v.getSelection(),M=N.merge({anchorOffset:_,focusOffset:k,isBackward:!1}),I=P.getEntityAt(_),A=s(I)?C.getEntity(I):null,L="MUTABLE"===(null!=A?A.getMutability():null),B=L?"spellcheck-change":"apply-entity",F=r.replaceText(C,M,m,P.getInlineStyleAt(_),L?P.getEntityAt(_):null);if(f)T=n.anchorOffset,x=n.focusOffset,D=(R=_+Math.min(T,x))+Math.abs(T-x),T=R,x=D;else{var U=m.length-j.length;R=N.getStartOffset(),D=N.getEndOffset(),T=p?D+U:R,x=D+U}var K=F.merge({selectionBefore:C.getSelectionAfter(),selectionAfter:N.merge({anchorOffset:T,focusOffset:x})});e.update(i.push(v,K,B))}else{var q=t.nativeEvent.inputType;if(q){var V=function(e,t){return"deleteContentBackward"===e?l(t):t}(q,v);if(V!==v)return e.restoreEditorDOM(),void e.update(V)}}}}},8881:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(72),a=n(9119),s=n(2633),c=n(5306),l=n(8231),u=n(1473),f=n(1525),p=n(147),h=n(7587),d=n(8646),y=n(9728),m=n(8281),v=n(4022),b=n(5803),g=n(3973),w=i.isOptionKeyCommand,E=c.isBrowser("Chrome");e.exports=function(e,t){var n=t.which,i=e._latestEditorState;function c(n){var r=e.props[n];return!!r&&(r(t),!0)}switch(n){case a.RETURN:if(t.preventDefault(),e.props.handleReturn&&l(e.props.handleReturn(t,i)))return;break;case a.ESC:if(t.preventDefault(),c("onEscape"))return;break;case a.TAB:if(c("onTab"))return;break;case a.UP:if(c("onUpArrow"))return;break;case a.RIGHT:if(c("onRightArrow"))return;break;case a.DOWN:if(c("onDownArrow"))return;break;case a.LEFT:if(c("onLeftArrow"))return;break;case a.SPACE:E&&w(t)&&t.preventDefault()}var S=e.props.keyBindingFn(t);if(null!=S&&""!==S)if("undo"!==S){if(t.preventDefault(),!e.props.handleKeyCommand||!l(e.props.handleKeyCommand(S,i,t.timeStamp))){var O=function(e,t,n){switch(e){case"redo":return o.redo(t);case"delete":return v(t);case"delete-word":return p(t);case"backspace":return m(t);case"backspace-word":return f(t);case"backspace-to-start-of-line":return u(t,n);case"split-block":return h(t);case"transpose-characters":return b(t);case"move-selection-to-start-of-block":return y(t);case"move-selection-to-end-of-block":return d(t);case"secondary-cut":return s.cut(t);case"secondary-paste":return s.paste(t);default:return t}}(S,i,t);O!==i&&e.update(O)}}else g(t,i,e.update);else if(n===a.SPACE&&E&&w(t)){var _=r.replaceText(i.getCurrentContent(),i.getSelection()," ");e.update(o.push(i,_,"insert-characters"))}}},8257:(e,t,n)=>{"use strict";var r=n(403),o=n(490),i=n(1045),a=n(4702),s=n(5252),c=n(7077),l=n(509),u=n(3522),f=n(5711),p=n(8231),h=n(5264);function d(e,t,n){var r=a.replaceWithFragment(e.getCurrentContent(),e.getSelection(),t);return c.push(e,r.set("entityMap",n),"insert-fragment")}e.exports=function(e,t){t.preventDefault();var n=new i(t.clipboardData);if(!n.isRichText()){var y=n.getFiles(),m=n.getText();if(y.length>0){if(e.props.handlePastedFiles&&p(e.props.handlePastedFiles(y)))return;return void f(y,(function(t){if(t=t||m){var n=e._latestEditorState,i=h(t),f=o.create({style:n.getCurrentInlineStyle(),entity:u(n.getCurrentContent(),n.getSelection())}),p=l.getCurrentBlockType(n),d=s.processText(i,f,p),y=r.createFromArray(d),v=a.replaceWithFragment(n.getCurrentContent(),n.getSelection(),y);e.update(c.push(n,v,"insert-fragment"))}}))}}var v=[],b=n.getText(),g=n.getHTML(),w=e._latestEditorState;if(e.props.formatPastedText){var E=e.props.formatPastedText(b,g);b=E.text,g=E.html}if(!e.props.handlePastedText||!p(e.props.handlePastedText(b,g,w))){if(b&&(v=h(b)),!e.props.stripPastedStyles){var S,O=e.getClipboard();if(!e.props.formatPastedText&&n.isRichText()&&O){if(-1!==(null===(S=g)||void 0===S?void 0:S.indexOf(e.getEditorKey()))||1===v.length&&1===O.size&&O.first().getText()===b)return void e.update(d(e._latestEditorState,O))}else if(O&&n.types.includes("com.apple.webarchive")&&!n.types.includes("text/html")&&function(e,t){return e.length===t.size&&t.valueSeq().every((function(t,n){return t.getText()===e[n]}))}(v,O))return void e.update(d(e._latestEditorState,O));if(g){var _=s.processHTML(g,e.props.blockRenderMap);if(_){var k=_.contentBlocks,C=_.entityMap;if(k){var P=r.createFromArray(k);return void e.update(d(e._latestEditorState,P,C))}}}e.setClipboard(null)}if(v.length){var j=o.create({style:w.getCurrentInlineStyle(),entity:u(w.getCurrentContent(),w.getSelection())}),T=l.getCurrentBlockType(w),x=s.processText(v,j,T),R=r.createFromArray(x);e.update(d(e._latestEditorState,R))}}}},8762:(e,t,n)=>{"use strict";var r=n(3405),o=n(7077),i=n(4489),a=n(9938);e.exports=function(e){if(e._blockSelectEvents||e._latestEditorState!==e.props.editorState){if(e._blockSelectEvents){var t=e.props.editorState.getSelection();r.logBlockedSelectionEvent({anonymizedDom:"N/A",extraParams:JSON.stringify({stacktrace:(new Error).stack}),selectionState:JSON.stringify(t.toJS())})}}else{var n=e.props.editorState,s=a(n,i(e)),c=s.selectionState;c!==n.getSelection()&&(n=s.needsRecovery?o.forceSelection(n,c):o.acceptSelection(n,c),e.update(n))}}},7037:(e,t,n)=>{"use strict";var r=n(9532),o=n(7027).strlen;e.exports=function(e,t){var n=[];return e.findEntityRanges((function(e){return!!e.getEntity()}),(function(i,a){var s=e.getText(),c=e.getEntityAt(i);n.push({offset:o(s.slice(0,i)),length:o(s.slice(i,a)),key:Number(t[r.stringify(c)])})})),n}},2e3:(e,t,n)=>{"use strict";var r=n(7027),o=n(9572),i=function(e,t){return e===t},a=function(e){return!!e},s=[];e.exports=function(e){var t=e.getCharacterList().map((function(e){return e.getStyle()})).toList(),n=t.flatten().toSet().map((function(n){return function(e,t,n){var s=[],c=t.map((function(e){return e.has(n)})).toList();return o(c,i,a,(function(t,o){var i=e.getText();s.push({offset:r.strlen(i.slice(0,t)),length:r.strlen(i.slice(t,o)),style:n})})),s}(e,t,n)}));return Array.prototype.concat.apply(s,n.toJS())}},6078:(e,t,n)=>{"use strict";var r=n(7027),o=n(8681),i=n(5215),a=n(7081);function s(e,t){for(var n=1/0,r=1/0,o=-1/0,i=-1/0,a=0;a<e.length;a++){var s=e[a];0!==s.width&&1!==s.width&&(n=Math.min(n,s.top),r=Math.min(r,s.bottom),o=Math.max(o,s.top),i=Math.max(i,s.bottom))}return o<=r&&o-n<t&&i-r<t}function c(e){switch(e.nodeType){case Node.DOCUMENT_TYPE_NODE:return 0;case Node.TEXT_NODE:case Node.PROCESSING_INSTRUCTION_NODE:case Node.COMMENT_NODE:return e.length;default:return e.childNodes.length}}e.exports=function(e){e.collapsed||a(!1);var t=(e=e.cloneRange()).startContainer;1!==t.nodeType&&(t=t.parentNode);var n=function(e){var t=getComputedStyle(e),n=o(e),r=n.createElement("div");r.style.fontFamily=t.fontFamily,r.style.fontSize=t.fontSize,r.style.fontStyle=t.fontStyle,r.style.fontWeight=t.fontWeight,r.style.lineHeight=t.lineHeight,r.style.position="absolute",r.textContent="M";var i=n.body;i||a(!1),i.appendChild(r);var s=r.getBoundingClientRect();return i.removeChild(r),s.height}(t),l=e.endContainer,u=e.endOffset;for(e.setStart(e.startContainer,0);s(i(e),n)&&(l=e.startContainer,u=e.startOffset,l.parentNode||a(!1),e.setStartBefore(l),1!==l.nodeType||"inline"===getComputedStyle(l).display););for(var f=l,p=u-1;;){for(var h=f.nodeValue,d=p;d>=0;d--)if(!(null!=h&&d>0&&r.isSurrogatePair(h,d-1))){if(e.setStart(f,d),!s(i(e),n))break;l=f,u=d}if(-1===d||0===f.childNodes.length)break;p=c(f=f.childNodes[d])}return e.setStart(l,u),e}},9704:(e,t,n)=>{"use strict";var r=n(8681),o=n(2946);e.exports=function(e){for(var t=e;t&&t!==r(e).documentElement;){var n=o(t);if(null!=n)return n;t=t.parentNode}return null}},9572:e=>{"use strict";e.exports=function(e,t,n,r){if(e.size){var o=0;e.reduce((function(e,i,a){return t(e,i)||(n(e)&&r(o,a),o=a),i})),n(e.last())&&r(o,e.count())}}},462:e=>{"use strict";var t={},n=Math.pow(2,24);e.exports=function(){for(var e;void 0===e||t.hasOwnProperty(e)||!isNaN(+e);)e=Math.floor(Math.random()*n).toString(32);return t[e]=!0,e}},8655:(e,t,n)=>{"use strict";var r=n(3688),o=n(876),i=n(7081);function a(e,t,n,a,s,c,l){var u=n.getStartOffset(),f=n.getEndOffset(),p=e.__get(s).getMutability(),h=l?u:f;if("MUTABLE"===p)return n;var d=o(t,s).filter((function(e){return h<=e.end&&h>=e.start}));1!=d.length&&i(!1);var y=d[0];if("IMMUTABLE"===p)return n.merge({anchorOffset:y.start,focusOffset:y.end,isBackward:!1});c||(l?f=y.end:u=y.start);var m=r.getRemovalRange(u,f,t.getText().slice(y.start,y.end),y.start,a);return n.merge({anchorOffset:m.start,focusOffset:m.end,isBackward:!1})}e.exports=function(e,t,n,r,o){var i=r.getStartOffset(),s=r.getEndOffset(),c=t.getEntityAt(i),l=n.getEntityAt(s-1);if(!c&&!l)return r;var u=r;if(c&&c===l)u=a(e,t,u,o,c,!0,!0);else if(c&&l){var f=a(e,t,u,o,c,!1,!0),p=a(e,n,u,o,l,!1,!1);u=u.merge({anchorOffset:f.getAnchorOffset(),focusOffset:p.getFocusOffset(),isBackward:!1})}else if(c){var h=a(e,t,u,o,c,!1,!0);u=u.merge({anchorOffset:h.getStartOffset(),isBackward:!1})}else if(l){var d=a(e,n,u,o,l,!1,!1);u=u.merge({focusOffset:d.getEndOffset(),isBackward:!1})}return u}},4489:(e,t,n)=>{"use strict";var r=n(7081),o=n(5435);e.exports=function(e){var t=e.editorContainer;return t||r(!1),o(t.firstChild)||r(!1),t.firstChild}},9845:(e,t,n)=>{"use strict";var r=n(8290),o=n(4511);e.exports=function(e,t){var n=t.getStartKey(),i=t.getStartOffset(),a=t.getEndKey(),s=t.getEndOffset(),c=o(e,t).getBlockMap(),l=c.keySeq(),u=l.indexOf(n),f=l.indexOf(a)+1;return r(c.slice(u,f).map((function(e,t){var r=e.getText(),o=e.getCharacterList();return n===a?e.merge({text:r.slice(i,s),characterList:o.slice(i,s)}):t===n?e.merge({text:r.slice(i),characterList:o.slice(i)}):t===a?e.merge({text:r.slice(0,s),characterList:o.slice(0,s)}):e})))}},8681:e=>{"use strict";e.exports=function(e){return e&&e.ownerDocument?e.ownerDocument:document}},6164:(e,t,n)=>{"use strict";var r=n(72),o=n(9119),i=n(5306),a=i.isPlatform("Mac OS X"),s=a&&i.isBrowser("Firefox < 29"),c=r.hasCommandModifier,l=r.isCtrlKeyCommand;function u(e){return a&&e.altKey||l(e)}e.exports=function(e){switch(e.keyCode){case 66:return c(e)?"bold":null;case 68:return l(e)?"delete":null;case 72:return l(e)?"backspace":null;case 73:return c(e)?"italic":null;case 74:return c(e)?"code":null;case 75:return a&&l(e)?"secondary-cut":null;case 77:case 79:return l(e)?"split-block":null;case 84:return a&&l(e)?"transpose-characters":null;case 85:return c(e)?"underline":null;case 87:return a&&l(e)?"backspace-word":null;case 89:return l(e)?a?"secondary-paste":"redo":null;case 90:return function(e){return c(e)?e.shiftKey?"redo":"undo":null}(e)||null;case o.RETURN:return"split-block";case o.DELETE:return function(e){return!a&&e.shiftKey?null:u(e)?"delete-word":"delete"}(e);case o.BACKSPACE:return function(e){return c(e)&&a?"backspace-to-start-of-line":u(e)?"backspace-word":"backspace"}(e);case o.LEFT:return s&&c(e)?"move-selection-to-start-of-block":null;case o.RIGHT:return s&&c(e)?"move-selection-to-end-of-block":null;default:return null}}},9938:(e,t,n)=>{"use strict";var r=n(6764);e.exports=function(e,t){var n=t.ownerDocument.defaultView.getSelection(),o=n.anchorNode,i=n.anchorOffset,a=n.focusNode,s=n.focusOffset;return 0===n.rangeCount||null==o||null==a?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:r(e,t,o,i,a,s)}},6764:(e,t,n)=>{"use strict";var r=n(9704),o=n(2946),i=n(7546),a=n(7081),s=n(9509),c=n(3946);function l(e,t,n){var i=t,l=r(i);if(null!=l||e&&(e===i||e.firstChild===i)||a(!1),e===i&&(i=i.firstChild,s(i)||a(!1),"true"!==i.getAttribute("data-contents")&&a(!1),n>0&&(n=i.childNodes.length)),0===n){var f=null;if(null!=l)f=l;else{var p=function(e){for(;e.firstChild&&(s(e.firstChild)&&"true"===e.firstChild.getAttribute("data-blocks")||o(e.firstChild));)e=e.firstChild;return e}(i);f=c(o(p))}return{key:f,offset:0}}var h=i.childNodes[n-1],d=null,y=null;if(o(h)){var m=function(e){for(;e.lastChild&&(s(e.lastChild)&&"true"===e.lastChild.getAttribute("data-blocks")||o(e.lastChild));)e=e.lastChild;return e}(h);d=c(o(m)),y=u(m)}else d=c(l),y=u(h);return{key:d,offset:y}}function u(e){var t=e.textContent;return"\n"===t?0:t.length}e.exports=function(e,t,n,o,a,s){var u=n.nodeType===Node.TEXT_NODE,f=a.nodeType===Node.TEXT_NODE;if(u&&f)return{selectionState:i(e,c(r(n)),o,c(r(a)),s),needsRecovery:!1};var p=null,h=null,d=!0;return u?(p={key:c(r(n)),offset:o},h=l(t,a,s)):f?(h={key:c(r(a)),offset:s},p=l(t,n,o)):(p=l(t,n,o),h=l(t,a,s),n===a&&o===s&&(d=!!n.firstChild&&"BR"!==n.firstChild.nodeName)),{selectionState:i(e,p.key,p.offset,h.key,h.offset),needsRecovery:d}}},3522:(e,t,n)=>{"use strict";var r=n(4249).notEmptyKey;function o(e,t){return r(t)&&"MUTABLE"===e.__get(t).getMutability()?t:null}e.exports=function(e,t){var n;if(t.isCollapsed()){var r=t.getAnchorKey(),i=t.getAnchorOffset();return i>0?(n=e.getBlockForKey(r).getEntityAt(i-1))!==e.getBlockForKey(r).getEntityAt(i)?null:o(e.getEntityMap(),n):null}var a=t.getStartKey(),s=t.getStartOffset(),c=e.getBlockForKey(a);return n=s===c.getLength()?null:c.getEntityAt(s),o(e.getEntityMap(),n)}},1295:(e,t,n)=>{"use strict";var r=n(9845);e.exports=function(e){var t=e.getSelection();return t.isCollapsed()?null:r(e.getCurrentContent(),t)}},1023:(e,t,n)=>{"use strict";var r=n(6207);e.exports=function(e,t){if(!(e instanceof r))return null;var n=e.getNextSiblingKey();if(n)return n;var o=e.getParentKey();if(!o)return null;for(var i=t.get(o);i&&!i.getNextSiblingKey();){var a=i.getParentKey();i=a?t.get(a):null}return i?i.getNextSiblingKey():null}},2023:e=>{"use strict";e.exports=function(e){return Object.keys(e).map((function(t){return e[t]}))}},3683:(e,t,n)=>{"use strict";var r=n(5215);e.exports=function(e){var t=r(e),n=0,o=0,i=0,a=0;if(t.length){if(t.length>1&&0===t[0].width){var s=t[1];n=s.top,o=s.right,i=s.bottom,a=s.left}else{var c=t[0];n=c.top,o=c.right,i=c.bottom,a=c.left}for(var l=1;l<t.length;l++){var u=t[l];0!==u.height&&0!==u.width&&(n=Math.min(n,u.top),o=Math.max(o,u.right),i=Math.max(i,u.bottom),a=Math.min(a,u.left))}}return{top:n,right:o,bottom:i,left:a,width:o-a,height:i-n}}},5215:(e,t,n)=>{"use strict";var r=n(5306),o=n(7081),i=r.isBrowser("Chrome")?function(e){for(var t=e.cloneRange(),n=[],r=e.endContainer;null!=r;r=r.parentNode){var i=r===e.commonAncestorContainer;i?t.setStart(e.startContainer,e.startOffset):t.setStart(t.endContainer,0);var a,s=Array.from(t.getClientRects());if(n.push(s),i)return n.reverse(),(a=[]).concat.apply(a,n);t.setEndBefore(r)}o(!1)}:function(e){return Array.from(e.getClientRects())};e.exports=i},876:(e,t,n)=>{"use strict";var r=n(7081);e.exports=function(e,t){var n=[];return e.findEntityRanges((function(e){return e.getEntity()===t}),(function(e,t){n.push({start:e,end:t})})),n.length||r(!1),n}},1539:(e,t,n)=>{"use strict";var r=n(5306),o=n(7081),i=r.isBrowser("IE <= 9");e.exports=function(e){var t,n=null;return!i&&document.implementation&&document.implementation.createHTMLDocument&&((t=document.implementation.createHTMLDocument("foo")).documentElement||o(!1),t.documentElement.innerHTML=e,n=t.getElementsByTagName("body")[0]),n}},2946:(e,t,n)=>{"use strict";var r=n(9509);e.exports=function e(t){if(r(t)){var n=t,o=n.getAttribute("data-offset-key");if(o)return o;for(var i=0;i<n.childNodes.length;i++){var a=e(n.childNodes[i]);if(a)return a}}return null}},5711:(e,t,n)=>{"use strict";var r=n(7081),o=/\.textClipping$/,i={"text/plain":!0,"text/html":!0,"text/rtf":!0};e.exports=function(e,t){var a=0,s=[];e.forEach((function(c){!function(e,t){if(!n.g.FileReader||e.type&&!(e.type in i))t("");else{if(""===e.type){var a="";return o.test(e.name)&&(a=e.name.replace(o,"")),void t(a)}var s=new FileReader;s.onload=function(){var e=s.result;"string"!=typeof e&&r(!1),t(e)},s.onerror=function(){t("")},s.readAsText(e)}}(c,(function(n){a++,n&&s.push(n.slice(0,5e3)),a==e.length&&t(s.join("\r"))}))}))}},7546:(e,t,n)=>{"use strict";var r=n(5044),o=n(3946);e.exports=function(e,t,n,i,a){var s=o(e.getSelection());if(!t||!i)return s;var c=r.decode(t),l=c.blockKey,u=e.getBlockTree(l),f=u&&u.getIn([c.decoratorKey,"leaves",c.leafKey]),p=r.decode(i),h=p.blockKey,d=e.getBlockTree(h),y=d&&d.getIn([p.decoratorKey,"leaves",p.leafKey]);if(!f||!y)return s;var m=f.get("start"),v=y.get("start"),b=f?m+n:null,g=y?v+a:null;if(s.getAnchorKey()===l&&s.getAnchorOffset()===b&&s.getFocusKey()===h&&s.getFocusOffset()===g)return s;var w=!1;if(l===h){var E=f.get("end"),S=y.get("end");w=v===m&&S===E?a<n:v<m}else w=e.getCurrentContent().getBlockMap().keySeq().skipUntil((function(e){return e===l||e===h})).first()===h;return s.merge({anchorKey:l,anchorOffset:b,focusKey:h,focusOffset:g,isBackward:w})}},5452:(e,t,n)=>{"use strict";var r=n(3683);e.exports=function(e){var t=e.getSelection();if(!t.rangeCount)return null;var n=t.getRangeAt(0),o=r(n),i=o.top,a=o.right,s=o.bottom,c=o.left;return 0===i&&0===a&&0===s&&0===c?null:o}},2189:e=>{"use strict";e.exports=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}},6130:e=>{"use strict";e.exports=function(e){return!("undefined"==typeof window||!window.__DRAFT_GKX||!window.__DRAFT_GKX[e])}},9657:(e,t,n)=>{"use strict";var r=n(403),o=n(6207),i=n(3941),a=n(2882),s=n(7081),c=n(8290),l=i.List,u=function(e,t,n,r,o,i){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"REPLACE_WITH_NEW_DATA",c=n.get(o),l=c.getText(),u=c.getCharacterList(),f=o,p=i+r.getText().length,h=null;switch(s){case"MERGE_OLD_DATA_TO_NEW_DATA":h=r.getData().merge(c.getData());break;case"REPLACE_WITH_NEW_DATA":h=r.getData()}var d=c.getType();l&&"unstyled"===d&&(d=r.getType());var y=c.merge({text:l.slice(0,i)+r.getText()+l.slice(i),characterList:a(u,r.getCharacterList(),i),type:d,data:h});return e.merge({blockMap:n.set(o,y),selectionBefore:t,selectionAfter:t.merge({anchorKey:f,anchorOffset:p,focusKey:f,focusOffset:p,isBackward:!1})})},f=function(e,t,n,i,a,s){var c=n.first()instanceof o,u=[],f=i.size,p=n.get(a),h=i.first(),d=i.last(),y=d.getLength(),m=d.getKey(),v=c&&(!p.getChildKeys().isEmpty()||!h.getChildKeys().isEmpty());n.forEach((function(e,t){t===a?(v?u.push(e):u.push(function(e,t,n){var r=e.getText(),o=e.getCharacterList(),i=r.slice(0,t),a=o.slice(0,t),s=n.first();return e.merge({text:i+s.getText(),characterList:a.concat(s.getCharacterList()),type:i?e.getType():s.getType(),data:s.getData()})}(e,s,i)),i.slice(v?0:1,f-1).forEach((function(e){return u.push(e)})),u.push(function(e,t,n){var r=e.getText(),o=e.getCharacterList(),i=r.length,a=r.slice(t,i),s=o.slice(t,i),c=n.last();return c.merge({text:c.getText()+a,characterList:c.getCharacterList().concat(s),data:c.getData()})}(e,s,i))):u.push(e)}));var b=r.createFromArray(u);return c&&(b=function(e,t,n,r){return e.withMutations((function(t){var o=n.getKey(),i=r.getKey(),a=n.getNextSiblingKey(),s=n.getParentKey(),c=function(e,t){var n=e.getKey(),r=e,o=[];for(t.get(n)&&o.push(n);r&&r.getNextSiblingKey();){var i=r.getNextSiblingKey();if(!i)break;o.push(i),r=t.get(i)}return o}(r,e),u=c[c.length-1];if(t.get(i)?(t.setIn([o,"nextSibling"],i),t.setIn([i,"prevSibling"],o)):(t.setIn([o,"nextSibling"],r.getNextSiblingKey()),t.setIn([r.getNextSiblingKey(),"prevSibling"],o)),t.setIn([u,"nextSibling"],a),a&&t.setIn([a,"prevSibling"],u),c.forEach((function(e){return t.setIn([e,"parent"],s)})),s){var f=e.get(s).getChildKeys(),p=f.indexOf(o)+1,h=f.toArray();h.splice.apply(h,[p,0].concat(c)),t.setIn([s,"children"],l(h))}}))}(b,0,p,h)),e.merge({blockMap:b,selectionBefore:t,selectionAfter:t.merge({anchorKey:m,anchorOffset:y,focusKey:m,focusOffset:y,isBackward:!1})})};e.exports=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"REPLACE_WITH_NEW_DATA";t.isCollapsed()||s(!1);var i=e.getBlockMap(),a=c(n),l=t.getStartKey(),p=t.getStartOffset(),h=i.get(l);return h instanceof o&&(h.getChildKeys().isEmpty()||s(!1)),1===a.size?u(e,t,i,a.first(),l,p,r):f(e,t,i,a,l,p)}},2882:e=>{"use strict";e.exports=function(e,t,n){var r=e;if(n===r.count())t.forEach((function(e){r=r.push(e)}));else if(0===n)t.reverse().forEach((function(e){r=r.unshift(e)}));else{var o=r.slice(0,n),i=r.slice(n);r=o.concat(t,i).toList()}return r}},3163:(e,t,n)=>{"use strict";var r=n(3941),o=n(2882),i=n(7081),a=r.Repeat;e.exports=function(e,t,n,r){t.isCollapsed()||i(!1);var s=null;if(null!=n&&(s=n.length),null==s||0===s)return e;var c=e.getBlockMap(),l=t.getStartKey(),u=t.getStartOffset(),f=c.get(l),p=f.getText(),h=f.merge({text:p.slice(0,u)+n+p.slice(u,f.getLength()),characterList:o(f.getCharacterList(),a(r,s).toList(),u)}),d=u+s;return e.merge({blockMap:c.set(l,h),selectionAfter:t.merge({anchorOffset:d,focusOffset:d})})}},9509:e=>{"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&e.nodeType===Node.ELEMENT_NODE}},8231:e=>{"use strict";e.exports=function(e){return"handled"===e||!0===e}},285:(e,t,n)=>{"use strict";var r=n(9509);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"A"===e.nodeName}},6959:(e,t,n)=>{"use strict";var r=n(9509);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"BR"===e.nodeName}},5435:e=>{"use strict";e.exports=function(e){return!(!e||!e.ownerDocument)&&(e.ownerDocument.defaultView?e instanceof e.ownerDocument.defaultView.HTMLElement:e instanceof HTMLElement)}},132:(e,t,n)=>{"use strict";var r=n(9509);e.exports=function(e){return!(!e||!e.ownerDocument)&&r(e)&&"IMG"===e.nodeName}},9404:e=>{"use strict";e.exports=function(e){if(!e||!("ownerDocument"in e))return!1;if("ownerDocument"in e){var t=e;if(!t.ownerDocument.defaultView)return t instanceof Node;if(t instanceof t.ownerDocument.defaultView.Node)return!0}return!1}},8727:e=>{"use strict";e.exports=function(e){var t=e.getSelection(),n=t.getAnchorKey(),r=e.getBlockTree(n),o=t.getStartOffset(),i=!1;return r.some((function(e){return o===e.get("start")?(i=!0,!0):o<e.get("end")&&e.get("leaves").some((function(e){var t=e.get("start");return o===t&&(i=!0,!0)}))})),i}},6731:(e,t,n)=>{"use strict";var r=n(9119);e.exports=function(e){return e.which===r.RETURN&&(e.getModifierState("Shift")||e.getModifierState("Alt")||e.getModifierState("Control"))}},1473:(e,t,n)=>{"use strict";var r=n(7077),o=n(6078),i=n(6764),a=n(3021),s=n(9416);e.exports=function(e,t){var n=s(e,(function(e){var n=e.getSelection();if(n.isCollapsed()&&0===n.getAnchorOffset())return a(e,1);var r=t.currentTarget.ownerDocument.defaultView.getSelection().getRangeAt(0);return r=o(r),i(e,null,r.endContainer,r.endOffset,r.startContainer,r.startOffset).selectionState}),"backward");return n===e.getCurrentContent()?e:r.push(e,n,"remove-range")}},1525:(e,t,n)=>{"use strict";var r=n(1111),o=n(7077),i=n(3021),a=n(9416);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=t.getStartOffset();if(0===n)return i(e,1);var o=t.getStartKey(),a=e.getCurrentContent().getBlockForKey(o).getText().slice(0,n),s=r.getBackward(a);return i(e,s.length||1)}),"backward");return t===e.getCurrentContent()?e:o.push(e,t,"remove-range")}},147:(e,t,n)=>{"use strict";var r=n(1111),o=n(7077),i=n(2645),a=n(9416);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=t.getStartOffset(),o=t.getStartKey(),a=e.getCurrentContent().getBlockForKey(o).getText().slice(n),s=r.getForward(a);return i(e,s.length||1)}),"forward");return t===e.getCurrentContent()?e:o.push(e,t,"remove-range")}},7587:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077);e.exports=function(e){var t=r.splitBlock(e.getCurrentContent(),e.getSelection());return o.push(e,t,"split-block")}},8646:(e,t,n)=>{"use strict";var r=n(7077);e.exports=function(e){var t=e.getSelection(),n=t.getEndKey(),o=e.getCurrentContent().getBlockForKey(n).getLength();return r.set(e,{selection:t.merge({anchorKey:n,anchorOffset:o,focusKey:n,focusOffset:o,isBackward:!1}),forceSelection:!0})}},9728:(e,t,n)=>{"use strict";var r=n(7077);e.exports=function(e){var t=e.getSelection(),n=t.getStartKey();return r.set(e,{selection:t.merge({anchorKey:n,anchorOffset:0,focusKey:n,focusOffset:0,isBackward:!1}),forceSelection:!0})}},8281:(e,t,n)=>{"use strict";var r=n(7077),o=n(7027),i=n(3021),a=n(9416);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=t.getAnchorKey(),a=t.getAnchorOffset(),s=n.getBlockForKey(r).getText()[a-1];return i(e,s?o.getUTF16Length(s,0):1)}),"backward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return r.push(e,t.set("selectionBefore",n),n.isCollapsed()?"backspace-character":"remove-range")}},4022:(e,t,n)=>{"use strict";var r=n(7077),o=n(7027),i=n(2645),a=n(9416);e.exports=function(e){var t=a(e,(function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=t.getAnchorKey(),a=t.getAnchorOffset(),s=n.getBlockForKey(r).getText()[a];return i(e,s?o.getUTF16Length(s,0):1)}),"forward");if(t===e.getCurrentContent())return e;var n=e.getSelection();return r.push(e,t.set("selectionBefore",n),n.isCollapsed()?"delete-character":"remove-range")}},5803:(e,t,n)=>{"use strict";var r=n(4702),o=n(7077),i=n(9845);e.exports=function(e){var t=e.getSelection();if(!t.isCollapsed())return e;var n=t.getAnchorOffset();if(0===n)return e;var a,s,c=t.getAnchorKey(),l=e.getCurrentContent(),u=l.getBlockForKey(c).getLength();if(u<=1)return e;n===u?(a=t.set("anchorOffset",n-1),s=t):s=(a=t.set("focusOffset",n+1)).set("anchorOffset",n+1);var f=i(l,a),p=r.removeRange(l,a,"backward"),h=p.getSelectionAfter(),d=h.getAnchorOffset()-1,y=h.merge({anchorOffset:d,focusOffset:d}),m=r.replaceWithFragment(p,y,f),v=o.push(e,m,"insert-fragment");return o.acceptSelection(v,s)}},3973:(e,t,n)=>{"use strict";var r=n(7077);e.exports=function(e,t,n){var o=r.undo(t);if("spellcheck-change"!==t.getLastChangeType())e.preventDefault(),t.getNativelyRenderedContent()?(n(r.set(t,{nativelyRenderedContent:null})),setTimeout((function(){n(o)}),0)):n(o);else{var i=o.getCurrentContent();n(r.set(o,{nativelyRenderedContent:i}))}}},2356:(e,t,n)=>{"use strict";var r=n(3941).Map;e.exports=function(e,t,n){var o=t.getStartKey(),i=t.getEndKey(),a=e.getBlockMap(),s=a.toSeq().skipUntil((function(e,t){return t===o})).takeUntil((function(e,t){return t===i})).concat(r([[i,a.get(i)]])).map(n);return e.merge({blockMap:a.merge(s),selectionBefore:t,selectionAfter:t})}},2351:(e,t,n)=>{"use strict";var r=n(6207),o=n(1023),i=n(3941),a=n(7081),s=i.OrderedMap,c=i.List,l=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},u=function(e,t,n,r,o){if(!o)return e;var i="after"===r,a=t.getKey(),s=n.getKey(),u=t.getParentKey(),f=t.getNextSiblingKey(),p=t.getPrevSiblingKey(),h=n.getParentKey(),d=i?n.getNextSiblingKey():s,y=i?s:n.getPrevSiblingKey();return e.withMutations((function(e){l(u,e,(function(e){var t=e.getChildKeys();return e.merge({children:t.delete(t.indexOf(a))})})),l(p,e,(function(e){return e.merge({nextSibling:f})})),l(f,e,(function(e){return e.merge({prevSibling:p})})),l(d,e,(function(e){return e.merge({prevSibling:a})})),l(y,e,(function(e){return e.merge({nextSibling:a})})),l(h,e,(function(e){var t=e.getChildKeys(),n=t.indexOf(s),r=i?n+1:0!==n?n-1:0,o=t.toArray();return o.splice(r,0,a),e.merge({children:c(o)})})),l(a,e,(function(e){return e.merge({nextSibling:d,prevSibling:y,parent:h})}))}))};e.exports=function(e,t,n,i){"replace"===i&&a(!1);var c=n.getKey(),l=t.getKey();l===c&&a(!1);var f=e.getBlockMap(),p=t instanceof r,h=[t],d=f.delete(l);p&&(h=[],d=f.withMutations((function(e){var n=t.getNextSiblingKey(),r=o(t,e);e.toSeq().skipUntil((function(e){return e.getKey()===l})).takeWhile((function(e){var t=e.getKey(),o=t===l,i=n&&t!==n,a=!n&&e.getParentKey()&&(!r||t!==r);return!!(o||i||a)})).forEach((function(t){h.push(t),e.delete(t.getKey())}))})));var y=d.toSeq().takeUntil((function(e){return e===n})),m=d.toSeq().skipUntil((function(e){return e===n})).skip(1),v=h.map((function(e){return[e.getKey(),e]})),b=s();if("before"===i){var g=e.getBlockBefore(c);g&&g.getKey()===t.getKey()&&a(!1),b=y.concat([].concat(v,[[c,n]]),m).toOrderedMap()}else if("after"===i){var w=e.getBlockAfter(c);w&&w.getKey()===l&&a(!1),b=y.concat([[c,n]].concat(v),m).toOrderedMap()}return e.merge({blockMap:u(b,t,n,i,p),selectionBefore:e.getSelectionAfter(),selectionAfter:e.getSelectionAfter().merge({anchorKey:l,focusKey:l})})}},3021:(e,t,n)=>{"use strict";n(2264),e.exports=function(e,t){var n=e.getSelection(),r=e.getCurrentContent(),o=n.getStartKey(),i=n.getStartOffset(),a=o,s=0;if(t>i){var c=r.getKeyBefore(o);null==c?a=o:(a=c,s=r.getBlockForKey(c).getText().length)}else s=i-t;return n.merge({focusKey:a,focusOffset:s,isBackward:!0})}},2645:(e,t,n)=>{"use strict";n(2264),e.exports=function(e,t){var n,r=e.getSelection(),o=r.getStartKey(),i=r.getStartOffset(),a=e.getCurrentContent(),s=o;return t>a.getBlockForKey(o).getText().length-i?(s=a.getKeyAfter(o),n=0):n=i+t,r.merge({focusKey:s,focusOffset:n})}},8290:(e,t,n)=>{"use strict";var r=n(6207),o=n(462),i=n(3941).OrderedMap;e.exports=function(e){return e.first()instanceof r?function(e){var t,n={};return i(e.withMutations((function(e){e.forEach((function(r,i){var a=r.getKey(),s=r.getNextSiblingKey(),c=r.getPrevSiblingKey(),l=r.getChildKeys(),u=r.getParentKey(),f=o();if(n[a]=f,s&&(e.get(s)?e.setIn([s,"prevSibling"],f):e.setIn([a,"nextSibling"],null)),c&&(e.get(c)?e.setIn([c,"nextSibling"],f):e.setIn([a,"prevSibling"],null)),u&&e.get(u)){var p=e.get(u).getChildKeys();e.setIn([u,"children"],p.set(p.indexOf(r.getKey()),f))}else e.setIn([a,"parent"],null),t&&(e.setIn([t.getKey(),"nextSibling"],f),e.setIn([a,"prevSibling"],n[t.getKey()])),t=e.get(a);l.forEach((function(t){e.get(t)?e.setIn([t,"parent"],f):e.setIn([a,"children"],r.getChildKeys().filter((function(e){return e!==t})))}))}))})).toArray().map((function(e){return[n[e.getKey()],e.set("key",n[e.getKey()])]})))}(e):function(e){return i(e.toArray().map((function(e){var t=o();return[t,e.set("key",t)]})))}(e)}},4511:(e,t,n)=>{"use strict";var r=n(490),o=n(9572),i=n(7081);function a(e,t,n){var a=t.getCharacterList(),s=n>0?a.get(n-1):void 0,c=n<a.count()?a.get(n):void 0,l=s?s.getEntity():void 0,u=c?c.getEntity():void 0;if(u&&u===l&&"MUTABLE"!==e.__get(u).getMutability()){for(var f,p=function(e,t,n){var r;return o(e,(function(e,t){return e.getEntity()===t.getEntity()}),(function(e){return e.getEntity()===t}),(function(e,t){e<=n&&t>=n&&(r={start:e,end:t})})),"object"!=typeof r&&i(!1),r}(a,u,n),h=p.start,d=p.end;h<d;)f=a.get(h),a=a.set(h,r.applyEntity(f,null)),h++;return t.set("characterList",a)}return t}e.exports=function(e,t){var n=e.getBlockMap(),r=e.getEntityMap(),o={},i=t.getStartKey(),s=t.getStartOffset(),c=n.get(i),l=a(r,c,s);l!==c&&(o[i]=l);var u=t.getEndKey(),f=t.getEndOffset(),p=n.get(u);i===u&&(p=l);var h=a(r,p,f);return h!==p&&(o[u]=h),Object.keys(o).length?e.merge({blockMap:n.merge(o),selectionAfter:t}):e.set("selectionAfter",t)}},4217:(e,t,n)=>{"use strict";var r=n(6207),o=n(1023),i=n(3941),a=(i.List,i.Map),s=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},c=function(e,t){var n=[];if(!e)return n;for(var r=t.get(e);r&&r.getParentKey();){var o=r.getParentKey();o&&n.push(o),r=o?t.get(o):null}return n},l=function(e,t,n){if(!e)return null;for(var r=n.get(e.getKey()).getNextSiblingKey();r&&!t.get(r);)r=n.get(r).getNextSiblingKey()||null;return r},u=function(e,t,n){if(!e)return null;for(var r=n.get(e.getKey()).getPrevSiblingKey();r&&!t.get(r);)r=n.get(r).getPrevSiblingKey()||null;return r};e.exports=function(e,t){if(t.isCollapsed())return e;var n,i=e.getBlockMap(),f=t.getStartKey(),p=t.getStartOffset(),h=t.getEndKey(),d=t.getEndOffset(),y=i.get(f),m=i.get(h),v=y instanceof r,b=[];if(v){var g=m.getChildKeys(),w=c(h,i);m.getNextSiblingKey()&&(b=b.concat(w)),g.isEmpty()||(b=b.concat(w.concat([h]))),b=b.concat(c(o(m,i),i))}n=y===m?function(e,t,n){if(0===t)for(;t<n;)e=e.shift(),t++;else if(n===e.count())for(;n>t;)e=e.pop(),n--;else{var r=e.slice(0,t),o=e.slice(n);e=r.concat(o).toList()}return e}(y.getCharacterList(),p,d):y.getCharacterList().slice(0,p).concat(m.getCharacterList().slice(d));var E=y.merge({text:y.getText().slice(0,p)+m.getText().slice(d),characterList:n}),S=v&&0===p&&0===d&&m.getParentKey()===f&&null==m.getPrevSiblingKey()?a([[f,null]]):i.toSeq().skipUntil((function(e,t){return t===f})).takeUntil((function(e,t){return t===h})).filter((function(e,t){return-1===b.indexOf(t)})).concat(a([[h,null]])).map((function(e,t){return t===f?E:null})),O=i.merge(S).filter((function(e){return!!e}));return v&&y!==m&&(O=function(e,t,n,r){return e.withMutations((function(i){if(s(t.getKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})),s(n.getKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})})),c(t.getKey(),r).forEach((function(e){return s(e,i,(function(e){return e.merge({children:e.getChildKeys().filter((function(e){return i.get(e)})),nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),s(t.getNextSiblingKey(),i,(function(e){return e.merge({prevSibling:t.getPrevSiblingKey()})})),s(t.getPrevSiblingKey(),i,(function(e){return e.merge({nextSibling:l(e,i,r)})})),s(n.getNextSiblingKey(),i,(function(e){return e.merge({prevSibling:u(e,i,r)})})),s(n.getPrevSiblingKey(),i,(function(e){return e.merge({nextSibling:n.getNextSiblingKey()})})),c(n.getKey(),r).forEach((function(e){s(e,i,(function(e){return e.merge({children:e.getChildKeys().filter((function(e){return i.get(e)})),nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),function(e,t){var n=[];if(!e)return n;for(var r=o(e,t);r&&t.get(r);){var i=t.get(r);n.push(r),r=i.getParentKey()?o(i,t):null}return n}(n,r).forEach((function(e){return s(e,i,(function(e){return e.merge({nextSibling:l(e,i,r),prevSibling:u(e,i,r)})}))})),null==e.get(t.getKey())&&null!=e.get(n.getKey())&&n.getParentKey()===t.getKey()&&null==n.getPrevSiblingKey()){var a=t.getPrevSiblingKey();s(n.getKey(),i,(function(e){return e.merge({prevSibling:a})})),s(a,i,(function(e){return e.merge({nextSibling:n.getKey()})}));var f=a?e.get(a):null,p=f?f.getParentKey():null;if(t.getChildKeys().forEach((function(e){s(e,i,(function(e){return e.merge({parent:p})}))})),null!=p){var h=e.get(p);s(p,i,(function(e){return e.merge({children:h.getChildKeys().concat(t.getChildKeys())})}))}s(t.getChildKeys().find((function(t){return null===e.get(t).getNextSiblingKey()})),i,(function(e){return e.merge({nextSibling:t.getNextSiblingKey()})}))}}))}(O,y,m,i)),e.merge({blockMap:O,selectionBefore:t,selectionAfter:t.merge({anchorKey:f,anchorOffset:p,focusKey:f,focusOffset:p,isBackward:!1})})}},9416:(e,t,n)=>{"use strict";var r=n(4702),o=n(6130)("draft_tree_data_support");e.exports=function(e,t,n){var i=e.getSelection(),a=e.getCurrentContent(),s=i,c=i.getAnchorKey(),l=i.getFocusKey(),u=a.getBlockForKey(c);if(o&&"forward"===n&&c!==l)return a;if(i.isCollapsed()){if("forward"===n){if(e.isSelectionAtEndOfContent())return a;if(o&&i.getAnchorOffset()===a.getBlockForKey(c).getLength()){var f=a.getBlockForKey(u.nextSibling);if(!f||0===f.getLength())return a}}else if(e.isSelectionAtStartOfContent())return a;if((s=t(e))===i)return a}return r.removeRange(a,s,n)}},2140:e=>{"use strict";var t=new RegExp("\r","g");e.exports=function(e){return e.replace(t,"")}},2337:(e,t,n)=>{"use strict";var r=n(6512),o=n(3405),i=n(5306),a=n(1089),s=n(2402),c=n(8681),l=n(7081),u=n(9509),f=i.isBrowser("IE");function p(e,t){if(!e)return"[empty]";var n=h(e,t);return n.nodeType===Node.TEXT_NODE?n.textContent:(u(n)||l(!1),n.outerHTML)}function h(e,t){var n=void 0!==t?t(e):[];if(e.nodeType===Node.TEXT_NODE){var r=e.textContent.length;return c(e).createTextNode("[text "+r+(n.length?" | "+n.join(", "):"")+"]")}var o=e.cloneNode();1===o.nodeType&&n.length&&o.setAttribute("data-labels",n.join(", "));for(var i=e.childNodes,a=0;a<i.length;a++)o.appendChild(h(i[a],t));return o}function d(e,t){for(var n=e,r=n;n;){if(u(n)&&r.hasAttribute("contenteditable"))return p(n,t);r=n=n.parentNode}return"Could not find contentEditable parent of node"}function y(e){return null===e.nodeValue?e.childNodes.length:e.nodeValue.length}function m(e,t,n,r){var i=s();if(e.extend&&null!=t&&a(i,t)){n>y(t)&&o.logSelectionStateFailure({anonymizedDom:d(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())});var c=t===e.focusNode;try{e.rangeCount>0&&e.extend&&e.extend(t,n)}catch(a){throw o.logSelectionStateFailure({anonymizedDom:d(t,(function(t){var n=[];return t===i&&n.push("active element"),t===e.anchorNode&&n.push("selection anchor node"),t===e.focusNode&&n.push("selection focus node"),n})),extraParams:JSON.stringify({activeElementName:i?i.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:c,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:a?""+a:null,offset:n},null,2),selectionState:JSON.stringify(r.toJS(),null,2)}),a}}else if(t&&e.rangeCount>0){var l=e.getRangeAt(0);l.setEnd(t,n),e.addRange(l.cloneRange())}}function v(e,t,n,i){var a=c(t).createRange();if(n>y(t)&&(o.logSelectionStateFailure({anonymizedDom:d(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(i.toJS())}),r.handleExtensionCausedError()),a.setStart(t,n),f)try{e.addRange(a)}catch(e){}else e.addRange(a)}e.exports={setDraftEditorSelection:function(e,t,n,r,o){var i=c(t);if(a(i.documentElement,t)){var s=i.defaultView.getSelection(),l=e.getAnchorKey(),u=e.getAnchorOffset(),f=e.getFocusKey(),p=e.getFocusOffset(),h=e.getIsBackward();if(!s.extend&&h){var d=l,y=u;l=f,u=p,f=d,p=y,h=!1}var b=l===n&&r<=u&&o>=u,g=f===n&&r<=p&&o>=p;if(b&&g)return s.removeAllRanges(),v(s,t,u-r,e),void m(s,t,p-r,e);if(h){if(g&&(s.removeAllRanges(),v(s,t,p-r,e)),b){var w=s.focusNode,E=s.focusOffset;s.removeAllRanges(),v(s,t,u-r,e),m(s,w,E,e)}}else b&&(s.removeAllRanges(),v(s,t,u-r,e)),g&&m(s,t,p-r,e)}},addFocusToSelection:m}},8124:(e,t,n)=>{"use strict";var r=n(6207),o=n(462),i=n(3941),a=n(7081),s=n(2356),c=i.List,l=i.Map,u=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}};e.exports=function(e,t){t.isCollapsed()||a(!1);var n=t.getAnchorKey(),i=e.getBlockMap(),f=i.get(n),p=f.getText();if(!p){var h=f.getType();if("unordered-list-item"===h||"ordered-list-item"===h)return s(e,t,(function(e){return e.merge({type:"unstyled",depth:0})}))}var d=t.getAnchorOffset(),y=f.getCharacterList(),m=o(),v=f instanceof r,b=f.merge({text:p.slice(0,d),characterList:y.slice(0,d)}),g=b.merge({key:m,text:p.slice(d),characterList:y.slice(d),data:l()}),w=i.toSeq().takeUntil((function(e){return e===f})),E=i.toSeq().skipUntil((function(e){return e===f})).rest(),S=w.concat([[n,b],[m,g]],E).toOrderedMap();return v&&(f.getChildKeys().isEmpty()||a(!1),S=function(e,t,n){return e.withMutations((function(e){var r=t.getKey(),o=n.getKey();u(t.getParentKey(),e,(function(e){var t=e.getChildKeys(),n=t.indexOf(r)+1,i=t.toArray();return i.splice(n,0,o),e.merge({children:c(i)})})),u(t.getNextSiblingKey(),e,(function(e){return e.merge({prevSibling:o})})),u(r,e,(function(e){return e.merge({nextSibling:o})})),u(o,e,(function(e){return e.merge({prevSibling:r})}))}))}(S,b,g)),e.merge({blockMap:S,selectionBefore:t,selectionAfter:t.merge({anchorKey:m,anchorOffset:0,focusKey:m,focusOffset:0,isBackward:!1})})}},5264:e=>{"use strict";var t=/\r\n?|\n/g;e.exports=function(e){return e.split(t)}},5634:e=>{"use strict";e.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}},3941:function(e){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:q(e)}function r(e){return s(e)?e:V(e)}function o(e){return c(e)?e:z(e)}function i(e){return a(e)&&!l(e)?e:W(e)}function a(e){return!(!e||!e[f])}function s(e){return!(!e||!e[p])}function c(e){return!(!e||!e[h])}function l(e){return s(e)||c(e)}function u(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=c,n.isAssociative=l,n.isOrdered=u,n.Keyed=r,n.Indexed=o,n.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y=32,m=31,v={},b={value:!1},g={value:!1};function w(e){return e.value=!1,e}function E(e){e&&(e.value=!0)}function S(){}function O(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function _(e){return void 0===e.size&&(e.size=e.__iterate(C)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?_(e)+t:t}function C(){return!0}function P(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function j(e,t){return x(e,t,0)}function T(e,t){return x(e,t,t)}function x(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var R="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",N=R||D;function M(e){this.next=e}function I(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function A(){return{value:void 0,done:!0}}function L(e){return!!U(e)}function B(e){return e&&"function"==typeof e.next}function F(e){var t=U(e);return t&&t.call(e)}function U(e){var t=e&&(R&&e[R]||e["@@iterator"]);if("function"==typeof t)return t}function K(e){return e&&"number"==typeof e.length}function q(e){return null==e?te():a(e)?e.toSeq():function(e){var t=oe(e)||"object"==typeof e&&new Y(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function V(e){return null==e?te().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():ne(e)}function z(e){return null==e?te():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():re(e)}function W(e){return(null==e?te():a(e)?s(e)?e.entrySeq():e:re(e)).toSetSeq()}M.prototype.toString=function(){return"[Iterator]"},M.KEYS=0,M.VALUES=1,M.ENTRIES=2,M.prototype.inspect=M.prototype.toSource=function(){return this.toString()},M.prototype[N]=function(){return this},t(q,n),q.of=function(){return q(arguments)},q.prototype.toSeq=function(){return this},q.prototype.toString=function(){return this.__toString("Seq {","}")},q.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},q.prototype.__iterate=function(e,t){return ie(this,e,t,!0)},q.prototype.__iterator=function(e,t){return ae(this,e,t,!0)},t(V,q),V.prototype.toKeyedSeq=function(){return this},t(z,q),z.of=function(){return z(arguments)},z.prototype.toIndexedSeq=function(){return this},z.prototype.toString=function(){return this.__toString("Seq [","]")},z.prototype.__iterate=function(e,t){return ie(this,e,t,!1)},z.prototype.__iterator=function(e,t){return ae(this,e,t,!1)},t(W,q),W.of=function(){return W(arguments)},W.prototype.toSetSeq=function(){return this},q.isSeq=ee,q.Keyed=V,q.Set=W,q.Indexed=z;var H,$,J,G="@@__IMMUTABLE_SEQ__@@";function Q(e){this._array=e,this.size=e.length}function Y(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function X(e){this._iterable=e,this.size=e.length||e.size}function Z(e){this._iterator=e,this._iteratorCache=[]}function ee(e){return!(!e||!e[G])}function te(){return H||(H=new Q([]))}function ne(e){var t=Array.isArray(e)?new Q(e).fromEntrySeq():B(e)?new Z(e).fromEntrySeq():L(e)?new X(e).fromEntrySeq():"object"==typeof e?new Y(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function re(e){var t=oe(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function oe(e){return K(e)?new Q(e):B(e)?new Z(e):L(e)?new X(e):void 0}function ie(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ae(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new M((function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:I(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function se(e,t){return t?ce(t,e,"",{"":e}):le(e)}function ce(e,t,n,r){return Array.isArray(t)?e.call(r,n,z(t).map((function(n,r){return ce(e,n,r,t)}))):ue(t)?e.call(r,n,V(t).map((function(n,r){return ce(e,n,r,t)}))):t}function le(e){return Array.isArray(e)?z(e).map(le).toList():ue(e)?V(e).map(le).toMap():e}function ue(e){return e&&(e.constructor===Object||void 0===e.constructor)}function fe(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function pe(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||c(e)!==c(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!l(e);if(u(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&fe(o[1],e)&&(n||fe(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var f=!0,p=t.__iterate((function(t,r){if(n?!e.has(t):o?!fe(t,e.get(r,v)):!fe(e.get(r,v),t))return f=!1,!1}));return f&&e.size===p}function he(e,t){if(!(this instanceof he))return new he(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if($)return $;$=this}}function de(e,t){if(!e)throw new Error(t)}function ye(e,t,n){if(!(this instanceof ye))return new ye(e,t,n);if(de(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(J)return J;J=this}}function me(){throw TypeError("Abstract")}function ve(){}function be(){}function ge(){}q.prototype[G]=!0,t(Q,z),Q.prototype.get=function(e,t){return this.has(e)?this._array[k(this,e)]:t},Q.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},Q.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new M((function(){return o>r?{value:void 0,done:!0}:I(e,o,n[t?r-o++:o++])}))},t(Y,V),Y.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},Y.prototype.has=function(e){return this._object.hasOwnProperty(e)},Y.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},Y.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new M((function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:I(e,a,n[a])}))},Y.prototype[d]=!0,t(X,z),X.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=F(this._iterable),r=0;if(B(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},X.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=F(this._iterable);if(!B(n))return new M(A);var r=0;return new M((function(){var t=n.next();return t.done?t:I(e,r++,t.value)}))},t(Z,z),Z.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},Z.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new M((function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return I(e,o,r[o++])}))},t(he,z),he.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},he.prototype.get=function(e,t){return this.has(e)?this._value:t},he.prototype.includes=function(e){return fe(this._value,e)},he.prototype.slice=function(e,t){var n=this.size;return P(e,t,n)?this:new he(this._value,T(t,n)-j(e,n))},he.prototype.reverse=function(){return this},he.prototype.indexOf=function(e){return fe(this._value,e)?0:-1},he.prototype.lastIndexOf=function(e){return fe(this._value,e)?this.size:-1},he.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},he.prototype.__iterator=function(e,t){var n=this,r=0;return new M((function(){return r<n.size?I(e,r++,n._value):{value:void 0,done:!0}}))},he.prototype.equals=function(e){return e instanceof he?fe(this._value,e._value):pe(e)},t(ye,z),ye.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},ye.prototype.get=function(e,t){return this.has(e)?this._start+k(this,e)*this._step:t},ye.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ye.prototype.slice=function(e,t){return P(e,t,this.size)?this:(e=j(e,this.size),(t=T(t,this.size))<=e?new ye(0,0):new ye(this.get(e,this._end),this.get(t,this._end),this._step))},ye.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},ye.prototype.lastIndexOf=function(e){return this.indexOf(e)},ye.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},ye.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new M((function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:I(e,i++,a)}))},ye.prototype.equals=function(e){return e instanceof ye?this._start===e._start&&this._end===e._end&&this._step===e._step:pe(this,e)},t(me,n),t(ve,me),t(be,me),t(ge,me),me.Keyed=ve,me.Indexed=be,me.Set=ge;var we="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Ee(e){return e>>>1&1073741824|3221225471&e}function Se(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Ee(n)}if("string"===t)return e.length>xe?function(e){var t=Ne[e];return void 0===t&&(t=Oe(e),De===Re&&(De=0,Ne={}),De++,Ne[e]=t),t}(e):Oe(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(Pe&&void 0!==(t=Ce.get(e)))return t;if(void 0!==(t=e[Te]))return t;if(!ke){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Te]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++je,1073741824&je&&(je=0),Pe)Ce.set(e,t);else{if(void 0!==_e&&!1===_e(e))throw new Error("Non-extensible objects are not allowed as keys.");if(ke)Object.defineProperty(e,Te,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Te]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Te]=t}}return t}(e);if("function"==typeof e.toString)return Oe(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Oe(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Ee(t)}var _e=Object.isExtensible,ke=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();var Ce,Pe="function"==typeof WeakMap;Pe&&(Ce=new WeakMap);var je=0,Te="__immutablehash__";"function"==typeof Symbol&&(Te=Symbol(Te));var xe=16,Re=255,De=0,Ne={};function Me(e){de(e!==1/0,"Cannot perform this action with an infinite size.")}function Ie(e){return null==e?Ge():Ae(e)&&!u(e)?e:Ge().withMutations((function(t){var n=r(e);Me(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Ae(e){return!(!e||!e[Be])}t(Ie,ve),Ie.prototype.toString=function(){return this.__toString("Map {","}")},Ie.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ie.prototype.set=function(e,t){return Qe(this,e,t)},Ie.prototype.setIn=function(e,t){return this.updateIn(e,v,(function(){return t}))},Ie.prototype.remove=function(e){return Qe(this,e,v)},Ie.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return v}))},Ie.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ie.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=ot(this,tn(e),t,n);return r===v?void 0:r},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Ge()},Ie.prototype.merge=function(){return et(this,void 0,arguments)},Ie.prototype.mergeWith=function(t){return et(this,t,e.call(arguments,1))},Ie.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Ge(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Ie.prototype.mergeDeep=function(){return et(this,tt,arguments)},Ie.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return et(this,nt(t),n)},Ie.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Ge(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Ie.prototype.sort=function(e){return Pt(zt(this,e))},Ie.prototype.sortBy=function(e,t){return Pt(zt(this,t,e))},Ie.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ie.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new S)},Ie.prototype.asImmutable=function(){return this.__ensureOwner()},Ie.prototype.wasAltered=function(){return this.__altered},Ie.prototype.__iterator=function(e,t){return new We(this,e,t)},Ie.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},Ie.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Je(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ie.isMap=Ae;var Le,Be="@@__IMMUTABLE_MAP__@@",Fe=Ie.prototype;function Ue(e,t){this.ownerID=e,this.entries=t}function Ke(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function qe(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ze(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function We(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&$e(e._root)}function He(e,t){return I(e,t[0],t[1])}function $e(e,t){return{node:e,index:0,__prev:t}}function Je(e,t,n,r){var o=Object.create(Fe);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Ge(){return Le||(Le=Je(0))}function Qe(e,t,n){var r,o;if(e._root){var i=w(b),a=w(g);if(r=Ye(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===v?-1:1:0)}else{if(n===v)return e;o=1,r=new Ue(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Je(o,r):Ge()}function Ye(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===v?e:(E(s),E(a),new ze(t,r,[o,i]))}function Xe(e){return e.constructor===ze||e.constructor===Ve}function Ze(e,t,n,r,o){if(e.keyHash===r)return new Ve(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&m,s=(0===n?r:r>>>n)&m;return new Ke(t,1<<a|1<<s,a===s?[Ze(e,t,n+5,r,o)]:(i=new ze(t,r,o),a<s?[e,i]:[i,e]))}function et(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],c=r(s);a(s)||(c=c.map((function(e){return se(e)}))),o.push(c)}return rt(e,t,o)}function tt(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):fe(e,t)?e:t}function nt(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return fe(t,o)?t:o}}function rt(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var r=t?function(n,r){e.update(r,v,(function(e){return e===v?n:t(e,n,r)}))}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)})):e.constructor(n[0])}function ot(e,t,n,r){var o=e===v,i=t.next();if(i.done){var a=o?n:e,s=r(a);return s===a?e:s}de(o||e&&e.set,"invalid keyPath");var c=i.value,l=o?v:e.get(c,v),u=ot(l,t,n,r);return u===l?e:u===v?e.remove(c):(o?Ge():e).set(c,u)}function it(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function at(e,t,n,r){var o=r?e:O(e);return o[t]=n,o}Fe[Be]=!0,Fe.delete=Fe.remove,Fe.removeIn=Fe.deleteIn,Ue.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(fe(n,o[i][0]))return o[i][1];return r},Ue.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===v,c=this.entries,l=0,u=c.length;l<u&&!fe(r,c[l][0]);l++);var f=l<u;if(f?c[l][1]===o:s)return this;if(E(a),(s||!f)&&E(i),!s||1!==c.length){if(!f&&!s&&c.length>=st)return function(e,t,n,r){e||(e=new S);for(var o=new ze(e,Se(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,c,r,o);var p=e&&e===this.ownerID,h=p?c:O(c);return f?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new Ue(e,h)}},Ke.prototype.get=function(e,t,n,r){void 0===t&&(t=Se(n));var o=1<<((0===e?t:t>>>e)&m),i=this.bitmap;return 0==(i&o)?r:this.nodes[it(i&o-1)].get(e+5,t,n,r)},Ke.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var s=(0===t?n:n>>>t)&m,c=1<<s,l=this.bitmap,u=0!=(l&c);if(!u&&o===v)return this;var f=it(l&c-1),p=this.nodes,h=u?p[f]:void 0,d=Ye(h,e,t+5,n,r,o,i,a);if(d===h)return this;if(!u&&d&&p.length>=ct)return function(e,t,n,r,o){for(var i=0,a=new Array(y),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new qe(e,i+1,a)}(e,p,l,s,d);if(u&&!d&&2===p.length&&Xe(p[1^f]))return p[1^f];if(u&&d&&1===p.length&&Xe(d))return d;var b=e&&e===this.ownerID,g=u?d?l:l^c:l|c,w=u?d?at(p,f,d,b):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(p,f,b):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(p,f,d,b);return b?(this.bitmap=g,this.nodes=w,this):new Ke(e,g,w)},qe.prototype.get=function(e,t,n,r){void 0===t&&(t=Se(n));var o=(0===e?t:t>>>e)&m,i=this.nodes[o];return i?i.get(e+5,t,n,r):r},qe.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var s=(0===t?n:n>>>t)&m,c=o===v,l=this.nodes,u=l[s];if(c&&!u)return this;var f=Ye(u,e,t+5,n,r,o,i,a);if(f===u)return this;var p=this.count;if(u){if(!f&&--p<lt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,c=1,l=t.length;s<l;s++,c<<=1){var u=t[s];void 0!==u&&s!==r&&(o|=c,a[i++]=u)}return new Ke(e,o,a)}(e,l,p,s)}else p++;var h=e&&e===this.ownerID,d=at(l,s,f,h);return h?(this.count=p,this.nodes=d,this):new qe(e,p,d)},Ve.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(fe(n,o[i][0]))return o[i][1];return r},Ve.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var s=o===v;if(n!==this.keyHash)return s?this:(E(a),E(i),Ze(this,e,t,n,[r,o]));for(var c=this.entries,l=0,u=c.length;l<u&&!fe(r,c[l][0]);l++);var f=l<u;if(f?c[l][1]===o:s)return this;if(E(a),(s||!f)&&E(i),s&&2===u)return new ze(e,this.keyHash,c[1^l]);var p=e&&e===this.ownerID,h=p?c:O(c);return f?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new Ve(e,this.keyHash,h)},ze.prototype.get=function(e,t,n,r){return fe(n,this.entry[0])?this.entry[1]:r},ze.prototype.update=function(e,t,n,r,o,i,a){var s=o===v,c=fe(r,this.entry[0]);return(c?o===this.entry[1]:s)?this:(E(a),s?void E(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new ze(e,this.keyHash,[r,o]):(E(i),Ze(this,e,t,Se(r),[r,o])))},Ue.prototype.iterate=Ve.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},Ke.prototype.iterate=qe.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},ze.prototype.iterate=function(e,t){return e(this.entry)},t(We,M),We.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return He(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return He(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return He(e,i.entry);t=this._stack=$e(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var st=8,ct=16,lt=8;function ut(e){var t=wt();if(null==e)return t;if(ft(e))return e;var n=o(e),r=n.size;return 0===r?t:(Me(r),r>0&&r<y?gt(0,r,5,null,new dt(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function ft(e){return!(!e||!e[pt])}t(ut,be),ut.of=function(){return this(arguments)},ut.prototype.toString=function(){return this.__toString("List [","]")},ut.prototype.get=function(e,t){if((e=k(this,e))>=0&&e<this.size){var n=Ot(this,e+=this._origin);return n&&n.array[e&m]}return t},ut.prototype.set=function(e,t){return function(e,t,n){if((t=k(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?_t(e,t).set(0,n):_t(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,i=w(g);return t>=Ct(e._capacity)?r=Et(r,e.__ownerID,0,t,n,i):o=Et(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):gt(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},ut.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},ut.prototype.insert=function(e,t){return this.splice(e,0,t)},ut.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):wt()},ut.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){_t(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])}))},ut.prototype.pop=function(){return _t(this,0,-1)},ut.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){_t(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])}))},ut.prototype.shift=function(){return _t(this,1)},ut.prototype.merge=function(){return kt(this,void 0,arguments)},ut.prototype.mergeWith=function(t){return kt(this,t,e.call(arguments,1))},ut.prototype.mergeDeep=function(){return kt(this,tt,arguments)},ut.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return kt(this,nt(t),n)},ut.prototype.setSize=function(e){return _t(this,0,e)},ut.prototype.slice=function(e,t){var n=this.size;return P(e,t,n)?this:_t(this,j(e,n),T(t,n))},ut.prototype.__iterator=function(e,t){var n=0,r=bt(this,t);return new M((function(){var t=r();return t===vt?{value:void 0,done:!0}:I(e,n++,t)}))},ut.prototype.__iterate=function(e,t){for(var n,r=0,o=bt(this,t);(n=o())!==vt&&!1!==e(n,r++,this););return r},ut.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?gt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},ut.isList=ft;var pt="@@__IMMUTABLE_LIST__@@",ht=ut.prototype;function dt(e,t){this.array=e,this.ownerID=t}ht[pt]=!0,ht.delete=ht.remove,ht.setIn=Fe.setIn,ht.deleteIn=ht.removeIn=Fe.removeIn,ht.update=Fe.update,ht.updateIn=Fe.updateIn,ht.mergeIn=Fe.mergeIn,ht.mergeDeepIn=Fe.mergeDeepIn,ht.withMutations=Fe.withMutations,ht.asMutable=Fe.asMutable,ht.asImmutable=Fe.asImmutable,ht.wasAltered=Fe.wasAltered,dt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&m;if(r>=this.array.length)return new dt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-5,n))===a&&i)return this}if(i&&!o)return this;var s=St(this,e);if(!i)for(var c=0;c<r;c++)s.array[c]=void 0;return o&&(s.array[r]=o),s},dt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&m;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-5,n))===i&&o===this.array.length-1)return this}var a=St(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var yt,mt,vt={};function bt(e,t){var n=e._origin,r=e._capacity,o=Ct(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,c=a>n?0:n-a,l=r-a;return l>y&&(l=y),function(){if(c===l)return vt;var e=t?--l:c++;return s&&s[e]}}(e,c):function(e,o,i){var s,c=e&&e.array,l=i>n?0:n-i>>o,u=1+(r-i>>o);return u>y&&(u=y),function(){for(;;){if(s){var e=s();if(e!==vt)return e;s=null}if(l===u)return vt;var n=t?--u:l++;s=a(c&&c[n],o-5,i+(n<<o))}}}(e,s,c)}}function gt(e,t,n,r,o,i,a){var s=Object.create(ht);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function wt(){return yt||(yt=gt(0,0,5))}function Et(e,t,n,r,o,i){var a,s=r>>>n&m,c=e&&s<e.array.length;if(!c&&void 0===o)return e;if(n>0){var l=e&&e.array[s],u=Et(l,t,n-5,r,o,i);return u===l?e:((a=St(e,t)).array[s]=u,a)}return c&&e.array[s]===o?e:(E(i),a=St(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function St(e,t){return t&&e&&t===e.ownerID?e:new dt(e?e.array.slice():[],t)}function Ot(e,t){if(t>=Ct(e._capacity))return e._tail;if(t<1<<e._level+5){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&m],r-=5;return n}}function _t(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new S,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var c=e._level,l=e._root,u=0;a+u<0;)l=new dt(l&&l.array.length?[void 0,l]:[],r),u+=1<<(c+=5);u&&(a+=u,o+=u,s+=u,i+=u);for(var f=Ct(i),p=Ct(s);p>=1<<c+5;)l=new dt(l&&l.array.length?[l]:[],r),c+=5;var h=e._tail,d=p<f?Ot(e,s-1):p>f?new dt([],r):h;if(h&&p>f&&a<i&&h.array.length){for(var y=l=St(l,r),v=c;v>5;v-=5){var b=f>>>v&m;y=y.array[b]=St(y.array[b],r)}y.array[f>>>5&m]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=p)a-=p,s-=p,c=5,l=null,d=d&&d.removeBefore(r,0,a);else if(a>o||p<f){for(u=0;l;){var g=a>>>c&m;if(g!==p>>>c&m)break;g&&(u+=(1<<c)*g),c-=5,l=l.array[g]}l&&a>o&&(l=l.removeBefore(r,c,a-u)),l&&p<f&&(l=l.removeAfter(r,c,p-u)),u&&(a-=u,s-=u)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=l,e._tail=d,e.__hash=void 0,e.__altered=!0,e):gt(a,s,c,l,d)}function kt(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var c=n[s],l=o(c);l.size>i&&(i=l.size),a(c)||(l=l.map((function(e){return se(e)}))),r.push(l)}return i>e.size&&(e=e.setSize(i)),rt(e,t,r)}function Ct(e){return e<y?0:e-1>>>5<<5}function Pt(e){return null==e?xt():jt(e)?e:xt().withMutations((function(t){var n=r(e);Me(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function jt(e){return Ae(e)&&u(e)}function Tt(e,t,n,r){var o=Object.create(Pt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function xt(){return mt||(mt=Tt(Ge(),wt()))}function Rt(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),c=void 0!==s;if(n===v){if(!c)return e;a.size>=y&&a.size>=2*i.size?(r=(o=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Tt(r,o)}function Dt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Nt(e){this._iter=e,this.size=e.size}function Mt(e){this._iter=e,this.size=e.size}function It(e){this._iter=e,this.size=e.size}function At(e){var t=Xt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Zt,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(2===t){var r=e.__iterator(t,n);return new M((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,n)},t}function Lt(e,t,n){var r=Xt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,v);return i===v?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate((function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)}),o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(2,o);return new M((function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return I(r,s,t.call(n,a[1],s,e),o)}))},r}function Bt(e,t){var n=Xt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=At(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Zt,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function Ft(e,t,n,r){var o=Xt(e);return r&&(o.has=function(r){var o=e.get(r,v);return o!==v&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,v);return i!==v&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate((function(e,i,c){if(t.call(n,e,i,c))return s++,o(e,r?i:s-1,a)}),i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(2,i),s=0;return new M((function(){for(;;){var i=a.next();if(i.done)return i;var c=i.value,l=c[0],u=c[1];if(t.call(n,u,l,e))return I(o,r?l:s++,u,i)}}))},o}function Ut(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n|=0),P(t,n,o))return e;var i=j(t,o),a=T(n,o);if(i!=i||a!=a)return Ut(e.toSeq().cacheResult(),t,n,r);var s,c=a-i;c==c&&(s=c<0?0:c);var l=Xt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&ee(e)&&s>=0&&(l.get=function(t,n){return(t=k(this,t))>=0&&t<s?e.get(t+i,n):n}),l.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,c=!0,l=0;return e.__iterate((function(e,n){if(!c||!(c=a++<i))return l++,!1!==t(e,r?n:l-1,o)&&l!==s})),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,c=0;return new M((function(){for(;a++<i;)o.next();if(++c>s)return{value:void 0,done:!0};var e=o.next();return r||1===t?e:I(t,c-1,0===t?void 0:e.value[1],e)}))},l}function Kt(e,t,n,r){var o=Xt(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,c=0;return e.__iterate((function(e,i,l){if(!s||!(s=t.call(n,e,i,l)))return c++,o(e,r?i:c-1,a)})),c},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(2,i),c=!0,l=0;return new M((function(){var e,i,u;do{if((e=s.next()).done)return r||1===o?e:I(o,l++,0===o?void 0:e.value[1],e);var f=e.value;i=f[0],u=f[1],c&&(c=t.call(n,u,i,a))}while(c);return 2===o?e:I(o,i,u,e)}))},o}function qt(e,t){var n=s(e),o=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?ne(e):re(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||c(e)&&c(i))return i}var l=new Q(o);return n?l=l.toKeyedSeq():c(e)||(l=l.toSetSeq()),(l=l.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),l}function Vt(e,t,n){var r=Xt(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(c,l){var u=this;c.__iterate((function(o,c){return(!t||l<t)&&a(o)?e(o,l+1):!1===r(o,n?c:i++,u)&&(s=!0),!s}),o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],c=0;return new M((function(){for(;i;){var e=i.next();if(!1===e.done){var l=e.value;if(2===r&&(l=l[1]),t&&!(s.length<t)||!a(l))return n?e:I(r,c++,l,e);s.push(i),i=l.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}}))},r}function zt(e,t,n){t||(t=en);var r=s(e),o=0,i=e.toSeq().map((function(t,r){return[r,t,o++,n?n(t,r,e):t]})).toArray();return i.sort((function(e,n){return t(e[3],n[3])||e[2]-n[2]})).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?V(i):c(e)?z(i):W(i)}function Wt(e,t,n){if(t||(t=en),n){var r=e.toSeq().map((function(t,r){return[t,n(t,r,e)]})).reduce((function(e,n){return Ht(t,e[1],n[1])?n:e}));return r&&r[0]}return e.reduce((function(e,n){return Ht(t,e,n)?n:e}))}function Ht(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function $t(e,t,r){var o=Xt(e);return o.size=new Q(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(1,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=n(e),F(o?e.reverse():e)})),a=0,s=!1;return new M((function(){var n;return s||(n=i.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:I(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function Jt(e,t){return ee(e)?t:e.constructor(t)}function Gt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Qt(e){return Me(e.size),_(e)}function Yt(e){return s(e)?r:c(e)?o:i}function Xt(e){return Object.create((s(e)?V:c(e)?z:W).prototype)}function Zt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):q.prototype.cacheResult.call(this)}function en(e,t){return e>t?1:e<t?-1:0}function tn(e){var t=F(e);if(!t){if(!K(e))throw new TypeError("Expected iterable or array-like: "+e);t=F(n(e))}return t}function nn(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);(function(e,t){try{t.forEach(sn.bind(void 0,e))}catch(e){}})(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ie(i)},o=r.prototype=Object.create(rn);return o.constructor=r,r}t(Pt,Ie),Pt.of=function(){return this(arguments)},Pt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Pt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Pt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):xt()},Pt.prototype.set=function(e,t){return Rt(this,e,t)},Pt.prototype.remove=function(e){return Rt(this,e,v)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Pt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},Pt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Tt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Pt.isOrderedMap=jt,Pt.prototype[d]=!0,Pt.prototype.delete=Pt.prototype.remove,t(Dt,V),Dt.prototype.get=function(e,t){return this._iter.get(e,t)},Dt.prototype.has=function(e){return this._iter.has(e)},Dt.prototype.valueSeq=function(){return this._iter.valueSeq()},Dt.prototype.reverse=function(){var e=this,t=Bt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Dt.prototype.map=function(e,t){var n=this,r=Lt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Dt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Qt(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Dt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(1,t),r=t?Qt(this):0;return new M((function(){var o=n.next();return o.done?o:I(e,t?--r:r++,o.value,o)}))},Dt.prototype[d]=!0,t(Nt,z),Nt.prototype.includes=function(e){return this._iter.includes(e)},Nt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate((function(t){return e(t,r++,n)}),t)},Nt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(1,t),r=0;return new M((function(){var t=n.next();return t.done?t:I(e,r++,t.value,t)}))},t(Mt,W),Mt.prototype.has=function(e){return this._iter.includes(e)},Mt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){return e(t,t,n)}),t)},Mt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(1,t);return new M((function(){var t=n.next();return t.done?t:I(e,t.value,t.value,t)}))},t(It,V),It.prototype.entrySeq=function(){return this._iter.toSeq()},It.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){if(t){Gt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}}),t)},It.prototype.__iterator=function(e,t){var n=this._iter.__iterator(1,t);return new M((function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Gt(r);var o=a(r);return I(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}}))},Nt.prototype.cacheResult=Dt.prototype.cacheResult=Mt.prototype.cacheResult=It.prototype.cacheResult=Zt,t(nn,ve),nn.prototype.toString=function(){return this.__toString(an(this)+" {","}")},nn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},nn.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},nn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=on(this,Ge()))},nn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+an(this));var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:on(this,n)},nn.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:on(this,t)},nn.prototype.wasAltered=function(){return this._map.wasAltered()},nn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterator(e,t)},nn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterate(e,t)},nn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?on(this,t,e):(this.__ownerID=e,this._map=t,this)};var rn=nn.prototype;function on(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function an(e){return e._name||e.constructor.name||"Record"}function sn(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){de(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function cn(e){return null==e?yn():ln(e)&&!u(e)?e:yn().withMutations((function(t){var n=i(e);Me(n.size),n.forEach((function(e){return t.add(e)}))}))}function ln(e){return!(!e||!e[fn])}rn.delete=rn.remove,rn.deleteIn=rn.removeIn=Fe.removeIn,rn.merge=Fe.merge,rn.mergeWith=Fe.mergeWith,rn.mergeIn=Fe.mergeIn,rn.mergeDeep=Fe.mergeDeep,rn.mergeDeepWith=Fe.mergeDeepWith,rn.mergeDeepIn=Fe.mergeDeepIn,rn.setIn=Fe.setIn,rn.update=Fe.update,rn.updateIn=Fe.updateIn,rn.withMutations=Fe.withMutations,rn.asMutable=Fe.asMutable,rn.asImmutable=Fe.asImmutable,t(cn,ge),cn.of=function(){return this(arguments)},cn.fromKeys=function(e){return this(r(e).keySeq())},cn.prototype.toString=function(){return this.__toString("Set {","}")},cn.prototype.has=function(e){return this._map.has(e)},cn.prototype.add=function(e){return hn(this,this._map.set(e,!0))},cn.prototype.remove=function(e){return hn(this,this._map.remove(e))},cn.prototype.clear=function(){return hn(this,this._map.clear())},cn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},cn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.every((function(e){return e.includes(n)}))||e.remove(n)}))}))},cn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.some((function(e){return e.includes(n)}))&&e.remove(n)}))}))},cn.prototype.merge=function(){return this.union.apply(this,arguments)},cn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},cn.prototype.sort=function(e){return mn(zt(this,e))},cn.prototype.sortBy=function(e,t){return mn(zt(this,t,e))},cn.prototype.wasAltered=function(){return this._map.wasAltered()},cn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate((function(t,r){return e(r,r,n)}),t)},cn.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},cn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},cn.isSet=ln;var un,fn="@@__IMMUTABLE_SET__@@",pn=cn.prototype;function hn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function dn(e,t){var n=Object.create(pn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function yn(){return un||(un=dn(Ge()))}function mn(e){return null==e?En():vn(e)?e:En().withMutations((function(t){var n=i(e);Me(n.size),n.forEach((function(e){return t.add(e)}))}))}function vn(e){return ln(e)&&u(e)}pn[fn]=!0,pn.delete=pn.remove,pn.mergeDeep=pn.merge,pn.mergeDeepWith=pn.mergeWith,pn.withMutations=Fe.withMutations,pn.asMutable=Fe.asMutable,pn.asImmutable=Fe.asImmutable,pn.__empty=yn,pn.__make=dn,t(mn,cn),mn.of=function(){return this(arguments)},mn.fromKeys=function(e){return this(r(e).keySeq())},mn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},mn.isOrderedSet=vn;var bn,gn=mn.prototype;function wn(e,t){var n=Object.create(gn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function En(){return bn||(bn=wn(xt()))}function Sn(e){return null==e?jn():On(e)?e:jn().unshiftAll(e)}function On(e){return!(!e||!e[kn])}gn[d]=!0,gn.__empty=En,gn.__make=wn,t(Sn,be),Sn.of=function(){return this(arguments)},Sn.prototype.toString=function(){return this.__toString("Stack [","]")},Sn.prototype.get=function(e,t){var n=this._head;for(e=k(this,e);n&&e--;)n=n.next;return n?n.value:t},Sn.prototype.peek=function(){return this._head&&this._head.value},Sn.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Pn(e,t)},Sn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Me(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Pn(t,n)},Sn.prototype.pop=function(){return this.slice(1)},Sn.prototype.unshift=function(){return this.push.apply(this,arguments)},Sn.prototype.unshiftAll=function(e){return this.pushAll(e)},Sn.prototype.shift=function(){return this.pop.apply(this,arguments)},Sn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):jn()},Sn.prototype.slice=function(e,t){if(P(e,t,this.size))return this;var n=j(e,this.size);if(T(t,this.size)!==this.size)return be.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Pn(r,o)},Sn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Pn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Sn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Sn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new M((function(){if(r){var t=r.value;return r=r.next,I(e,n++,t)}return{value:void 0,done:!0}}))},Sn.isStack=On;var _n,kn="@@__IMMUTABLE_STACK__@@",Cn=Sn.prototype;function Pn(e,t,n,r){var o=Object.create(Cn);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function jn(){return _n||(_n=Pn(0))}function Tn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}Cn[kn]=!0,Cn.withMutations=Fe.withMutations,Cn.asMutable=Fe.asMutable,Cn.asImmutable=Fe.asImmutable,Cn.wasAltered=Fe.wasAltered,n.Iterator=M,Tn(n,{toArray:function(){Me(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Nt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Dt(this,!0)},toMap:function(){return Ie(this.toKeyedSeq())},toObject:function(){Me(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return Pt(this.toKeyedSeq())},toOrderedSet:function(){return mn(s(this)?this.valueSeq():this)},toSet:function(){return cn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Mt(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Sn(s(this)?this.valueSeq():this)},toList:function(){return ut(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Jt(this,qt(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return fe(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){Me(this.size);var n=!0;return this.__iterate((function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1})),n},filter:function(e,t){return Jt(this,Ft(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},findEntry:function(e,t){var n;return this.__iterate((function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1})),n},findLastEntry:function(e,t){return this.toSeq().reverse().findEntry(e,t)},forEach:function(e,t){return Me(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Me(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Jt(this,Lt(this,e,t))},reduce:function(e,t,n){var r,o;return Me(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Jt(this,Bt(this,!0))},slice:function(e,t){return Jt(this,Ut(this,e,t,!0))},some:function(e,t){return!this.every(Mn(e),t)},sort:function(e){return Jt(this,zt(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return _(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ie().asMutable();return e.__iterate((function(o,i){r.update(t.call(n,o,i,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return pe(this,e)},entrySeq:function(){var e=this;if(e._cache)return new Q(e._cache);var t=e.toSeq().map(Nn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Mn(e),t)},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},first:function(){return this.find(C)},flatMap:function(e,t){return Jt(this,function(e,t,n){var r=Yt(e);return e.toSeq().map((function(o,i){return r(t.call(n,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Jt(this,Vt(this,e,!0))},fromEntrySeq:function(){return new It(this)},get:function(e,t){return this.find((function(t,n){return fe(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=tn(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,v):v)===v)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(u(e)?Pt():Ie()).asMutable();e.__iterate((function(i,a){o.update(t.call(n,i,a,e),(function(e){return(e=e||[]).push(r?[a,i]:i),e}))}));var i=Yt(e);return o.map((function(t){return Jt(e,i(t))}))}(this,e,t)},has:function(e){return this.get(e,v)!==v},hasIn:function(e){return this.getIn(e,v)!==v},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keySeq:function(){return this.toSeq().map(Dn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return Wt(this,e)},maxBy:function(e,t){return Wt(this,t,e)},min:function(e){return Wt(this,e?In(e):Bn)},minBy:function(e,t){return Wt(this,t?In(t):Bn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Jt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Jt(this,Kt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Mn(e),t)},sortBy:function(e,t){return Jt(this,zt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Jt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Jt(this,function(e,t,n){var r=Xt(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate((function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)})),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(2,o),s=!0;return new M((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,c=o[0],l=o[1];return t.call(n,l,c,i)?2===r?e:I(r,c,l,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Mn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=t?1:0;return function(e,t){return t=we(t,3432918353),t=we(t<<15|t>>>-15,461845907),t=we(t<<13|t>>>-13,5),t=we((t=(t+3864292196|0)^e)^t>>>16,2246822507),Ee((t=we(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Fn(Se(e),Se(t))|0}:function(e,t){r=r+Fn(Se(e),Se(t))|0}:t?function(e){r=31*r+Se(e)|0}:function(e){r=r+Se(e)|0}),r)}(this))}});var xn=n.prototype;xn[f]=!0,xn[N]=xn.values,xn.__toJS=xn.toArray,xn.__toStringMapper=An,xn.inspect=xn.toSource=function(){return this.toString()},xn.chain=xn.flatMap,xn.contains=xn.includes,function(){try{Object.defineProperty(xn,"length",{get:function(){if(!n.noLengthWarning){var e;try{throw new Error}catch(t){e=t.stack}if(-1===e.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+e),this.size}}})}catch(e){}}(),Tn(r,{flip:function(){return Jt(this,At(this))},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLastKey:function(e,t){return this.toSeq().reverse().findKey(e,t)},keyOf:function(e){return this.findKey((function(t){return fe(t,e)}))},lastKeyOf:function(e){return this.findLastKey((function(t){return fe(t,e)}))},mapEntries:function(e,t){var n=this,r=0;return Jt(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Jt(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var Rn=r.prototype;function Dn(e,t){return t}function Nn(e,t){return[t,e]}function Mn(e){return function(){return!e.apply(this,arguments)}}function In(e){return function(){return-e.apply(this,arguments)}}function An(e){return"string"==typeof e?JSON.stringify(e):e}function Ln(){return O(arguments)}function Bn(e,t){return e<t?1:e>t?-1:0}function Fn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Rn[p]=!0,Rn[N]=xn.entries,Rn.__toJS=xn.toObject,Rn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+An(e)},Tn(o,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(e,t){return Jt(this,Ft(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.toKeyedSeq().keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.toKeyedSeq().reverse().keyOf(e);return void 0===t?-1:t},reverse:function(){return Jt(this,Bt(this,!1))},slice:function(e,t){return Jt(this,Ut(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=j(e,e<0?this.count():this.size);var r=this.slice(0,e);return Jt(this,1===n?r:r.concat(O(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.toKeyedSeq().findLastKey(e,t);return void 0===n?-1:n},first:function(){return this.get(0)},flatten:function(e){return Jt(this,Vt(this,e,!1))},get:function(e,t){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Jt(this,function(e,t){var n=Xt(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate((function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)}),r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(1,r),a=0;return new M((function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?I(n,a++,t):I(n,a++,o.value,o)}))},n}(this,e))},interleave:function(){var e=[this].concat(O(arguments)),t=$t(this.toSeq(),z.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Jt(this,n)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Jt(this,Kt(this,e,t,!1))},zip:function(){return Jt(this,$t(this,Ln,[this].concat(O(arguments))))},zipWith:function(e){var t=O(arguments);return t[0]=this,Jt(this,$t(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,Tn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=xn.includes,Tn(V,r.prototype),Tn(z,o.prototype),Tn(W,i.prototype),Tn(ve,r.prototype),Tn(be,o.prototype),Tn(ge,i.prototype),{Iterable:n,Seq:q,Collection:me,Map:Ie,OrderedMap:Pt,List:ut,Stack:Sn,Set:cn,OrderedSet:mn,Record:nn,Range:ye,Repeat:he,is:fe,fromJS:se}}()},7002:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,s,c=o(e),l=1;l<arguments.length;l++){for(var u in a=Object(arguments[l]))n.call(a,u)&&(c[u]=a[u]);if(t){s=t(a);for(var f=0;f<s.length;f++)r.call(a,s[f])&&(c[s[f]]=a[s[f]])}}return c}},1045:(e,t,n)=>{"use strict";var r=n(1651),o=n(3682),i=n(3743),a=new RegExp("\r\n","g"),s={"text/rtf":1,"text/html":1};function c(e){if("file"==e.kind)return e.getAsFile()}var l=function(){function e(e){this.data=e,this.types=e.types?o(e.types):[]}var t=e.prototype;return t.isRichText=function(){return!(!this.getHTML()||!this.getText())||!this.isImage()&&this.types.some((function(e){return s[e]}))},t.getText=function(){var e;return this.data.getData&&(this.types.length?-1!=this.types.indexOf("text/plain")&&(e=this.data.getData("text/plain")):e=this.data.getData("Text")),e?e.replace(a,"\n"):null},t.getHTML=function(){if(this.data.getData){if(!this.types.length)return this.data.getData("Text");if(-1!=this.types.indexOf("text/html"))return this.data.getData("text/html")}},t.isLink=function(){return this.types.some((function(e){return-1!=e.indexOf("Url")||-1!=e.indexOf("text/uri-list")||e.indexOf("text/x-moz-url")}))},t.getLink=function(){return this.data.getData?-1!=this.types.indexOf("text/x-moz-url")?this.data.getData("text/x-moz-url").split("\n")[0]:-1!=this.types.indexOf("text/uri-list")?this.data.getData("text/uri-list"):this.data.getData("url"):null},t.isImage=function(){var e=this.types.some((function(e){return-1!=e.indexOf("application/x-moz-file")}));if(e)return!0;for(var t=this.getFiles(),n=0;n<t.length;n++){var o=t[n].type;if(!r.isImage(o))return!1}return!0},t.getCount=function(){return this.data.hasOwnProperty("items")?this.data.items.length:this.data.hasOwnProperty("mozItemCount")?this.data.mozItemCount:this.data.files?this.data.files.length:null},t.getFiles=function(){return this.data.items?Array.prototype.slice.call(this.data.items).map(c).filter(i.thatReturnsArgument):this.data.files?Array.prototype.slice.call(this.data.files):[]},t.hasFiles=function(){return this.getFiles().length>0},e}();e.exports=l},9119:e=>{"use strict";e.exports={BACKSPACE:8,TAB:9,RETURN:13,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,COMMA:188,PERIOD:190,A:65,Z:90,ZERO:48,NUMPAD_0:96,NUMPAD_9:105}},1651:e=>{"use strict";var t={isImage:function(e){return"image"===n(e)[0]},isJpeg:function(e){var r=n(e);return t.isImage(e)&&("jpeg"===r[1]||"pjpeg"===r[1])}};function n(e){return e.split("/")}e.exports=t},5754:e=>{"use strict";function t(e,t){return!!t&&(e===t.documentElement||e===t.body)}var n={getTop:function(e){var n=e.ownerDocument;return t(e,n)?n.body.scrollTop||n.documentElement.scrollTop:e.scrollTop},setTop:function(e,n){var r=e.ownerDocument;t(e,r)?r.body.scrollTop=r.documentElement.scrollTop=n:e.scrollTop=n},getLeft:function(e){var n=e.ownerDocument;return t(e,n)?n.body.scrollLeft||n.documentElement.scrollLeft:e.scrollLeft},setLeft:function(e,n){var r=e.ownerDocument;t(e,r)?r.body.scrollLeft=r.documentElement.scrollLeft=n:e.scrollLeft=n}};e.exports=n},4234:(e,t,n)=>{"use strict";function r(e,t){var n=o.get(e,t);return"auto"===n||"scroll"===n}var o={get:n(1838),getScrollParent:function(e){if(!e)return null;for(var t=e.ownerDocument;e&&e!==t.body;){if(r(e,"overflow")||r(e,"overflowY")||r(e,"overflowX"))return e;e=e.parentNode}return t.defaultView||t.parentWindow}};e.exports=o},6156:e=>{"use strict";e.exports={getPunctuation:function(){return"[.,+*?$|#{}()'\\^\\-\\[\\]\\\\\\/!@%\"~=<>_:;・、。〈-】〔-〟：-？！-／［-｀｛-･⸮؟٪-٬؛،؍﴾﴿᠁।၊။‐-‧‰-⁞¡-±´-¸º»¿]"}}},6831:e=>{"use strict";var t=function(){function e(e){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e._uri=n}(this,"_uri",void 0),this._uri=e}return e.prototype.toString=function(){return this._uri},e}();e.exports=t},3172:(e,t,n)=>{"use strict";var r=n(1644),o=n(7081),i="֐־׀׃׆׈-׏א-ת׫-ׯװ-ײ׳-״׵-׿߀-߉ߊ-ߪߴ-ߵߺ߻-߿ࠀ-ࠕࠚࠤࠨ࠮-࠯࠰-࠾࠿ࡀ-ࡘ࡜-࡝࡞࡟-࢟‏יִײַ-ﬨשׁ-זּ﬷טּ-לּ﬽מּ﬿נּ-סּ﭂ףּ-פּ﭅צּ-ﭏ",a="؈؋؍؛؜؝؞-؟ؠ-ؿـف-ي٭ٮ-ٯٱ-ۓ۔ەۥ-ۦۮ-ۯۺ-ۼ۽-۾ۿ܀-܍܎܏ܐܒ-ܯ݋-݌ݍ-ޥޱ޲-޿ࢠ-ࢲࢳ-ࣣﭐ-ﮱ﮲-﯁﯂-﯒ﯓ-ﴽ﵀-﵏ﵐ-ﶏ﶐-﶑ﶒ-ﷇ﷈-﷏ﷰ-ﷻ﷼﷾-﷿ﹰ-ﹴ﹵ﹶ-ﻼ﻽-﻾",s=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ƺƻƼ-ƿǀ-ǃǄ-ʓʔʕ-ʯʰ-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷͺͻ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ՚-՟ա-և։ःऄ-हऻऽा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥०-९॰ॱॲ-ঀং-ঃঅ-ঌএ-ঐও-নপ-রলশ-হঽা-ীে-ৈো-ৌৎৗড়-ঢ়য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽા-ીૉો-ૌૐૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽାୀେ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹா-ிு-ூெ-ைொ-ௌௐௗ௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽಾಿೀ-ೄೆೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖක-නඳ-රලව-ෆා-ෑෘ-ෟ෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆ໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔༕-༗༚-༟༠-༩༪-༳༴༶༸༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘࿙-࿚က-ဪါ-ာေးျ-ြဿ၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅះ-ៈ។-៖ៗ៘-៚ៜ០-៩᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℴℵ-ℸℹℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤⳫ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇〡-〩〮-〯〱-〵〸-〺〻〼ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫꙀ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎꞐ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ-豈-舘並-龎ﬀ-ﬆﬓ-ﬗＡ-Ｚａ-ｚｦ-ｯｰｱ-ﾝﾞ-ﾟﾠ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ"+i+a+"]"),c=new RegExp("["+i+a+"]");function l(e){var t=s.exec(e);return null==t?null:t[0]}function u(e){var t=l(e);return null==t?r.NEUTRAL:c.exec(t)?r.RTL:r.LTR}function f(e,t){if(t=t||r.NEUTRAL,!e.length)return t;var n=u(e);return n===r.NEUTRAL?t:n}function p(e,t){return t||(t=r.getGlobalDir()),r.isStrong(t)||o(!1),f(e,t)}var h={firstStrongChar:l,firstStrongCharDir:u,resolveBlockDir:f,getDirection:p,isDirectionLTR:function(e,t){return p(e,t)===r.LTR},isDirectionRTL:function(e,t){return p(e,t)===r.RTL}};e.exports=h},1644:(e,t,n)=>{"use strict";var r=n(7081),o="LTR",i=null;function a(e){return e===o||"RTL"===e}function s(e){return a(e)||r(!1),e===o?"ltr":"rtl"}function c(e){i=e}var l={NEUTRAL:"NEUTRAL",LTR:o,RTL:"RTL",isStrong:a,getHTMLDir:s,getHTMLDirIfDifferent:function(e,t){return a(e)||r(!1),a(t)||r(!1),e===t?null:s(e)},setGlobalDir:c,initGlobalDir:function(){c(o)},getGlobalDir:function(){return i||this.initGlobalDir(),i||r(!1),i}};e.exports=l},2573:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o=n(3172),i=n(1644),a=n(7081),s=function(){function e(e){r(this,"_defaultDir",void 0),r(this,"_lastDir",void 0),e?i.isStrong(e)||a(!1):e=i.getGlobalDir(),this._defaultDir=e,this.reset()}var t=e.prototype;return t.reset=function(){this._lastDir=this._defaultDir},t.getDirection=function(e){return this._lastDir=o.getDirection(e,this._lastDir),this._lastDir},e}();e.exports=s},7027:(e,t,n)=>{"use strict";var r=n(7081),o=/[\uD800-\uDFFF]/;function i(e){return 55296<=e&&e<=57343}function a(e){return o.test(e)}function s(e,t){return 1+i(e.charCodeAt(t))}function c(e,t,n){if(t=t||0,n=void 0===n?1/0:n||0,!a(e))return e.substr(t,n);var r=e.length;if(r<=0||t>r||n<=0)return"";var o=0;if(t>0){for(;t>0&&o<r;t--)o+=s(e,o);if(o>=r)return""}else if(t<0){for(o=r;t<0&&0<o;t++)o-=s(e,o-1);o<0&&(o=0)}var i=r;if(n<r)for(i=o;n>0&&i<r;n--)i+=s(e,i);return e.substring(o,i)}var l={getCodePoints:function(e){for(var t=[],n=0;n<e.length;n+=s(e,n))t.push(e.codePointAt(n));return t},getUTF16Length:s,hasSurrogateUnit:a,isCodeUnitInSurrogateRange:i,isSurrogatePair:function(e,t){if(0<=t&&t<e.length||r(!1),t+1===e.length)return!1;var n=e.charCodeAt(t),o=e.charCodeAt(t+1);return 55296<=n&&n<=56319&&56320<=o&&o<=57343},strlen:function(e){if(!a(e))return e.length;for(var t=0,n=0;n<e.length;n+=s(e,n))t++;return t},substring:function(e,t,n){(t=t||0)<0&&(t=0),(n=void 0===n?1/0:n||0)<0&&(n=0);var r=Math.abs(n-t);return c(e,t=t<n?t:n,r)},substr:c};e.exports=l},5306:(e,t,n)=>{"use strict";var r=n(9483),o=n(5348),i=n(5185),a=n(9951);function s(e,t,n,r){if(e===n)return!0;if(!n.startsWith(e))return!1;var i=n.slice(e.length);return!!t&&(i=r?r(i):i,o.contains(i,t))}function c(e){return"Windows"===r.platformName?e.replace(/^\s*NT/,""):e}var l={isBrowser:function(e){return s(r.browserName,r.browserFullVersion,e)},isBrowserArchitecture:function(e){return s(r.browserArchitecture,null,e)},isDevice:function(e){return s(r.deviceName,null,e)},isEngine:function(e){return s(r.engineName,r.engineVersion,e)},isPlatform:function(e){return s(r.platformName,r.platformFullVersion,e,c)},isPlatformArchitecture:function(e){return s(r.platformArchitecture,null,e)}};e.exports=i(l,a)},9483:(e,t,n)=>{"use strict";var r,o="Unknown",i=(new(n(2989))).getResult(),a=function(e){if(!e)return{major:"",minor:""};var t=e.split(".");return{major:t[0],minor:t[1]}}(i.browser.version),s={browserArchitecture:i.cpu.architecture||o,browserFullVersion:i.browser.version||o,browserMinorVersion:a.minor||o,browserName:i.browser.name||o,browserVersion:i.browser.major||o,deviceName:i.device.model||o,engineName:i.engine.name||o,engineVersion:i.engine.version||o,platformArchitecture:i.cpu.architecture||o,platformName:(r=i.os.name,{"Mac OS":"Mac OS X"}[r]||r||o),platformVersion:i.os.version||o,platformFullVersion:i.os.version||o};e.exports=s},5348:(e,t,n)=>{"use strict";var r=n(7081),o=/\./,i=/\|\|/,a=/\s+\-\s+/,s=/^(<=|<|=|>=|~>|~|>|)?\s*(.+)/,c=/^(\d*)(.*)/;function l(e,t){if(""===(e=e.trim()))return!0;var n,r=t.split(o),i=p(e),a=i.modifier,s=i.rangeComponents;switch(a){case"<":return u(r,s);case"<=":return-1===(n=b(r,s))||0===n;case">=":return f(r,s);case">":return 1===b(r,s);case"~":case"~>":return function(e,t){var n=t.slice(),r=t.slice();r.length>1&&r.pop();var o=r.length-1,i=parseInt(r[o],10);return h(i)&&(r[o]=i+1+""),f(e,n)&&u(e,r)}(r,s);default:return function(e,t){return 0===b(e,t)}(r,s)}}function u(e,t){return-1===b(e,t)}function f(e,t){var n=b(e,t);return 1===n||0===n}function p(e){var t=e.split(o),n=t[0].match(s);return n||r(!1),{modifier:n[1],rangeComponents:[n[2]].concat(t.slice(1))}}function h(e){return!isNaN(e)&&isFinite(e)}function d(e){return!p(e).modifier}function y(e,t){for(var n=e.length;n<t;n++)e[n]="0"}function m(e,t){var n=e.match(c)[1],r=t.match(c)[1],o=parseInt(n,10),i=parseInt(r,10);return h(o)&&h(i)&&o!==i?v(o,i):v(e,t)}function v(e,t){return typeof e!=typeof t&&r(!1),e>t?1:e<t?-1:0}function b(e,t){for(var n=function(e,t){y(e=e.slice(),(t=t.slice()).length);for(var n=0;n<t.length;n++){var r=t[n].match(/^[x*]$/i);if(r&&(t[n]=e[n]="0","*"===r[0]&&n===t.length-1))for(var o=n;o<e.length;o++)e[o]="0"}return y(t,e.length),[e,t]}(e,t),r=n[0],o=n[1],i=0;i<o.length;i++){var a=m(r[i],o[i]);if(a)return a}return 0}var g={contains:function(e,t){return function(e,t){var n=e.split(i);return n.length>1?n.some((function(e){return g.contains(e,t)})):function(e,t){var n=e.split(a);if(n.length>0&&n.length<=2||r(!1),1===n.length)return l(n[0],t);var o=n[0],i=n[1];return d(o)&&d(i)||r(!1),l(">="+o,t)&&l("<="+i,t)}(e=n[0].trim(),t)}(e.trim(),t.trim())}};e.exports=g},1515:e=>{"use strict";var t=/-(.)/g;e.exports=function(e){return e.replace(t,(function(e,t){return t.toUpperCase()}))}},1089:(e,t,n)=>{"use strict";var r=n(4707);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},3682:(e,t,n)=>{"use strict";var r=n(7081);e.exports=function(e){return function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}(e)?Array.isArray(e)?e.slice():function(e){var t=e.length;if((Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e)&&r(!1),"number"!=typeof t&&r(!1),0===t||t-1 in e||r(!1),"function"==typeof e.callee&&r(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),o=0;o<t;o++)n[o]=e[o];return n}(e):[e]}},5935:e=>{"use strict";function t(e){return e.replace(/\//g,"-")}e.exports=function(e){return"object"==typeof e?Object.keys(e).filter((function(t){return e[t]})).map(t).join(" "):Array.prototype.map.call(arguments,t).join(" ")}},3743:e=>{"use strict";function t(e){return function(){return e}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},2402:e=>{"use strict";e.exports=function(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}},9914:e=>{"use strict";var t="undefined"!=typeof navigator&&navigator.userAgent.indexOf("AppleWebKit")>-1;e.exports=function(e){return(e=e||document).scrollingElement?e.scrollingElement:t||"CSS1Compat"!==e.compatMode?e.body:e.documentElement}},6076:(e,t,n)=>{"use strict";var r=n(2430);e.exports=function(e){var t=r(e);return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}},2430:(e,t,n)=>{"use strict";var r=n(1089);e.exports=function(e){var t=e.ownerDocument.documentElement;if(!("getBoundingClientRect"in e)||!r(t,e))return{left:0,right:0,top:0,bottom:0};var n=e.getBoundingClientRect();return{left:Math.round(n.left)-t.clientLeft,right:Math.round(n.right)-t.clientLeft,top:Math.round(n.top)-t.clientTop,bottom:Math.round(n.bottom)-t.clientTop}}},3020:(e,t,n)=>{"use strict";var r=n(9914),o=n(3338);e.exports=function(e){var t=r(e.ownerDocument||e.document);e.Window&&e instanceof e.Window&&(e=t);var n=o(e),i=e===t?e.ownerDocument.documentElement:e,a=e.scrollWidth-i.clientWidth,s=e.scrollHeight-i.clientHeight;return n.x=Math.max(0,Math.min(n.x,a)),n.y=Math.max(0,Math.min(n.y,s)),n}},1838:(e,t,n)=>{"use strict";var r=n(1515),o=n(8722);function i(e){return null==e?e:String(e)}e.exports=function(e,t){var n;if(window.getComputedStyle&&(n=window.getComputedStyle(e,null)))return i(n.getPropertyValue(o(t)));if(document.defaultView&&document.defaultView.getComputedStyle){if(n=document.defaultView.getComputedStyle(e,null))return i(n.getPropertyValue(o(t)));if("display"===t)return"none"}return e.currentStyle?i("float"===t?e.currentStyle.cssFloat||e.currentStyle.styleFloat:e.currentStyle[r(t)]):i(e.style&&e.style[r(t)])}},3338:e=>{"use strict";e.exports=function(e){return e.Window&&e instanceof e.Window?{x:e.pageXOffset||e.document.documentElement.scrollLeft,y:e.pageYOffset||e.document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}},448:e=>{"use strict";function t(){var e;return document.documentElement&&(e=document.documentElement.clientWidth),!e&&document.body&&(e=document.body.clientWidth),e||0}function n(){var e;return document.documentElement&&(e=document.documentElement.clientHeight),!e&&document.body&&(e=document.body.clientHeight),e||0}function r(){return{width:window.innerWidth||t(),height:window.innerHeight||n()}}r.withoutScrollbars=function(){return{width:t(),height:n()}},e.exports=r},8722:e=>{"use strict";var t=/([A-Z])/g;e.exports=function(e){return e.replace(t,"-$1").toLowerCase()}},7081:e=>{"use strict";e.exports=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,(function(){return String(r[a++])})))).name="Invariant Violation"}throw i.framesToPop=1,i}}},6447:e=>{"use strict";e.exports=function(e){var t=(e?e.ownerDocument||e:document).defaultView||window;return!(!e||!("function"==typeof t.Node?e instanceof t.Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}},4707:(e,t,n)=>{"use strict";var r=n(6447);e.exports=function(e){return r(e)&&3==e.nodeType}},7022:e=>{"use strict";e.exports=function(e){var t=e||"",n=arguments.length;if(n>1)for(var r=1;r<n;r++){var o=arguments[r];o&&(t=(t?t+" ":"")+o)}return t}},5185:e=>{"use strict";var t=Object.prototype.hasOwnProperty;e.exports=function(e,n,r){if(!e)return null;var o={};for(var i in e)t.call(e,i)&&(o[i]=n.call(r,e[i],i,e));return o}},9951:e=>{"use strict";e.exports=function(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}},3946:e=>{"use strict";e.exports=function(e){if(null!=e)return e;throw new Error("Got unexpected null or undefined")}},1574:(e,t,n)=>{"use strict";n(8132),e.exports=n.g.setImmediate},2264:(e,t,n)=>{"use strict";var r=n(3743);e.exports=r},7728:e=>{"use strict";e.exports=function(e,t){for(var n={},r=Object.keys(e),o=Array.isArray(t),i=0;i<r.length;i++){var a=r[i],s=e[a];(o?-1!==t.indexOf(a):t(a,s,e))&&(n[a]=s)}return n}},5839:e=>{"use strict";var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,o=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,a=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,c=s&&s(Object);e.exports=function e(l,u,f){if("string"!=typeof u){if(c){var p=s(u);p&&p!==c&&e(l,p,f)}var h=o(u);i&&(h=h.concat(i(u)));for(var d=0;d<h.length;++d){var y=h[d];if(!(t[y]||n[y]||f&&f[y])){var m=a(u,y);try{r(l,y,m)}catch(e){}}}return l}return l}},46:function(e){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:q(e)}function r(e){return s(e)?e:V(e)}function o(e){return c(e)?e:z(e)}function i(e){return a(e)&&!l(e)?e:W(e)}function a(e){return!(!e||!e[f])}function s(e){return!(!e||!e[p])}function c(e){return!(!e||!e[h])}function l(e){return s(e)||c(e)}function u(e){return!(!e||!e[d])}t(r,n),t(o,n),t(i,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=c,n.isAssociative=l,n.isOrdered=u,n.Keyed=r,n.Indexed=o,n.Set=i;var f="@@__IMMUTABLE_ITERABLE__@@",p="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",y=32,m=31,v={},b={value:!1},g={value:!1};function w(e){return e.value=!1,e}function E(e){e&&(e.value=!0)}function S(){}function O(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function _(e){return void 0===e.size&&(e.size=e.__iterate(C)),e.size}function k(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?_(e)+t:t}function C(){return!0}function P(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function j(e,t){return x(e,t,0)}function T(e,t){return x(e,t,t)}function x(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var R="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",N=R||D;function M(e){this.next=e}function I(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function A(){return{value:void 0,done:!0}}function L(e){return!!U(e)}function B(e){return e&&"function"==typeof e.next}function F(e){var t=U(e);return t&&t.call(e)}function U(e){var t=e&&(R&&e[R]||e["@@iterator"]);if("function"==typeof t)return t}function K(e){return e&&"number"==typeof e.length}function q(e){return null==e?te():a(e)?e.toSeq():function(e){var t=oe(e)||"object"==typeof e&&new Y(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function V(e){return null==e?te().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():ne(e)}function z(e){return null==e?te():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():re(e)}function W(e){return(null==e?te():a(e)?s(e)?e.entrySeq():e:re(e)).toSetSeq()}M.prototype.toString=function(){return"[Iterator]"},M.KEYS=0,M.VALUES=1,M.ENTRIES=2,M.prototype.inspect=M.prototype.toSource=function(){return this.toString()},M.prototype[N]=function(){return this},t(q,n),q.of=function(){return q(arguments)},q.prototype.toSeq=function(){return this},q.prototype.toString=function(){return this.__toString("Seq {","}")},q.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},q.prototype.__iterate=function(e,t){return ie(this,e,t,!0)},q.prototype.__iterator=function(e,t){return ae(this,e,t,!0)},t(V,q),V.prototype.toKeyedSeq=function(){return this},t(z,q),z.of=function(){return z(arguments)},z.prototype.toIndexedSeq=function(){return this},z.prototype.toString=function(){return this.__toString("Seq [","]")},z.prototype.__iterate=function(e,t){return ie(this,e,t,!1)},z.prototype.__iterator=function(e,t){return ae(this,e,t,!1)},t(W,q),W.of=function(){return W(arguments)},W.prototype.toSetSeq=function(){return this},q.isSeq=ee,q.Keyed=V,q.Set=W,q.Indexed=z;var H,$,J,G="@@__IMMUTABLE_SEQ__@@";function Q(e){this._array=e,this.size=e.length}function Y(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function X(e){this._iterable=e,this.size=e.length||e.size}function Z(e){this._iterator=e,this._iteratorCache=[]}function ee(e){return!(!e||!e[G])}function te(){return H||(H=new Q([]))}function ne(e){var t=Array.isArray(e)?new Q(e).fromEntrySeq():B(e)?new Z(e).fromEntrySeq():L(e)?new X(e).fromEntrySeq():"object"==typeof e?new Y(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function re(e){var t=oe(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function oe(e){return K(e)?new Q(e):B(e)?new Z(e):L(e)?new X(e):void 0}function ie(e,t,n,r){var o=e._cache;if(o){for(var i=o.length-1,a=0;a<=i;a++){var s=o[n?i-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function ae(e,t,n,r){var o=e._cache;if(o){var i=o.length-1,a=0;return new M((function(){var e=o[n?i-a:a];return a++>i?{value:void 0,done:!0}:I(t,r?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,n)}function se(e,t){return t?ce(t,e,"",{"":e}):le(e)}function ce(e,t,n,r){return Array.isArray(t)?e.call(r,n,z(t).map((function(n,r){return ce(e,n,r,t)}))):ue(t)?e.call(r,n,V(t).map((function(n,r){return ce(e,n,r,t)}))):t}function le(e){return Array.isArray(e)?z(e).map(le).toList():ue(e)?V(e).map(le).toMap():e}function ue(e){return e&&(e.constructor===Object||void 0===e.constructor)}function fe(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function pe(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||c(e)!==c(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!l(e);if(u(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&fe(o[1],e)&&(n||fe(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var f=!0,p=t.__iterate((function(t,r){if(n?!e.has(t):o?!fe(t,e.get(r,v)):!fe(e.get(r,v),t))return f=!1,!1}));return f&&e.size===p}function he(e,t){if(!(this instanceof he))return new he(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if($)return $;$=this}}function de(e,t){if(!e)throw new Error(t)}function ye(e,t,n){if(!(this instanceof ye))return new ye(e,t,n);if(de(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(J)return J;J=this}}function me(){throw TypeError("Abstract")}function ve(){}function be(){}function ge(){}q.prototype[G]=!0,t(Q,z),Q.prototype.get=function(e,t){return this.has(e)?this._array[k(this,e)]:t},Q.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},Q.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new M((function(){return o>r?{value:void 0,done:!0}:I(e,o,n[t?r-o++:o++])}))},t(Y,V),Y.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},Y.prototype.has=function(e){return this._object.hasOwnProperty(e)},Y.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,i=0;i<=o;i++){var a=r[t?o-i:i];if(!1===e(n[a],a,this))return i+1}return i},Y.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,i=0;return new M((function(){var a=r[t?o-i:i];return i++>o?{value:void 0,done:!0}:I(e,a,n[a])}))},Y.prototype[d]=!0,t(X,z),X.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=F(this._iterable),r=0;if(B(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},X.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=F(this._iterable);if(!B(n))return new M(A);var r=0;return new M((function(){var t=n.next();return t.done?t:I(e,r++,t.value)}))},t(Z,z),Z.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,i=0;i<o.length;)if(!1===e(o[i],i++,this))return i;for(;!(n=r.next()).done;){var a=n.value;if(o[i]=a,!1===e(a,i++,this))break}return i},Z.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new M((function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return I(e,o,r[o++])}))},t(he,z),he.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},he.prototype.get=function(e,t){return this.has(e)?this._value:t},he.prototype.includes=function(e){return fe(this._value,e)},he.prototype.slice=function(e,t){var n=this.size;return P(e,t,n)?this:new he(this._value,T(t,n)-j(e,n))},he.prototype.reverse=function(){return this},he.prototype.indexOf=function(e){return fe(this._value,e)?0:-1},he.prototype.lastIndexOf=function(e){return fe(this._value,e)?this.size:-1},he.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},he.prototype.__iterator=function(e,t){var n=this,r=0;return new M((function(){return r<n.size?I(e,r++,n._value):{value:void 0,done:!0}}))},he.prototype.equals=function(e){return e instanceof he?fe(this._value,e._value):pe(e)},t(ye,z),ye.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},ye.prototype.get=function(e,t){return this.has(e)?this._start+k(this,e)*this._step:t},ye.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ye.prototype.slice=function(e,t){return P(e,t,this.size)?this:(e=j(e,this.size),(t=T(t,this.size))<=e?new ye(0,0):new ye(this.get(e,this._end),this.get(t,this._end),this._step))},ye.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},ye.prototype.lastIndexOf=function(e){return this.indexOf(e)},ye.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;i<=n;i++){if(!1===e(o,i,this))return i+1;o+=t?-r:r}return i},ye.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,i=0;return new M((function(){var a=o;return o+=t?-r:r,i>n?{value:void 0,done:!0}:I(e,i++,a)}))},ye.prototype.equals=function(e){return e instanceof ye?this._start===e._start&&this._end===e._end&&this._step===e._step:pe(this,e)},t(me,n),t(ve,me),t(be,me),t(ge,me),me.Keyed=ve,me.Indexed=be,me.Set=ge;var we="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Ee(e){return e>>>1&1073741824|3221225471&e}function Se(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Ee(n)}if("string"===t)return e.length>xe?function(e){var t=Ne[e];return void 0===t&&(t=Oe(e),De===Re&&(De=0,Ne={}),De++,Ne[e]=t),t}(e):Oe(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(Pe&&void 0!==(t=Ce.get(e)))return t;if(void 0!==(t=e[Te]))return t;if(!ke){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Te]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++je,1073741824&je&&(je=0),Pe)Ce.set(e,t);else{if(void 0!==_e&&!1===_e(e))throw new Error("Non-extensible objects are not allowed as keys.");if(ke)Object.defineProperty(e,Te,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Te]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Te]=t}}return t}(e);if("function"==typeof e.toString)return Oe(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Oe(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Ee(t)}var _e=Object.isExtensible,ke=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();var Ce,Pe="function"==typeof WeakMap;Pe&&(Ce=new WeakMap);var je=0,Te="__immutablehash__";"function"==typeof Symbol&&(Te=Symbol(Te));var xe=16,Re=255,De=0,Ne={};function Me(e){de(e!==1/0,"Cannot perform this action with an infinite size.")}function Ie(e){return null==e?Ge():Ae(e)&&!u(e)?e:Ge().withMutations((function(t){var n=r(e);Me(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function Ae(e){return!(!e||!e[Be])}t(Ie,ve),Ie.of=function(){var t=e.call(arguments,0);return Ge().withMutations((function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},Ie.prototype.toString=function(){return this.__toString("Map {","}")},Ie.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},Ie.prototype.set=function(e,t){return Qe(this,e,t)},Ie.prototype.setIn=function(e,t){return this.updateIn(e,v,(function(){return t}))},Ie.prototype.remove=function(e){return Qe(this,e,v)},Ie.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return v}))},Ie.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},Ie.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=ot(this,tn(e),t,n);return r===v?void 0:r},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Ge()},Ie.prototype.merge=function(){return et(this,void 0,arguments)},Ie.prototype.mergeWith=function(t){return et(this,t,e.call(arguments,1))},Ie.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Ge(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},Ie.prototype.mergeDeep=function(){return et(this,tt,arguments)},Ie.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return et(this,nt(t),n)},Ie.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,Ge(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},Ie.prototype.sort=function(e){return Pt(zt(this,e))},Ie.prototype.sortBy=function(e,t){return Pt(zt(this,t,e))},Ie.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},Ie.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new S)},Ie.prototype.asImmutable=function(){return this.__ensureOwner()},Ie.prototype.wasAltered=function(){return this.__altered},Ie.prototype.__iterator=function(e,t){return new We(this,e,t)},Ie.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},Ie.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Je(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Ie.isMap=Ae;var Le,Be="@@__IMMUTABLE_MAP__@@",Fe=Ie.prototype;function Ue(e,t){this.ownerID=e,this.entries=t}function Ke(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function qe(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ze(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function We(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&$e(e._root)}function He(e,t){return I(e,t[0],t[1])}function $e(e,t){return{node:e,index:0,__prev:t}}function Je(e,t,n,r){var o=Object.create(Fe);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function Ge(){return Le||(Le=Je(0))}function Qe(e,t,n){var r,o;if(e._root){var i=w(b),a=w(g);if(r=Ye(e._root,e.__ownerID,0,void 0,t,n,i,a),!a.value)return e;o=e.size+(i.value?n===v?-1:1:0)}else{if(n===v)return e;o=1,r=new Ue(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?Je(o,r):Ge()}function Ye(e,t,n,r,o,i,a,s){return e?e.update(t,n,r,o,i,a,s):i===v?e:(E(s),E(a),new ze(t,r,[o,i]))}function Xe(e){return e.constructor===ze||e.constructor===Ve}function Ze(e,t,n,r,o){if(e.keyHash===r)return new Ve(t,r,[e.entry,o]);var i,a=(0===n?e.keyHash:e.keyHash>>>n)&m,s=(0===n?r:r>>>n)&m;return new Ke(t,1<<a|1<<s,a===s?[Ze(e,t,n+5,r,o)]:(i=new ze(t,r,o),a<s?[e,i]:[i,e]))}function et(e,t,n){for(var o=[],i=0;i<n.length;i++){var s=n[i],c=r(s);a(s)||(c=c.map((function(e){return se(e)}))),o.push(c)}return rt(e,t,o)}function tt(e,t,n){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):fe(e,t)?e:t}function nt(e){return function(t,n,r){if(t&&t.mergeDeepWith&&a(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return fe(t,o)?t:o}}function rt(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var r=t?function(n,r){e.update(r,v,(function(e){return e===v?n:t(e,n,r)}))}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)})):e.constructor(n[0])}function ot(e,t,n,r){var o=e===v,i=t.next();if(i.done){var a=o?n:e,s=r(a);return s===a?e:s}de(o||e&&e.set,"invalid keyPath");var c=i.value,l=o?v:e.get(c,v),u=ot(l,t,n,r);return u===l?e:u===v?e.remove(c):(o?Ge():e).set(c,u)}function it(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,127&(e+=e>>8)+(e>>16)}function at(e,t,n,r){var o=r?e:O(e);return o[t]=n,o}Fe[Be]=!0,Fe.delete=Fe.remove,Fe.removeIn=Fe.deleteIn,Ue.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(fe(n,o[i][0]))return o[i][1];return r},Ue.prototype.update=function(e,t,n,r,o,i,a){for(var s=o===v,c=this.entries,l=0,u=c.length;l<u&&!fe(r,c[l][0]);l++);var f=l<u;if(f?c[l][1]===o:s)return this;if(E(a),(s||!f)&&E(i),!s||1!==c.length){if(!f&&!s&&c.length>=st)return function(e,t,n,r){e||(e=new S);for(var o=new ze(e,Se(n),[n,r]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}(e,c,r,o);var p=e&&e===this.ownerID,h=p?c:O(c);return f?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new Ue(e,h)}},Ke.prototype.get=function(e,t,n,r){void 0===t&&(t=Se(n));var o=1<<((0===e?t:t>>>e)&m),i=this.bitmap;return 0==(i&o)?r:this.nodes[it(i&o-1)].get(e+5,t,n,r)},Ke.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var s=(0===t?n:n>>>t)&m,c=1<<s,l=this.bitmap,u=0!=(l&c);if(!u&&o===v)return this;var f=it(l&c-1),p=this.nodes,h=u?p[f]:void 0,d=Ye(h,e,t+5,n,r,o,i,a);if(d===h)return this;if(!u&&d&&p.length>=ct)return function(e,t,n,r,o){for(var i=0,a=new Array(y),s=0;0!==n;s++,n>>>=1)a[s]=1&n?t[i++]:void 0;return a[r]=o,new qe(e,i+1,a)}(e,p,l,s,d);if(u&&!d&&2===p.length&&Xe(p[1^f]))return p[1^f];if(u&&d&&1===p.length&&Xe(d))return d;var b=e&&e===this.ownerID,g=u?d?l:l^c:l|c,w=u?d?at(p,f,d,b):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),i=0,a=0;a<r;a++)a===t&&(i=1),o[a]=e[a+i];return o}(p,f,b):function(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=n,a=-1):i[s]=e[s+a];return i}(p,f,d,b);return b?(this.bitmap=g,this.nodes=w,this):new Ke(e,g,w)},qe.prototype.get=function(e,t,n,r){void 0===t&&(t=Se(n));var o=(0===e?t:t>>>e)&m,i=this.nodes[o];return i?i.get(e+5,t,n,r):r},qe.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var s=(0===t?n:n>>>t)&m,c=o===v,l=this.nodes,u=l[s];if(c&&!u)return this;var f=Ye(u,e,t+5,n,r,o,i,a);if(f===u)return this;var p=this.count;if(u){if(!f&&--p<lt)return function(e,t,n,r){for(var o=0,i=0,a=new Array(n),s=0,c=1,l=t.length;s<l;s++,c<<=1){var u=t[s];void 0!==u&&s!==r&&(o|=c,a[i++]=u)}return new Ke(e,o,a)}(e,l,p,s)}else p++;var h=e&&e===this.ownerID,d=at(l,s,f,h);return h?(this.count=p,this.nodes=d,this):new qe(e,p,d)},Ve.prototype.get=function(e,t,n,r){for(var o=this.entries,i=0,a=o.length;i<a;i++)if(fe(n,o[i][0]))return o[i][1];return r},Ve.prototype.update=function(e,t,n,r,o,i,a){void 0===n&&(n=Se(r));var s=o===v;if(n!==this.keyHash)return s?this:(E(a),E(i),Ze(this,e,t,n,[r,o]));for(var c=this.entries,l=0,u=c.length;l<u&&!fe(r,c[l][0]);l++);var f=l<u;if(f?c[l][1]===o:s)return this;if(E(a),(s||!f)&&E(i),s&&2===u)return new ze(e,this.keyHash,c[1^l]);var p=e&&e===this.ownerID,h=p?c:O(c);return f?s?l===u-1?h.pop():h[l]=h.pop():h[l]=[r,o]:h.push([r,o]),p?(this.entries=h,this):new Ve(e,this.keyHash,h)},ze.prototype.get=function(e,t,n,r){return fe(n,this.entry[0])?this.entry[1]:r},ze.prototype.update=function(e,t,n,r,o,i,a){var s=o===v,c=fe(r,this.entry[0]);return(c?o===this.entry[1]:s)?this:(E(a),s?void E(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new ze(e,this.keyHash,[r,o]):(E(i),Ze(this,e,t,Se(r),[r,o])))},Ue.prototype.iterate=Ve.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},Ke.prototype.iterate=qe.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var i=n[t?o-r:r];if(i&&!1===i.iterate(e,t))return!1}},ze.prototype.iterate=function(e,t){return e(this.entry)},t(We,M),We.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return He(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return He(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var i=r.nodes[this._reverse?n-o:o];if(i){if(i.entry)return He(e,i.entry);t=this._stack=$e(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var st=8,ct=16,lt=8;function ut(e){var t=wt();if(null==e)return t;if(ft(e))return e;var n=o(e),r=n.size;return 0===r?t:(Me(r),r>0&&r<y?gt(0,r,5,null,new dt(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function ft(e){return!(!e||!e[pt])}t(ut,be),ut.of=function(){return this(arguments)},ut.prototype.toString=function(){return this.__toString("List [","]")},ut.prototype.get=function(e,t){if((e=k(this,e))>=0&&e<this.size){var n=Ot(this,e+=this._origin);return n&&n.array[e&m]}return t},ut.prototype.set=function(e,t){return function(e,t,n){if((t=k(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?_t(e,t).set(0,n):_t(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,i=w(g);return t>=Ct(e._capacity)?r=Et(r,e.__ownerID,0,t,n,i):o=Et(o,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e):gt(e._origin,e._capacity,e._level,o,r):e}(this,e,t)},ut.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},ut.prototype.insert=function(e,t){return this.splice(e,0,t)},ut.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):wt()},ut.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){_t(n,0,t+e.length);for(var r=0;r<e.length;r++)n.set(t+r,e[r])}))},ut.prototype.pop=function(){return _t(this,0,-1)},ut.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){_t(t,-e.length);for(var n=0;n<e.length;n++)t.set(n,e[n])}))},ut.prototype.shift=function(){return _t(this,1)},ut.prototype.merge=function(){return kt(this,void 0,arguments)},ut.prototype.mergeWith=function(t){return kt(this,t,e.call(arguments,1))},ut.prototype.mergeDeep=function(){return kt(this,tt,arguments)},ut.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return kt(this,nt(t),n)},ut.prototype.setSize=function(e){return _t(this,0,e)},ut.prototype.slice=function(e,t){var n=this.size;return P(e,t,n)?this:_t(this,j(e,n),T(t,n))},ut.prototype.__iterator=function(e,t){var n=0,r=bt(this,t);return new M((function(){var t=r();return t===vt?{value:void 0,done:!0}:I(e,n++,t)}))},ut.prototype.__iterate=function(e,t){for(var n,r=0,o=bt(this,t);(n=o())!==vt&&!1!==e(n,r++,this););return r},ut.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?gt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},ut.isList=ft;var pt="@@__IMMUTABLE_LIST__@@",ht=ut.prototype;function dt(e,t){this.array=e,this.ownerID=t}ht[pt]=!0,ht.delete=ht.remove,ht.setIn=Fe.setIn,ht.deleteIn=ht.removeIn=Fe.removeIn,ht.update=Fe.update,ht.updateIn=Fe.updateIn,ht.mergeIn=Fe.mergeIn,ht.mergeDeepIn=Fe.mergeDeepIn,ht.withMutations=Fe.withMutations,ht.asMutable=Fe.asMutable,ht.asImmutable=Fe.asImmutable,ht.wasAltered=Fe.wasAltered,dt.prototype.removeBefore=function(e,t,n){if(n===t?1<<t:0===this.array.length)return this;var r=n>>>t&m;if(r>=this.array.length)return new dt([],e);var o,i=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-5,n))===a&&i)return this}if(i&&!o)return this;var s=St(this,e);if(!i)for(var c=0;c<r;c++)s.array[c]=void 0;return o&&(s.array[r]=o),s},dt.prototype.removeAfter=function(e,t,n){if(n===(t?1<<t:0)||0===this.array.length)return this;var r,o=n-1>>>t&m;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((r=i&&i.removeAfter(e,t-5,n))===i&&o===this.array.length-1)return this}var a=St(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var yt,mt,vt={};function bt(e,t){var n=e._origin,r=e._capacity,o=Ct(r),i=e._tail;return a(e._root,e._level,0);function a(e,s,c){return 0===s?function(e,a){var s=a===o?i&&i.array:e&&e.array,c=a>n?0:n-a,l=r-a;return l>y&&(l=y),function(){if(c===l)return vt;var e=t?--l:c++;return s&&s[e]}}(e,c):function(e,o,i){var s,c=e&&e.array,l=i>n?0:n-i>>o,u=1+(r-i>>o);return u>y&&(u=y),function(){for(;;){if(s){var e=s();if(e!==vt)return e;s=null}if(l===u)return vt;var n=t?--u:l++;s=a(c&&c[n],o-5,i+(n<<o))}}}(e,s,c)}}function gt(e,t,n,r,o,i,a){var s=Object.create(ht);return s.size=t-e,s._origin=e,s._capacity=t,s._level=n,s._root=r,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function wt(){return yt||(yt=gt(0,0,5))}function Et(e,t,n,r,o,i){var a,s=r>>>n&m,c=e&&s<e.array.length;if(!c&&void 0===o)return e;if(n>0){var l=e&&e.array[s],u=Et(l,t,n-5,r,o,i);return u===l?e:((a=St(e,t)).array[s]=u,a)}return c&&e.array[s]===o?e:(E(i),a=St(e,t),void 0===o&&s===a.array.length-1?a.array.pop():a.array[s]=o,a)}function St(e,t){return t&&e&&t===e.ownerID?e:new dt(e?e.array.slice():[],t)}function Ot(e,t){if(t>=Ct(e._capacity))return e._tail;if(t<1<<e._level+5){for(var n=e._root,r=e._level;n&&r>0;)n=n.array[t>>>r&m],r-=5;return n}}function _t(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new S,o=e._origin,i=e._capacity,a=o+t,s=void 0===n?i:n<0?i+n:o+n;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var c=e._level,l=e._root,u=0;a+u<0;)l=new dt(l&&l.array.length?[void 0,l]:[],r),u+=1<<(c+=5);u&&(a+=u,o+=u,s+=u,i+=u);for(var f=Ct(i),p=Ct(s);p>=1<<c+5;)l=new dt(l&&l.array.length?[l]:[],r),c+=5;var h=e._tail,d=p<f?Ot(e,s-1):p>f?new dt([],r):h;if(h&&p>f&&a<i&&h.array.length){for(var y=l=St(l,r),v=c;v>5;v-=5){var b=f>>>v&m;y=y.array[b]=St(y.array[b],r)}y.array[f>>>5&m]=h}if(s<i&&(d=d&&d.removeAfter(r,0,s)),a>=p)a-=p,s-=p,c=5,l=null,d=d&&d.removeBefore(r,0,a);else if(a>o||p<f){for(u=0;l;){var g=a>>>c&m;if(g!==p>>>c&m)break;g&&(u+=(1<<c)*g),c-=5,l=l.array[g]}l&&a>o&&(l=l.removeBefore(r,c,a-u)),l&&p<f&&(l=l.removeAfter(r,c,p-u)),u&&(a-=u,s-=u)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=l,e._tail=d,e.__hash=void 0,e.__altered=!0,e):gt(a,s,c,l,d)}function kt(e,t,n){for(var r=[],i=0,s=0;s<n.length;s++){var c=n[s],l=o(c);l.size>i&&(i=l.size),a(c)||(l=l.map((function(e){return se(e)}))),r.push(l)}return i>e.size&&(e=e.setSize(i)),rt(e,t,r)}function Ct(e){return e<y?0:e-1>>>5<<5}function Pt(e){return null==e?xt():jt(e)?e:xt().withMutations((function(t){var n=r(e);Me(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function jt(e){return Ae(e)&&u(e)}function Tt(e,t,n,r){var o=Object.create(Pt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function xt(){return mt||(mt=Tt(Ge(),wt()))}function Rt(e,t,n){var r,o,i=e._map,a=e._list,s=i.get(t),c=void 0!==s;if(n===v){if(!c)return e;a.size>=y&&a.size>=2*i.size?(r=(o=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(r.__ownerID=o.__ownerID=e.__ownerID)):(r=i.remove(t),o=s===a.size-1?a.pop():a.set(s,void 0))}else if(c){if(n===a.get(s)[1])return e;r=i,o=a.set(s,[t,n])}else r=i.set(t,a.size),o=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=o,e.__hash=void 0,e):Tt(r,o)}function Dt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Nt(e){this._iter=e,this.size=e.size}function Mt(e){this._iter=e,this.size=e.size}function It(e){this._iter=e,this.size=e.size}function At(e){var t=Xt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Zt,t.__iterateUncached=function(t,n){var r=this;return e.__iterate((function(e,n){return!1!==t(n,e,r)}),n)},t.__iteratorUncached=function(t,n){if(2===t){var r=e.__iterator(t,n);return new M((function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,n)},t}function Lt(e,t,n){var r=Xt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,o){var i=e.get(r,v);return i===v?o:t.call(n,i,r,e)},r.__iterateUncached=function(r,o){var i=this;return e.__iterate((function(e,o,a){return!1!==r(t.call(n,e,o,a),o,i)}),o)},r.__iteratorUncached=function(r,o){var i=e.__iterator(2,o);return new M((function(){var o=i.next();if(o.done)return o;var a=o.value,s=a[0];return I(r,s,t.call(n,a[1],s,e),o)}))},r}function Bt(e,t){var n=Xt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=At(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Zt,n.__iterate=function(t,n){var r=this;return e.__iterate((function(e,n){return t(e,n,r)}),!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function Ft(e,t,n,r){var o=Xt(e);return r&&(o.has=function(r){var o=e.get(r,v);return o!==v&&!!t.call(n,o,r,e)},o.get=function(r,o){var i=e.get(r,v);return i!==v&&t.call(n,i,r,e)?i:o}),o.__iterateUncached=function(o,i){var a=this,s=0;return e.__iterate((function(e,i,c){if(t.call(n,e,i,c))return s++,o(e,r?i:s-1,a)}),i),s},o.__iteratorUncached=function(o,i){var a=e.__iterator(2,i),s=0;return new M((function(){for(;;){var i=a.next();if(i.done)return i;var c=i.value,l=c[0],u=c[1];if(t.call(n,u,l,e))return I(o,r?l:s++,u,i)}}))},o}function Ut(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=o:n|=0),P(t,n,o))return e;var i=j(t,o),a=T(n,o);if(i!=i||a!=a)return Ut(e.toSeq().cacheResult(),t,n,r);var s,c=a-i;c==c&&(s=c<0?0:c);var l=Xt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&ee(e)&&s>=0&&(l.get=function(t,n){return(t=k(this,t))>=0&&t<s?e.get(t+i,n):n}),l.__iterateUncached=function(t,n){var o=this;if(0===s)return 0;if(n)return this.cacheResult().__iterate(t,n);var a=0,c=!0,l=0;return e.__iterate((function(e,n){if(!c||!(c=a++<i))return l++,!1!==t(e,r?n:l-1,o)&&l!==s})),l},l.__iteratorUncached=function(t,n){if(0!==s&&n)return this.cacheResult().__iterator(t,n);var o=0!==s&&e.__iterator(t,n),a=0,c=0;return new M((function(){for(;a++<i;)o.next();if(++c>s)return{value:void 0,done:!0};var e=o.next();return r||1===t?e:I(t,c-1,0===t?void 0:e.value[1],e)}))},l}function Kt(e,t,n,r){var o=Xt(e);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=!0,c=0;return e.__iterate((function(e,i,l){if(!s||!(s=t.call(n,e,i,l)))return c++,o(e,r?i:c-1,a)})),c},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator(2,i),c=!0,l=0;return new M((function(){var e,i,u;do{if((e=s.next()).done)return r||1===o?e:I(o,l++,0===o?void 0:e.value[1],e);var f=e.value;i=f[0],u=f[1],c&&(c=t.call(n,u,i,a))}while(c);return 2===o?e:I(o,i,u,e)}))},o}function qt(e,t){var n=s(e),o=[e].concat(t).map((function(e){return a(e)?n&&(e=r(e)):e=n?ne(e):re(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===o.length)return e;if(1===o.length){var i=o[0];if(i===e||n&&s(i)||c(e)&&c(i))return i}var l=new Q(o);return n?l=l.toKeyedSeq():c(e)||(l=l.toSetSeq()),(l=l.flatten(!0)).size=o.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),l}function Vt(e,t,n){var r=Xt(e);return r.__iterateUncached=function(r,o){var i=0,s=!1;return function e(c,l){var u=this;c.__iterate((function(o,c){return(!t||l<t)&&a(o)?e(o,l+1):!1===r(o,n?c:i++,u)&&(s=!0),!s}),o)}(e,0),i},r.__iteratorUncached=function(r,o){var i=e.__iterator(r,o),s=[],c=0;return new M((function(){for(;i;){var e=i.next();if(!1===e.done){var l=e.value;if(2===r&&(l=l[1]),t&&!(s.length<t)||!a(l))return n?e:I(r,c++,l,e);s.push(i),i=l.__iterator(r,o)}else i=s.pop()}return{value:void 0,done:!0}}))},r}function zt(e,t,n){t||(t=en);var r=s(e),o=0,i=e.toSeq().map((function(t,r){return[r,t,o++,n?n(t,r,e):t]})).toArray();return i.sort((function(e,n){return t(e[3],n[3])||e[2]-n[2]})).forEach(r?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),r?V(i):c(e)?z(i):W(i)}function Wt(e,t,n){if(t||(t=en),n){var r=e.toSeq().map((function(t,r){return[t,n(t,r,e)]})).reduce((function(e,n){return Ht(t,e[1],n[1])?n:e}));return r&&r[0]}return e.reduce((function(e,n){return Ht(t,e,n)?n:e}))}function Ht(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}function $t(e,t,r){var o=Xt(e);return o.size=new Q(r).map((function(e){return e.size})).min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(1,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=n(e),F(o?e.reverse():e)})),a=0,s=!1;return new M((function(){var n;return s||(n=i.map((function(e){return e.next()})),s=n.some((function(e){return e.done}))),s?{value:void 0,done:!0}:I(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function Jt(e,t){return ee(e)?t:e.constructor(t)}function Gt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Qt(e){return Me(e.size),_(e)}function Yt(e){return s(e)?r:c(e)?o:i}function Xt(e){return Object.create((s(e)?V:c(e)?z:W).prototype)}function Zt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):q.prototype.cacheResult.call(this)}function en(e,t){return e>t?1:e<t?-1:0}function tn(e){var t=F(e);if(!t){if(!K(e))throw new TypeError("Expected iterable or array-like: "+e);t=F(n(e))}return t}function nn(e,t){var n,r=function(i){if(i instanceof r)return i;if(!(this instanceof r))return new r(i);if(!n){n=!0;var a=Object.keys(e);(function(e,t){try{t.forEach(sn.bind(void 0,e))}catch(e){}})(o,a),o.size=a.length,o._name=t,o._keys=a,o._defaultValues=e}this._map=Ie(i)},o=r.prototype=Object.create(rn);return o.constructor=r,r}t(Pt,Ie),Pt.of=function(){return this(arguments)},Pt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Pt.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Pt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):xt()},Pt.prototype.set=function(e,t){return Rt(this,e,t)},Pt.prototype.remove=function(e){return Rt(this,e,v)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Pt.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},Pt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?Tt(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Pt.isOrderedMap=jt,Pt.prototype[d]=!0,Pt.prototype.delete=Pt.prototype.remove,t(Dt,V),Dt.prototype.get=function(e,t){return this._iter.get(e,t)},Dt.prototype.has=function(e){return this._iter.has(e)},Dt.prototype.valueSeq=function(){return this._iter.valueSeq()},Dt.prototype.reverse=function(){var e=this,t=Bt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},Dt.prototype.map=function(e,t){var n=this,r=Lt(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},Dt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Qt(this):0,function(o){return e(o,t?--n:n++,r)}),t)},Dt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(1,t),r=t?Qt(this):0;return new M((function(){var o=n.next();return o.done?o:I(e,t?--r:r++,o.value,o)}))},Dt.prototype[d]=!0,t(Nt,z),Nt.prototype.includes=function(e){return this._iter.includes(e)},Nt.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate((function(t){return e(t,r++,n)}),t)},Nt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(1,t),r=0;return new M((function(){var t=n.next();return t.done?t:I(e,r++,t.value,t)}))},t(Mt,W),Mt.prototype.has=function(e){return this._iter.includes(e)},Mt.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){return e(t,t,n)}),t)},Mt.prototype.__iterator=function(e,t){var n=this._iter.__iterator(1,t);return new M((function(){var t=n.next();return t.done?t:I(e,t.value,t.value,t)}))},t(It,V),It.prototype.entrySeq=function(){return this._iter.toSeq()},It.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate((function(t){if(t){Gt(t);var r=a(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}}),t)},It.prototype.__iterator=function(e,t){var n=this._iter.__iterator(1,t);return new M((function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){Gt(r);var o=a(r);return I(e,o?r.get(0):r[0],o?r.get(1):r[1],t)}}}))},Nt.prototype.cacheResult=Dt.prototype.cacheResult=Mt.prototype.cacheResult=It.prototype.cacheResult=Zt,t(nn,ve),nn.prototype.toString=function(){return this.__toString(an(this)+" {","}")},nn.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},nn.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},nn.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=on(this,Ge()))},nn.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+an(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:on(this,n)},nn.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:on(this,t)},nn.prototype.wasAltered=function(){return this._map.wasAltered()},nn.prototype.__iterator=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterator(e,t)},nn.prototype.__iterate=function(e,t){var n=this;return r(this._defaultValues).map((function(e,t){return n.get(t)})).__iterate(e,t)},nn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?on(this,t,e):(this.__ownerID=e,this._map=t,this)};var rn=nn.prototype;function on(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return r._map=t,r.__ownerID=n,r}function an(e){return e._name||e.constructor.name||"Record"}function sn(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){de(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function cn(e){return null==e?yn():ln(e)&&!u(e)?e:yn().withMutations((function(t){var n=i(e);Me(n.size),n.forEach((function(e){return t.add(e)}))}))}function ln(e){return!(!e||!e[fn])}rn.delete=rn.remove,rn.deleteIn=rn.removeIn=Fe.removeIn,rn.merge=Fe.merge,rn.mergeWith=Fe.mergeWith,rn.mergeIn=Fe.mergeIn,rn.mergeDeep=Fe.mergeDeep,rn.mergeDeepWith=Fe.mergeDeepWith,rn.mergeDeepIn=Fe.mergeDeepIn,rn.setIn=Fe.setIn,rn.update=Fe.update,rn.updateIn=Fe.updateIn,rn.withMutations=Fe.withMutations,rn.asMutable=Fe.asMutable,rn.asImmutable=Fe.asImmutable,t(cn,ge),cn.of=function(){return this(arguments)},cn.fromKeys=function(e){return this(r(e).keySeq())},cn.prototype.toString=function(){return this.__toString("Set {","}")},cn.prototype.has=function(e){return this._map.has(e)},cn.prototype.add=function(e){return hn(this,this._map.set(e,!0))},cn.prototype.remove=function(e){return hn(this,this._map.remove(e))},cn.prototype.clear=function(){return hn(this,this._map.clear())},cn.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var n=0;n<t.length;n++)i(t[n]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},cn.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.every((function(e){return e.includes(n)}))||e.remove(n)}))}))},cn.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return i(e)}));var n=this;return this.withMutations((function(e){n.forEach((function(n){t.some((function(e){return e.includes(n)}))&&e.remove(n)}))}))},cn.prototype.merge=function(){return this.union.apply(this,arguments)},cn.prototype.mergeWith=function(t){var n=e.call(arguments,1);return this.union.apply(this,n)},cn.prototype.sort=function(e){return mn(zt(this,e))},cn.prototype.sortBy=function(e,t){return mn(zt(this,t,e))},cn.prototype.wasAltered=function(){return this._map.wasAltered()},cn.prototype.__iterate=function(e,t){var n=this;return this._map.__iterate((function(t,r){return e(r,r,n)}),t)},cn.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},cn.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},cn.isSet=ln;var un,fn="@@__IMMUTABLE_SET__@@",pn=cn.prototype;function hn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function dn(e,t){var n=Object.create(pn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function yn(){return un||(un=dn(Ge()))}function mn(e){return null==e?En():vn(e)?e:En().withMutations((function(t){var n=i(e);Me(n.size),n.forEach((function(e){return t.add(e)}))}))}function vn(e){return ln(e)&&u(e)}pn[fn]=!0,pn.delete=pn.remove,pn.mergeDeep=pn.merge,pn.mergeDeepWith=pn.mergeWith,pn.withMutations=Fe.withMutations,pn.asMutable=Fe.asMutable,pn.asImmutable=Fe.asImmutable,pn.__empty=yn,pn.__make=dn,t(mn,cn),mn.of=function(){return this(arguments)},mn.fromKeys=function(e){return this(r(e).keySeq())},mn.prototype.toString=function(){return this.__toString("OrderedSet {","}")},mn.isOrderedSet=vn;var bn,gn=mn.prototype;function wn(e,t){var n=Object.create(gn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function En(){return bn||(bn=wn(xt()))}function Sn(e){return null==e?jn():On(e)?e:jn().unshiftAll(e)}function On(e){return!(!e||!e[kn])}gn[d]=!0,gn.__empty=En,gn.__make=wn,t(Sn,be),Sn.of=function(){return this(arguments)},Sn.prototype.toString=function(){return this.__toString("Stack [","]")},Sn.prototype.get=function(e,t){var n=this._head;for(e=k(this,e);n&&e--;)n=n.next;return n?n.value:t},Sn.prototype.peek=function(){return this._head&&this._head.value},Sn.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,n=arguments.length-1;n>=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Pn(e,t)},Sn.prototype.pushAll=function(e){if(0===(e=o(e)).size)return this;Me(e.size);var t=this.size,n=this._head;return e.reverse().forEach((function(e){t++,n={value:e,next:n}})),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Pn(t,n)},Sn.prototype.pop=function(){return this.slice(1)},Sn.prototype.unshift=function(){return this.push.apply(this,arguments)},Sn.prototype.unshiftAll=function(e){return this.pushAll(e)},Sn.prototype.shift=function(){return this.pop.apply(this,arguments)},Sn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):jn()},Sn.prototype.slice=function(e,t){if(P(e,t,this.size))return this;var n=j(e,this.size);if(T(t,this.size)!==this.size)return be.prototype.slice.call(this,e,t);for(var r=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=r,this._head=o,this.__hash=void 0,this.__altered=!0,this):Pn(r,o)},Sn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Pn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Sn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Sn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new M((function(){if(r){var t=r.value;return r=r.next,I(e,n++,t)}return{value:void 0,done:!0}}))},Sn.isStack=On;var _n,kn="@@__IMMUTABLE_STACK__@@",Cn=Sn.prototype;function Pn(e,t,n,r){var o=Object.create(Cn);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function jn(){return _n||(_n=Pn(0))}function Tn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}Cn[kn]=!0,Cn.withMutations=Fe.withMutations,Cn.asMutable=Fe.asMutable,Cn.asImmutable=Fe.asImmutable,Cn.wasAltered=Fe.wasAltered,n.Iterator=M,Tn(n,{toArray:function(){Me(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,n){e[n]=t})),e},toIndexedSeq:function(){return new Nt(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new Dt(this,!0)},toMap:function(){return Ie(this.toKeyedSeq())},toObject:function(){Me(this.size);var e={};return this.__iterate((function(t,n){e[n]=t})),e},toOrderedMap:function(){return Pt(this.toKeyedSeq())},toOrderedSet:function(){return mn(s(this)?this.valueSeq():this)},toSet:function(){return cn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Mt(this)},toSeq:function(){return c(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Sn(s(this)?this.valueSeq():this)},toList:function(){return ut(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Jt(this,qt(this,e.call(arguments,0)))},includes:function(e){return this.some((function(t){return fe(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){Me(this.size);var n=!0;return this.__iterate((function(r,o,i){if(!e.call(t,r,o,i))return n=!1,!1})),n},filter:function(e,t){return Jt(this,Ft(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return Me(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Me(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate((function(r){n?n=!1:t+=e,t+=null!=r?r.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Jt(this,Lt(this,e,t))},reduce:function(e,t,n){var r,o;return Me(this.size),arguments.length<2?o=!0:r=t,this.__iterate((function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)})),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Jt(this,Bt(this,!0))},slice:function(e,t){return Jt(this,Ut(this,e,t,!0))},some:function(e,t){return!this.every(Mn(e),t)},sort:function(e){return Jt(this,zt(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return _(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,n){var r=Ie().asMutable();return e.__iterate((function(o,i){r.update(t.call(n,o,i,e),0,(function(e){return e+1}))})),r.asImmutable()}(this,e,t)},equals:function(e){return pe(this,e)},entrySeq:function(){var e=this;if(e._cache)return new Q(e._cache);var t=e.toSeq().map(Nn).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Mn(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate((function(n,o,i){if(e.call(t,n,o,i))return r=[o,n],!1})),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(C)},flatMap:function(e,t){return Jt(this,function(e,t,n){var r=Yt(e);return e.toSeq().map((function(o,i){return r(t.call(n,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Jt(this,Vt(this,e,!0))},fromEntrySeq:function(){return new It(this)},get:function(e,t){return this.find((function(t,n){return fe(n,e)}),void 0,t)},getIn:function(e,t){for(var n,r=this,o=tn(e);!(n=o.next()).done;){var i=n.value;if((r=r&&r.get?r.get(i,v):v)===v)return t}return r},groupBy:function(e,t){return function(e,t,n){var r=s(e),o=(u(e)?Pt():Ie()).asMutable();e.__iterate((function(i,a){o.update(t.call(n,i,a,e),(function(e){return(e=e||[]).push(r?[a,i]:i),e}))}));var i=Yt(e);return o.map((function(t){return Jt(e,i(t))}))}(this,e,t)},has:function(e){return this.get(e,v)!==v},hasIn:function(e){return this.getIn(e,v)!==v},isSubset:function(e){return e="function"==typeof e.includes?e:n(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:n(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return fe(t,e)}))},keySeq:function(){return this.toSeq().map(Dn).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Wt(this,e)},maxBy:function(e,t){return Wt(this,t,e)},min:function(e){return Wt(this,e?In(e):Bn)},minBy:function(e,t){return Wt(this,t?In(t):Bn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Jt(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Jt(this,Kt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Mn(e),t)},sortBy:function(e,t){return Jt(this,zt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Jt(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Jt(this,function(e,t,n){var r=Xt(e);return r.__iterateUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterate(r,o);var a=0;return e.__iterate((function(e,o,s){return t.call(n,e,o,s)&&++a&&r(e,o,i)})),a},r.__iteratorUncached=function(r,o){var i=this;if(o)return this.cacheResult().__iterator(r,o);var a=e.__iterator(2,o),s=!0;return new M((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var o=e.value,c=o[0],l=o[1];return t.call(n,l,c,i)?2===r?e:I(r,c,l,e):(s=!1,{value:void 0,done:!0})}))},r}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Mn(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=t?1:0;return function(e,t){return t=we(t,3432918353),t=we(t<<15|t>>>-15,461845907),t=we(t<<13|t>>>-13,5),t=we((t=(t+3864292196|0)^e)^t>>>16,2246822507),Ee((t=we(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Fn(Se(e),Se(t))|0}:function(e,t){r=r+Fn(Se(e),Se(t))|0}:t?function(e){r=31*r+Se(e)|0}:function(e){r=r+Se(e)|0}),r)}(this))}});var xn=n.prototype;xn[f]=!0,xn[N]=xn.values,xn.__toJS=xn.toArray,xn.__toStringMapper=An,xn.inspect=xn.toSource=function(){return this.toString()},xn.chain=xn.flatMap,xn.contains=xn.includes,Tn(r,{flip:function(){return Jt(this,At(this))},mapEntries:function(e,t){var n=this,r=0;return Jt(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Jt(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var Rn=r.prototype;function Dn(e,t){return t}function Nn(e,t){return[t,e]}function Mn(e){return function(){return!e.apply(this,arguments)}}function In(e){return function(){return-e.apply(this,arguments)}}function An(e){return"string"==typeof e?JSON.stringify(e):String(e)}function Ln(){return O(arguments)}function Bn(e,t){return e<t?1:e>t?-1:0}function Fn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Rn[p]=!0,Rn[N]=xn.entries,Rn.__toJS=xn.toObject,Rn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+An(e)},Tn(o,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(e,t){return Jt(this,Ft(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Jt(this,Bt(this,!1))},slice:function(e,t){return Jt(this,Ut(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=j(e,e<0?this.count():this.size);var r=this.slice(0,e);return Jt(this,1===n?r:r.concat(O(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Jt(this,Vt(this,e,!1))},get:function(e,t){return(e=k(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=k(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Jt(this,function(e,t){var n=Xt(e);return n.size=e.size&&2*e.size-1,n.__iterateUncached=function(n,r){var o=this,i=0;return e.__iterate((function(e,r){return(!i||!1!==n(t,i++,o))&&!1!==n(e,i++,o)}),r),i},n.__iteratorUncached=function(n,r){var o,i=e.__iterator(1,r),a=0;return new M((function(){return(!o||a%2)&&(o=i.next()).done?o:a%2?I(n,a++,t):I(n,a++,o.value,o)}))},n}(this,e))},interleave:function(){var e=[this].concat(O(arguments)),t=$t(this.toSeq(),z.of,e),n=t.flatten(!0);return t.size&&(n.size=t.size*e.length),Jt(this,n)},keySeq:function(){return ye(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Jt(this,Kt(this,e,t,!1))},zip:function(){return Jt(this,$t(this,Ln,[this].concat(O(arguments))))},zipWith:function(e){var t=O(arguments);return t[0]=this,Jt(this,$t(this,e,t))}}),o.prototype[h]=!0,o.prototype[d]=!0,Tn(i,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=xn.includes,i.prototype.contains=i.prototype.includes,Tn(V,r.prototype),Tn(z,o.prototype),Tn(W,i.prototype),Tn(ve,r.prototype),Tn(be,o.prototype),Tn(ge,i.prototype),{Iterable:n,Seq:q,Collection:me,Map:Ie,OrderedMap:Pt,List:ut,Stack:Sn,Set:cn,OrderedSet:mn,Record:nn,Range:ye,Repeat:he,is:fe,fromJS:se}}()},1204:e=>{function t(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function n(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,r,o){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof r&&(o=r,r={}),r=r||{},o=o||function(){},a.type=r.type||"text/javascript",a.charset=r.charset||"utf8",a.async=!("async"in r)||!!r.async,a.src=e,r.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(a,r.attrs),r.text&&(a.text=""+r.text),("onload"in a?t:n)(a,o),a.onload||t(a,o),i.appendChild(a)}},3655:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(7426)),s=/(\{[\d|\w]+\})/,c=/(\$ref\{[\w|.]+\})/,l=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"function"==typeof n&&(n={customLanguageInterface:n}),this._opts=o({},{customLanguageInterface:a.getInterfaceLanguage,pseudo:!1,pseudoMultipleLanguages:!1,logsEnabled:!0},n),this._interfaceLanguage=this._opts.customLanguageInterface(),this._language=this._interfaceLanguage,this.setContent(t)}return i(e,[{key:"setContent",value:function(e){var t=this,n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(Object.keys(e),1)[0];this._defaultLanguage=n,this._defaultLanguageFirstLevelKeys=[],this._props=e,a.validateTranslationKeys(Object.keys(e[this._defaultLanguage])),Object.keys(this._props[this._defaultLanguage]).forEach((function(e){"string"==typeof t._props[t._defaultLanguage][e]&&t._defaultLanguageFirstLevelKeys.push(e)})),this.setLanguage(this._interfaceLanguage),this._opts.pseudo&&this._pseudoAllValues(this._props)}},{key:"_pseudoAllValues",value:function(e){var t=this;Object.keys(e).forEach((function(n){if("object"===r(e[n]))t._pseudoAllValues(e[n]);else if("string"==typeof e[n]){if(0===e[n].indexOf("[")&&e[n].lastIndexOf("]")===e[n].length-1)return;for(var o=e[n].split(" "),i=0;i<o.length;i+=1)if(o[i].match(s));else if(o[i].match(c));else{var l=o[i].length;t._opts.pseudoMultipleLanguages&&(l=parseInt(1.4*l,10)),o[i]=a.randomPseudo(l)}e[n]="["+o.join(" ")+"]"}}))}},{key:"setLanguage",value:function(e){var t=this,n=a.getBestMatchingLanguage(e,this._props),r=Object.keys(this._props)[0];if(this._language=n,this._props[n]){for(var i=0;i<this._defaultLanguageFirstLevelKeys.length;i+=1)delete this[this._defaultLanguageFirstLevelKeys[i]];var s=o({},this._props[this._language]);Object.keys(s).forEach((function(e){t[e]=s[e]})),r!==this._language&&(s=this._props[r],this._fallbackValues(s,this))}}},{key:"_fallbackValues",value:function(e,t){var n=this;Object.keys(e).forEach((function(r){Object.prototype.hasOwnProperty.call(e,r)&&!t[r]&&""!==t[r]?(t[r]=e[r],n._opts.logsEnabled&&console.log("🚧 👷 key '"+r+"' not found in localizedStrings for language "+n._language+" 🚧")):"string"!=typeof t[r]&&n._fallbackValues(e[r],t[r])}))}},{key:"getLanguage",value:function(){return this._language}},{key:"getInterfaceLanguage",value:function(){return this._interfaceLanguage}},{key:"getAvailableLanguages",value:function(){var e=this;return this._availableLanguages||(this._availableLanguages=[],Object.keys(this._props).forEach((function(t){e._availableLanguages.push(t)}))),this._availableLanguages}},{key:"formatString",value:function(e){for(var t=this,n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=e||"";"string"==typeof i&&(i=this.getString(e,null,!0)||i);var a=i.split(c).filter((function(e){return!!e})).map((function(n){if(n.match(c)){var r=n.slice(5,-1);return t.getString(r)||(t._opts.logsEnabled&&console.log("No Localization ref found for '"+n+"' in string '"+e+"'"),"$ref(id:"+r+")")}return n})).join("");return a.split(s).filter((function(e){return!!e})).map((function(e){if(e.match(s)){var t=e.slice(1,-1),n=r[t];if(void 0===n){var o=r[0][t];if(void 0===o)return n;n=o}return n}return e})).join("")}},{key:"getString",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{for(var r=this._props[t||this._language],o=e.split("."),i=0;i<o.length;i+=1){if(void 0===r[o[i]])throw Error(o[i]);r=r[o[i]]}return r}catch(r){!n&&this._opts.logsEnabled&&console.log("No localization found for key '"+e+"' and language '"+t+"', failed on "+r.message)}return null}},{key:"getContent",value:function(){return this._props}}]),e}();t.default=l},7426:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceLanguage=function(){var e="en-US";if("undefined"==typeof navigator)return e;var t=navigator;if(t){if(t.language)return t.language;if(t.languages&&t.languages[0])return t.languages[0];if(t.userLanguage)return t.userLanguage;if(t.browserLanguage)return t.browserLanguage}return e},t.getBestMatchingLanguage=function(e,t){if(t[e])return e;var n=e.indexOf("-"),r=n>=0?e.substring(0,n):e;return t[r]?r:Object.keys(t)[0]},t.validateTranslationKeys=function(e){var t=["_interfaceLanguage","_language","_defaultLanguage","_defaultLanguageFirstLevelKeys","_props"];e.forEach((function(e){if(-1!==t.indexOf(e))throw new Error(e+" cannot be used as a key. It is a reserved word.")}))},t.randomPseudo=function(e){for(var t="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r+=1)t+=n.charAt(Math.floor(Math.random()*n.length));return t}},8389:(e,t,n)=>{var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,f=l||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,d=Math.min,y=function(){return f.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return m(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,a,s,c,l,u=0,f=!1,p=!1,b=!0;if("function"!=typeof e)throw new TypeError(r);function g(t){var n=o,r=i;return o=i=void 0,u=t,s=e.apply(r,n)}function w(e){return u=e,c=setTimeout(S,t),f?g(e):s}function E(e){var n=e-l;return void 0===l||n>=t||n<0||p&&e-u>=a}function S(){var e=y();if(E(e))return O(e);c=setTimeout(S,function(e){var n=t-(e-l);return p?d(n,a-(e-u)):n}(e))}function O(e){return c=void 0,b&&o?g(e):(o=i=void 0,s)}function _(){var e=y(),n=E(e);if(o=arguments,i=this,l=e,n){if(void 0===c)return w(l);if(p)return c=setTimeout(S,t),g(l)}return void 0===c&&(c=setTimeout(S,t)),s}return t=v(t)||0,m(n)&&(f=!!n.leading,a=(p="maxWait"in n)?h(v(n.maxWait)||0,t):a,b="trailing"in n?!!n.trailing:b),_.cancel=function(){void 0!==c&&clearTimeout(c),u=0,o=l=i=c=void 0},_.flush=function(){return void 0===c?s:O(y())},_}(e,t,{leading:o,maxWait:t,trailing:i})}},2525:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,a,s=r(e),c=1;c<arguments.length;c++){for(var l in i=Object(arguments[c]))t.call(i,l)&&(s[l]=i[l]);if(Object.getOwnPropertySymbols){a=Object.getOwnPropertySymbols(i);for(var u=0;u<a.length;u++)n.call(i,a[u])&&(s[a[u]]=i[a[u]])}}return s}},405:(e,t,n)=>{var r=n(5491);e.exports=function e(t,n,o){return r(n)||(o=n||o,n=[]),o=o||{},t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return u(e,t)}(t,n):r(t)?function(t,n,r){for(var o=[],i=0;i<t.length;i++)o.push(e(t[i],n,r).source);return u(new RegExp("(?:"+o.join("|")+")",f(r)),n)}(t,n,o):function(e,t,n){return p(i(e,n),t,n)}(t,n,o)},e.exports.parse=i,e.exports.compile=function(e,t){return s(i(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=p;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,s="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var f=n[0],p=n[1],h=n.index;if(s+=e.slice(a,h),a=h+f.length,p)s+=p[1];else{var d=e[a],y=n[2],m=n[3],v=n[4],b=n[5],g=n[6],w=n[7];s&&(r.push(s),s="");var E=null!=y&&null!=d&&d!==y,S="+"===g||"*"===g,O="?"===g||"*"===g,_=n[2]||u,k=v||b;r.push({name:m||i++,prefix:y||"",delimiter:_,optional:O,repeat:S,partial:E,asterisk:!!w,pattern:k?l(k):w?".*":"[^"+c(_)+"]+?"})}}return a<e.length&&(s+=e.substr(a)),s&&r.push(s),r}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function s(e,t){for(var n=new Array(e.length),o=0;o<e.length;o++)"object"==typeof e[o]&&(n[o]=new RegExp("^(?:"+e[o].pattern+")$",f(t)));return function(t,o){for(var i="",s=t||{},c=(o||{}).pretty?a:encodeURIComponent,l=0;l<e.length;l++){var u=e[l];if("string"!=typeof u){var f,p=s[u.name];if(null==p){if(u.optional){u.partial&&(i+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(r(p)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var h=0;h<p.length;h++){if(f=c(p[h]),!n[l].test(f))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(f)+"`");i+=(0===h?u.prefix:u.delimiter)+f}}else{if(f=u.asterisk?encodeURI(p).replace(/[?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})):c(p),!n[l].test(f))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+f+'"');i+=u.prefix+f}}else i+=u}return i}}function c(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function l(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function u(e,t){return e.keys=t,e}function f(e){return e&&e.sensitive?"":"i"}function p(e,t,n){r(t)||(n=t||n,t=[]);for(var o=(n=n||{}).strict,i=!1!==n.end,a="",s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)a+=c(l);else{var p=c(l.prefix),h="(?:"+l.pattern+")";t.push(l),l.repeat&&(h+="(?:"+p+h+")*"),a+=h=l.optional?l.partial?p+"("+h+")?":"(?:"+p+"("+h+"))?":p+"("+h+")"}}var d=c(n.delimiter||"/"),y=a.slice(-d.length)===d;return o||(a=(y?a.slice(0,-d.length):a)+"(?:"+d+"(?=$))?"),a+=i?"$":o&&y?"":"(?="+d+"|$)",u(new RegExp("^"+a,f(n)),t)}},5491:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},8772:(e,t,n)=>{"use strict";var r=n(331);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},3615:(e,t,n)=>{e.exports=n(8772)()},331:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},8891:(e,t,n)=>{"use strict";const r=n(9742),o=n(1998),i=n(9400),a=n(7728),s=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function u(e,t){return t.decode?o(e):e}function f(e){return Array.isArray(e)?e.sort():"object"==typeof e?f(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function p(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function h(e){const t=(e=p(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function y(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&u(n,e).includes(e.arrayFormatSeparator);n=i?u(n,e):n;const a=o||i?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(r[t]=n?u(n,e):n);const i=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],i):r[t]=i};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;let[e,a]=i(t.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:u(a,t),n(u(e,t),a,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=d(n[e],t);else r[e]=d(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=f(n):e[t]=n,e}),Object.create(null))}t.extract=h,t.parse=y,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&(e=>null==e)(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[",o,"]"].join("")]:[...n,[l(t,e),"[",l(o,e),"]=",l(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[l(n,e),t,l(o,e)].join("")]:[[r,l(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,l(t,e)]:[...n,[l(t,e),"=",l(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const o=e[n];return void 0===o?"":null===o?l(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":o.reduce(r(n),[]).join("&"):l(n,t)+"="+l(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:y(h(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=p(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),a=Object.assign(i,e.query);let c=t.stringify(a,n);c&&(c=`?${c}`);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?l(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${c}${u}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:o,query:i,fragmentIdentifier:c}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:a(i,n),fragmentIdentifier:c},r)},t.exclude=(e,n,r)=>{const o=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,o,r)}},8658:(e,t,n)=>{"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(5839),a=n(4639),s=n(1346);e.exports=function(e){var t=e.displayName||e.name,n=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.handleClickOutside=t.handleClickOutside.bind(t),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),o(n,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleClickOutside,!0)}},{key:"handleClickOutside",value:function(e){var t=this.__domNode;t&&t.contains(e.target)||!this.__wrappedInstance||"function"!=typeof this.__wrappedInstance.handleClickOutside||this.__wrappedInstance.handleClickOutside(e)}},{key:"render",value:function(){var t=this,n=this.props,o=n.wrappedRef,i=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(n,["wrappedRef"]);return a.createElement(e,r({},i,{ref:function(e){t.__wrappedInstance=e,t.__domNode=s.findDOMNode(e),o&&o(e)}}))}}]),n}(a.Component);return n.displayName="clickOutside("+t+")",i(n,e)}},4335:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,a){if(e===a)return!0;if(e&&a&&"object"==typeof e&&"object"==typeof a){if(e.constructor!==a.constructor)return!1;var s,c,l,u;if(Array.isArray(e)){if((s=e.length)!=a.length)return!1;for(c=s;0!=c--;)if(!i(e[c],a[c]))return!1;return!0}if(n&&e instanceof Map&&a instanceof Map){if(e.size!==a.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(r&&e instanceof Set&&a instanceof Set){if(e.size!==a.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(a)){if((s=e.length)!=a.length)return!1;for(c=s;0!=c--;)if(e[c]!==a[c])return!1;return!0}if(e.constructor===RegExp)return e.source===a.source&&e.flags===a.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===a.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===a.toString();if((s=(l=Object.keys(e)).length)!==Object.keys(a).length)return!1;for(c=s;0!=c--;)if(!Object.prototype.hasOwnProperty.call(a,l[c]))return!1;if(t&&e instanceof Element)return!1;for(c=s;0!=c--;)if(("_owner"!==l[c]&&"__v"!==l[c]&&"__o"!==l[c]||!e.$$typeof)&&!i(e[l[c]],a[l[c]]))return!1;return!0}return e!=e&&a!=a}e.exports=function(e,t){try{return i(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},2468:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,s,c=o(e),l=1;l<arguments.length;l++){for(var u in a=Object(arguments[l]))n.call(a,u)&&(c[u]=a[u]);if(t){s=t(a);for(var f=0;f<s.length;f++)r.call(a,s[f])&&(c[s[f]]=a[s[f]])}}return c}},8326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(4639),i=s(o),a=s(n(3615));function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){return this.props.useCapture,this.isPassiveSupported()?{useCapture:this.props.useCapture,passive:!0}:{passive:!1}}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),r=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,i=void 0!==t.pageYOffset?t.pageYOffset:o.scrollTop;r=this.props.isReverse?i:this.calculateOffset(e,i)}else r=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;r<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,r=t.element,o=t.hasMore,a=(t.initialLoad,t.isReverse),s=t.loader,c=(t.loadMore,t.pageStart,t.ref),l=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));l.ref=function(t){e.scrollComponent=t,c&&c(t)};var u=[n];return o&&(s?a?u.unshift(s):u.push(s):this.defaultLoader&&(a?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),i.default.createElement(r,l,u)}}]),t}(o.Component);c.propTypes={children:a.default.node.isRequired,element:a.default.node,hasMore:a.default.bool,initialLoad:a.default.bool,isReverse:a.default.bool,loader:a.default.node,loadMore:a.default.func.isRequired,pageStart:a.default.number,ref:a.default.func,getScrollParent:a.default.func,threshold:a.default.number,useCapture:a.default.bool,useWindow:a.default.bool},c.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=c,e.exports=t.default},3674:(e,t,n)=>{e.exports=n(8326)},8702:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118;function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case i:case s:case a:case h:return e;default:switch(e=e&&e.$$typeof){case l:case p:case c:return e;default:return t}}case m:case y:case o:return t}}}function w(e){return g(e)===f}t.typeOf=g,t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=m,t.Memo=y,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=h,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===s||e===a||e===h||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===c||e.$$typeof===l||e.$$typeof===p||e.$$typeof===v||e.$$typeof===b)},t.isAsyncMode=function(e){return w(e)||g(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return g(e)===l},t.isContextProvider=function(e){return g(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return g(e)===p},t.isFragment=function(e){return g(e)===i},t.isLazy=function(e){return g(e)===m},t.isMemo=function(e){return g(e)===y},t.isPortal=function(e){return g(e)===o},t.isProfiler=function(e){return g(e)===s},t.isStrictMode=function(e){return g(e)===a},t.isSuspense=function(e){return g(e)===h}},9185:(e,t,n)=>{"use strict";e.exports=n(8702)},9895:(e,t,n)=>{"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=a(n(4639)),i=a(n(3655));function a(e){return e&&e.__esModule?e:{default:e}}var s=/(\{[\d|\w]+\})/;i.default.prototype.formatString=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var a=!1,c=(e||"").split(s).filter((function(e){return!!e})).map((function(e,t){if(e.match(s)){var i=e.slice(1,-1),c=n[i];if(null==c){var l=n[0][i];if(void 0===l)return c;c=l}return o.default.isValidElement(c)?(a=!0,o.default.Children.toArray(c).map((function(e){return r({},e,{key:t.toString()})}))):c}return e}));return a?c:c.join("")},t.Z=i.default},9448:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==s(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),o=n(8416),i=n(3887);function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e){return s="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},s(e)}function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(s,e);var t,n,o,a=(t=s,function(){var e,n=d(t);if(h()){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function s(){var e;l(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return m(p(e=a.call.apply(a,[this].concat(n))),"mounted",!1),m(p(e),"isReady",!1),m(p(e),"isPlaying",!1),m(p(e),"isLoading",!0),m(p(e),"loadOnReady",null),m(p(e),"startOnPlay",!0),m(p(e),"seekOnPlay",null),m(p(e),"onDurationCalled",!1),m(p(e),"getInternalPlayer",(function(t){return e.player?e.player[t]:null})),m(p(e),"progress",(function(){if(e.props.url&&e.player&&e.isReady){var t=e.getCurrentTime()||0,n=e.getSecondsLoaded(),r=e.getDuration();if(r){var o={playedSeconds:t,played:t/r};null!==n&&(o.loadedSeconds=n,o.loaded=n/r),o.playedSeconds===e.prevPlayed&&o.loadedSeconds===e.prevLoaded||e.props.onProgress(o),e.prevPlayed=o.playedSeconds,e.prevLoaded=o.loadedSeconds}}e.progressTimeout=setTimeout(e.progress,e.props.progressFrequency||e.props.progressInterval)})),m(p(e),"handleReady",(function(){if(e.mounted){e.isReady=!0,e.isLoading=!1;var t=e.props,n=t.onReady,r=t.playing,o=t.volume,i=t.muted;n(),i||null===o||e.player.setVolume(o),e.loadOnReady?(e.player.load(e.loadOnReady,!0),e.loadOnReady=null):r&&e.player.play(),e.handleDurationCheck()}})),m(p(e),"handlePlay",(function(){e.isPlaying=!0,e.isLoading=!1;var t=e.props,n=t.onStart,r=t.onPlay,o=t.playbackRate;e.startOnPlay&&(e.player.setPlaybackRate&&1!==o&&e.player.setPlaybackRate(o),n(),e.startOnPlay=!1),r(),e.seekOnPlay&&(e.seekTo(e.seekOnPlay),e.seekOnPlay=null),e.handleDurationCheck()})),m(p(e),"handlePause",(function(t){e.isPlaying=!1,e.isLoading||e.props.onPause(t)})),m(p(e),"handleEnded",(function(){var t=e.props,n=t.activePlayer,r=t.loop,o=t.onEnded;n.loopOnEnded&&r&&e.seekTo(0),r||(e.isPlaying=!1,o())})),m(p(e),"handleError",(function(){var t;e.isLoading=!1,(t=e.props).onError.apply(t,arguments)})),m(p(e),"handleDurationCheck",(function(){clearTimeout(e.durationCheckTimeout);var t=e.getDuration();t?e.onDurationCalled||(e.props.onDuration(t),e.onDurationCalled=!0):e.durationCheckTimeout=setTimeout(e.handleDurationCheck,100)})),m(p(e),"handleLoaded",(function(){e.isLoading=!1})),m(p(e),"ref",(function(t){t&&(e.player=t)})),e}return n=s,o=[{key:"componentDidMount",value:function(){this.mounted=!0,this.player.load(this.props.url),this.progress()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.player.stop(),this.player.disablePIP&&this.player.disablePIP(),this.mounted=!1}},{key:"componentDidUpdate",value:function(e){var t=this,n=this.props,r=n.url,o=n.playing,a=n.volume,s=n.muted,c=n.playbackRate,l=n.pip,u=n.loop,f=n.activePlayer;if(!(0,i.isEqual)(e.url,r)){if(this.isLoading&&!f.forceLoad)return console.warn("ReactPlayer: the attempt to load ".concat(r," is being deferred until the player has loaded")),void(this.loadOnReady=r);this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(r,this.isReady)}e.playing||!o||this.isPlaying||this.player.play(),e.playing&&!o&&this.isPlaying&&this.player.pause(),!e.pip&&l&&this.player.enablePIP&&this.player.enablePIP(),e.pip&&!l&&this.player.disablePIP&&this.player.disablePIP(),e.volume!==a&&null!==a&&this.player.setVolume(a),e.muted!==s&&(s?this.player.mute():(this.player.unmute(),null!==a&&setTimeout((function(){return t.player.setVolume(a)})))),e.playbackRate!==c&&this.player.setPlaybackRate&&this.player.setPlaybackRate(c),e.loop!==u&&this.player.setLoop&&this.player.setLoop(u)}},{key:"getDuration",value:function(){return this.isReady?this.player.getDuration():null}},{key:"getCurrentTime",value:function(){return this.isReady?this.player.getCurrentTime():null}},{key:"getSecondsLoaded",value:function(){return this.isReady?this.player.getSecondsLoaded():null}},{key:"seekTo",value:function(e,t){var n=this;if(!this.isReady&&0!==e)return this.seekOnPlay=e,void setTimeout((function(){n.seekOnPlay=null}),5e3);if(t?"fraction"===t:e>0&&e<1){var r=this.player.getDuration();return r?void this.player.seekTo(r*e):void console.warn("ReactPlayer: could not seek using fraction – duration not yet available")}this.player.seekTo(e)}},{key:"render",value:function(){var e=this.props.activePlayer;return e?r.default.createElement(e,c({},this.props,{ref:this.ref,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError})):null}}],o&&u(n.prototype,o),s}(r.Component);t.default=v,m(v,"displayName","Player"),m(v,"propTypes",o.propTypes),m(v,"defaultProps",o.defaultProps)},6148:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=r?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}(n(4639));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m="64px",v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(a,e);var t,n,o,i=(t=a,function(){var e,n=h(t);if(p()){var r=h(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return u(this,e)});function a(){var e;c(this,a);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return y(f(e=i.call.apply(i,[this].concat(n))),"mounted",!1),y(f(e),"state",{image:null}),e}return n=a,(o=[{key:"componentDidMount",value:function(){this.mounted=!0,this.fetchImage(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.url,r=t.light;e.url===n&&e.light===r||this.fetchImage(this.props)}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"fetchImage",value:function(e){var t=this,n=e.url,r=e.light;if("string"!=typeof r)return this.setState({image:null}),window.fetch("https://noembed.com/embed?url=".concat(n)).then((function(e){return e.json()})).then((function(e){if(e.thumbnail_url&&t.mounted){var n=e.thumbnail_url.replace("height=100","height=480");t.setState({image:n})}}));this.setState({image:r})}},{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.playIcon,o=this.state.image,i={display:"flex",alignItems:"center",justifyContent:"center"},a={preview:s({width:"100%",height:"100%",backgroundImage:o?"url(".concat(o,")"):void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer"},i),shadow:s({background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:m,width:m,height:m},i),playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},c=r.default.createElement("div",{style:a.shadow,className:"react-player__shadow"},r.default.createElement("div",{style:a.playIcon,className:"react-player__play-icon"}));return r.default.createElement("div",{style:a.preview,className:"react-player__preview",onClick:t},n||c)}}])&&l(n.prototype,o),a}(r.Component);t.default=v},2452:(e,t,n)=>{"use strict";t.ZP=void 0;var r=h(n(4639)),o=n(8416),i=n(3887),a=f(n(4985)),s=f(n(9448)),c=f(n(6148)),l=h(n(8450)),u=f(n(8428));f(n(8144)),f(n(4992)),f(n(1251)),f(n(6765)),f(n(5876)),f(n(2521)),f(n(7964)),f(n(4922)),f(n(1241));function f(e){return e&&e.__esModule?e:{default:e}}function p(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return p=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==d(e)&&"function"!=typeof e)return{default:e};var t=p();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}function d(e){return d="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(e)}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){P(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v.apply(this,arguments)}function b(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function S(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?O(e):t}function O(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function C(e,t){return C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},C(e,t)}function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j=Object.keys(o.propTypes),T=[],x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&C(e,t)}(h,e);var t,n,f,p=(t=h,function(){var e,n=k(t);if(_()){var r=k(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return S(this,e)});function h(){var e;w(this,h);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return P(O(e=p.call.apply(p,[this].concat(n))),"config",(0,i.getConfig)(e.props,o.defaultProps,!0)),P(O(e),"state",{showPreview:!!e.props.light}),P(O(e),"handleClickPreview",(function(){e.setState({showPreview:!1})})),P(O(e),"showPreview",(function(){e.setState({showPreview:!0})})),P(O(e),"getDuration",(function(){return e.player?e.player.getDuration():null})),P(O(e),"getCurrentTime",(function(){return e.player?e.player.getCurrentTime():null})),P(O(e),"getSecondsLoaded",(function(){return e.player?e.player.getSecondsLoaded():null})),P(O(e),"getInternalPlayer",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return e.player?e.player.getInternalPlayer(t):null})),P(O(e),"seekTo",(function(t,n){if(!e.player)return null;e.player.seekTo(t,n)})),P(O(e),"handleReady",(function(){e.props.onReady(O(e))})),P(O(e),"wrapperRef",(function(t){e.wrapper=t})),P(O(e),"activePlayerRef",(function(t){e.player=t})),e}return n=h,(f=[{key:"componentDidMount",value:function(){this.props.progressFrequency&&console.warn("ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead","font-weight: bold","","font-weight: bold","")}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,i.isEqual)(this.props,e)||!(0,i.isEqual)(this.state,t)}},{key:"componentDidUpdate",value:function(e){var t=this.props.light;this.config=(0,i.getConfig)(this.props,o.defaultProps),!e.light&&t&&this.setState({showPreview:!0}),e.light&&!t&&this.setState({showPreview:!1})}},{key:"getActivePlayer",value:function(e){for(var t=0,n=[].concat(b(T),b(a.default));t<n.length;t++){var r=n[t];if(r.canPlay(e))return r}return l.FilePlayer}},{key:"renderActivePlayer",value:function(e,t){return e?r.default.createElement(s.default,v({},this.props,{key:t.displayName,ref:this.activePlayerRef,config:this.config,activePlayer:t,onReady:this.handleReady})):null}},{key:"sortPlayers",value:function(e,t){return e&&t?e.key<t.key?-1:1:0}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.controls,a=e.style,s=e.width,l=e.height,f=e.light,p=e.playIcon,h=e.wrapper,d=this.state.showPreview&&t,y=(0,i.omit)(this.props,j,o.DEPRECATED_CONFIG_PROPS),g=this.getActivePlayer(t),w=this.renderActivePlayer(t,g),E=(0,u.default)(t,n,this.config),S=[w].concat(b(E)).sort(this.sortPlayers),O=r.default.createElement(c.default,{url:t,light:f,playIcon:p,onClick:this.handleClickPreview});return r.default.createElement(h,v({ref:this.wrapperRef,style:m({},a,{width:s,height:l})},y),d?O:S)}}])&&E(n.prototype,f),h}(r.Component);t.ZP=x,P(x,"addCustomPlayer",(function(e){T.push(e)})),P(x,"removeCustomPlayers",(function(){T=[]})),P(x,"displayName","ReactPlayer"),P(x,"propTypes",o.propTypes),P(x,"defaultProps",o.defaultProps),P(x,"canPlay",(function(e){for(var t=0,n=[].concat(b(T),b(a.default));t<n.length;t++)if(n[t].canPlay(e))return!0;return!1})),P(x,"canEnablePIP",(function(e){for(var t=0,n=[].concat(b(T),b(a.default));t<n.length;t++){var r=n[t];if(r.canEnablePIP&&r.canEnablePIP(e))return!0}return!1}))},4922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.DailyMotion=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/,E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=v(t);if(m()){var r=v(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return d(this,e)});function s(){var e;p(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return g(y(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),g(y(e),"onDurationChange",(function(){var t=e.getDuration();e.props.onDuration(t)})),g(y(e),"mute",(function(){e.callPlayer("setMuted",!0)})),g(y(e),"unmute",(function(){e.callPlayer("setMuted",!1)})),g(y(e),"ref",(function(t){e.container=t})),e}return n=s,(r=[{key:"load",value:function(e){var t,n,r=this,o=this.props,a=o.controls,s=o.config,c=o.onError,l=o.playing,p=(t=e.match(w),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];this.player?this.player.load(p,{start:(0,i.parseStartTime)(e),autoplay:l}):(0,i.getSDK)("https://api.dmcdn.net/all.js","DM","dmAsyncInit",(function(e){return e.player})).then((function(t){if(r.container){var n=t.player;r.player=new n(r.container,{width:"100%",height:"100%",video:p,params:u({controls:a,autoplay:r.props.playing,mute:r.props.muted,start:(0,i.parseStartTime)(e),origin:window.location.origin},s.dailymotion.params),events:{apiready:r.props.onReady,seeked:function(){return r.props.onSeek(r.player.currentTime)},video_end:r.props.onEnded,durationchange:r.onDurationChange,pause:r.props.onPause,playing:r.props.onPlay,waiting:r.props.onBuffer,error:function(e){return c(e)}}})}}),c)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.player.duration||null}},{key:"getCurrentTime",value:function(){return this.player.currentTime}},{key:"getSecondsLoaded",value:function(){return this.player.bufferedTime}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("div",{style:e},o.default.createElement("div",{ref:this.ref}))}}])&&h(n.prototype,r),s}(o.Component);t.DailyMotion=E,g(E,"displayName","DailyMotion"),g(E,"canPlay",(function(e){return w.test(e)})),g(E,"loopOnEnded",!0);var S=(0,a.default)(E);t.default=S},6765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Facebook=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v="https://connect.facebook.net/en_US/sdk.js",b="fbAsyncInit",g=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,w="facebook-player-",E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=d(t);if(h()){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function s(){var e;l(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return m(p(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),m(p(e),"playerID",e.props.config.facebook.playerId||"".concat(w).concat((0,i.randomString)())),m(p(e),"mute",(function(){e.callPlayer("mute")})),m(p(e),"unmute",(function(){e.callPlayer("unmute")})),e}return n=s,(r=[{key:"load",value:function(e,t){var n=this;t?(0,i.getSDK)(v,"FB",b).then((function(e){return e.XFBML.parse()})):(0,i.getSDK)(v,"FB",b).then((function(e){e.init({appId:n.props.config.facebook.appId,xfbml:!0,version:n.props.config.facebook.version}),e.Event.subscribe("xfbml.render",(function(e){n.props.onLoaded()})),e.Event.subscribe("xfbml.ready",(function(e){"video"===e.type&&e.id===n.playerID&&(n.player=e.instance,n.player.subscribe("startedPlaying",n.props.onPlay),n.player.subscribe("paused",n.props.onPause),n.player.subscribe("finishedPlaying",n.props.onEnded),n.player.subscribe("startedBuffering",n.props.onBuffer),n.player.subscribe("finishedBuffering",n.props.onBufferEnd),n.player.subscribe("error",n.props.onError),n.props.muted||n.callPlayer("unmute"),n.props.onReady(),document.getElementById(n.playerID).querySelector("iframe").style.visibility="visible")}))}))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentPosition")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){return o.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false"})}}])&&u(n.prototype,r),s}(o.Component);t.Facebook=E,m(E,"displayName","Facebook"),m(E,"canPlay",(function(e){return g.test(e)})),m(E,"loopOnEnded",!0);var S=(0,a.default)(E);t.default=S},8450:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FilePlayer=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var g="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,w=/\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,E=/\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i,S=/\.(m3u8)($|\?)/i,O=/\.(mpd)($|\?)/i,_=/www\.dropbox\.com\/.+/;function k(e){if(e instanceof Array){var t,n=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;if("string"==typeof r&&k(r))return!0;if(k(r.src))return!0}}catch(e){n.e(e)}finally{n.f()}return!1}return!!(0,i.isMediaStream)(e)||w.test(e)||E.test(e)||S.test(e)||O.test(e)}function C(e){return e||(e=document.createElement("video")),e.webkitSupportsPresentationMode&&"function"==typeof e.webkitSetPresentationMode&&!/iPhone|iPod/.test(navigator.userAgent)}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=y(t);if(d()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return p(this,e)});function s(){var e;u(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(h(e=a.call.apply(a,[this].concat(n))),"onReady",(function(){var t;return(t=e.props).onReady.apply(t,arguments)})),v(h(e),"onPlay",(function(){var t;return(t=e.props).onPlay.apply(t,arguments)})),v(h(e),"onBuffer",(function(){var t;return(t=e.props).onBuffer.apply(t,arguments)})),v(h(e),"onBufferEnd",(function(){var t;return(t=e.props).onBufferEnd.apply(t,arguments)})),v(h(e),"onPause",(function(){var t;return(t=e.props).onPause.apply(t,arguments)})),v(h(e),"onEnded",(function(){var t;return(t=e.props).onEnded.apply(t,arguments)})),v(h(e),"onError",(function(){var t;return(t=e.props).onError.apply(t,arguments)})),v(h(e),"onEnablePIP",(function(){var t;return(t=e.props).onEnablePIP.apply(t,arguments)})),v(h(e),"onDisablePIP",(function(t){var n=e.props,r=n.onDisablePIP,o=n.playing;r(t),o&&e.play()})),v(h(e),"onPresentationModeChange",(function(t){if(e.player&&C(e.player)){var n=e.player.webkitPresentationMode;"picture-in-picture"===n?e.onEnablePIP(t):"inline"===n&&e.onDisablePIP(t)}})),v(h(e),"onSeek",(function(t){e.props.onSeek(t.target.currentTime)})),v(h(e),"mute",(function(){e.player.muted=!0})),v(h(e),"unmute",(function(){e.player.muted=!1})),v(h(e),"renderSourceElement",(function(e,t){return"string"==typeof e?o.default.createElement("source",{key:t,src:e}):o.default.createElement("source",l({key:t},e))})),v(h(e),"renderTrack",(function(e,t){return o.default.createElement("track",l({key:t},e))})),v(h(e),"ref",(function(t){e.player&&(e.prevPlayer=e.player),e.player=t})),e}return n=s,(r=[{key:"componentDidMount",value:function(){this.addListeners(this.player),g&&this.player.load()}},{key:"componentDidUpdate",value:function(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer),this.addListeners(this.player))}},{key:"componentWillUnmount",value:function(){this.removeListeners(this.player),this.hls&&this.hls.destroy()}},{key:"addListeners",value:function(e){var t=this.props.playsinline;e.addEventListener("canplay",this.onReady),e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),t&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}},{key:"removeListeners",value:function(e){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange)}},{key:"shouldUseAudio",value:function(e){return!e.config.file.forceVideo&&!e.config.file.attributes.poster&&(w.test(e.url)||e.config.file.forceAudio)}},{key:"shouldUseHLS",value:function(e){return S.test(e)&&!g||this.props.config.file.forceHLS}},{key:"shouldUseDASH",value:function(e){return O.test(e)||this.props.config.file.forceDASH}},{key:"load",value:function(e){var t=this,n=this.props.config.file,r=n.hlsVersion,o=n.dashVersion;if(this.shouldUseHLS(e)&&(0,i.getSDK)("https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js".replace("VERSION",r),"Hls").then((function(n){t.hls=new n(t.props.config.file.hlsOptions),t.hls.on(n.Events.ERROR,(function(e,r){t.props.onError(e,r,t.hls,n)})),t.hls.loadSource(e),t.hls.attachMedia(t.player)})),this.shouldUseDASH(e)&&(0,i.getSDK)("https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js".replace("VERSION",o),"dashjs").then((function(n){t.dash=n.MediaPlayer().create(),t.dash.initialize(t.player,e,t.props.playing),t.dash.on("error",t.props.onError),t.dash.getDebug().setLogToBrowserConsole(!1)})),e instanceof Array)this.player.load();else if((0,i.isMediaStream)(e))try{this.player.srcObject=e}catch(t){this.player.src=window.URL.createObjectURL(e)}}},{key:"play",value:function(){var e=this.player.play();e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}},{key:"seekTo",value:function(e){this.player.currentTime=e}},{key:"setVolume",value:function(e){this.player.volume=e}},{key:"enablePIP",value:function(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():C(this.player)&&"picture-in-picture"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("picture-in-picture")}},{key:"disablePIP",value:function(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():C(this.player)&&"inline"!==this.player.webkitPresentationMode&&this.player.webkitSetPresentationMode("inline")}},{key:"setPlaybackRate",value:function(e){this.player.playbackRate=e}},{key:"getDuration",value:function(){if(!this.player)return null;var e=this.player,t=e.duration,n=e.seekable;return t===1/0&&n.length>0?n.end(n.length-1):t}},{key:"getCurrentTime",value:function(){return this.player?this.player.currentTime:null}},{key:"getSecondsLoaded",value:function(){if(!this.player)return null;var e=this.player.buffered;if(0===e.length)return 0;var t=e.end(e.length-1),n=this.getDuration();return t>n?n:t}},{key:"getSource",value:function(e){var t=this.shouldUseHLS(e),n=this.shouldUseDASH(e);if(!(e instanceof Array||(0,i.isMediaStream)(e)||t||n))return _.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.playing,r=e.loop,i=e.controls,a=e.muted,s=e.config,c=e.width,u=e.height,f=this.shouldUseAudio(this.props)?"audio":"video",p={width:"auto"===c?c:"100%",height:"auto"===u?u:"100%"};return o.default.createElement(f,l({ref:this.ref,src:this.getSource(t),style:p,preload:"auto",autoPlay:n||void 0,controls:i,muted:a,loop:r},s.file.attributes),t instanceof Array&&t.map(this.renderSourceElement),s.file.tracks.map(this.renderTrack))}}])&&f(n.prototype,r),s}(o.Component);t.FilePlayer=P,v(P,"displayName","FilePlayer"),v(P,"canPlay",k),v(P,"canEnablePIP",(function(e){return k(e)&&(!!document.pictureInPictureEnabled||C())&&!w.test(e)}));var j=(0,a.default)(P);t.default=j},1241:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Mixcloud=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=/mixcloud\.com\/([^/]+\/[^/]+)/,g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=y(t);if(d()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return p(this,e)});function s(){var e;u(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(h(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),v(h(e),"duration",null),v(h(e),"currentTime",null),v(h(e),"secondsLoaded",null),v(h(e),"mute",(function(){})),v(h(e),"unmute",(function(){})),v(h(e),"ref",(function(t){e.iframe=t})),e}return n=s,r=[{key:"load",value:function(e){var t=this;(0,i.getSDK)("https://widget.mixcloud.com/media/js/widgetApi.js","Mixcloud").then((function(e){t.player=e.PlayerWidget(t.iframe),t.player.ready.then((function(){t.player.events.play.on(t.props.onPlay),t.player.events.pause.on(t.props.onPause),t.player.events.ended.on(t.props.onEnded),t.player.events.error.on(t.props.error),t.player.events.progress.on((function(e,n){t.currentTime=e,t.duration=n})),t.props.onReady()}))}),this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.props,t=e.url,n=e.config,r=t.match(b)[1],a=(0,i.queryString)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.mixcloud.options,{feed:"/".concat(r,"/")}));return o.default.createElement("iframe",{key:r,ref:this.ref,style:{width:"100%",height:"100%"},src:"https://www.mixcloud.com/widget/iframe/?".concat(a),frameBorder:"0"})}}],r&&f(n.prototype,r),s}(o.Component);t.Mixcloud=g,v(g,"displayName","Mixcloud"),v(g,"canPlay",(function(e){return b.test(e)})),v(g,"loopOnEnded",!0);var w=(0,a.default)(g);t.default=w},4992:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SoundCloud=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=y(t);if(d()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return p(this,e)});function s(){var e;u(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(h(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),v(h(e),"duration",null),v(h(e),"currentTime",null),v(h(e),"fractionLoaded",null),v(h(e),"mute",(function(){e.setVolume(0)})),v(h(e),"unmute",(function(){null!==e.props.volume&&e.setVolume(e.props.volume)})),v(h(e),"ref",(function(t){e.iframe=t})),e}return n=s,r=[{key:"load",value:function(e,t){var n=this;(0,i.getSDK)("https://w.soundcloud.com/player/api.js","SC").then((function(r){if(n.iframe){var o=r.Widget.Events,i=o.PLAY,a=o.PLAY_PROGRESS,s=o.PAUSE,c=o.FINISH,u=o.ERROR;t||(n.player=r.Widget(n.iframe),n.player.bind(i,n.props.onPlay),n.player.bind(s,n.props.onPause),n.player.bind(a,(function(e){n.currentTime=e.currentPosition/1e3,n.fractionLoaded=e.loadedProgress})),n.player.bind(c,(function(){return n.props.onEnded()})),n.player.bind(u,(function(e){return n.props.onError(e)}))),n.player.load(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.props.config.soundcloud.options,{callback:function(){n.player.getDuration((function(e){n.duration=e/1e3,n.props.onReady()}))}}))}}))}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",1e3*e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.fractionLoaded*this.duration}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("iframe",{ref:this.ref,src:"https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),style:e,frameBorder:0,allow:"autoplay"})}}],r&&f(n.prototype,r),s}(o.Component);t.SoundCloud=g,v(g,"displayName","SoundCloud"),v(g,"canPlay",(function(e){return b.test(e)})),v(g,"loopOnEnded",!0);var w=(0,a.default)(g);t.default=w},5876:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Streamable=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=/streamable\.com\/([a-z0-9]+)$/,b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=d(t);if(h()){var r=d(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return f(this,e)});function s(){var e;l(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return m(p(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),m(p(e),"duration",null),m(p(e),"currentTime",null),m(p(e),"secondsLoaded",null),m(p(e),"mute",(function(){e.callPlayer("mute")})),m(p(e),"unmute",(function(){e.callPlayer("unmute")})),m(p(e),"ref",(function(t){e.iframe=t})),e}return n=s,(r=[{key:"load",value:function(e){var t=this;(0,i.getSDK)("https://cdn.embed.ly/player-0.1.0.min.js","playerjs").then((function(e){t.iframe&&(t.player=new e.Player(t.iframe),t.player.setLoop(t.props.loop),t.player.on("ready",t.props.onReady),t.player.on("play",t.props.onPlay),t.player.on("pause",t.props.onPause),t.player.on("seeked",t.props.onSeek),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",(function(e){var n=e.duration,r=e.seconds;t.duration=n,t.currentTime=r})),t.player.on("buffered",(function(e){var n=e.percent;t.duration&&(t.secondsLoaded=t.duration*n)})),t.props.muted&&t.player.mute())}),this.props.onError)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e=this.props.url.match(v)[1];return o.default.createElement("iframe",{ref:this.ref,src:"https://streamable.com/o/".concat(e),frameBorder:"0",scrolling:"no",style:{width:"100%",height:"100%"},allowFullScreen:!0})}}])&&u(n.prototype,r),s}(o.Component);t.Streamable=b,m(b,"displayName","Streamable"),m(b,"canPlay",(function(e){return v.test(e)}));var g=(0,a.default)(b);t.default=g},7964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Twitch=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,g=/(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/,w="twitch-player-",E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=y(t);if(d()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return p(this,e)});function s(){var e;u(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(h(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),v(h(e),"playerID",e.props.config.twitch.playerId||"".concat(w).concat((0,i.randomString)())),v(h(e),"mute",(function(){e.callPlayer("setMuted",!0)})),v(h(e),"unmute",(function(){e.callPlayer("setMuted",!1)})),e}return n=s,r=[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playsinline,a=r.onError,s=r.config,c=r.controls,u=g.test(e),f=u?e.match(g)[1]:e.match(b)[1];t?u?this.player.setChannel(f):this.player.setVideo("v"+f):(0,i.getSDK)("https://player.twitch.tv/js/embed/v1.js","Twitch").then((function(e){n.player=new e.Player(n.playerID,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({video:u?"":f,channel:u?f:"",height:"100%",width:"100%",playsinline:o,autoplay:n.props.playing,muted:n.props.muted,controls:!!u||c},s.twitch.options));var t=e.Player,r=t.READY,i=t.PLAYING,a=t.PAUSE,p=t.ENDED,h=t.ONLINE,d=t.OFFLINE;n.player.addEventListener(r,n.props.onReady),n.player.addEventListener(i,n.props.onPlay),n.player.addEventListener(a,n.props.onPause),n.player.addEventListener(p,n.props.onEnded),n.player.addEventListener(h,n.props.onLoaded),n.player.addEventListener(d,n.props.onLoaded)}),a)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("pause")}},{key:"seekTo",value:function(e){this.callPlayer("seek",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){return o.default.createElement("div",{style:{width:"100%",height:"100%"},id:this.playerID})}}],r&&f(n.prototype,r),s}(o.Component);t.Twitch=E,v(E,"displayName","Twitch"),v(E,"canPlay",(function(e){return b.test(e)||g.test(e)})),v(E,"loopOnEnded",!0);var S=(0,a.default)(E);t.default=S},1251:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Vimeo=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?h(e):t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t){return m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},m(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=/vimeo\.com\/.+/,g=/vimeo\.com\/external\/[0-9]+\..+/,w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=y(t);if(d()){var r=y(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return p(this,e)});function s(){var e;u(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v(h(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),v(h(e),"duration",null),v(h(e),"currentTime",null),v(h(e),"secondsLoaded",null),v(h(e),"mute",(function(){e.setVolume(0)})),v(h(e),"unmute",(function(){null!==e.props.volume&&e.setVolume(e.props.volume)})),v(h(e),"ref",(function(t){e.container=t})),e}return n=s,r=[{key:"load",value:function(e){var t=this;this.duration=null,(0,i.getSDK)("https://player.vimeo.com/api/player.js","Vimeo").then((function(n){t.container&&(t.player=new n.Player(t.container,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({url:e,autoplay:t.props.playing,muted:t.props.muted,loop:t.props.loop,playsinline:t.props.playsinline,controls:t.props.controls},t.props.config.vimeo.playerOptions)),t.player.ready().then((function(){var e=t.container.querySelector("iframe");e.style.width="100%",e.style.height="100%"})).catch(t.props.onError),t.player.on("loaded",(function(){t.props.onReady(),t.refreshDuration()})),t.player.on("play",(function(){t.props.onPlay(),t.refreshDuration()})),t.player.on("pause",t.props.onPause),t.player.on("seeked",(function(e){return t.props.onSeek(e.seconds)})),t.player.on("ended",t.props.onEnded),t.player.on("error",t.props.onError),t.player.on("timeupdate",(function(e){var n=e.seconds;t.currentTime=n})),t.player.on("progress",(function(e){var n=e.seconds;t.secondsLoaded=n})))}),this.props.onError)}},{key:"refreshDuration",value:function(){var e=this;this.player.getDuration().then((function(t){e.duration=t}))}},{key:"play",value:function(){var e=this.callPlayer("play");e&&e.catch(this.props.onError)}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.callPlayer("unload")}},{key:"seekTo",value:function(e){this.callPlayer("setCurrentTime",e)}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"getDuration",value:function(){return this.duration}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"getSecondsLoaded",value:function(){return this.secondsLoaded}},{key:"render",value:function(){var e={width:"100%",height:"100%",overflow:"hidden",display:this.props.display};return o.default.createElement("div",{key:this.props.url,ref:this.ref,style:e})}}],r&&f(n.prototype,r),s}(o.Component);t.Vimeo=w,v(w,"displayName","Vimeo"),v(w,"forceLoad",!0),v(w,"canPlay",(function(e){return!g.test(e)&&b.test(e)}));var E=(0,a.default)(w);t.default=E},2521:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Wistia=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=/(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/,w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=m(t);if(y()){var r=m(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return h(this,e)});function s(){var e;f(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return b(d(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),b(d(e),"onPlay",(function(){var t;return(t=e.props).onPlay.apply(t,arguments)})),b(d(e),"onPause",(function(){var t;return(t=e.props).onPause.apply(t,arguments)})),b(d(e),"onSeek",(function(){var t;return(t=e.props).onSeek.apply(t,arguments)})),b(d(e),"onEnded",(function(){var t;return(t=e.props).onEnded.apply(t,arguments)})),b(d(e),"mute",(function(){e.callPlayer("mute")})),b(d(e),"unmute",(function(){e.callPlayer("unmute")})),e}return n=s,(r=[{key:"getID",value:function(e){return e&&e.match(g)[1]}},{key:"load",value:function(e){var t=this,n=this.props,r=n.playing,o=n.muted,a=n.controls,s=n.onReady,c=n.config,l=n.onError;(0,i.getSDK)("https://fast.wistia.com/assets/external/E-v1.js","Wistia").then((function(){window._wq=window._wq||[],window._wq.push({id:t.getID(e),options:u({autoPlay:r,silentAutoPlay:"allow",muted:o,controlsVisibleOnLoad:a},c.wistia.options),onReady:function(e){t.player=e,t.unbind(),t.player.bind("play",t.onPlay),t.player.bind("pause",t.onPause),t.player.bind("seek",t.onSeek),t.player.bind("end",t.onEnded),s()}})}),l)}},{key:"unbind",value:function(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded)}},{key:"play",value:function(){this.callPlayer("play")}},{key:"pause",value:function(){this.callPlayer("pause")}},{key:"stop",value:function(){this.unbind(),this.callPlayer("remove")}},{key:"seekTo",value:function(e){this.callPlayer("time",e)}},{key:"setVolume",value:function(e){this.callPlayer("volume",e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("playbackRate",e)}},{key:"getDuration",value:function(){return this.callPlayer("duration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("time")}},{key:"getSecondsLoaded",value:function(){return null}},{key:"render",value:function(){var e=this.getID(this.props.url),t="wistia_embed wistia_async_".concat(e);return o.default.createElement("div",{key:e,className:t,style:{width:"100%",height:"100%"}})}}])&&p(n.prototype,r),s}(o.Component);t.Wistia=w,b(w,"displayName","Wistia"),b(w,"canPlay",(function(e){return g.test(e)})),b(w,"loopOnEnded",!0);var E=(0,a.default)(w);t.default=E},8144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.YouTube=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(3887),a=(r=n(3114))&&r.__esModule?r:{default:r};function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function c(e){return c="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},c(e)}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w=/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/,E=/list=([a-zA-Z0-9_-]+)/;function S(e){return E.test(e)?{listType:"playlist",list:(t=e.match(E),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1]}:{};var t,n}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(s,e);var t,n,r,a=(t=s,function(){var e,n=m(t);if(y()){var r=m(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return h(this,e)});function s(){var e;f(this,s);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return b(d(e=a.call.apply(a,[this].concat(n))),"callPlayer",i.callPlayer),b(d(e),"onStateChange",(function(t){var n=t.data,r=e.props,o=r.onPlay,i=r.onPause,a=r.onBuffer,s=r.onBufferEnd,c=r.onEnded,l=r.onReady,u=r.loop,f=window.YT.PlayerState,p=f.PLAYING,h=f.PAUSED,d=f.BUFFERING,y=f.ENDED,m=f.CUED;if(n===p&&(o(),s()),n===h&&i(),n===d&&a(),n===y){var v=!!e.callPlayer("getPlaylist");u&&!v&&e.play(),c()}n===m&&l()})),b(d(e),"mute",(function(){e.callPlayer("mute")})),b(d(e),"unmute",(function(){e.callPlayer("unMute")})),b(d(e),"ref",(function(t){e.container=t})),e}return n=s,(r=[{key:"load",value:function(e,t){var n=this,r=this.props,o=r.playing,a=r.muted,s=r.playsinline,c=r.controls,l=r.loop,f=r.config,p=r.onError,h=f.youtube,d=h.playerVars,y=h.embedOptions,m=e&&e.match(w)[1];if(t)return E.test(e)?void this.player.loadPlaylist(S(e)):void this.player.cueVideoById({videoId:m,startSeconds:(0,i.parseStartTime)(e)||d.start,endSeconds:(0,i.parseEndTime)(e)||d.end});(0,i.getSDK)("https://www.youtube.com/iframe_api","YT","onYouTubeIframeAPIReady",(function(e){return e.loaded})).then((function(t){n.container&&(n.player=new t.Player(n.container,u({width:"100%",height:"100%",videoId:m,playerVars:u({autoplay:o?1:0,mute:a?1:0,controls:c?1:0,start:(0,i.parseStartTime)(e),end:(0,i.parseEndTime)(e),origin:window.location.origin,playsinline:s},S(e),{},d),events:{onReady:function(){l&&n.player.setLoop(!0),n.props.onReady()},onStateChange:n.onStateChange,onError:function(e){return p(e.data)}}},y)))}),p)}},{key:"play",value:function(){this.callPlayer("playVideo")}},{key:"pause",value:function(){this.callPlayer("pauseVideo")}},{key:"stop",value:function(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}},{key:"seekTo",value:function(e){this.callPlayer("seekTo",e),this.props.playing||this.pause()}},{key:"setVolume",value:function(e){this.callPlayer("setVolume",100*e)}},{key:"setPlaybackRate",value:function(e){this.callPlayer("setPlaybackRate",e)}},{key:"setLoop",value:function(e){this.callPlayer("setLoop",e)}},{key:"getDuration",value:function(){return this.callPlayer("getDuration")}},{key:"getCurrentTime",value:function(){return this.callPlayer("getCurrentTime")}},{key:"getSecondsLoaded",value:function(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}},{key:"render",value:function(){var e={width:"100%",height:"100%",display:this.props.display};return o.default.createElement("div",{style:e},o.default.createElement("div",{ref:this.ref}))}}])&&p(n.prototype,r),s}(o.Component);t.YouTube=O,b(O,"displayName","YouTube"),b(O,"canPlay",(function(e){return w.test(e)}));var _=(0,a.default)(O);t.default=_},4985:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(8144),o=n(4992),i=n(1251),a=n(6765),s=n(5876),c=n(2521),l=n(7964),u=n(4922),f=n(1241),p=n(8450),h=[r.YouTube,o.SoundCloud,i.Vimeo,a.Facebook,s.Streamable,c.Wistia,l.Twitch,u.DailyMotion,f.Mixcloud,p.FilePlayer];t.default=h},8428:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var i,a=[],s=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(f);try{for(s.s();!(i=s.n()).done;){var c=i.value;!c.Player.canPlay(e)&&n[c.configKey].preload&&a.push(r.default.createElement(o.default,{key:c.Player.displayName,activePlayer:c.Player,url:c.url,controls:t,playing:!0,muted:!0,display:"none"}))}}catch(e){s.e(e)}finally{s.f()}return a};var r=l(n(4639)),o=l(n(9448)),i=n(8144),a=n(4992),s=n(1251),c=n(4922);function l(e){return e&&e.__esModule?e:{default:e}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var f=[{Player:i.YouTube,configKey:"youtube",url:"https://www.youtube.com/watch?v=GlCmAC4MHek"},{Player:a.SoundCloud,configKey:"soundcloud",url:"https://soundcloud.com/seucheu/john-cage-433-8-bit-version"},{Player:s.Vimeo,configKey:"vimeo",url:"https://vimeo.com/300970506"},{Player:c.DailyMotion,configKey:"dailymotion",url:"http://www.dailymotion.com/video/xqdpyk"}]},8416:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEPRECATED_CONFIG_PROPS=t.defaultProps=t.propTypes=void 0;var r,o=(r=n(3615))&&r.__esModule?r:{default:r},i=o.default.string,a=o.default.bool,s=o.default.number,c=o.default.array,l=o.default.oneOfType,u=o.default.shape,f=o.default.object,p=o.default.func,h=o.default.node,d={url:l([i,c,f]),playing:a,loop:a,controls:a,volume:s,muted:a,playbackRate:s,width:l([i,s]),height:l([i,s]),style:f,progressInterval:s,playsinline:a,pip:a,light:l([a,i]),playIcon:h,wrapper:l([i,p,u({render:p.isRequired})]),config:u({soundcloud:u({options:f,preload:a}),youtube:u({playerVars:f,embedOptions:f,preload:a}),facebook:u({appId:i,version:i,playerId:i}),dailymotion:u({params:f,preload:a}),vimeo:u({playerOptions:f,preload:a}),file:u({attributes:f,tracks:c,forceVideo:a,forceAudio:a,forceHLS:a,forceDASH:a,hlsOptions:f,hlsVersion:i,dashVersion:i}),wistia:u({options:f}),mixcloud:u({options:f}),twitch:u({options:f,playerId:i})}),onReady:p,onStart:p,onPlay:p,onPause:p,onBuffer:p,onBufferEnd:p,onEnded:p,onError:p,onDuration:p,onSeek:p,onProgress:p,onEnablePIP:p,onDisablePIP:p};t.propTypes=d,t.defaultProps={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,light:!1,wrapper:"div",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},preload:!1},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null},dailymotion:{params:{api:1,"endscreen-enable":!1},preload:!1},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},preload:!1},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,hlsOptions:{},hlsVersion:"0.13.1",dashVersion:"2.9.2"},wistia:{options:{}},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null}},onReady:function(){},onStart:function(){},onPlay:function(){},onPause:function(){},onBuffer:function(){},onBufferEnd:function(){},onEnded:function(){},onError:function(){},onDuration:function(){},onSeek:function(){},onProgress:function(){},onEnablePIP:function(){},onDisablePIP:function(){}},t.DEPRECATED_CONFIG_PROPS=["soundcloudConfig","youtubeConfig","facebookConfig","dailymotionConfig","vimeoConfig","fileConfig","wistiaConfig"]},3114:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n;return n=t=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(f,t);var n,r,c,l=(n=f,function(){var e,t=b(n);if(v()){var r=b(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return y(this,e)});function f(){var e;h(this,f);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return w(m(e=l.call.apply(l,[this].concat(n))),"config",(0,a.getConfig)(e.props,i.defaultProps,!0)),w(m(e),"getDuration",(function(){return e.player?e.player.getDuration():null})),w(m(e),"getCurrentTime",(function(){return e.player?e.player.getCurrentTime():null})),w(m(e),"getSecondsLoaded",(function(){return e.player?e.player.getSecondsLoaded():null})),w(m(e),"getInternalPlayer",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"player";return e.player?e.player.getInternalPlayer(t):null})),w(m(e),"seekTo",(function(t,n){if(!e.player)return null;e.player.seekTo(t,n)})),w(m(e),"ref",(function(t){e.player=t})),e}return r=f,(c=[{key:"shouldComponentUpdate",value:function(e){return!(0,a.isEqual)(this.props,e)}},{key:"componentDidUpdate",value:function(){this.config=(0,a.getConfig)(this.props,i.defaultProps)}},{key:"render",value:function(){var t=this.config.file,n=t.forceVideo,r=t.forceAudio,c=t.forceHLS,l=t.forceDASH,f=n||r||c||l;if(!e.canPlay(this.props.url)&&!f)return null;var h=this.props,d=h.style,y=h.width,m=h.height,v=h.wrapper,b=(0,a.omit)(this.props,E,i.DEPRECATED_CONFIG_PROPS);return o.default.createElement(v,u({style:p({},d,{width:y,height:m})},b),o.default.createElement(s.default,u({},this.props,{ref:this.ref,activePlayer:e,config:this.config})))}}])&&d(r.prototype,c),f}(o.Component),w(t,"displayName","".concat(e.displayName,"Player")),w(t,"propTypes",i.propTypes),w(t,"defaultProps",i.defaultProps),w(t,"canPlay",e.canPlay),n};var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==l(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}return n.default=e,t&&t.set(e,n),n}(n(4639)),i=n(8416),a=n(3887),s=(r=n(9448))&&r.__esModule?r:{default:r};function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function l(e){return l="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},l(e)}function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){w(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?m(e):t}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var E=Object.keys(i.propTypes)},3887:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseStartTime=function(e){return m(e,p)},t.parseEndTime=function(e){return m(e,h)},t.randomString=function(){return Math.random().toString(36).substr(2,5)},t.queryString=function(e){return Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).join("&")},t.getSDK=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.default;return window[t]&&r(window[t])?Promise.resolve(window[t]):new Promise((function(r,o){if(v[e])v[e].push({resolve:r,reject:o});else{v[e]=[{resolve:r,reject:o}];var a=function(t){v[e].forEach((function(e){return e.resolve(t)}))};if(n){var s=window[n];window[n]=function(){s&&s(),a(window[t])}}i(e,(function(r){r?(v[e].forEach((function(e){return e.reject(r)})),v[e]=null):n||a(window[t])}))}}))},t.getConfig=function(e,t,n){var r,o=(0,i.default)(t.config,e.config),s=function(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=u(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}(a.DEPRECATED_CONFIG_PROPS);try{for(s.s();!(r=s.n()).done;){var c=r.value;if(e[c]){var f=c.replace(/Config$/,"");if(o=(0,i.default)(o,l({},f,e[c])),n){var p="ReactPlayer: %c".concat(c," %cis deprecated, please use the config prop instead – ").concat("https://github.com/CookPete/react-player#config-prop");console.warn(p,"font-weight: bold","")}}}}catch(e){s.e(e)}finally{s.f()}return o},t.omit=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=(t=[]).concat.apply(t,r),a={},s=Object.keys(e),c=0,l=s;c<l.length;c++){var u=l[c];-1===i.indexOf(u)&&(a[u]=e[u])}return a},t.callPlayer=function(e){var t;if(!this.player||!this.player[e]){var n="ReactPlayer: ".concat(this.constructor.displayName," player could not call %c").concat(e,"%c – ");return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return(t=this.player)[e].apply(t,o)},t.isObject=b,t.isEqual=function e(t,n){if("function"==typeof t&&"function"==typeof n)return!0;if((0,r.isValidElement)(t)&&(0,r.isValidElement)(n))return!0;if(t instanceof Array&&n instanceof Array){if(t.length!==n.length)return!1;for(var o=0;o!==t.length;o++)if(!e(t[o],n[o]))return!1;return!0}if(b(t)&&b(n)){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(var i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];if(!e(t[s],n[s]))return!1}return!0}return t===n},t.isMediaStream=function(e){return"undefined"!=typeof window&&void 0!==window.MediaStream&&e instanceof window.MediaStream};var r=n(4639),o=s(n(1204)),i=s(n(1857)),a=n(8416);function s(e){return e&&e.__esModule?e:{default:e}}function c(e){return c="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},c(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=/[?&#](?:start|t)=([0-9hms]+)/,h=/[?&#]end=([0-9hms]+)/,d=/(\d+)(h|m|s)/g,y=/^\d+$/;function m(e,t){var n=e.match(t);if(n){var r=n[1];if(r.match(d))return function(e){for(var t,n,r=0,o=d.exec(e);null!==o;){var i=(n=3,function(e){if(Array.isArray(e))return e}(t=o)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}}(t,n)||u(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[1],s=i[2];"h"===s&&(r+=60*parseInt(a,10)*60),"m"===s&&(r+=60*parseInt(a,10)),"s"===s&&(r+=parseInt(a,10)),o=d.exec(e)}return r}(r);if(y.test(r))return parseInt(r)}}var v={};function b(e){return null!==e&&"object"===c(e)}},2529:(e,t,n)=>{"use strict";var r=n(9185),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,d=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(d){var o=h(n);o&&o!==d&&e(t,o,r)}var a=u(n);f&&(a=a.concat(f(n)));for(var s=c(t),y=c(n),m=0;m<a.length;++m){var v=a[m];if(!(i[v]||r&&r[v]||y&&y[v]||s&&s[v])){var b=p(n,v);try{l(t,v,b)}catch(e){}}}}return t}},5738:(e,t,n)=>{"use strict";var r,o=n(4639),i=(r=o)&&"object"==typeof r&&"default"in r?r.default:r;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,n){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var c,l=[];function u(){c=e(l.map((function(e){return e.props}))),f.canUseDOM?t(c):n&&(c=n(c))}var f=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o.peek=function(){return c},o.rewind=function(){if(o.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=c;return c=void 0,l=[],e};var a=o.prototype;return a.UNSAFE_componentWillMount=function(){l.push(this),u()},a.componentDidUpdate=function(){u()},a.componentWillUnmount=function(){var e=l.indexOf(this);l.splice(e,1),u()},a.render=function(){return i.createElement(r,this.props)},o}(o.PureComponent);return a(f,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),a(f,"canUseDOM",s),f}}},1031:e=>{"use strict";e.exports=function(e,t,n,r,o,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],u=0;(c=new Error(t.replace(/%s/g,(function(){return l[u++]})))).name="Invariant Violation"}throw c.framesToPop=1,c}}},8132:function(e,t,n){!function(e,t){"use strict";if(!e.setImmediate){var n,r,o,i,a,s=1,c={},l=!1,u=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(i="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){o.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,n=function(e){var t=u.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):n=function(e){setTimeout(h,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return c[s]=o,n(s),s++},f.clearImmediate=p}function p(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===n.g?this:n.g:self)},9400:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},9742:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},2989:function(e,t,n){var r;!function(o,i){"use strict";var a="function",s="undefined",c="object",l="string",u="model",f="name",p="type",h="vendor",d="version",y="architecture",m="console",v="mobile",b="tablet",g="smarttv",w="wearable",E="embedded",S="Amazon",O="Apple",_="ASUS",k="BlackBerry",C="Google",P="Huawei",j="LG",T="Microsoft",x="Motorola",R="Samsung",D="Sony",N="Xiaomi",M="Zebra",I="Facebook",A=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},L=function(e,t){return typeof e===l&&-1!==B(t).indexOf(B(e))},B=function(e){return e.toLowerCase()},F=function(e,t){if(typeof e===l)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===s?e:e.substring(0,255)},U=function(e,t){for(var n,r,o,s,l,u,f=0;f<t.length&&!l;){var p=t[f],h=t[f+1];for(n=r=0;n<p.length&&!l;)if(l=p[n++].exec(e))for(o=0;o<h.length;o++)u=l[++r],typeof(s=h[o])===c&&s.length>0?2===s.length?typeof s[1]==a?this[s[0]]=s[1].call(this,u):this[s[0]]=s[1]:3===s.length?typeof s[1]!==a||s[1].exec&&s[1].test?this[s[0]]=u?u.replace(s[1],s[2]):i:this[s[0]]=u?s[1].call(this,u,s[2]):i:4===s.length&&(this[s[0]]=u?s[3].call(this,u.replace(s[1],s[2])):i):this[s]=u||i;f+=2}},K=function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(L(t[n][r],e))return"?"===n?i:n}else if(L(t[n],e))return"?"===n?i:n;return e},q={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},V={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,d],[/opios[\/ ]+([\w\.]+)/i],[d,[f,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[d,[f,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[f,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[f,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[d,[f,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[f,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[f,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure Browser"],d],[/\bfocus\/([\w\.]+)/i],[d,[f,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[d,[f,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[f,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[f,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[d,[f,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[f,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[f,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[f,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,I],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[f,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[f,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[f,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,"Chrome WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[f,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,d],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[d,[f,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[d,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[d,K,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[f,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[f,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[f,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[y,"amd64"]],[/(ia32(?=;))/i],[[y,B]],[/((?:i[346]|x)86)[;\)]/i],[[y,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/windows (ce|mobile); ppc;/i],[[y,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[y,/ower/,"",B]],[/(sun4\w)[;\)]/i],[[y,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[y,B]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[h,R],[p,b]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[h,R],[p,v]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[h,O],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[h,O],[p,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[h,P],[p,b]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[u,[h,P],[p,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[h,N],[p,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[h,N],[p,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[h,"OPPO"],[p,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[h,"Vivo"],[p,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[h,"Realme"],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[h,x],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[h,x],[p,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[h,j],[p,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[h,j],[p,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[h,"Lenovo"],[p,b]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[h,"Nokia"],[p,v]],[/(pixel c)\b/i],[u,[h,C],[p,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[h,C],[p,v]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[h,D],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[h,D],[p,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[h,"OnePlus"],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[h,S],[p,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[h,S],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,h,[p,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[h,k],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[h,_],[p,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[h,_],[p,v]],[/(nexus 9)/i],[u,[h,"HTC"],[p,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[h,[u,/_/g," "],[p,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[h,"Acer"],[p,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[h,"Meizu"],[p,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[h,"Sharp"],[p,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,u,[p,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,u,[p,b]],[/(surface duo)/i],[u,[h,T],[p,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[h,"Fairphone"],[p,v]],[/(u304aa)/i],[u,[h,"AT&T"],[p,v]],[/\bsie-(\w*)/i],[u,[h,"Siemens"],[p,v]],[/\b(rct\w+) b/i],[u,[h,"RCA"],[p,b]],[/\b(venue[\d ]{2,7}) b/i],[u,[h,"Dell"],[p,b]],[/\b(q(?:mv|ta)\w+) b/i],[u,[h,"Verizon"],[p,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[h,"Barnes & Noble"],[p,b]],[/\b(tm\d{3}\w+) b/i],[u,[h,"NuVision"],[p,b]],[/\b(k88) b/i],[u,[h,"ZTE"],[p,b]],[/\b(nx\d{3}j) b/i],[u,[h,"ZTE"],[p,v]],[/\b(gen\d{3}) b.+49h/i],[u,[h,"Swiss"],[p,v]],[/\b(zur\d{3}) b/i],[u,[h,"Swiss"],[p,b]],[/\b((zeki)?tb.*\b) b/i],[u,[h,"Zeki"],[p,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],u,[p,b]],[/\b(ns-?\w{0,9}) b/i],[u,[h,"Insignia"],[p,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[h,"NextBook"],[p,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],u,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],u,[p,v]],[/\b(ph-1) /i],[u,[h,"Essential"],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[h,"Envizen"],[p,b]],[/\b(trio[-\w\. ]+) b/i],[u,[h,"MachSpeed"],[p,b]],[/\btu_(1491) b/i],[u,[h,"Rotor"],[p,b]],[/(shield[\w ]+) b/i],[u,[h,"Nvidia"],[p,b]],[/(sprint) (\w+)/i],[h,u,[p,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[h,T],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[h,M],[p,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[h,M],[p,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,u,[p,m]],[/droid.+; (shield) bui/i],[u,[h,"Nvidia"],[p,m]],[/(playstation [345portablevi]+)/i],[u,[h,D],[p,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[h,T],[p,m]],[/smart-tv.+(samsung)/i],[h,[p,g]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[h,R],[p,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,j],[p,g]],[/(apple) ?tv/i],[h,[u,"Apple TV"],[p,g]],[/crkey/i],[[u,"Chromecast"],[h,C],[p,g]],[/droid.+aft(\w)( bui|\))/i],[u,[h,S],[p,g]],[/\(dtv[\);].+(aquos)/i],[u,[h,"Sharp"],[p,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,F],[u,F],[p,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,g]],[/((pebble))app/i],[h,u,[p,w]],[/droid.+; (glass) \d/i],[u,[h,C],[p,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[h,M],[p,w]],[/(quest( 2)?)/i],[u,[h,I],[p,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[p,E]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[p,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,b]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[p,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[f,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[f,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[f,[d,K,q]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,"Windows"],[d,K,q]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[d,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,d],[/\(bb(10);/i],[d,[f,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[f,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[f,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[f,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[f,"Chromium OS"],d],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,d],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[f,d]]},z=function(e,t){if(typeof e===c&&(t=e,e=i),!(this instanceof z))return new z(e,t).getResult();var n=e||(typeof o!==s&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),r=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(V,t):V;return this.getBrowser=function(){var e,t={};return t.name=i,t.version=i,U.call(t,n,r.browser),t.major=typeof(e=t.version)===l?e.replace(/[^\d\.]/g,"").split(".")[0]:i,t},this.getCPU=function(){var e={};return e.architecture=i,U.call(e,n,r.cpu),e},this.getDevice=function(){var e={};return e.vendor=i,e.model=i,e.type=i,U.call(e,n,r.device),e},this.getEngine=function(){var e={};return e.name=i,e.version=i,U.call(e,n,r.engine),e},this.getOS=function(){var e={};return e.name=i,e.version=i,U.call(e,n,r.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===l&&e.length>255?F(e,255):e,this},this.setUA(n),this};z.VERSION="0.7.31",z.BROWSER=A([f,d,"major"]),z.CPU=A([y]),z.DEVICE=A([u,h,p,m,v,g,b,w,E]),z.ENGINE=z.OS=A([f,d]),typeof t!==s?(e.exports&&(t=e.exports=z),t.UAParser=z):n.amdO?(r=function(){return z}.call(t,n,t,e))===i||(e.exports=r):typeof o!==s&&(o.UAParser=z);var W=typeof o!==s&&(o.jQuery||o.Zepto);if(W&&!W.ua){var H=new z;W.ua=H.getResult(),W.ua.get=function(){return H.getUA()},W.ua.set=function(e){H.setUA(e);var t=H.getResult();for(var n in t)W.ua[n]=t[n]}}}("object"==typeof window?window:this)},4639:t=>{"use strict";t.exports=e},1346:e=>{"use strict";e.exports=t}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e].call(i.exports,i,i.exports,o),i.exports}o.amdO={},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";o.r(i),o.d(i,{AssetProjectEditor:()=>OD,AssetView:()=>Ck,CourseView:()=>UP,DashboardApp:()=>hc,DiscussionApp:()=>Qg,Enums:()=>a,ExploreApp:()=>JS,InfiniteScrollGalleryContainer:()=>tc,MultiSelectEditor:()=>Di,PlaylistPlayer:()=>nj,PlaylistView:()=>MC,PortfolioView:()=>y_,ProfileApp:()=>US,ProfileAvatarEditor:()=>FD,ProfileRenameInput:()=>RD,ProjectEditor:()=>WR,QuickSearch:()=>ge,Resources:()=>r,SearchApp:()=>Pr,ShareApp:()=>$S,SimpleGalleryView:()=>pw,TrainingView:()=>R_,WatchApp:()=>vE});const e=new(o(9895).Z)({en:{BasicTraining:"Basic Training",Captions:"Caption Languages",Categories:"Categories",Category:"Category",CourseFiles:"Course Files",CoursePlayButton:{StartTheCourse:"Start the Course",WatchAgain:"Watch Again",ContinueWatching:"Continue Watching"},Current:"Current",Discussion:"Discussion",Docs:"Docs",Experience:{Beginner:"Beginner",Intermediate:"Intermediate",Advanced:"Advanced",All:"All Skill Levels"},Files:"Files",Instructor:"Instructor",Instructors:"Instructors",Learn:"Learn",Length:"Length",Level:"Level",Overview:"Overview",Products:"Products",ShowMore:"Show More",Tags:"Tags",Tutorials:"Tutorials",VersionRequired:"Version Required",Video:"Video",Videos:"Videos"},ja:{BasicTraining:"ベーシックトレーニング",Categories:"カテゴリー",Category:"カテゴリー",CourseFiles:"学習用ファイル",CoursePlayButton:{StartTheCourse:"コースを開始",WatchAgain:"もう一度観ます",ContinueWatching:"見続けます"},Current:"現在",Discussion:"ディスカッション",Docs:"ドキュメント",Experience:{Beginner:"初級",Intermediate:"中級",Advanced:"上級"},Instructor:"インストラクター",Learn:"学びましょう",Length:"長さ",Level:"レベル",Overview:"概要",Products:"製品",ShowMore:"さらに表示する",Tags:"タグ",Tutorials:"チュートリアル",Video:"ビデオ",Videos:"ビデオ"},ko:{BasicTraining:"기본 교육",Categories:"카테고리",Category:"카테고리",CourseFiles:"코스 파일",CoursePlayButton:{StartTheCourse:"코스 시작하기",WatchAgain:"다시보기",ContinueWatching:"보고 계속"},Current:"현재",Discussion:"토론하기",Docs:"문서",Experience:{Beginner:"초급",Intermediate:"중급",Advanced:"고급"},Instructor:"강사",Learn:"학습하기",Length:"길이",Level:"레벨",Overview:"개요",Products:"프로덕트",ShowMore:"더 보기",Tags:"태그",Tutorials:"튜토리얼",Video:"비디오",Videos:"비디오"},zh:{BasicTraining:"基础训练",Categories:"分类",Category:"类别",CourseFiles:"课程文件",CoursePlayButton:{StartTheCourse:"开始课程",WatchAgain:"再次在手表",ContinueWatching:"继续观看"},Current:"当前",Discussion:"讨论",Docs:"文件",Experience:{Beginner:"初学者",Intermediate:"中间",Advanced:"高级"},Instructor:"讲师",Learn:"学习",Length:"长度",Level:"水平",Overview:"概观",Products:"制品",ShowMore:"展示更多",Tags:"标签",Tutorials:"教程",Video:"视频",Videos:"影片"}});function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,r;return n=e,r=[{key:"setLanguage",value:function(e){null===e&&(e="en"),this.language=e,this.UI.setLanguage(e)}},{key:"getLanguage",value:function(){return this.language}}],null&&t(n.prototype,null),r&&t(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e.UI=n}(n,"UI",e);const r=n,a={ProjectTypes:{Portfolio:3,Training:4,Asset:1,Extension:2},NotificationPeriod:{None:0,BookmarkOnly:10,OncePerView:50,AllUpdates:100},LoadStatus:{PreLoad:"PreLoad",Loading:"Loading",Loaded:"Loaded",Error:"Error"},ConsumerTypes:{Collection:"collections",Project:"projects"}};var s=o(4639),c=o.n(s),l=o(8389),u=o.n(l),f=o(3615),p=o.n(f),h=o(1346),d=o.n(h),y=!("undefined"==typeof window||!window.document||!window.document.createElement),m=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var g=function(e){function t(){return v(this,t),b(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),m(t,[{key:"componentWillUnmount",value:function(){this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null}},{key:"render",value:function(){return y?(this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode)),d().createPortal(this.props.children,this.props.node||this.defaultNode)):null}}]),t}(c().Component);g.propTypes={children:p().node.isRequired,node:p().any};const w=g;var E=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var _=function(e){function t(){return S(this,t),O(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),E(t,[{key:"componentDidMount",value:function(){this.renderPortal()}},{key:"componentDidUpdate",value:function(e){this.renderPortal()}},{key:"componentWillUnmount",value:function(){d().unmountComponentAtNode(this.defaultNode||this.props.node),this.defaultNode&&document.body.removeChild(this.defaultNode),this.defaultNode=null,this.portal=null}},{key:"renderPortal",value:function(e){this.props.node||this.defaultNode||(this.defaultNode=document.createElement("div"),document.body.appendChild(this.defaultNode));var t=this.props.children;"function"==typeof this.props.children.type&&(t=c().cloneElement(this.props.children)),this.portal=d().unstable_renderSubtreeIntoContainer(this,t,this.props.node||this.defaultNode)}},{key:"render",value:function(){return null}}]),t}(c().Component);const k=_;_.propTypes={children:p().node.isRequired,node:p().any};const C=d().createPortal?w:k;var P=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),j=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.portalNode=null,n.state={active:!!e.defaultOpen},n.openPortal=n.openPortal.bind(n),n.closePortal=n.closePortal.bind(n),n.wrapWithPortal=n.wrapWithPortal.bind(n),n.handleOutsideMouseClick=n.handleOutsideMouseClick.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),P(t,[{key:"componentDidMount",value:function(){this.props.closeOnEsc&&document.addEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.addEventListener("click",this.handleOutsideMouseClick)}},{key:"componentWillUnmount",value:function(){this.props.closeOnEsc&&document.removeEventListener("keydown",this.handleKeydown),this.props.closeOnOutsideClick&&document.removeEventListener("click",this.handleOutsideMouseClick)}},{key:"openPortal",value:function(e){this.state.active||(e&&e.nativeEvent&&e.nativeEvent.stopImmediatePropagation(),this.setState({active:!0},this.props.onOpen))}},{key:"closePortal",value:function(){this.state.active&&this.setState({active:!1},this.props.onClose)}},{key:"wrapWithPortal",value:function(e){var t=this;return this.state.active?c().createElement(C,{node:this.props.node,key:"react-portal",ref:function(e){return t.portalNode=e}},e):null}},{key:"handleOutsideMouseClick",value:function(e){if(this.state.active){var t=this.portalNode&&(this.portalNode.props.node||this.portalNode.defaultNode);!t||t.contains(e.target)||e.button&&0!==e.button||this.closePortal()}}},{key:"handleKeydown",value:function(e){27===e.keyCode&&this.state.active&&this.closePortal()}},{key:"render",value:function(){return this.props.children({openPortal:this.openPortal,closePortal:this.closePortal,portal:this.wrapWithPortal,isOpen:this.state.active})}}]),t}(c().Component);j.propTypes={children:p().func.isRequired,defaultOpen:p().bool,node:p().any,closeOnEsc:p().bool,closeOnOutsideClick:p().bool,onOpen:p().func,onClose:p().func},j.defaultProps={onOpen:function(){},onClose:function(){}};const T=j;function x(e){return x="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},x(e)}function R(){return R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(this,arguments)}function D(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function N(e,t){return N=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},N(e,t)}function M(e,t){if(t&&("object"===x(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return I(e)}function I(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}var L=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=A(r);if(o){var n=A(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return M(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleOverlayClick=t.handleOverlayClick.bind(I(t)),t.handleCloseClick=t.handleCloseClick.bind(I(t)),t.handlePortalClose=t.handlePortalClose.bind(I(t)),t.preventClose=t.preventClose.bind(I(t)),t}return t=a,(n=[{key:"componentDidMount",value:function(){this.windowScrollTop=$(window).scrollTop();var e=-1*this.windowScrollTop+"px",t=$("body");this.bodyStyle=t.attr("style"),$("body").attr("style","position: fixed; width: 100%; top: "+e)}},{key:"componentWillUnmount",value:function(){$("body").removeAttr("style"),$(window).scrollTop(this.windowScrollTop)}},{key:"handleOverlayClick",value:function(e){e.stopPropagation(),!0===this.props.closeOnOutsideClick&&(this.isClosed=!0,this.props.onClose&&this.props.onClose())}},{key:"handleCloseClick",value:function(e){e.stopPropagation(),this.isClosed=!0,this.props.onClose&&this.props.onClose()}},{key:"handlePortalClose",value:function(){this.props.closeOnEsc&&this.props.onClose&&!this.isClosed&&this.props.onClose()}},{key:"preventClose",value:function(e){e.stopPropagation()}},{key:"render",value:function(){var e="tf-overlay-content ".concat(this.props.contentClass?this.props.contentClass:""),t=null;this.props.overlayStyle&&(t={style:this.props.overlayStyle});var n=null;this.props.containerStyle&&(n={style:this.props.containerStyle});var r=null;this.props.contentStyle&&(r={style:this.props.contentStyle});var o=this;return c().createElement(T,{closeOnEsc:this.props.closeOnEsc,onClose:this.handlePortalClose,defaultOpen:!0},(function(i){i.openPortal;var a=i.closePortal,s=(i.isOpen,i.portal);return c().createElement(c().Fragment,null,s(c().createElement("div",R({className:"tf-overlay",onClick:o.handleOverlayClick},t),c().createElement("div",R({className:"tf-overlay-container",onClick:o.handleOverlayClick},n),c().createElement("div",{className:"close"},1==o.props.closeOnEsc&&c().createElement("span",{className:"close-hint"},"hit ",c().createElement("span",{className:"key"},"ESC")," to close"),o.props.showClose&&c().createElement("button",{type:"button",className:"close light",onClick:a},c().createElement("i",{className:"glyphicon glyphicon-remove"}))),c().createElement("div",R({className:e,onClick:o.preventClose},r),o.props.children)))))}))}}])&&D(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);L.propTypes={showClose:p().bool,closeOnEsc:p().bool,closeOnOutsideClick:p().bool,onClose:p().func,contentStyle:p().object,contentClass:p().string},L.defaultProps={showClose:!1,closeOnEsc:!1,closeOnOutsideClick:!1};const B=L;function F(e){return F="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},F(e)}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function q(e,t,n){return t&&K(e.prototype,t),n&&K(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function V(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z(e,t)}function z(e,t){return z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},z(e,t)}function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=G(e);if(t){var o=G(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return H(this,n)}}function H(e,t){if(t&&("object"===F(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return J(e)}function J(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}var Q=function(e){V(n,e);var t=W(n);function n(e){var r;return U(this,n),(r=t.call(this,e)).getValues=r.getValues.bind(J(r)),r.handleClick=r.handleClick.bind(J(r)),r.selected=r.props.selected?r.props.selected:[],r}return q(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.selected=e.selected?e.selected:[]}},{key:"getValues",value:function(){return this.selected.length>0?this.selected:null}},{key:"handleClick",value:function(e,t){if(1==t)this.selected.push(this.props.options[e].value);else{var n=this.selected.indexOf(this.props.options[e].value);n>-1&&this.selected.splice(n,1)}this.props.onChange&&this.props.onChange(this.selected)}},{key:"render",value:function(){var e=this,t=this.props.options.map((function(t,n){var r=e.selected.indexOf(t.value);return c().createElement(Y,{key:n,text:t.text,value:t.value,toggled:-1!=r,onClick:e.handleClick.bind(null,n)})}));return c().createElement("div",{className:this.props.className},t)}}]),n}(c().Component);Q.defaultProps={className:"toggle-button-group"};var Y=function(e){V(n,e);var t=W(n);function n(e){var r;return U(this,n),(r=t.call(this,e)).getValue=r.getValue.bind(J(r)),r.handleClick=r.handleClick.bind(J(r)),r.state={toggled:!0===r.props.toggled},r}return q(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.toggled!=this.state.toggled&&this.setState({toggled:e.toggled})}},{key:"getValue",value:function(){return this.state.toggled}},{key:"handleClick",value:function(){var e=this,t=!this.state.toggled;this.setState({toggled:t},(function(){e.props.onClick&&e.props.onClick(t)}))}},{key:"render",value:function(){var e=1==this.state.toggled?"btn-primary":"";return c().createElement("button",{type:"button",value:this.props.value,onClick:this.handleClick,className:e},this.props.text)}}]),n}(c().Component);const X=Q;function Z(e){return Z="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},Z(e)}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t){return te=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},te(e,t)}function ne(e,t){if(t&&("object"===Z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return re(e)}function re(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oe(e){return oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},oe(e)}const ie=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&te(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=oe(r);if(o){var n=oe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ne(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleProductsToggle=t.handleProductsToggle.bind(re(t)),t.products=null,t.productOptions=[{text:"Nuke",value:"Nuke"},{text:"Hiero",value:"Hiero"},{text:"Katana",value:"Katana"},{text:"Modo",value:"Modo"},{text:"Mari",value:"Mari"},{text:"Cara VR",value:"CaraVR"},{text:"Colorway",value:"Colorway"},{text:"Flix",value:"Flix"}],t}return t=a,(n=[{key:"handleProductsToggle",value:function(e){this.props.onChange&&this.props.onChange(e)}},{key:"render",value:function(){return c().createElement(X,{ref:"products",className:this.props.className,selected:this.props.selected,options:this.productOptions,onChange:this.handleProductsToggle})}}])&&ee(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function ae(e){return ae="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},ae(e)}function se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function le(e,t){return le=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},le(e,t)}function ue(e,t){if(t&&("object"===ae(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function fe(e){return fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},fe(e)}const pe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&le(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=fe(r);if(o){var n=fe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ue(this,e)});function a(){return se(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"search-cta"},c().createElement("span",{className:"hint hint-submit"},"hit ",c().createElement("span",{className:"key"},"ENTER")," to "),c().createElement("a",{href:"#",onClick:this.props.onSearch,className:"search-submit"},"see all results"))}}])&&ce(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function he(e){return he="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},he(e)}function de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ye(e,t){return ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ye(e,t)}function me(e,t){if(t&&("object"===he(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ve(e)}function ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function be(e){return be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},be(e)}const ge=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ye(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=be(r);if(o){var n=be(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return me(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).state={results:[],showSearch:!1,allowQuery:!1},t.query="",t.products=null,t.handleKeyDown=t.handleKeyDown.bind(ve(t)),t.handleKeyUp=t.handleKeyUp.bind(ve(t)),t.handleProductsToggle=t.handleProductsToggle.bind(ve(t)),t.doQuery=t.doQuery.bind(ve(t)),t.onSearchClick=t.onSearchClick.bind(ve(t)),t.onSearchClose=t.onSearchClose.bind(ve(t)),t.searchSubmit=t.searchSubmit.bind(ve(t)),t.fullSearch=t.fullSearch.bind(ve(t)),t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.doQuery=u()(this.doQuery,500)}},{key:"handleKeyDown",value:function(e){13==e.keyCode&&(e.preventDefault(),this.fullSearch())}},{key:"handleKeyUp",value:function(e){var t=this.refs.input.value;if(t!=this.query){if(this.query=t,0==t.length&&this.state.results.length>0)return void this.setState({results:[]});this.query.length>=3?this.setState({allowQuery:!0},(function(){this.doQuery()})):this.setState({allowQuery:!1})}}},{key:"handleProductsToggle",value:function(e){this.products=e,this.state.allowQuery&&this.doQuery()}},{key:"doQuery",value:function(){if(!(this.query.length<3)){var e={query:this.query,products:this.products,count:10};$.ajax({type:"POST",url:"/api/search/hints",contentType:"application/json; charset=utf-8",data:JSON.stringify(e),dataType:"json",context:this}).then((function(e){null!=e&&0!=e.length&&this.setState({results:e})}))}}},{key:"onSearchClick",value:function(e){e.preventDefault(),this.setState({showSearch:!0},(function(){this.refs.input.focus()}))}},{key:"onSearchClose",value:function(e){this.setState({showSearch:!1})}},{key:"searchSubmit",value:function(e){e.preventDefault(),this.fullSearch()}},{key:"fullSearch",value:function(){var e=TFWeb.Resources.getLanguage(),t="/search?q=".concat(encodeURIComponent(this.refs.input.value)).concat(null!=this.products&&this.products.length>0?"&products="+this.products.toString():"");e&&"en"!=e&&(t="/".concat(e).concat(t)),window.location.href=t}},{key:"render",value:function(){var e=this.state.results.map((function(e,t){var n=null;e.thumbUrl&&(n=c().createElement("a",{href:e.url,className:"thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var r=[];return r.push(c().createElement("li",{key:"t"},e.type)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){r.push(c().createElement("li",{key:t,className:"product"},e))})),c().createElement("li",{key:t},n,c().createElement("a",{className:"title",href:e.url},e.title,e.path&&c().createElement("span",null,e.path)),null!=r&&r.length>0&&c().createElement("ul",null,r))}));return c().createElement("a",{href:"#",className:"nav-link nav-link--search--local nav-link--icon",onClick:this.onSearchClick},c().createElement("span",{className:"nav-link__title"},"Search"),1==this.state.showSearch&&c().createElement(B,{closeOnEsc:!0,closeOnOutsideClick:!1,showClose:!0,onClose:this.onSearchClose,containerStyle:{padding:"0"},contentStyle:{width:"100%"}},c().createElement("div",{className:"search-control"},c().createElement("input",{ref:"input",onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,type:"text",placeholder:"Ask me anything...",className:"form-control"}),c().createElement(ie,{ref:"products",className:"search-product-filter",selected:this.products,onChange:this.handleProductsToggle}),this.state.allowQuery&&c().createElement(pe,{onSearch:this.searchSubmit}),null!=e&&e.length>0&&c().createElement("ol",{className:"quicksearch-results"},e),this.state.allowQuery&&this.state.results&&this.state.results.length>0&&c().createElement("div",{className:"search-submit"},c().createElement("a",{href:"#",onClick:this.searchSubmit},"see all results")))))}}])&&de(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function we(e,t){return we=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},we(e,t)}function Ee(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,we(e,t)}function Se(){return Se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Se.apply(this,arguments)}function Oe(e){return"/"===e.charAt(0)}function _e(e,t){for(var n=t,r=n+1,o=e.length;r<o;n+=1,r+=1)e[n]=e[r];e.pop()}function ke(e,t){if(!e)throw new Error("Invariant failed")}function Ce(e){return"/"===e.charAt(0)?e:"/"+e}function Pe(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function je(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function Te(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function xe(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=Se({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],o=t&&t.split("/")||[],i=e&&Oe(e),a=t&&Oe(t),s=i||a;if(e&&Oe(e)?o=r:r.length&&(o.pop(),o=o.concat(r)),!o.length)return"/";if(o.length){var c=o[o.length-1];n="."===c||".."===c||""===c}else n=!1;for(var l=0,u=o.length;u>=0;u--){var f=o[u];"."===f?_e(o,u):".."===f?(_e(o,u),l++):l&&(_e(o,u),l--)}if(!s)for(;l--;l)o.unshift("..");!s||""===o[0]||o[0]&&Oe(o[0])||o.unshift("");var p=o.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p}(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function Re(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var De=!("undefined"==typeof window||!window.document||!window.document.createElement);function Ne(e,t){t(window.confirm(e))}var Me="popstate",Ie="hashchange";function Ae(){try{return window.history.state||{}}catch(e){return{}}}function Le(e){void 0===e&&(e={}),De||ke(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),i=e,a=i.forceRefresh,s=void 0!==a&&a,c=i.getUserConfirmation,l=void 0===c?Ne:c,u=i.keyLength,f=void 0===u?6:u,p=e.basename?je(Ce(e.basename)):"";function h(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return p&&(i=Pe(i,p)),xe(i,r,n)}function d(){return Math.random().toString(36).substr(2,f)}var y=Re();function m(e){Se(j,e),j.length=n.length,y.notifyListeners(j.location,j.action)}function v(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||w(h(e.state))}function b(){w(h(Ae()))}var g=!1;function w(e){g?(g=!1,m()):y.confirmTransitionTo(e,"POP",l,(function(t){t?m({action:"POP",location:e}):function(e){var t=j.location,n=S.indexOf(t.key);-1===n&&(n=0);var r=S.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(g=!0,_(o))}(e)}))}var E=h(Ae()),S=[E.key];function O(e){return p+Te(e)}function _(e){n.go(e)}var k=0;function C(e){1===(k+=e)&&1===e?(window.addEventListener(Me,v),o&&window.addEventListener(Ie,b)):0===k&&(window.removeEventListener(Me,v),o&&window.removeEventListener(Ie,b))}var P=!1,j={length:n.length,action:"POP",location:E,createHref:O,push:function(e,t){var o="PUSH",i=xe(e,t,d(),j.location);y.confirmTransitionTo(i,o,l,(function(e){if(e){var t=O(i),a=i.key,c=i.state;if(r)if(n.pushState({key:a,state:c},null,t),s)window.location.href=t;else{var l=S.indexOf(j.location.key),u=S.slice(0,l+1);u.push(i.key),S=u,m({action:o,location:i})}else window.location.href=t}}))},replace:function(e,t){var o="REPLACE",i=xe(e,t,d(),j.location);y.confirmTransitionTo(i,o,l,(function(e){if(e){var t=O(i),a=i.key,c=i.state;if(r)if(n.replaceState({key:a,state:c},null,t),s)window.location.replace(t);else{var l=S.indexOf(j.location.key);-1!==l&&(S[l]=i.key),m({action:o,location:i})}else window.location.replace(t)}}))},go:_,goBack:function(){_(-1)},goForward:function(){_(1)},block:function(e){void 0===e&&(e=!1);var t=y.setPrompt(e);return P||(C(1),P=!0),function(){return P&&(P=!1,C(-1)),t()}},listen:function(e){var t=y.appendListener(e);return C(1),function(){C(-1),t()}}};return j}var Be=1073741823,Fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==o.g?o.g:{};function Ue(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}const Ke=c().createContext||function(e,t){var n,r,o,i="__create-react-context-"+((Fe[o="__global_unique_id__"]=(Fe[o]||0)+1)+"__"),a=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=Ue(t.props.value),t}Ee(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[i]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((i=r)===(a=o)?0!==i||1/i==1/a:i!=i&&a!=a)?n=0:(n="function"==typeof t?t(r,o):Be,0!=(n|=0)&&this.emitter.set(e.value,n))}var i,a},r.render=function(){return this.props.children},n}(s.Component);a.childContextTypes=((n={})[i]=p().object.isRequired,n);var c=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}Ee(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?Be:t},r.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?Be:e},r.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},r.getValue=function(){return this.context[i]?this.context[i].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(s.Component);return c.contextTypes=((r={})[i]=p().object,r),{Provider:a,Consumer:c}};var qe=o(405),Ve=o.n(qe);function ze(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}o(9185);var We=o(2529),He=o.n(We),$e=function(e){var t=Ke();return t.displayName=e,t},Je=$e("Router-History"),Ge=$e("Router"),Qe=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Ee(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return c().createElement(Ge.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},c().createElement(Je.Provider,{children:this.props.children||null,value:this.props.history}))},t}(c().Component);c().Component,c().Component;var Ye={},Xe=0;function Ze(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,o=n.exact,i=void 0!==o&&o,a=n.strict,s=void 0!==a&&a,c=n.sensitive,l=void 0!==c&&c;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=Ye[n]||(Ye[n]={});if(r[e])return r[e];var o=[],i={regexp:Ve()(e,o,t),keys:o};return Xe<1e4&&(r[e]=i,Xe++),i}(n,{end:i,strict:s,sensitive:l}),o=r.regexp,a=r.keys,c=o.exec(e);if(!c)return null;var u=c[0],f=c.slice(1),p=e===u;return i&&!p?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:p,params:a.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var et=function(e){function t(){return e.apply(this,arguments)||this}return Ee(t,e),t.prototype.render=function(){var e=this;return c().createElement(Ge.Consumer,null,(function(t){t||ke(!1);var n=e.props.location||t.location,r=Se({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?Ze(n.pathname,e.props):t.match}),o=e.props,i=o.children,a=o.component,s=o.render;return Array.isArray(i)&&function(e){return 0===c().Children.count(e)}(i)&&(i=null),c().createElement(Ge.Provider,{value:r},r.match?i?"function"==typeof i?i(r):i:a?c().createElement(a,r):s?s(r):null:"function"==typeof i?i(r):null)}))},t}(c().Component);c().Component;var tt=function(e){function t(){return e.apply(this,arguments)||this}return Ee(t,e),t.prototype.render=function(){var e=this;return c().createElement(Ge.Consumer,null,(function(t){t||ke(!1);var n,r,o=e.props.location||t.location;return c().Children.forEach(e.props.children,(function(e){if(null==r&&c().isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?Ze(o.pathname,Se({},e.props,{path:i})):t.match}})),r?c().cloneElement(n,{location:o,computedMatch:r}):null}))},t}(c().Component);function nt(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=ze(t,["wrappedComponentRef"]);return c().createElement(Ge.Consumer,null,(function(t){return t||ke(!1),c().createElement(e,Se({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,He()(n,e)}c().useContext;var rt=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).history=Le(t.props),t}return Ee(t,e),t.prototype.render=function(){return c().createElement(Qe,{history:this.history,children:this.props.children})},t}(c().Component);c().Component;var ot=function(e,t){return"function"==typeof e?e(t):e},it=function(e,t){return"string"==typeof e?xe(e,null,null,t):e},at=function(e){return e},st=c().forwardRef;void 0===st&&(st=at);var ct=st((function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=ze(e,["innerRef","navigate","onClick"]),a=i.target,s=Se({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||a&&"_self"!==a||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return s.ref=at!==st&&t||n,c().createElement("a",s)})),lt=st((function(e,t){var n=e.component,r=void 0===n?ct:n,o=e.replace,i=e.to,a=e.innerRef,s=ze(e,["component","replace","to","innerRef"]);return c().createElement(Ge.Consumer,null,(function(e){e||ke(!1);var n=e.history,l=it(ot(i,e.location),e.location),u=l?n.createHref(l):"",f=Se({},s,{href:u,navigate:function(){var t=ot(i,e.location),r=Te(e.location)===Te(it(t));(o||r?n.replace:n.push)(t)}});return at!==st?f.ref=t||a:f.innerRef=a,c().createElement(r,f)}))})),ut=function(e){return e},ft=c().forwardRef;void 0===ft&&(ft=ut);var pt,ht,dt,yt,mt=ft((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,i=void 0===o?"active":o,a=e.activeStyle,s=e.className,l=e.exact,u=e.isActive,f=e.location,p=e.sensitive,h=e.strict,d=e.style,y=e.to,m=e.innerRef,v=ze(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return c().createElement(Ge.Consumer,null,(function(e){e||ke(!1);var n=f||e.location,o=it(ot(y,n),n),b=o.pathname,g=b&&b.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),w=g?Ze(n.pathname,{path:g,exact:l,sensitive:p,strict:h}):null,E=!!(u?u(w,n):w),S="function"==typeof s?s(E):s,O="function"==typeof d?d(E):d;E&&(S=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(S,i),O=Se({},O,a));var _=Se({"aria-current":E&&r||null,className:S,style:O,to:o},v);return ut!==ft?_.ref=t||m:_.innerRef=m,c().createElement(lt,_)}))})),vt=o(5738),bt=o.n(vt),gt=o(4335),wt=o.n(gt),Et=o(2468),St=o.n(Et),Ot="bodyAttributes",_t="htmlAttributes",kt={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},Ct=(Object.keys(kt).map((function(e){return kt[e]})),"charset"),Pt="cssText",jt="href",Tt="innerHTML",xt="itemprop",Rt="rel",Dt={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Nt=Object.keys(Dt).reduce((function(e,t){return e[Dt[t]]=t,e}),{}),Mt=[kt.NOSCRIPT,kt.SCRIPT,kt.STYLE],It="data-react-helmet",At="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},Lt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Bt=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ut=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},Kt=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},qt=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!1===t?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")},Vt=function(e){var t=Jt(e,kt.TITLE),n=Jt(e,"titleTemplate");if(n&&t)return n.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var r=Jt(e,"defaultTitle");return t||r||void 0},zt=function(e){return Jt(e,"onChangeClientState")||function(){}},Wt=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return Ft({},e,t)}),{})},Ht=function(e,t){return t.filter((function(e){return void 0!==e[kt.BASE]})).map((function(e){return e[kt.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),o=0;o<r.length;o++){var i=r[o].toLowerCase();if(-1!==e.indexOf(i)&&n[i])return t.concat(n)}return t}),[])},$t=function(e,t,n){var r={};return n.filter((function(t){return!!Array.isArray(t[e])||(void 0!==t[e]&&Zt("Helmet: "+e+' should be of type "Array". Instead found type "'+At(t[e])+'"'),!1)})).map((function(t){return t[e]})).reverse().reduce((function(e,n){var o={};n.filter((function(e){for(var n=void 0,i=Object.keys(e),a=0;a<i.length;a++){var s=i[a],c=s.toLowerCase();-1===t.indexOf(c)||n===Rt&&"canonical"===e[n].toLowerCase()||c===Rt&&"stylesheet"===e[c].toLowerCase()||(n=c),-1===t.indexOf(s)||s!==Tt&&s!==Pt&&s!==xt||(n=s)}if(!n||!e[n])return!1;var l=e[n].toLowerCase();return r[n]||(r[n]={}),o[n]||(o[n]={}),!r[n][l]&&(o[n][l]=!0,!0)})).reverse().forEach((function(t){return e.push(t)}));for(var i=Object.keys(o),a=0;a<i.length;a++){var s=i[a],c=St()({},r[s],o[s]);r[s]=c}return e}),[]).reverse()},Jt=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},Gt=(pt=Date.now(),function(e){var t=Date.now();t-pt>16?(pt=t,e(t)):setTimeout((function(){Gt(e)}),0)}),Qt=function(e){return clearTimeout(e)},Yt="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Gt:o.g.requestAnimationFrame||Gt,Xt="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Qt:o.g.cancelAnimationFrame||Qt,Zt=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},en=null,tn=function(e,t){var n=e.baseTag,r=e.bodyAttributes,o=e.htmlAttributes,i=e.linkTags,a=e.metaTags,s=e.noscriptTags,c=e.onChangeClientState,l=e.scriptTags,u=e.styleTags,f=e.title,p=e.titleAttributes;on(kt.BODY,r),on(kt.HTML,o),rn(f,p);var h={baseTag:an(kt.BASE,n),linkTags:an(kt.LINK,i),metaTags:an(kt.META,a),noscriptTags:an(kt.NOSCRIPT,s),scriptTags:an(kt.SCRIPT,l),styleTags:an(kt.STYLE,u)},d={},y={};Object.keys(h).forEach((function(e){var t=h[e],n=t.newTags,r=t.oldTags;n.length&&(d[e]=n),r.length&&(y[e]=h[e].oldTags)})),t&&t(),c(e,d,y)},nn=function(e){return Array.isArray(e)?e.join(""):e},rn=function(e,t){void 0!==e&&document.title!==e&&(document.title=nn(e)),on(kt.TITLE,t)},on=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(It),o=r?r.split(","):[],i=[].concat(o),a=Object.keys(t),s=0;s<a.length;s++){var c=a[s],l=t[c]||"";n.getAttribute(c)!==l&&n.setAttribute(c,l),-1===o.indexOf(c)&&o.push(c);var u=i.indexOf(c);-1!==u&&i.splice(u,1)}for(var f=i.length-1;f>=0;f--)n.removeAttribute(i[f]);o.length===i.length?n.removeAttribute(It):n.getAttribute(It)!==a.join(",")&&n.setAttribute(It,a.join(","))}},an=function(e,t){var n=document.head||document.querySelector(kt.HEAD),r=n.querySelectorAll(e+"[data-react-helmet]"),o=Array.prototype.slice.call(r),i=[],a=void 0;return t&&t.length&&t.forEach((function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===Tt)n.innerHTML=t.innerHTML;else if(r===Pt)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var s=void 0===t[r]?"":t[r];n.setAttribute(r,s)}n.setAttribute(It,"true"),o.some((function(e,t){return a=t,n.isEqualNode(e)}))?o.splice(a,1):i.push(n)})),o.forEach((function(e){return e.parentNode.removeChild(e)})),i.forEach((function(e){return n.appendChild(e)})),{oldTags:o,newTags:i}},sn=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},cn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[Dt[n]||n]=e[n],t}),t)},ln=function(e,t,n){switch(e){case kt.TITLE:return{toComponent:function(){return e=t.title,n=t.titleAttributes,(r={key:e})[It]=!0,o=cn(n,r),[c().createElement(kt.TITLE,o,e)];var e,n,r,o},toString:function(){return function(e,t,n,r){var o=sn(n),i=nn(t);return o?"<"+e+' data-react-helmet="true" '+o+">"+qt(i,r)+"</"+e+">":"<"+e+' data-react-helmet="true">'+qt(i,r)+"</"+e+">"}(e,t.title,t.titleAttributes,n)}};case Ot:case _t:return{toComponent:function(){return cn(t)},toString:function(){return sn(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,n){var r,o=((r={key:n})[It]=!0,r);return Object.keys(t).forEach((function(e){var n=Dt[e]||e;if(n===Tt||n===Pt){var r=t.innerHTML||t.cssText;o.dangerouslySetInnerHTML={__html:r}}else o[n]=t[e]})),c().createElement(e,o)}))}(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var o=Object.keys(r).filter((function(e){return!(e===Tt||e===Pt)})).reduce((function(e,t){var o=void 0===r[t]?t:t+'="'+qt(r[t],n)+'"';return e?e+" "+o:o}),""),i=r.innerHTML||r.cssText||"",a=-1===Mt.indexOf(e);return t+"<"+e+' data-react-helmet="true" '+o+(a?"/>":">"+i+"</"+e+">")}),"")}(e,t,n)}}}},un=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,o=e.htmlAttributes,i=e.linkTags,a=e.metaTags,s=e.noscriptTags,c=e.scriptTags,l=e.styleTags,u=e.title,f=void 0===u?"":u,p=e.titleAttributes;return{base:ln(kt.BASE,t,r),bodyAttributes:ln(Ot,n,r),htmlAttributes:ln(_t,o,r),link:ln(kt.LINK,i,r),meta:ln(kt.META,a,r),noscript:ln(kt.NOSCRIPT,s,r),script:ln(kt.SCRIPT,c,r),style:ln(kt.STYLE,l,r),title:ln(kt.TITLE,{title:f,titleAttributes:p},r)}},fn=bt()((function(e){return{baseTag:Ht([jt,"target"],e),bodyAttributes:Wt(Ot,e),defer:Jt(e,"defer"),encode:Jt(e,"encodeSpecialCharacters"),htmlAttributes:Wt(_t,e),linkTags:$t(kt.LINK,[Rt,jt],e),metaTags:$t(kt.META,["name",Ct,"http-equiv","property",xt],e),noscriptTags:$t(kt.NOSCRIPT,[Tt],e),onChangeClientState:zt(e),scriptTags:$t(kt.SCRIPT,["src",Tt],e),styleTags:$t(kt.STYLE,[Pt],e),title:Vt(e),titleAttributes:Wt("titleAttributes",e)}}),(function(e){en&&Xt(en),e.defer?en=Yt((function(){tn(e,(function(){en=null}))})):(tn(e),en=null)}),un)((function(){return null})),pn=(ht=fn,yt=dt=function(e){function t(){return Lt(this,t),Kt(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.shouldComponentUpdate=function(e){return!wt()(this.props,e)},t.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case kt.SCRIPT:case kt.NOSCRIPT:return{innerHTML:t};case kt.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},t.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,o=e.newChildProps,i=e.nestedChildren;return Ft({},r,((t={})[n.type]=[].concat(r[n.type]||[],[Ft({},o,this.mapNestedChildrenToProps(n,i))]),t))},t.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,o=e.newProps,i=e.newChildProps,a=e.nestedChildren;switch(r.type){case kt.TITLE:return Ft({},o,((t={})[r.type]=a,t.titleAttributes=Ft({},i),t));case kt.BODY:return Ft({},o,{bodyAttributes:Ft({},i)});case kt.HTML:return Ft({},o,{htmlAttributes:Ft({},i)})}return Ft({},o,((n={})[r.type]=Ft({},i),n))},t.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=Ft({},t);return Object.keys(e).forEach((function(t){var r;n=Ft({},n,((r={})[t]=e[t],r))})),n},t.prototype.warnOnInvalidChildren=function(e,t){return!0},t.prototype.mapChildrenToProps=function(e,t){var n=this,r={};return c().Children.forEach(e,(function(e){if(e&&e.props){var o=e.props,i=o.children,a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[Nt[n]||n]=e[n],t}),t)}(Ut(o,["children"]));switch(n.warnOnInvalidChildren(e,i),e.type){case kt.LINK:case kt.META:case kt.NOSCRIPT:case kt.SCRIPT:case kt.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:a,nestedChildren:i});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:a,nestedChildren:i})}}})),t=this.mapArrayTypeChildrenToProps(r,t)},t.prototype.render=function(){var e=this.props,t=e.children,n=Ut(e,["children"]),r=Ft({},n);return t&&(r=this.mapChildrenToProps(t,r)),c().createElement(ht,r)},Bt(t,null,[{key:"canUseDOM",set:function(e){ht.canUseDOM=e}}]),t}(c().Component),dt.propTypes={base:p().object,bodyAttributes:p().object,children:p().oneOfType([p().arrayOf(p().node),p().node]),defaultTitle:p().string,defer:p().bool,encodeSpecialCharacters:p().bool,htmlAttributes:p().object,link:p().arrayOf(p().object),meta:p().arrayOf(p().object),noscript:p().arrayOf(p().object),onChangeClientState:p().func,script:p().arrayOf(p().object),style:p().arrayOf(p().object),title:p().string,titleAttributes:p().object,titleTemplate:p().string},dt.defaultProps={defer:!0,encodeSpecialCharacters:!0},dt.peek=ht.peek,dt.rewind=function(){var e=ht.rewind();return e||(e=un({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},yt);pn.renderStatic=pn.rewind;const hn=pn;var dn=o(8891),yn={viewport:function(){var e=window,t="inner";return!1 in window&&(t="client",e=document.documentElement||document.body),{width:e[t+"Width"],height:e[t+"Height"]}},isUrl:function(e){return new RegExp(/(http|https):\/\//).test(e)},createMarkup:function(e){return{__html:e}},generateUID:function(){return((new Date).getUTCMilliseconds()*Math.random()).toString(36).replace(".","").substr(0,10)+"."+((new Date).getUTCMilliseconds()*Math.random()).toString(36).replace(".","").substr(0,10)},updateScrollPosition:function(e){var t=window.location.hash;if(t){var n=t.replace("#",""),r=document.querySelector("a[name='"+n+"']");r&&r.scrollIntoView()}else!0===e&&window.scrollTo(0,0)},isOnScreen:function(e){var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-n>=0)},setEndOfContenteditable:function(e){var t,n;document.createRange?((t=document.createRange()).selectNodeContents(e),t.collapse(!1),(n=window.getSelection()).removeAllRanges(),n.addRange(t)):document.selection&&((t=document.body.createTextRange()).moveToElementText(e),t.collapse(!1),t.select())},jsonToOptions:function(e){for(var t=[],n=e.length,r=0;r<n;r++){var o=$("<option/>");if(o.attr({value:e[r].Value}).text(e[r].Text),""==e[r].Value&&o.addClass("ignore"),null!=e[r].DataAttributes&&e[r].DataAttributes.length>0)for(var i=0;i<e[r].DataAttributes.length;i++)o.attr(e[r].DataAttributes[i].Name,e[r].DataAttributes[i].Value);t.push(o)}return t},getFileExtension:function(e){var t=e.split(".");return 1===t.length||""===t[0]&&2===t.length?null:"."+t.pop().toLowerCase()},getFileNameWithoutExtension:function(e){return e.substr(0,e.lastIndexOf("."))||e},indexOfFile:function(e,t){for(var n=0;n<t.length;n++)if(t[n].name==e)return n;return-1},indexOfOption:function(e,t){for(var n=0;n<e.length;n++)if(e[n].value==t)return n;return-1},createSlug:function(e){var t=e.toLowerCase().replace(/[^a-z0-9\s-]+/gi,"-");return t=(t=t.replace(/[^a-z0-9-]+/gi,"-")).replace(/(-{2,})/gi,"-"),yn.lrTrim(t,"-")},lrTrim:function(e,t,n){if(n=n||"g","string"!=typeof e||"string"!=typeof t||"string"!=typeof n)throw new TypeError("argument must be string");if(!/^[gi]*$/.test(n))throw new TypeError("Invalid flags supplied '"+n.match(new RegExp("[^gi]*"))+"'");return t=yn.escapeRegex(t),e.replace(new RegExp("^["+t+"]+|["+t+"]+$",n),"")},format:function(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/\{(\d+)\}/g,(function(e,n){return t[n]}))},escapeRegex:function(e){return e.replace(/[\[\](){}?*+\^$\\.|\-]/g,"\\$&")},arrayUnique:function(e){for(var t=e.concat(),n=0;n<t.length;++n)for(var r=n+1;r<t.length;++r)t[n]===t[r]&&t.splice(r--,1);return t},clone:function(e){return JSON.parse(JSON.stringify(e))},cloneArray:function(e){return JSON.parse(JSON.stringify(e))},base64toBlob:function(e,t,n){t=t||"",n=n||512;for(var r=atob(e),o=[],i=0;i<r.length;i+=n){for(var a=r.slice(i,i+n),s=new Array(a.length),c=0;c<a.length;c++)s[c]=a.charCodeAt(c);var l=new Uint8Array(s);o.push(l)}return new Blob(o,{type:t})},niceDuration:function(e){var t=Math.floor(e/60/60);e-=60*t*60;var n=Math.floor(e/60),r=Math.trunc(e%60),o="".concat(n,"m ").concat(r,"s");return t>0&&(o="".concat(t,"h ")+o),o},niceFileSize:function(e){var t=e+" Bytes";return e>=1073741824?t=(e/1073741824).toFixed(1)+" GB":e>=1048576?t=(e/1048576).toFixed(1)+" MB":e>=1024&&(t=(e/1024).toFixed(1)+" KB"),t}};const mn=yn;function vn(e){return vn="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},vn(e)}function bn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gn(e,t){return gn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},gn(e,t)}function wn(e,t){if(t&&("object"===vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return En(e)}function En(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sn(e){return Sn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Sn(e)}const On=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gn(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Sn(r);if(o){var n=Sn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return wn(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).nextActiveSquare=t.nextActiveSquare.bind(En(t)),t.updateActiveSquare=t.updateActiveSquare.bind(En(t)),t.active_square=1,t}return t=a,(n=[{key:"componentDidMount",value:function(){this.updateActiveSquare()}},{key:"nextActiveSquare",value:function(){++this.active_square,this.active_square>3&&(this.active_square=0),this.updateActiveSquare()}},{key:"updateActiveSquare",value:function(){var e=(this.active_square+1)%4,t=(this.active_square+2)%4,n=(this.active_square+3)%4,r=this;$('#loader .loader-square[data-squareid="'+this.active_square+'"]').fadeTo(500,1,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200)}),500)})),setTimeout((function(){$('#loader .loader-square[data-squareid="'+e+'"]').fadeTo(500,.5,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200)}),500)}))}),100),setTimeout((function(){$('#loader .loader-square[data-squareid="'+t+'"]').fadeTo(500,.2,(function(){var e=this;setTimeout((function(){$(e).fadeOut(200,r.nextActiveSquare)}),500)}))}),200),$('#loader .loader-square[data-squareid="'+n+'"]').fadeTo(0,0)}},{key:"render",value:function(){return c().createElement("div",{id:"loader"},c().createElement("div",{className:"loader-container"},c().createElement("div",{className:"loader-square-container"},c().createElement("span",{className:"loader-square","data-squareid":"0"}," ")),c().createElement("div",{className:"loader-square-container"},c().createElement("span",{className:"loader-square","data-squareid":"1"}," ")),c().createElement("div",{className:"loader-square-container"},c().createElement("span",{className:"loader-square","data-squareid":"3"}," ")),c().createElement("div",{className:"loader-square-container"},c().createElement("span",{className:"loader-square","data-squareid":"2"}," "))))}}])&&bn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function _n(e){return _n="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},_n(e)}function kn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cn(e,t){return Cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Cn(e,t)}function Pn(e,t){if(t&&("object"===_n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jn(e)}function jn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tn(e){return Tn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Tn(e)}var xn={first:'<i class="fa fa-angle-double-left" aria-hidden="true"></i>',prev:'<i class="fa fa-angle-left" aria-hidden="true"></i>',prevSet:"...",nextSet:"...",next:'<i class="fa fa-angle-right" aria-hidden="true"></i>',last:'<i class="fa fa-angle-double-right" aria-hidden="true"></i>'},Rn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cn(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Tn(r);if(o){var n=Tn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Pn(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleKeyPress=t.handleKeyPress.bind(jn(t)),t.handleFirstPage=t.handleFirstPage.bind(jn(t)),t.handlePreviousPage=t.handlePreviousPage.bind(jn(t)),t.handleNextPage=t.handleNextPage.bind(jn(t)),t.handleLastPage=t.handleLastPage.bind(jn(t)),t.handleMorePrevPages=t.handleMorePrevPages.bind(jn(t)),t.handleMoreNextPages=t.handleMoreNextPages.bind(jn(t)),t.handlePageChanged=t.handlePageChanged.bind(jn(t)),t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){!0===this.props.enableKeyEvents&&"undefined"!=typeof window&&window.addEventListener("keydown",this.handleKeyPress)}},{key:"componentWillUnmount",value:function(){!0===this.props.enableKeyEvents&&"undefined"!=typeof window&&window.removeEventListener("keydown",this.handleKeyPress)}},{key:"getTitles",value:function(e){return this.props.titles[e]||xn[e]}},{key:"calcBlocks",value:function(){var e=this.props,t=e.total,n=e.visiblePages,r=e.current+1;return{total:Math.ceil(t/n),current:Math.ceil(r/n)-1,size:n}}},{key:"isPrevDisabled",value:function(){return this.props.current<=0}},{key:"isNextDisabled",value:function(){return this.props.current>=this.props.total-1}},{key:"isPrevMoreHidden",value:function(){var e=this.calcBlocks();return 1===e.total||0===e.current}},{key:"isNextMoreHidden",value:function(){var e=this.calcBlocks();return 1===e.total||e.current===e.total-1}},{key:"visibleRange",value:function(){var e=this.calcBlocks(),t=e.current*e.size,n=this.props.total-t;return[t+1,t+(n>e.size?e.size:n)+1]}},{key:"handleKeyPress",value:function(e){37==e.keyCode?this.handlePreviousPage():39==e.keyCode&&this.handleNextPage()}},{key:"handleFirstPage",value:function(){this.isPrevDisabled()||this.handlePageChanged(0)}},{key:"handlePreviousPage",value:function(){this.isPrevDisabled()||this.handlePageChanged(this.props.current-1)}},{key:"handleNextPage",value:function(){this.isNextDisabled()||this.handlePageChanged(this.props.current+1)}},{key:"handleLastPage",value:function(){this.isNextDisabled()||this.handlePageChanged(this.props.total-1)}},{key:"handleMorePrevPages",value:function(){var e=this.calcBlocks();this.handlePageChanged(e.current*e.size-1)}},{key:"handleMoreNextPages",value:function(){var e=this.calcBlocks();this.handlePageChanged((e.current+1)*e.size)}},{key:"handlePageChanged",value:function(e){var t=this.props.onPageChanged;t&&t(e)}},{key:"renderPages",value:function(e){var t=this;return function(e,t){for(var n=[],r=e;r<t;r++)n.push(r);return n}(e[0],e[1]).map((function(e,n){var r=e-1,o=t.handlePageChanged.bind(t,r),i=t.props.current===r;return c().createElement(Dn,{key:n,index:n,isActive:i,className:"btn-numbered-page",onClick:o},e)}))}},{key:"render",value:function(){var e=this.getTitles.bind(this);return c().createElement("nav",{className:"page-control"},this.props.children,c().createElement("ul",{className:"pagination pagination-sm"},c().createElement(Dn,{className:"btn-first-page",key:"btn-first-page",isHidden:this.isPrevDisabled(),onClick:this.handleFirstPage},e("first")),c().createElement(Dn,{className:"btn-prev-page",key:"btn-prev-page",isHidden:this.isPrevDisabled(),onClick:this.handlePreviousPage},e("prev")),c().createElement(Dn,{className:"btn-prev-more",key:"btn-prev-more",isHidden:this.isPrevMoreHidden(),onClick:this.handleMorePrevPages},e("prevSet")),this.renderPages(this.visibleRange()),c().createElement(Dn,{className:"btn-next-more",key:"btn-next-more",isHidden:this.isNextMoreHidden(),onClick:this.handleMoreNextPages},e("nextSet")),c().createElement(Dn,{className:"btn-next-page",key:"btn-next-page",isHidden:this.isNextDisabled(),onClick:this.handleNextPage},e("next")),c().createElement(Dn,{className:"btn-last-page",key:"btn-last-page",isHidden:this.isNextDisabled(),onClick:this.handleLastPage},e("last"))))}}])&&kn(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Rn.propTypes={current:p().number.isRequired,total:p().number.isRequired,visiblePages:p().number,titles:p().object,onPageChanged:p().func,enableKeyEvents:p().bool},Rn.defaultProps={titles:xn,visiblePages:8,enableKeyEvents:!1};var Dn=function(e){if(e.isHidden)return null;var t=e.className?"".concat(e.className," "):"",n="".concat(t).concat(e.isActive?" active":"").concat(e.isDisabled?" disabled":"");return c().createElement("li",{key:e.index,className:n},c().createElement("a",{onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.children}}))};Dn.propTypes={isHidden:p().bool,isActive:p().bool,isDisabled:p().bool,className:p().string,onClick:p().func};const Nn=Rn;function Mn(e){return Mn="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},Mn(e)}function In(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function An(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ln(e,t,n){return t&&An(e.prototype,t),n&&An(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fn(e,t)}function Fn(e,t){return Fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Fn(e,t)}function Un(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Vn(e);if(t){var o=Vn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Kn(this,n)}}function Kn(e,t){if(t&&("object"===Mn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return qn(e)}function qn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vn(e){return Vn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Vn(e)}var zn=function(e){Bn(n,e);var t=Un(n);function n(e){var r;return In(this,n),(r=t.call(this,e)).handleChange=r.handleChange.bind(qn(r)),r.handleMultiChange=r.handleMultiChange.bind(qn(r)),r}return Ln(n,[{key:"handleChange",value:function(e){var t=JSON.parse(JSON.stringify(this.props.filter));t[e.target.name].value=e.target.value,this.props.onChange&&this.props.onChange(t)}},{key:"handleMultiChange",value:function(e,t){var n=JSON.parse(JSON.stringify(this.props.filter));n[e].value=t,this.props.onChange&&this.props.onChange(n)}},{key:"render",value:function(){var e=[],t=[];for(var n in this.props.filter)if(this.props.filter.hasOwnProperty(n)){var r=this.props.filter[n];if(null!=r){var o=c().createElement("select",{key:n,name:n,value:r.value,onChange:this.handleChange},r.options.map((function(e,t){return c().createElement("option",{key:t,value:e.value},e.text)})));switch(r.type){case"Filter":e.push(o);break;case"Sort":t.push(o);break;case"MultiFilter":e.push(c().createElement(Wn,{key:n,name:n,filter:r,onChange:this.handleMultiChange}))}}}return c().createElement("div",null,t.length>0&&c().createElement("div",{className:"sort-filter"},c().createElement("h5",null,"Sort"),t),e.length>0&&c().createElement("div",null,e))}}]),n}(c().Component);zn.propTypes={filter:p().object,onChange:p().func};var Wn=function(e){Bn(n,e);var t=Un(n);function n(e){var r;In(this,n),(r=t.call(this,e)).setSelected=r.setSelected.bind(qn(r)),r.handleClick=r.handleClick.bind(qn(r)),r.clearSelected=r.clearSelected.bind(qn(r)),r.updateSelected=r.updateSelected.bind(qn(r)),r.getSelected=r.getSelected.bind(qn(r)),r.findOption=r.findOption.bind(qn(r));var o=JSON.parse(JSON.stringify(r.props.filter.options));return r.setSelected(o,r.props.filter.value),r.state={options:o,hasSelectedOptions:null!=r.props.filter.value&&""!=r.props.filter.value&&r.props.filter.value.length&&r.props.filter.value.length>0},r}return Ln(n,[{key:"setSelected",value:function(e,t){if(null!=t&&""!=t&&t.length&&t.length>0)for(var n=0;n<t.length;n++){var r=this.findOption(e,t[n]);null!=r&&(r.isSelected=!0)}}},{key:"handleClick",value:function(e,t){var n=JSON.parse(JSON.stringify(this.state.options)),r=this.findOption(n,e);this.updateSelected(r,t);var o=this.getSelected(n),i=this;this.setState({options:n,hasSelectedOptions:null!=o&&o.length>0},(function(){i.props.onChange&&i.props.onChange(i.props.name,o)}))}},{key:"clearSelected",value:function(){for(var e=JSON.parse(JSON.stringify(this.state.options)),t=0;t<=e.length-1;t++)this.updateSelected(e[t],!1);var n=this;this.setState({options:e,hasSelectedOptions:!1},(function(){n.props.onChange&&n.props.onChange(n.props.name,null)}))}},{key:"updateSelected",value:function(e,t){if(e.isSelected=t,null!=e.children&&e.children.length>0)for(var n=0;n<=e.children.length-1;n++)this.updateSelected(e.children[n],t)}},{key:"getSelected",value:function(e){for(var t=[],n=0;n<=e.length-1;n++)if(!0===e[n].isSelected&&t.push(e[n].value),null!=e[n].children&&e[n].children.length>0){var r=this.getSelected(e[n].children);null!=r&&r.length>0&&(t=t.concat(r))}return t}},{key:"findOption",value:function(e,t){for(var n=0;n<=e.length-1;n++){if(e[n].value==t)return e[n];if(null!=e[n].children&&e[n].children.length>0){var r=this.findOption(e[n].children,t);if(null!=r)return r}}return null}},{key:"render",value:function(){var e=this,t=this.state.options.map((function(t,n){return null!=t.children&&t.children.length>0?c().createElement(Hn,{key:n,option:t,onClick:e.handleClick}):c().createElement($n,{key:n,option:t,onClick:e.handleClick})}));return c().createElement("div",{className:"multi-filter"},c().createElement("h5",null,this.props.name,this.state.hasSelectedOptions&&c().createElement("a",{onClick:this.clearSelected},"Clear")),c().createElement("ul",null,t))}}]),n}(c().Component);Wn.propTypes={name:p().string,filter:p().object};var Hn=function(e){Bn(n,e);var t=Un(n);function n(){return In(this,n),t.apply(this,arguments)}return Ln(n,[{key:"render",value:function(){var e=this,t=this.props.option.children.map((function(t,r){return null!=t.children&&t.children.length>0?c().createElement(n,{key:r,option:t,onClick:e.props.onClick}):c().createElement("li",{key:r},c().createElement($n,{option:t,onClick:e.props.onClick}))}));return c().createElement("li",null,c().createElement($n,{option:this.props.option,onClick:this.props.onClick}),c().createElement("ul",null,t))}}]),n}(c().Component),$n=function(e){Bn(n,e);var t=Un(n);function n(e){var r;return In(this,n),(r=t.call(this,e)).handleClick=r.handleClick.bind(qn(r)),r}return Ln(n,[{key:"handleClick",value:function(e){this.props.onClick&&this.props.onClick(this.props.option.value,this.refs.checkbox.checked)}},{key:"render",value:function(){var e=this.props.option.hasOwnProperty("isSelected")&&!0===this.props.option.isSelected;return c().createElement("label",null,c().createElement("input",{ref:"checkbox",type:"checkbox",checked:e,onChange:this.handleClick}),this.props.option.display)}}]),n}(c().Component);const Jn=zn;function Gn(e){return Gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gn(e)}function Qn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xn(e,t,n){return t&&Yn(e.prototype,t),n&&Yn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&er(e,t)}function er(e,t){return er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},er(e,t)}function tr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=or(e);if(t){var o=or(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return nr(this,n)}}function nr(e,t){if(t&&("object"===Gn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return rr(e)}function rr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function or(e){return or=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},or(e)}var ir=function(e){Zn(n,e);var t=tr(n);function n(e){var r;return Qn(this,n),(r=t.call(this,e)).handleNewProps=r.handleNewProps.bind(rr(r)),r.updateUrl=r.updateUrl.bind(rr(r)),r.getData=r.getData.bind(rr(r)),r.handleKeyDown=r.handleKeyDown.bind(rr(r)),r.handleSearch=r.handleSearch.bind(rr(r)),r.handleProductsToggle=r.handleProductsToggle.bind(rr(r)),r.handleTypeFilter=r.handleTypeFilter.bind(rr(r)),r.handleFilterChange=r.handleFilterChange.bind(rr(r)),r.handleNewPage=r.handleNewPage.bind(rr(r)),r.handleExit=r.handleExit.bind(rr(r)),r.defaultEndpoint="all",r.query=null,r.products=null,r.page=0,r.type=r.defaultEndpoint,r.find=null,r.state={loadStatus:a.LoadStatus.PreLoad,total:0,results:null,aggregations:null,filter:null,suggest:null},r}return Xn(n,[{key:"componentDidMount",value:function(){this.handleNewProps(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.handleNewProps(e)}},{key:"handleNewProps",value:function(e){e.location&&e.location.search&&(this.parsedQS=dn.parse(e.location.search),this.parsedQS.q&&(this.query=this.parsedQS.q,this.type=null!=this.parsedQS.type?this.parsedQS.type:this.defaultEndpoint,this.find=null!=this.parsedQS.f?this.parsedQS.f:null,this.refs.input.value=this.query,this.products=null!=this.parsedQS.products?this.parsedQS.products.split(","):null,this.page=null!=this.parsedQS.page?this.parsedQS.page:0)),null!=this.query&&""!=this.query&&this.setState({loadStatus:a.LoadStatus.Loading},(function(){this.getData(e)}))}},{key:"updateUrl",value:function(){var e=[];if(this.query&&e.push("q="+encodeURIComponent(this.query)),this.products&&this.products.length>0&&e.push("products="+this.products.join()),this.type&&this.type!=this.defaultEndpoint&&e.push("type="+this.type),this.find&&e.push("field="+this.find),null!=this.state.filter)for(var t in this.state.filter)this.state.filter.hasOwnProperty(t)&&null!=this.state.filter[t]&&this.state.filter[t].value&&""!=this.state.filter[t].value&&e.push("".concat(t,"=").concat(this.state.filter[t].value));this.page>0&&e.push("page="+this.page);var n=this.props.location.pathname;e.length>0&&(n+="?"+e.join("&")),this.props.history.push(n)}},{key:"getData",value:function(e){var t=this;$.ajax({type:"GET",url:"/api/search/".concat(this.type).concat(e.location.search).concat(null==this.state.aggregations?"&refreshAggs=true":""),contentType:"application/json; charset=utf-8",context:this}).done((function(e,n,r){var o=null!=e.aggregations&&e.aggregations.length>0?e.aggregations:t.state.aggregations,i=null!=e.filter?e.filter:t.state.filter;t.setState({loadStatus:a.LoadStatus.Loaded,total:e.total,results:e.results,aggregations:o,filter:i,suggest:e.suggest},(function(){mn.updateScrollPosition(!0)}))})).fail((function(e,n,r){t.setState({loadStatus:a.LoadStatus.Error,results:null},(function(){alerts.error(e.responseJSON.errorMessage)}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleKeyDown",value:function(e){13==e.keyCode&&this.handleSearch(e)}},{key:"handleSearch",value:function(e){e.preventDefault();var t=this.refs.input.value;this.query=t,this.type=this.defaultEndpoint,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleProductsToggle",value:function(e){this.products=e,this.type=this.defaultEndpoint,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleTypeFilter",value:function(e){this.type=e,this.page=0,this.setState({filter:null},(function(){this.updateUrl()}))}},{key:"handleFilterChange",value:function(e){this.page=0,this.setState({filter:e},(function(){this.updateUrl()}))}},{key:"handleNewPage",value:function(e){this.page=e,this.updateUrl()}},{key:"handleExit",value:function(e,t){var n={q:this.query,products:this.products,url:e};return $.ajax({async:!1,type:"POST",url:"/api/search/exit",contentType:"application/json; charset=utf-8",data:JSON.stringify(n),dataType:"json"}).then((function(){return!0})),!1}},{key:"render",value:function(){return c().createElement("div",null,c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("div",{className:"search-control"},c().createElement("input",{ref:"input",onKeyDown:this.handleKeyDown,type:"text",placeholder:"Ask me anything...",className:"form-control"}),c().createElement(ie,{ref:"products",className:"search-product-filter",selected:this.products,onChange:this.handleProductsToggle}),c().createElement(pe,{onSearch:this.handleSearch})))),this.state.loadStatus==a.LoadStatus.Loading&&c().createElement(On,null),(""==this.query||null==this.query)&&c().createElement(sr,{suggest:"Please enter a search term in the search box above"}),!(""==this.query||null==this.query)&&this.state.loadStatus==a.LoadStatus.Loaded&&c().createElement("div",{className:"search-x"},c().createElement("div",{className:"search-filters"},c().createElement(ar,{doctypes:this.state.aggregations,defaultEndpoint:this.defaultEndpoint,selected:this.type,onTypeChange:this.handleTypeFilter}),c().createElement(Jn,{filter:this.state.filter,onChange:this.handleFilterChange})),this.state.total>0&&c().createElement(cr,{results:this.state.results,onPageChange:this.handleNewPage,onTypeChange:this.handleTypeFilter,onExit:this.handleExit}),0==this.state.total&&c().createElement(sr,{suggest:this.state.suggest})))}}]),n}(c().Component),ar=function(e){Zn(n,e);var t=tr(n);function n(){return Qn(this,n),t.apply(this,arguments)}return Xn(n,[{key:"render",value:function(){if(null==this.props.doctypes||0==this.props.doctypes.length)return null;var e=this,t=this.props.doctypes.map((function(t,n){var r;return r=1==t.disabled||t.text.toLowerCase()==e.props.selected.toLowerCase()?c().createElement("span",{className:t.text.toLowerCase()==e.props.selected.toLowerCase()?"selected":""},t.display," (",t.value,")"):c().createElement("a",{onClick:e.props.onTypeChange.bind(null,t.text)},t.display," (",t.value,")"),c().createElement("li",{key:n},r)}));return this.props.selected==this.props.defaultEndpoint?t.unshift(c().createElement("li",{key:this.props.doctypes.length},c().createElement("span",{className:"selected"},"All"))):t.unshift(c().createElement("li",{key:this.props.doctypes.length},c().createElement("a",{onClick:this.props.onTypeChange.bind(null,this.props.defaultEndpoint)},"All"))),c().createElement("ul",{className:"doctype-filter"},t)}}]),n}(c().Component),sr=function(e){Zn(n,e);var t=tr(n);function n(){return Qn(this,n),t.apply(this,arguments)}return Xn(n,[{key:"render",value:function(){return c().createElement("div",{className:"no-search-results"},c().createElement("div",{className:"noempty-results-container",dangerouslySetInnerHTML:mn.createMarkup(this.props.suggest)}))}}]),n}(c().Component),cr=function(e){Zn(n,e);var t=tr(n);function n(){return Qn(this,n),t.apply(this,arguments)}return Xn(n,[{key:"render",value:function(){if(null==this.props.results||0==this.props.results.length)return null;var e=[];for(var t in this.props.results)this.props.results.hasOwnProperty(t)&&e.push(c().createElement(lr,{key:t,documentType:t,results:this.props.results[t],onPageChange:this.props.onPageChange,onTypeChange:this.props.onTypeChange,onExit:this.props.onExit}));return c().createElement("div",{className:"search-results"},e)}}]),n}(c().Component),lr=nt(function(e){Zn(n,e);var t=tr(n);function n(e){return Qn(this,n),t.call(this,e)}return Xn(n,[{key:"render",value:function(){if(null==this.props.results||0==this.props.results.length)return null;var e=this,t=this.props.results.documents.data.map((function(t,n){switch(e.props.documentType){case"course":return c().createElement(ur,{key:n,result:t,onClick:e.props.onExit});case"asset":case"training":case"portfolio":case"catalogue":return c().createElement(fr,{key:n,result:t,onClick:e.props.onExit});case"profile":return c().createElement(pr,{key:n,result:t,onClick:e.props.onExit});case"discussionTopic":return c().createElement(hr,{key:n,result:t,onClick:e.props.onExit});default:return c().createElement(dr,{key:n,result:t,onClick:e.props.onExit})}})),n="search-results-list";switch(e.props.documentType){case"course":case"asset":case"training":case"portfolio":case"catalogue":n="search-results-card";break;case"profile":n="search-results-profile"}var r=dn.parse(this.props.location.search);return c().createElement("div",{className:"search-results-container"},c().createElement("div",{className:"clearfix"},c().createElement("h5",null,this.props.results.displayName),!r.type&&c().createElement("a",{onClick:this.props.onTypeChange.bind(null,this.props.documentType)},"See All")),this.props.results.documents.totalPages>1&&c().createElement(Nn,{total:this.props.results.documents.totalPages,current:this.props.results.documents.currentPage,onPageChanged:this.props.onPageChange}),c().createElement("ul",{className:n},t),this.props.results.documents.totalPages>1&&c().createElement(Nn,{total:this.props.results.documents.totalPages,current:this.props.results.documents.currentPage,onPageChanged:this.props.onPageChange}))}}]),n}(c().Component)),ur=function(e){Zn(n,e);var t=tr(n);function n(e){return Qn(this,n),t.call(this,e)}return Xn(n,[{key:"render",value:function(){var e=this.props.result,t=[];return null!=e.products&&e.products.length>0&&e.products.forEach((function(e,n){t.push(c().createElement("li",{key:"p:".concat(n),className:"product"},e))})),c().createElement("li",{className:"course"},c().createElement("a",{href:e.url,className:"card-image",onClick:this.props.onClick.bind(null,e.url)},c().createElement("img",{src:e.thumbUrl})),c().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},c().createElement("h4",null,e.title),null!=t&&t.length>0&&c().createElement("ul",null,t)))}}]),n}(c().Component),fr=function(e){Zn(n,e);var t=tr(n);function n(e){return Qn(this,n),t.call(this,e)}return Xn(n,[{key:"render",value:function(){var e=this.props.result,t=[];return null!=e.products&&e.products.length>0&&e.products.forEach((function(e,n){t.push(c().createElement("li",{key:"p:".concat(n),className:"product"},e))})),c().createElement("li",null,c().createElement("a",{href:e.url,className:"card-image",onClick:this.props.onClick.bind(null,e.url)},c().createElement("img",{src:e.thumbUrl})),c().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},c().createElement("h4",null,e.title),null!=t&&t.length>0&&c().createElement("ul",null,t)))}}]),n}(c().Component),pr=function(e){Zn(n,e);var t=tr(n);function n(e){return Qn(this,n),t.call(this,e)}return Xn(n,[{key:"render",value:function(){var e=this.props.result;return c().createElement("li",null,c().createElement("a",{href:e.url,className:"profile-image",style:{backgroundImage:"url("+e.thumbUrl+")"},onClick:this.props.onClick.bind(null,e.url)}),c().createElement("a",{href:e.url,className:"text-container",onClick:this.props.onClick.bind(null,e.url)},c().createElement("h4",null,e.title)))}}]),n}(c().Component),hr=function(e){Zn(n,e);var t=tr(n);function n(e){return Qn(this,n),t.call(this,e)}return Xn(n,[{key:"render",value:function(){var e=this.props.result,t=null;e.thumbUrl&&(t=c().createElement("a",{className:"thumb",href:e.url,style:{backgroundImage:'url("'+e.thumbUrl+'")'},onClick:this.props.onClick.bind(null,e.url)}));var n=[];return n.push(c().createElement("li",{key:"t"},e.displayType)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){n.push(c().createElement("li",{key:"p:".concat(t),className:"product"},e))})),c().createElement("li",null,t,c().createElement("div",{className:"title"},c().createElement("a",{className:"info",href:e.url,onClick:this.props.onClick.bind(null,e.url)},c().createElement("h4",null,e.title),e.path&&c().createElement("span",{className:"path"},e.path)),null!=n&&n.length>0&&c().createElement("ul",null,n)))}}]),n}(c().Component),dr=function(e){Zn(n,e);var t=tr(n);function n(e){return Qn(this,n),t.call(this,e)}return Xn(n,[{key:"render",value:function(){var e=this.props.result,t=null;e.thumbUrl&&(t=c().createElement("a",{className:"thumb",href:e.url,style:{backgroundImage:'url("'+e.thumbUrl+'")'},onClick:this.props.onClick.bind(null,e.url)}));var n=null;e.highlight&&e.highlight.length>0&&(n=e.highlight.map((function(e,t){return c().createElement("p",{key:"h:".concat(t),dangerouslySetInnerHTML:mn.createMarkup(e)})})));var r=[];r.push(c().createElement("li",{key:"t"},e.displayType)),null!=e.products&&e.products.length>0&&e.products.forEach((function(e,t){r.push(c().createElement("li",{key:"p:".concat(t),className:"product"},e))}));var o=null!=e.rating&&e.rating>0?c().createElement("span",null,"+",e.rating):null;return c().createElement("li",null,t,c().createElement("div",{className:"title"},c().createElement("a",{className:"info",href:e.url,onClick:this.props.onClick.bind(null,e.url)},c().createElement("h4",null,e.title),e.path&&c().createElement("span",{className:"path"},e.path)),null!=r&&r.length>0&&c().createElement("ul",null,r)),null!=n&&c().createElement("div",{className:"highlights"},n),c().createElement("div",{className:"support"},e.date," ",o))}}]),n}(c().Component);const yr=nt(ir);function mr(e){return mr="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},mr(e)}function vr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function br(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gr(e,t,n){return t&&br(e.prototype,t),n&&br(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Er(e,t)}function Er(e,t){return Er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Er(e,t)}function Sr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=_r(e);if(t){var o=_r(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Or(this,n)}}function Or(e,t){if(t&&("object"===mr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _r(e){return _r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_r(e)}var kr=function(e){wr(n,e);var t=Sr(n);function n(e){return vr(this,n),t.call(this,e)}return gr(n,[{key:"render",value:function(){return c().createElement("div",{className:"app"},c().createElement(hn,{defaultTitle:"Search",titleTemplate:"%s | Foundry Community"}),c().createElement(rt,null,c().createElement(Cr,null)))}}]),n}(c().Component),Cr=nt(function(e){wr(n,e);var t=Sr(n);function n(e){return vr(this,n),t.call(this,e)}return gr(n,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return c().createElement(tt,null,c().createElement(et,{path:"/:culture/search"},c().createElement(yr,null)),c().createElement(et,{path:"/search"},c().createElement(yr,null)))}}]),n}(c().Component));const Pr=kr;var jr=o(8658),Tr=o.n(jr);function xr(e){return xr="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},xr(e)}function Rr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Nr(e,t,n){return t&&Dr(e.prototype,t),n&&Dr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ir(e,t)}function Ir(e,t){return Ir=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ir(e,t)}function Ar(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Fr(e);if(t){var o=Fr(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Lr(this,n)}}function Lr(e,t){if(t&&("object"===xr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Br(e)}function Br(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fr(e){return Fr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Fr(e)}var Ur=function(e){Mr(n,e);var t=Ar(n);function n(e){var r;return Rr(this,n),function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(Br(r=t.call(this,e)),"getNavLinkClass",(function(e){return r.props.location.pathname===e?"active":""})),r.viewportIsMobile=r.viewportIsMobile.bind(Br(r)),r.handleResize=r.handleResize.bind(Br(r)),r.handleGroupClick=r.handleGroupClick.bind(Br(r)),r.handleClickOutside=r.handleClickOutside.bind(Br(r)),r.mobileBreakpoint=768,r.state={index:null,isMobile:r.viewportIsMobile()},r}return Nr(n,[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"viewportIsMobile",value:function(){return mn.viewport().width<=this.mobileBreakpoint}},{key:"handleResize",value:function(e){this.setState({isMobile:this.viewportIsMobile()})}},{key:"handleGroupClick",value:function(e,t){t.preventDefault();var n=null===this.state.index?e:null;this.setState({index:n})}},{key:"handleClickOutside",value:function(e){e.preventDefault(),e.stopPropagation(),this.setState({index:null})}},{key:"render",value:function(){var e=this,t=null,n=this.props.data.map((function(n,r){switch(n.type){case"ClientRoute":return c().createElement("li",{key:r,className:e.getNavLinkClass(n.url)},c().createElement(mt,{to:n.url,activeClassName:"active"},n.text));case"Anchor":return c().createElement("li",{className:e.getNavLinkClass(n.url)},c().createElement("a",{key:r,href:n.url},n.text));case"Group":e.state.index==r&&(t=c().createElement(Kr,{items:n.children,onClickOutside:e.handleClickOutside,onOptionClick:e.handleClickOutside}));for(var o=!1,i=0;i<n.children.length-1;i++)e.props.location.pathname===n.children[i].url&&(o=!0);return c().createElement("li",{key:r,className:o?"active":""},c().createElement("a",{href:"#",onClick:e.handleGroupClick.bind(null,r)},n.text," ",c().createElement("span",{className:"caret"})),e.state.index==r&&null!=t&&!e.state.isMobile&&t)}})),r="category-tabs".concat(this.props.className?" "+this.props.className:"");return c().createElement("nav",{className:r},c().createElement("div",{className:"mobile-options-wrapper"},c().createElement("ul",{className:"options"},n)),null!=t&&this.state.isMobile&&t)}}]),n}(c().Component);Ur.propTypes={data:p().array,activeIndex:p().number,className:p().string};var Kr=function(){var e=function(e){Mr(n,e);var t=Ar(n);function n(e){var r;return Rr(this,n),(r=t.call(this,e)).handleClickOutside=r.handleClickOutside.bind(Br(r)),r.handleOptionClick=r.handleOptionClick.bind(Br(r)),r}return Nr(n,[{key:"handleClickOutside",value:function(e){this.props.onClickOutside(e)}},{key:"handleOptionClick",value:function(e){this.props.onOptionClick&&this.props.onOptionClick(e)}},{key:"render",value:function(){var e=this,t=this.props.items.map((function(t,n){switch(t.type){case"ClientRoute":return c().createElement("li",{key:n,onClick:e.handleOptionClick},c().createElement(mt,{to:t.url},t.text));case"Anchor":return c().createElement("li",{key:n},c().createElement("a",{href:t.url},t.text))}}));return c().createElement("ul",{className:"subnav"},t)}}]),n}(c().Component);return e.propTypes={items:p().array.isRequired,onClickOutside:p().func.isRequired,onOptionClick:p().func},Tr()(e)}();const qr=nt(Ur);function Vr(e){return Vr="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},Vr(e)}function zr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wr(e,t){return Wr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wr(e,t)}function Hr(e,t){if(t&&("object"===Vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $r(e)}function $r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jr(e){return Jr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Jr(e)}var Gr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wr(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Jr(r);if(o){var n=Jr(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Hr(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getAttribute=t.getAttribute.bind($r(t)),t.metricAttributes=[{metric:"views",title:"Views",icon:"glyphicon glyphicon-eye-open"},{metric:"downloads",title:"Downloads",icon:"glyphicon glyphicon-download"},{metric:"likes",title:"Likes",icon:"glyphicon glyphicon-heart"},{metric:"rating",title:"Rating",icon:"glyphicon glyphicon-star"},{metric:"watchers",title:"Watchers",icon:"glyphicon glyphicon-download"},{metric:"collections",title:"Collections",icon:"glyphicon glyphicon-pushpin"},{metric:"comments",title:"Comments",icon:"glyphicon glyphicon-comment"},{metric:"profileView",title:"Profile Views",icon:"glyphicon glyphicon-eye-open"},{metric:"profileFollow",title:"Profile Followers",icon:"glyphicon glyphicon-user"},{metric:"projectView",title:"Project Views",icon:"glyphicon glyphicon-eye-open"},{metric:"projectLike",title:"Project Likes",icon:"glyphicon glyphicon-thumbs-up"}],t}return t=a,(n=[{key:"getAttribute",value:function(e){for(var t=0;t<this.metricAttributes.length;t++)if(this.metricAttributes[t].metric==e)return this.metricAttributes[t];return null}},{key:"render",value:function(){var e=[];for(var t in this.props.metrics)if(this.props.metrics.hasOwnProperty(t)){var n=this.getAttribute(t);null!=n&&e.push(c().createElement("span",{key:n.metric,className:n.metric,title:n.title},this.props.metrics[t]))}var r="metrics ".concat(this.props.displayClass?this.props.displayClass:"");return c().createElement("div",{className:r},e)}}])&&zr(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Gr.propTypes={metrics:p().object};const Qr=Gr;function Yr(e){return Yr="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},Yr(e)}function Xr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function eo(e,t){return eo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},eo(e,t)}function to(e,t){if(t&&("object"===Yr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function no(e){return no=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},no(e)}var ro=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=no(r);if(o){var n=no(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return to(this,e)});function a(){return Xr(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.profile,t={backgroundImage:"url(".concat(e.avatarUrl,")")};return c().createElement("section",{id:"heroBanner",className:"hero-profile",style:{backgroundImage:"url('/common/img/assets/headers/dashboard_header.png')"}},c().createElement("div",{className:"hero-content main clearfix",style:{margin:"0 auto"}},c().createElement("div",{className:"user-info"},c().createElement("a",{href:e.url,className:"profile"},c().createElement("span",{className:"profile-image",style:t}),c().createElement("span",{className:"profile-name"},"Hello ",c().createElement("b",null,e.name)))),c().createElement("div",{className:"user-edit"},c().createElement("div",{className:"user-ctas button-group"},!0===e.show.newProject&&c().createElement("a",{href:"/project/new",className:"button icon icon-after icon-add"},"Upload new project"),c().createElement("a",{href:e.url,className:"button icon icon-after icon-arrow"},"View profile")),c().createElement("div",{className:"profile-stats-wrapper"},c().createElement("p",null,"Your Profile"),c().createElement("div",{className:"profile-stats clearfix"},c().createElement(Qr,{metrics:e.metrics,displayClass:"light"}))))))}}])&&Zr(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);ro.propTypes={profile:p().object.isRequired};const oo=ro;function io(e){return io="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},io(e)}function ao(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function so(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function co(e,t,n){return t&&so(e.prototype,t),n&&so(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uo(e,t)}function uo(e,t){return uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},uo(e,t)}function fo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=yo(e);if(t){var o=yo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return po(this,n)}}function po(e,t){if(t&&("object"===io(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ho(e)}function ho(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yo(e){return yo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},yo(e)}var mo=function(e){lo(n,e);var t=fo(n);function n(e){var r;return ao(this,n),(r=t.call(this,e)).handleToggle=r.handleToggle.bind(ho(r)),r.handleClickOutside=r.handleClickOutside.bind(ho(r)),r.handleOptionClick=r.handleOptionClick.bind(ho(r)),r.state={isOpen:!1},r}return co(n,[{key:"handleToggle",value:function(e){e.preventDefault(),this.setState({isOpen:!this.state.isOpen})}},{key:"handleClickOutside",value:function(e){e.preventDefault(),this.state.isOpen&&e.target!=this.refs.action&&this.setState({isOpen:!1})}},{key:"handleOptionClick",value:function(){this.setState({isOpen:!1})}},{key:"render",value:function(){var e;"anchor"==this.props.actionTag||"link"==this.props.actionTag?e=c().createElement("a",{href:"#",ref:"action",onClick:this.handleToggle},this.props.actionLabel," ",c().createElement("span",{className:"caret"})):"button"==this.props.actionTag?e=c().createElement("button",{type:"button",className:"btn-default",onClick:this.handleToggle,ref:"action"},this.props.actionLabel," ",c().createElement("span",{className:"caret"})):"buttonLink"==this.props.actionTag&&(e=c().createElement("button",{type:"button",className:"btn-link",onClick:this.handleToggle,ref:"action"},this.props.actionLabel," ",c().createElement("span",{className:"caret"})));var t=null;switch(this.state.isOpen&&(t=c().createElement(vo,{options:this.props.options,onClickOutside:this.handleClickOutside,onOptionClick:this.handleOptionClick,className:this.props.dropdownClassName})),this.props.wrapperTag){case"li":return c().createElement("li",{className:"tfdropdown"},e,t);case"span":return c().createElement("span",{className:"tfdropdown"},e,t);default:return c().createElement("div",{className:"tfdropdown"},e,t)}}}]),n}(c().Component);mo.propTypes={wrapperTag:p().string,actionTag:p().string,actionLabel:p().oneOfType([p().string,p().object]),options:p().array,dropdownClassName:p().string};var vo=function(){var e=function(e){lo(n,e);var t=fo(n);function n(e){var r;return ao(this,n),(r=t.call(this,e)).handleClickOutside=r.handleClickOutside.bind(ho(r)),r.handleOptionClick=r.handleOptionClick.bind(ho(r)),r}return co(n,[{key:"handleClickOutside",value:function(e){this.props.onClickOutside(e)}},{key:"handleOptionClick",value:function(e){this.props.onOptionClick&&this.props.onOptionClick()}},{key:"render",value:function(){var e=this,t=null;return this.props.className&&(t={className:this.props.className}),c().createElement("ul",t,this.props.options.map((function(t,n){return c().createElement("li",{key:n,onClick:e.handleOptionClick},t)})))}}]),n}(c().Component);return e.propTypes={options:p().array.isRequired,onClickOutside:p().func.isRequired,onOptionClick:p().func},Tr()(e)}();const bo=mo;function go(e){return go="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},go(e)}function wo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Eo(e,t){return Eo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Eo(e,t)}function So(e,t){if(t&&("object"===go(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Oo(e)}function Oo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _o(e){return _o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_o(e)}var ko=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Eo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_o(r);if(o){var n=_o(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return So(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleDelete=t.handleDelete.bind(Oo(t)),t.state={filter:t.props.filter},t}return t=a,n=[{key:"handleDelete",value:function(e,t){t.preventDefault();var n=this.state.filter;n.options.splice(e,1);var r=n.options.map((function(e,t){return e.value}));n.value=r.join(","),this.props.onChange&&this.props.onChange(n)}},{key:"render",value:function(){var e=this,t=this.state.filter.options.map((function(t,n){return c().createElement("a",{key:n,href:"#",className:"tag main-tag"},t.text,c().createElement("span",{className:"remove",onClick:e.handleDelete.bind(null,n)},"Remove"))}));return null!=t&&t.length>0?c().createElement("div",{className:"filter-tags"},t):null}}],n&&wo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);ko.propTypes={filter:p().object};const Co=ko;function Po(e){return Po="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},Po(e)}function jo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function To(e,t){return To=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},To(e,t)}function xo(e,t){if(t&&("object"===Po(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ro(e)}function Ro(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Do(e){return Do=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Do(e)}var No=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&To(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Do(r);if(o){var n=Do(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return xo(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleChange=t.handleChange.bind(Ro(t)),t.handleTagChange=t.handleTagChange.bind(Ro(t)),t}return t=a,(n=[{key:"handleChange",value:function(e){var t=JSON.parse(JSON.stringify(this.props.filter)),n=e.target.name,r=t[n];for(var o in r.value=e.target.value,t)if(t.hasOwnProperty(o)&&null!=t[o]&&t[o]!=r){var i=t[o];null!=i.dependentOf&&i.dependentOf.includes(n)&&(i.value="")}this.props.onChange&&this.props.onChange(t)}},{key:"handleTagChange",value:function(e){var t=JSON.parse(JSON.stringify(this.props.filter));t.tags=e,this.props.onChange&&this.props.onChange(t)}},{key:"render",value:function(){var e=[],t=[];for(var n in this.props.filter)if(this.props.filter.hasOwnProperty(n)){var r=this.props.filter[n];if(null!=r){var o=c().createElement("select",{key:n,name:n,value:r.value,onChange:this.handleChange},r.options.map((function(e,t){return c().createElement("option",{key:t,value:e.value},e.text)})));switch(r.type){case"Sort":t.push(o);break;case"Filter":e.push(o)}}}return c().createElement("div",{className:"filters"},c().createElement("div",{className:"filter-select"},c().createElement("form",null,e.length>0&&c().createElement("fieldset",{className:"filter clearfix"},c().createElement("legend",null,"Filter by"),e),t.length>0&&c().createElement("fieldset",{className:"sort clearfix"},c().createElement("legend",null,"Sort by"),t))),this.props.filter&&this.props.filter.hasOwnProperty("tags")&&c().createElement(Co,{filter:this.props.filter.tags,onChange:this.handleTagChange}))}}])&&jo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);No.propTypes={filter:p().object,onChange:p().func};const Mo=No;function Io(e){return Io="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},Io(e)}function Ao(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bo(e,t){return Bo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bo(e,t)}function Fo(e,t){if(t&&("object"===Io(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Uo(e){return Uo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Uo(e)}var Ko=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Uo(r);if(o){var n=Uo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Fo(this,e)});function a(){return Ao(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=[],t="";!0===this.props.profile.hasFDot&&(t=" hasFDot",e.push("Foundry Account"));var n="";this.props.profile.badges&&this.props.profile.badges.hasOwnProperty("foundryHero")&&this.props.profile.badges.foundryHero.length>0&&(n=" badge-".concat(this.props.profile.badges.foundryHero[0].badge),e.push(this.props.profile.badges.foundryHero[0].name));var r=this.props.showArrow?" icon icon-after icon-arrow":"",o=this.props.colorClassName?" ".concat(this.props.colorClassName):"",i="profile".concat(t).concat(n).concat(r).concat(o),a=!0===this.props.showAvatar&&c().createElement("span",{className:"profile-image",style:{backgroundImage:"url(".concat(this.props.profile.avatarUrl,")")}}),s=c().createElement("span",{className:"profile-name"},this.props.profile.name),l=e.join(", ");return!0===this.props.showLink?c().createElement("a",{href:this.props.profile.url,className:i,title:l},a,s):c().createElement("div",{className:i},a,s)}}])&&Lo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Ko.propTypes={profile:p().object.isRequired,size:p().string,showAvatar:p().bool,showArrow:p().bool,colorClassName:p().string,showLink:p().bool},Ko.defaultProps={showAvatar:!0,showArrow:!1,showLink:!0};const qo=Ko;function Vo(e){return Vo="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},Vo(e)}function zo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ho(e,t){return Ho=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ho(e,t)}function $o(e,t){if(t&&("object"===Vo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Jo(e){return Jo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Jo(e)}var Go=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ho(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Jo(r);if(o){var n=Jo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return $o(this,e)});function a(){return zo(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null;"Asset"==this.props.project.type&&this.props.project.contents&&(e=this.props.project.contents.map((function(e,t){var n="c"+t;return c().createElement("span",{key:n,className:"content-type"},e)})));var t=null;this.props.project.products&&(t=this.props.project.products.map((function(e,t){return c().createElement("span",{key:t,className:"product"},e)})));var n=null;this.props.showProfile&&(n=c().createElement("div",{className:"info"},c().createElement(qo,{profile:this.props.project.profile,showArrow:!0})));var r="card".concat("Asset"==this.props.project.type?" asset-card":""),o="text-container".concat(this.props.showProfile?"":" noprofile"),i=null!=this.props.project.title&&""!=this.props.project.title?this.props.project.title:"Untitled ".concat(this.props.project.type," Project");return c().createElement("article",{className:r},c().createElement("a",{href:this.props.project.url,className:"card-image"},c().createElement("img",{src:this.props.project.thumbUrl})),c().createElement("a",{href:this.props.project.url,className:o},c().createElement("h4",{className:"Training"===this.props.project.type?"video":null,dangerouslySetInnerHTML:mn.createMarkup(i)}),c().createElement("div",{className:"products"},e,t)),n,this.props.children)}}])&&Wo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Go.propTypes={project:p().object.isRequired,showProfile:p().bool},Go.defaultProps={showProfile:!0};const Qo=Go;function Yo(e){return Yo="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},Yo(e)}function Xo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zo(e,t){return Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Zo(e,t)}function ei(e,t){if(t&&("object"===Yo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ti(e)}function ti(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ni(e){return ni=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ni(e)}var ri=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zo(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ni(r);if(o){var n=ni(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ei(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onBackButtonEvent=t.onBackButtonEvent.bind(ti(t)),t.buildQueryString=t.buildQueryString.bind(ti(t)),t.handleFilterChange=t.handleFilterChange.bind(ti(t)),t.handleNewPage=t.handleNewPage.bind(ti(t)),t.populate=t.populate.bind(ti(t)),t.getData=t.getData.bind(ti(t)),t.handleClickDelete=t.handleClickDelete.bind(ti(t)),t.handleDelete=t.handleDelete.bind(ti(t)),t.parsedQS=dn.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.totalPages=null,t.filterHistory=[],t.state={loaded:!1,projects:null,filter:null,showDeleteModal:!1,targetIndex:null},t}return t=a,n=[{key:"componentDidMount",value:function(){this.populate()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=dn.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.getData(null,!1)}},{key:"onBackButtonEvent",value:function(e){var t=this.filterHistory.length>0?this.filterHistory.pop():null;this.getData(t,!1)}},{key:"buildQueryString",value:function(e){var t=[];if(null!=e)for(var n in e)e.hasOwnProperty(n)&&e[n].value&&t.push("".concat(n,"=").concat(e[n].value));this.page&&t.push("p=".concat(this.page));var r="";return t.length>0&&(r="?"+t.join("&")),r}},{key:"handleFilterChange",value:function(e){this.page=0,this.getData(e,!0)}},{key:"handleNewPage",value:function(e){this.page=e,this.getData(this.state.filter,!0)}},{key:"populate",value:function(){var e=this;$.getJSON("/api/dashboard/projects",(function(t){e.totalPages=null!=t?t.gallery.totalPages:e.totalPages,e.setState({loaded:!0,projects:t.gallery.data,filter:t.filter},(function(){$("#globalFooter").removeClass("hide")}))}))}},{key:"getData",value:function(e,t){var n=this.buildQueryString(e),r="/api/dashboard/projects/get".concat(n),o=this;$.getJSON(r,(function(t){o.loaded=!0,o.totalPages=null!=t?t.totalPages:o.totalPages,o.setState({projects:t.data,filter:e},(function(){$("#globalFooter").removeClass("hide")}))}))}},{key:"handleClickDelete",value:function(e){this.setState({showDeleteModal:!0,targetIndex:e})}},{key:"handleDelete",value:function(e){if(!0===e){var t=this.state.projects[this.state.targetIndex],n=this;$.ajax({url:"/api/project/"+t.id+"/delete",type:"DELETE",success:function(e){if(!0===e.isSuccess){var t=n.state.projects;t.splice(n.state.targetIndex,1),n.setState({projects:t,showDeleteModal:!1,targetIndex:null})}}})}}},{key:"render",value:function(){if(!1===this.state.loaded)return c().createElement(On,null);var e,t=this;e=null===this.state.projects||0===this.state.projects.length?c().createElement("div",{className:"no-content",style:{width:"100%"}},"No Projects Found"):this.state.projects.map((function(e,n){var r=null,o=[];return o.push(c().createElement("a",{href:"/project/"+e.id+"/edit"},"Edit")),o.push(c().createElement("a",{onClick:t.handleClickDelete.bind(null,n)},"Delete")),e.viewer.canEdit&&(r=c().createElement("div",{className:"edit"},c().createElement(bo,{wrapperTag:"span",actionTag:"anchor",actionLabel:c().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:o}))),c().createElement(Qo,{key:e.id,project:e,showProfile:!1},r)}));var n=null;if(null!=this.state.targetIndex){var r=this.state.projects[this.state.targetIndex];this.state.showDeleteModal&&(n=c().createElement(B,{contentStyle:{width:"80%",padding:"40px",backgroundColor:"white"}},c().createElement("div",{className:"project-delete-modal report"},c().createElement("h4",null,"Delete project"),c().createElement("p",null,"Are you sure you want to delete the ",c().createElement("strong",null,r.title)," project?  All images, text and stats associated with this project will be permanently deleted."),c().createElement("div",{className:"buttons pull-right"},c().createElement("button",{type:"button",className:"btn-default",onClick:this.handleDelete.bind(null,!1)},"Cancel"),c().createElement("button",{type:"button",className:"btn-primary",onClick:this.handleDelete.bind(null,!0)},"Delete")))))}return c().createElement(c().Fragment,null,c().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange}),c().createElement("div",{className:"cards-container content-subsection"},this.totalPages&&this.totalPages>1&&c().createElement(Nn,{total:this.totalPages,current:this.page,visiblePages:10,onPageChanged:this.handleNewPage}),c().createElement("div",null,e),this.totalPages&&this.totalPages>1&&c().createElement(Nn,{total:this.totalPages,current:this.page,visiblePages:10,onPageChanged:this.handleNewPage})),n)}}],n&&Xo(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);const oi=nt(ri);function ii(e){return ii="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},ii(e)}function ai(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function si(e,t){return si=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},si(e,t)}function ci(e,t){if(t&&("object"===ii(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return li(e)}function li(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ui(e){return ui=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ui(e)}const fi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&si(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ui(r);if(o){var n=ui(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ci(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleChange=t.handleChange.bind(li(t)),t.getValue=t.getValue.bind(li(t)),t}return t=a,(n=[{key:"handleChange",value:function(){this.props.onChange(this.refs.select.value)}},{key:"getValue",value:function(){return this.refs.select.value}},{key:"render",value:function(){return c().createElement("div",{className:"form-group"},c().createElement("label",{className:"static"},"Time Zone"),c().createElement("select",{ref:"select",name:"TimeZone",defaultValue:this.props.value,onChange:this.handleChange},c().createElement("option",{value:"-12"},"[GMT - 12:00] Baker Island Time"),c().createElement("option",{value:"-11"},"[GMT - 11:00] Niue Time, Samoa Standard Time"),c().createElement("option",{value:"-10"},"[GMT - 10:00] Hawaii-Aleutian Standard Time, Cook Island Time"),c().createElement("option",{value:"-9.5"},"[GMT - 9:30] Marquesas Islands Time"),c().createElement("option",{value:"-9"},"[GMT - 9:00] Alaska Standard Time, Gambier Island Time"),c().createElement("option",{value:"-8"},"[GMT - 8:00] Pacific Standard Time"),c().createElement("option",{value:"-7"},"[GMT - 7:00] Mountain Standard Time"),c().createElement("option",{value:"-6"},"[GMT - 6:00] Central Standard Time"),c().createElement("option",{value:"-5"},"[GMT - 5:00] Eastern Standard Time"),c().createElement("option",{value:"-4.5"},"[GMT - 4:30] Venezuelan Standard Time"),c().createElement("option",{value:"-4"},"[GMT - 4:00] Atlantic Standard Time"),c().createElement("option",{value:"-3.5"},"[GMT - 3:30] Newfoundland Standard Time"),c().createElement("option",{value:"-3"},"[GMT - 3:00] Amazon Standard Time, Central Greenland Time"),c().createElement("option",{value:"-2"},"[GMT - 2:00] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time"),c().createElement("option",{value:"-1"},"[GMT - 1:00] Azores Standard Time, Cape Verde Time, Eastern Greenland Time"),c().createElement("option",{value:"0"},"[GMT] Western European Time, Greenwich Mean Time"),c().createElement("option",{value:"1"},"[GMT + 1:00] Central European Time, West African Time"),c().createElement("option",{value:"2"},"[GMT + 2:00] Eastern European Time, Central African Time"),c().createElement("option",{value:"3"},"[GMT + 3:00] Moscow Standard Time, Eastern African Time"),c().createElement("option",{value:"3.5"},"[GMT + 3:30] Iran Standard Time"),c().createElement("option",{value:"4"},"[GMT + 4:00] Gulf Standard Time, Samara Standard Time"),c().createElement("option",{value:"4.5"},"[GMT + 4:30] Afghanistan Time"),c().createElement("option",{value:"5"},"[GMT + 5:00] Pakistan Standard Time, Yekaterinburg Standard Time"),c().createElement("option",{value:"5.5"},"[GMT + 5:30] Indian Standard Time, Sri Lanka Time"),c().createElement("option",{value:"5.75"},"[GMT + 5:45] Nepal Time"),c().createElement("option",{value:"6"},"[GMT + 6:00] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time"),c().createElement("option",{value:"6.5"},"[GMT + 6:30] Cocos Islands Time, Myanmar Time"),c().createElement("option",{value:"7"},"[GMT + 7:00] Indochina Time, Krasnoyarsk Standard Time"),c().createElement("option",{value:"8"},"[GMT + 8:00] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time"),c().createElement("option",{value:"8.75"},"[GMT + 8:45] Southeastern Western Australia Standard Time"),c().createElement("option",{value:"9"},"[GMT + 9:00] Japan Standard Time, Korea Standard Time, Chita Standard Time"),c().createElement("option",{value:"9.5"},"[GMT + 9:30] Australian Central Standard Time"),c().createElement("option",{value:"10"},"[GMT + 10:00] Australian Eastern Standard Time, Vladivostok Standard Time"),c().createElement("option",{value:"10.5"},"[GMT + 10:30] Lord Howe Standard Time"),c().createElement("option",{value:"11"},"[GMT + 11:00] Solomon Island Time, Magadan Standard Time"),c().createElement("option",{value:"11.5"},"[GMT + 11:30] Norfolk Island Time"),c().createElement("option",{value:"12"},"[GMT + 12:00] New Zealand Time, Fiji Time, Kamchatka Standard Time"),c().createElement("option",{value:"12.75"},"[GMT + 12:45] Chatham Islands Time"),c().createElement("option",{value:"13"},"[GMT + 13:00] Tonga Time, Phoenix Islands Time"),c().createElement("option",{value:"14"},"[GMT + 14:00] Line Island Time")))}}])&&ai(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function pi(e){return pi="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},pi(e)}function hi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function di(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yi(e,t){return yi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yi(e,t)}function mi(e,t){if(t&&("object"===pi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function vi(e){return vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vi(e)}var bi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yi(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vi(r);if(o){var n=vi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return mi(this,e)});function a(){return hi(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("span",{className:"help-block"},this.props.message)}}])&&di(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);bi.propTypes={message:p().string.isRequired};const gi=bi;function wi(e){return wi="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},wi(e)}function Ei(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Si(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oi(e,t,n){return t&&Si(e.prototype,t),n&&Si(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ki(e,t)}function ki(e,t){return ki=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ki(e,t)}function Ci(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ti(e);if(t){var o=Ti(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Pi(this,n)}}function Pi(e,t){if(t&&("object"===wi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ji(e)}function ji(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ti(e){return Ti=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ti(e)}var xi=function(e){_i(n,e);var t=Ci(n);function n(e){var r;return Ei(this,n),(r=t.call(this,e)).validate=r.validate.bind(ji(r)),r.getSelectedOptions=r.getSelectedOptions.bind(ji(r)),r.handleChange=r.handleChange.bind(ji(r)),r.getOption=r.getOption.bind(ji(r)),r.getSelectedOptionIndex=r.getSelectedOptionIndex.bind(ji(r)),r.onDelete=r.onDelete.bind(ji(r)),r.onUpdateOrder=r.onUpdateOrder.bind(ji(r)),r.handleGroupFocus=r.handleGroupFocus.bind(ji(r)),r.handleGroupBlur=r.handleGroupBlur.bind(ji(r)),r.placeholderValue=null!=r.props.placeholderOption?r.props.placeholderOption.value:null,r.state={selectedOptions:r.props.selectedOptions?r.props.selectedOptions:[],validate:!1,isValid:!0===r.props.required&&null!=r.props.selectedOptions&&r.props.selectedOptions.length>0,showValidation:!1,hasFocus:!1},r}return Oi(n,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){null!=e.selectedOptions&&e.selectedOptions!==this.state.selectedOptions&&this.setState({selectedOptions:e.selectedOptions?e.selectedOptions:[]})}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.selectedOptions&&this.state.selectedOptions.length>0}},{key:"getSelectedOptions",value:function(){return this.state.selectedOptions}},{key:"handleChange",value:function(){var e=this.refs.select.value,t=this.getOption(e);if(e!=this.placeholderValue&&null==this.getSelectedOptionIndex(e)){var n=this.state.selectedOptions;n.push(t),this.setState({selectedOptions:n,isValid:this.valid()}),this.placeholderValue&&(this.refs.select.value,this.placeholderValue)}}},{key:"getOption",value:function(e){for(var t=0;t<this.props.options.length;t++)if(this.props.options[t].value==e)return this.props.options[t];return null}},{key:"getSelectedOptionIndex",value:function(e){for(var t=0;t<this.state.selectedOptions.length;t++)if(this.state.selectedOptions[t].value==e)return t;return null}},{key:"onDelete",value:function(e){var t=this.state.selectedOptions;t.splice(e,1),this.setState({selectedOptions:t,isValid:this.valid()})}},{key:"onUpdateOrder",value:function(e,t){var n=this.state.selectedOptions;n.splice(t,0,n.splice(e,1)[0]),this.setState({selectedOptions:n})}},{key:"handleGroupFocus",value:function(){this.setState({hasFocus:!0})}},{key:"handleGroupBlur",value:function(){this.setState({hasFocus:!1})}},{key:"render",value:function(){var e=this,t=this.props.options.map((function(t,n){var r=!1;return null!==e.getSelectedOptionIndex(t.value)&&(r=!0),c().createElement("option",{key:t.value,value:t.value,disabled:r},t.text)})),n="multiselect-editor form-group";!0!==this.state.showValidation||this.state.isValid?!0===this.state.hasFocus&&(n+=" has-focus"):n+=" has-error";var r="static";!0===this.props.required&&(r+=" required");var o=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(o=c().createElement(gi,{message:this.props.helpMessage})):o=c().createElement(gi,{message:this.props.requiredErrorMessage}),c().createElement("div",{className:n,onFocus:this.handleGroupFocus,onBlur:this.handleGroupBlur},this.props.label&&c().createElement("label",{className:r},this.props.label),c().createElement("div",null,c().createElement("select",{ref:"select",value:this.placeholderValue,onChange:this.handleChange},null!=this.props.placeholderOption&&c().createElement("option",{key:this.props.placeholderOption.value,value:this.props.placeholderOption.value,disabled:!1},this.props.placeholderOption.text),t),c().createElement(Ri,{data:this.state.selectedOptions,onUpdateOrder:this.onUpdateOrder,onDelete:this.onDelete})),o)}}]),n}(c().Component);xi.propTypes={label:p().string,helpMessage:p().string,options:p().array.isRequired,placeholderOption:p().object,selectedOptions:p().array,required:p().bool,requiredErrorMessage:p().string},xi.defaultProps={required:!1,requiredErrorMessage:"At least one item is required"};var Ri=function(e){_i(n,e);var t=Ci(n);function n(e){var r;return Ei(this,n),(r=t.call(this,e)).dragStart=r.dragStart.bind(ji(r)),r.dragOver=r.dragOver.bind(ji(r)),r.dragEnter=r.dragEnter.bind(ji(r)),r.dragEnd=r.dragEnd.bind(ji(r)),r.placeholder=document.createElement("li"),r.placeholder.className="placeholder",r.dragged=null,r}return Oi(n,[{key:"dragStart",value:function(e){this.dragged=e.currentTarget,e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("Text",e.currentTarget.id)}},{key:"dragOver",value:function(e){if(e.preventDefault(),this.dragged.style.display="none","placeholder"!=e.target.className&&"LI"==e.target.nodeName){this.over=e.target;var t=e.pageY-$(this.over).offset().top,n=this.over.offsetHeight/2,r=e.target.parentNode;"OL"==r.nodeName&&(t>n?(this.nodePlacement="after",r.insertBefore(this.placeholder,e.target.nextElementSibling)):(this.nodePlacement="before",r.insertBefore(this.placeholder,e.target)))}}},{key:"dragEnter",value:function(e){e.preventDefault()}},{key:"dragEnd",value:function(e){this.dragged.style.display="block",this.dragged.parentNode.removeChild(this.placeholder);var t=Number(this.dragged.dataset.id),n=Number(this.over.dataset.id);t<n&&n--,"after"==this.nodePlacement&&n++,this.props.onUpdateOrder(t,n)}},{key:"render",value:function(){if(null===this.props.data&&0===this.props.data.length)return null;var e=this;return c().createElement("ol",{onDragOver:this.dragOver,onDragEnter:this.dragEnter},this.props.data.map((function(t,n){return c().createElement("li",{"data-id":n,key:n,draggable:!0,onDragEnd:e.dragEnd,onDragStart:e.dragStart},c().createElement("span",{className:"drag-handle glyphicon glyphicon-option-vertical"}),null!=t.display?t.display:t.text," ",c().createElement("button",{type:"button",className:"close",onClick:e.props.onDelete.bind(null,n)},c().createElement("span",null,"×")))})))}}]),n}(c().Component);const Di=xi;function Ni(e){return Ni="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},Ni(e)}function Mi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ii(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ai(e,t,n){return t&&Ii(e.prototype,t),n&&Ii(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Li(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bi(e,t)}function Bi(e,t){return Bi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bi(e,t)}function Fi(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qi(e);if(t){var o=qi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ui(this,n)}}function Ui(e,t){if(t&&("object"===Ni(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ki(e)}function Ki(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qi(e){return qi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qi(e)}var Vi=function(e){Li(n,e);var t=Fi(n);function n(e){var r;Mi(this,n),(r=t.call(this,e)).setSelected=r.setSelected.bind(Ki(r)),r.updateHasSelectedChildren=r.updateHasSelectedChildren.bind(Ki(r)),r.clearSelectedForums=r.clearSelectedForums.bind(Ki(r)),r.getSelectedForums=r.getSelectedForums.bind(Ki(r)),r.getSelected=r.getSelected.bind(Ki(r)),r.handleSelect=r.handleSelect.bind(Ki(r)),r.updateSelected=r.updateSelected.bind(Ki(r)),r.findForum=r.findForum.bind(Ki(r)),r.handleShow=r.handleShow.bind(Ki(r));var o=r.props.forums;null!=r.props.selectedForums&&r.setSelected(o,r.props.selectedForums);var i=[];return r.updateHasSelectedChildren(o,i),r.state={forums:o,show:[],hasSelectedChildren:i},r}return Ai(n,[{key:"setSelected",value:function(e,t){for(var n=0;n<=e.length-1;n++){var r=t.indexOf(e[n].id);e[n].isSelected=-1!=r,null!=e[n].children&&e[n].children.length>0&&this.setSelected(e[n].children,t)}}},{key:"updateHasSelectedChildren",value:function(e,t){for(var n=!1,r=0;r<=e.length-1;r++)!0===e[r].isSelected&&(n=!0),null!=e[r].children&&e[r].children.length>0&&!0===this.updateHasSelectedChildren(e[r].children,t)&&("Root"===e[r].type&&t.push(e[r].id),n=!0);return n}},{key:"clearSelectedForums",value:function(){this.setSelected(this.state.forums,[]),this.setState({show:[],hasSelectedChildren:[]})}},{key:"getSelectedForums",value:function(){var e=[];return this.getSelected(this.state.forums,e),e}},{key:"getSelected",value:function(e,t){for(var n=0;n<=e.length-1;n++)!0===e[n].isSelected&&t.push(e[n].id),null!=e[n].children&&e[n].children.length>0&&this.getSelected(e[n].children,t)}},{key:"handleSelect",value:function(e,t){var n=JSON.parse(JSON.stringify(this.state.forums)),r=this.findForum(n,e);this.updateSelected(r,t);var o=[];this.updateHasSelectedChildren(n,o),this.setState({forums:n,hasSelectedChildren:o})}},{key:"updateSelected",value:function(e,t){if(e.isSelected=t,null!=e.children&&e.children.length>0)for(var n=0;n<=e.children.length-1;n++)this.updateSelected(e.children[n],t)}},{key:"findForum",value:function(e,t){for(var n=0;n<=e.length-1;n++){if(e[n].id==t)return e[n];if(null!=e[n].children&&e[n].children.length>0){var r=this.findForum(e[n].children,t);if(null!=r)return r}}return null}},{key:"handleShow",value:function(e){var t=JSON.parse(JSON.stringify(this.state.show)),n=t.indexOf(e);-1===n?t.push(e):t.splice(n,1),this.setState({show:t})}},{key:"render",value:function(){var e=this,t=this.state.forums.map((function(t){var n=-1!=e.state.hasSelectedChildren.indexOf(t.id);switch(t.type){case"Root":var r=-1!=e.state.show.indexOf(t.id);return c().createElement(zi,{key:t.id,root:t,onSelect:e.handleSelect,onShow:e.handleShow,show:r,hasSelectedChildren:n});case"Group":return c().createElement(Hi,{key:t.id,group:t,onSelect:e.handleSelect})}}));return c().createElement("div",{className:"forumSelectTree"},t)}}]),n}(c().Component);Vi.propTypes={forums:p().array,selectedForums:p().array};var zi=function(e){Li(n,e);var t=Fi(n);function n(){return Mi(this,n),t.apply(this,arguments)}return Ai(n,[{key:"render",value:function(){var e=this,t=this.props.root.children.map((function(t){return c().createElement(Hi,{key:t.id,group:t,onSelect:e.props.onSelect})}));return c().createElement("div",null,c().createElement(Wi,{show:this.props.show,onClick:this.props.onShow.bind(null,this.props.root.id)}),c().createElement(Ji,{forum:this.props.root,onSelect:this.props.onSelect,hasSelectedChildren:this.props.hasSelectedChildren}),!0===this.props.show&&c().createElement("ul",{className:"root"},t))}}]),n}(c().Component),Wi=function(e){Li(n,e);var t=Fi(n);function n(){return Mi(this,n),t.apply(this,arguments)}return Ai(n,[{key:"render",value:function(){var e=!0===this.props.show?"caret":"right-caret";return c().createElement("div",{className:"expand",onClick:this.props.onClick},c().createElement("span",{className:e}))}}]),n}(c().Component),Hi=function(e){Li(n,e);var t=Fi(n);function n(){return Mi(this,n),t.apply(this,arguments)}return Ai(n,[{key:"render",value:function(){var e=this,t=this.props.group.children.map((function(t){switch(t.type){case"Group":return c().createElement(n,{key:t.id,group:t,onSelect:e.props.onSelect});case"Discussion":case"Gallery":return c().createElement($i,{key:t.id,forum:t,onSelect:e.props.onSelect});default:return null}}));return c().createElement("li",null,c().createElement(Ji,{forum:this.props.group,onSelect:this.props.onSelect}),c().createElement("ul",{className:"group"},t))}}]),n}(c().Component),$i=function(e){Li(n,e);var t=Fi(n);function n(){return Mi(this,n),t.apply(this,arguments)}return Ai(n,[{key:"render",value:function(){return c().createElement("li",null,c().createElement(Ji,{forum:this.props.forum,onSelect:this.props.onSelect}))}}]),n}(c().Component),Ji=function(e){Li(n,e);var t=Fi(n);function n(e){var r;return Mi(this,n),(r=t.call(this,e)).handleClick=r.handleClick.bind(Ki(r)),r}return Ai(n,[{key:"handleClick",value:function(e){this.props.onSelect&&this.props.onSelect(this.props.forum.id,this.refs.checkbox.checked)}},{key:"render",value:function(){var e="noselect".concat(this.props.hasSelectedChildren&&!0===this.props.hasSelectedChildren?" has-selected-children":"");return c().createElement("label",{className:e},c().createElement("input",{type:"checkbox",ref:"checkbox",checked:this.props.forum.isSelected,onChange:this.handleClick})," ",this.props.forum.name)}}]),n}(c().Component);const Gi=Vi;function Qi(e){return Qi="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},Qi(e)}function Yi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xi(e,t){return Xi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Xi(e,t)}function Zi(e,t){if(t&&("object"===Qi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ea(e)}function ea(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ta(e){return ta=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ta(e)}const na=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xi(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ta(r);if(o){var n=ta(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Zi(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(ea(t)),t.handleAutoSubscribeChange=t.handleAutoSubscribeChange.bind(ea(t)),t.handleAddSignatureToPostChange=t.handleAddSignatureToPostChange.bind(ea(t)),t.handleHideRootProductLinksChange=t.handleHideRootProductLinksChange.bind(ea(t)),t.handleTimeZoneChange=t.handleTimeZoneChange.bind(ea(t)),t.handleSignatureChange=t.handleSignatureChange.bind(ea(t)),t.handleLimitUnreadPostsChange=t.handleLimitUnreadPostsChange.bind(ea(t)),t.onShowUnread=t.onShowUnread.bind(ea(t)),t.onAcceptUnread=t.onAcceptUnread.bind(ea(t)),t.onCancelUnread=t.onCancelUnread.bind(ea(t)),t.handleCancel=t.handleCancel.bind(ea(t)),t.handleSubmit=t.handleSubmit.bind(ea(t)),t.state={form:null,showUnreadPostsForumsModal:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/dashboard/preferences").done((function(t,n,r){e.setState({form:t})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleAutoSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribe=!t.autoSubscribe,this.setState({form:t})}},{key:"handleAddSignatureToPostChange",value:function(e){var t=this.state.form;t.addSignatureToPost=!t.addSignatureToPost,this.setState({form:t})}},{key:"handleHideRootProductLinksChange",value:function(e){var t=this.state.form;t.hideRootProductLinks=!t.hideRootProductLinks,this.setState({form:t})}},{key:"handleTimeZoneChange",value:function(e){var t=this.state.form;t.utcOffset=e,this.setState({form:t})}},{key:"handleSignatureChange",value:function(e){}},{key:"handleLimitUnreadPostsChange",value:function(e){var t=this.state.form;t.limitUnreadPosts=!t.limitUnreadPosts,this.setState({form:t})}},{key:"onShowUnread",value:function(){this.setState({showUnreadPostsForumsModal:!0})}},{key:"onAcceptUnread",value:function(){var e=this.state.form;e.unreadPostsForumData=this.refs.unreadForums.getSelectedForums(),this.setState({form:e,showUnreadPostsForumsModal:!1})}},{key:"onCancelUnread",value:function(){this.setState({showUnreadPostsForumsModal:!1})}},{key:"handleCancel",value:function(){this.setup()}},{key:"handleSubmit",value:function(){var e=this.state.form;e.rootForumDisplayData=this.refs.rootForumDisplay.getSelectedOptions(),e.signature=this.refs.signature.value,$.ajax({type:"POST",url:"/api/dashboard/preferences",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success("Preferences Saved")})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return null===this.state.form?null:c().createElement("div",{className:"preferences"},c().createElement("div",{className:"container clearfix"},c().createElement("fieldset",null,c().createElement("legend",null,"Community Site Preferences"),c().createElement("div",{className:"row clearfix"},c().createElement("div",{className:"col-lg-12"},c().createElement(fi,{value:this.state.form.utcOffset,onChange:this.handleTimeZoneChange})))),c().createElement("fieldset",null,c().createElement("legend",null,"Forum Preferences"),c().createElement("div",{className:"row clearfix"},c().createElement("div",{className:"col-lg-12"},c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"autoSubscribe",name:"autoSubscribe",checked:this.state.form.autoSubscribe,onChange:this.handleAutoSubscribeChange}),c().createElement("label",{htmlFor:"autoSubscribe"},"Automatically Set Subscription Checkbox During New Topic / Reply To Topic"))))),c().createElement("fieldset",null,c().createElement("legend",null,"Signature"),c().createElement("div",{className:"row clearfix"},c().createElement("div",{className:"col-lg-12"},c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"addSignatureToPost",name:"addSignatureToPost",checked:this.state.form.addSignatureToPost,onChange:this.handleAddSignatureToPostChange}),c().createElement("label",{htmlFor:"addSignatureToPost"},"Add Signature To Forum Posts")),c().createElement("div",{className:"form-group"},c().createElement("textarea",{name:"signature",ref:"signature",rows:"3",defaultValue:this.state.form.signature,onChange:this.handleSignatureChange,disabled:!this.state.form.addSignatureToPost}))))),c().createElement("fieldset",null,c().createElement("legend",null,"Forum Product Links"),c().createElement("div",{className:"row unread clearfix"},c().createElement("div",{className:"col-lg-12"},c().createElement("p",{className:"description"},'A group of links to product specific forums has been placed on the front page for the forum to help guide new users.  Advanced users can hide this group and continue using the products drop-down under the "Discuss" section navigation bar.'),c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"hideRootProductLinks",name:"hideRootProductLinks",checked:this.state.form.hideRootProductLinks,onChange:this.handleHideRootProductLinksChange}),c().createElement("label",{htmlFor:"hideRootProductLinks"},"Hide Product links group from front page of forum."))))),c().createElement("fieldset",null,c().createElement("legend",null,"Forum Front Page"),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-lg-12"},c().createElement("p",{className:"description"},"Select the Foundry product specific forums you want to display on the front page of the forum under the 'General' section.  On desktop browsers you can also arrange the products in any order through drag and drop."),c().createElement(Di,{ref:"rootForumDisplay",required:!1,options:this.state.form.rootForumDisplayOptions,placeholderOption:{text:"Select front page forums",value:"-1"},selectedOptions:this.state.form.rootForumDisplayData})))),c().createElement("fieldset",null,c().createElement("legend",null,"Forum Unread Posts Limit"),c().createElement("div",{className:"row unread"},c().createElement("div",{className:"col-lg-12"},c().createElement("p",{className:"description"},"The Unread Posts feature defaults to displaying results from all forums.  You can limit the results to specific forums by enabling this preference."),c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"limitUnreadPosts",name:"limitUnreadPosts",checked:this.state.form.limitUnreadPosts,onChange:this.handleLimitUnreadPostsChange}),c().createElement("label",{htmlFor:"limitUnreadPosts"},"Limit Unread Posts to Selected Forums")),c().createElement("div",{className:"unread-select"},c().createElement("button",{className:"btn-default",type:"button",onClick:this.onShowUnread,disabled:!this.state.form.limitUnreadPosts},"Select Forums For Unread Posts"),c().createElement("span",null,this.state.form.unreadPostsForumData?this.state.form.unreadPostsForumData.length:0," forums selected")),this.state.showUnreadPostsForumsModal&&c().createElement(B,{closeOnEsc:!0,contentClass:"unread-overlay"},c().createElement(Gi,{ref:"unreadForums",forums:this.state.form.unreadPostsForumOptions,selectedForums:this.state.form.unreadPostsForumData}),c().createElement("ul",{className:"list-inline center-contents"},c().createElement("li",null,c().createElement("button",{className:"btn-default",onClick:this.onCancelUnread},"Cancel")),c().createElement("li",null,c().createElement("button",{className:"btn-primary",onClick:this.onAcceptUnread},"Accept Selection")))))))),c().createElement("ul",{className:"list-inline center-contents"},c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-default",name:"reset",onClick:this.handleCancel},"Reset")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Save Preferences"))))}}])&&Yi(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function ra(e){return ra="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},ra(e)}function oa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ia(e,t){return ia=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ia(e,t)}function aa(e,t){if(t&&("object"===ra(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function sa(e){return sa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},sa(e)}var ca=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ia(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=sa(r);if(o){var n=sa(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return aa(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).displayValues=[{label:"Forum in",lengthOffset:2},{label:"Topic in",lengthOffset:1},{label:"in",lengthOffset:1}],t}return t=a,(n=[{key:"render",value:function(){if(!this.props.path)return null;var e=this.displayValues[0];switch(this.props.displayMode.toLowerCase()){case"topic":e=this.displayValues[1];break;case"search":e=this.displayValues[2];break;default:e=this.displayValues[0]}for(var t=[],n=0;n<=this.props.path.length-e.lengthOffset;n++)t.push(c().createElement(lt,{key:n,to:this.props.path[n].url},this.props.path[n].name));return c().createElement("span",{className:"forum-path"},e.label," ",t)}}])&&oa(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);ca.propTypes={displayMode:p().string},ca.defaultProps={displayMode:"forum"};const la=ca;function ua(e){return ua="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},ua(e)}function fa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ha(e,t){return ha=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ha(e,t)}function da(e,t){if(t&&("object"===ua(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ya(e){return ya=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ya(e)}const ma=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ha(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ya(r);if(o){var n=ya(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return da(this,e)});function a(){return fa(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.data)return null;var e="contribution-info".concat(this.props.addClass);return c().createElement("div",{className:e},c().createElement("time",null,this.props.data.displayDT),this.props.data.profile&&c().createElement(qo,{profile:this.props.data.profile}))}}])&&pa(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function va(e){return va="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},va(e)}function ba(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ga(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wa(e,t,n){return t&&ga(e.prototype,t),n&&ga(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ea(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sa(e,t)}function Sa(e,t){return Sa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Sa(e,t)}function Oa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ka(e);if(t){var o=ka(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return _a(this,n)}}function _a(e,t){if(t&&("object"===va(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ka(e){return ka=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ka(e)}var Ca=function(e){Ea(n,e);var t=Oa(n);function n(){return ba(this,n),t.apply(this,arguments)}return wa(n,[{key:"render",value:function(){var e=[];this.props.topics.data.forEach((function(t,n){e.push(c().createElement(Pa,{key:"t:"+t.topicID,topic:t}))}));var t="".concat(this.props.topics.totalRecords," ").concat(this.props.topicCountLabel?this.props.topicCountLabel:"").concat(1==this.props.topics.totalRecords?"topic":"topics");return c().createElement("div",{className:"thread-container subsection"},this.props.topics.totalPages>1&&c().createElement(Nn,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),c().createElement("div",{className:"thread-filters"},c().createElement("div",{className:"info"},c().createElement("p",{className:"thread-count"},c().createElement("span",null,t)," ",this.props.children)),c().createElement("div",{className:"sort"},c().createElement("span",null,"Started")),c().createElement("div",{className:"sort"},c().createElement("span",null,"Last post"))),c().createElement("div",{className:"thread-wrapper"},e),this.props.topics.totalPages>1&&c().createElement(Nn,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}]),n}(c().Component);Ca.propTypes={topics:p().object.isRequired,viewer:p().object.isRequired,onPageChanged:p().func.isRequired,topicCountLabel:p().string};var Pa=function(e){Ea(n,e);var t=Oa(n);function n(){return ba(this,n),t.apply(this,arguments)}return wa(n,[{key:"render",value:function(){var e=this.props.topic,t=null;"gallery"==e.type.toLowerCase()&&null!=e.thumbUrl&&(t=c().createElement("a",{href:e.url,className:"inline-thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var n=!0===e.viewer.hasNewContent?" new-content":"",r=!0===e.viewer.isSubscribed?" subscribed":"",o="".concat("thread"," clearfix").concat(n).concat(r),i=null;if(e.stickyFL)i=c().createElement("span",{className:"sticky"},c().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":i=c().createElement("span",{className:"moved"},"Moved :");break;case"Linked":i=c().createElement("span",{className:"moved"},"Link :")}return c().createElement("article",{className:o},c().createElement("div",{className:"topic clearfix"},t,c().createElement("div",{className:"info"},c().createElement("h4",null,null!=i&&i," ",c().createElement("a",{href:e.url},e.text)),"None"==e.redirectType&&c().createElement("div",{className:"topic-metrics"},c().createElement("span",null,e.postCount," posts"),c().createElement("span",null,e.viewCount," views"),e.rating>0&&c().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&c().createElement("a",{href:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&c().createElement("a",{href:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"),c().createElement(la,{displayMode:"Search",path:e.forumPath}))),c().createElement("div",{className:"contributions"},c().createElement(ma,{data:e.addedBy,addClass:" started"})),c().createElement("div",{className:"contributions mobile-hidden"},c().createElement(ma,{data:e.lastPostBy,addClass:" latest"}))))}}]),n}(c().Component);Pa.propTypes={topic:p().object.isRequired};const ja=Ca;function Ta(e){return Ta="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},Ta(e)}function xa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ra(e,t){return Ra=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ra(e,t)}function Da(e,t){if(t&&("object"===Ta(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Na(e)}function Na(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ma(e){return Ma=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ma(e)}const Ia=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ra(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ma(r);if(o){var n=Ma(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Da(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(Na(t)),t.addQuerystring=t.addQuerystring.bind(Na(t)),t.getData=t.getData.bind(Na(t)),t.handleMarkTopics=t.handleMarkTopics.bind(Na(t)),t.handleNewPage=t.handleNewPage.bind(Na(t)),t.parsedQS=dn.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.state={hasLoaded:!1,topics:null,viewer:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=dn.parse(e.location.search),e.location&&e.location.search&&this.parsedQS&&this.parsedQS.page?this.page=this.parsedQS.page:this.page=0,this.getData()}},{key:"buildUrl",value:function(){var e="/api/dashboard/unread";return this.addQuerystring(e,this.page)}},{key:"addQuerystring",value:function(e,t){var n=[];return t>0&&n.push("page="+t),n.length>0&&(e+="?"+n.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({hasLoaded:!0,topics:t.topics,viewer:t.viewer},(function(){mn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.push(t.responseJSON.redirectUrl):alerts.error(t.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleMarkTopics",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/dashboard/mark-unread",contentType:"application/json; charset=utf-8",data:JSON.stringify({page:this.page}),dataType:"json",context:this}).done((function(e,n,r){t.page=e.newPage,t.props.history.push(e.redirectUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"handleNewPage",value:function(e){this.page=e;var t=this.addQuerystring(this.props.location.pathname,this.page);this.props.history.push(t)}},{key:"render",value:function(){return!1===this.state.hasLoaded?c().createElement(On,null):!0===this.state.hasLoaded&&0==this.state.topics.data.length?c().createElement("div",{className:"subsection no-content"},"No Unread Posts"):c().createElement(ja,{topics:this.state.topics,viewer:this.state.viewer,topicCountLabel:"Unread ",onPageChanged:this.handleNewPage},c().createElement("button",{type:"button",className:"btn-link",onClick:this.handleMarkTopics},"Mark topics as read"))}}])&&xa(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function Aa(e){return Aa="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},Aa(e)}function La(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ba(e,t){return Ba=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ba(e,t)}function Fa(e,t){if(t&&("object"===Aa(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ua(e)}function Ua(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ka(e){return Ka=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ka(e)}var qa=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ba(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ka(r);if(o){var n=Ka(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Fa(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleSubscribeClick=t.handleSubscribeClick.bind(Ua(t)),t.updateSubscription=t.updateSubscription.bind(Ua(t)),t.getOptionsName=t.getOptionsName.bind(Ua(t)),t.state={period:t.props.period},t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({period:e.period})}},{key:"handleSubscribeClick",value:function(e){e>0?this.updateSubscription(!0,e):this.updateSubscription(!1,0)}},{key:"updateSubscription",value:function(e,t){$.ajax({type:"POST",url:"/api/social/watch",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:e,period:t}),dataType:"json",context:this}).done((function(e,n,r){this.setState({period:t},(function(){this.props.afterAction&&this.props.afterAction(t)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"getOptionsName",value:function(e){for(var t=0;t<this.props.options.length;t++)if(this.props.options[t].value==e)return this.props.options[t].name;return""}},{key:"render",value:function(){var e=this,t=[];if(this.props.options.forEach((function(n){t.push(c().createElement("button",{type:"button",className:"btn-block",onClick:e.handleSubscribeClick.bind(null,n.value),disabled:n.value==e.state.period},n.name))})),0==this.state.period){var n=this.props.addLabel&&""!=this.props.addLabel?this.props.addLabel:"Watch +";return c().createElement(bo,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:n,options:t,dropdownClassName:"subscription"})}n="".concat(this.props.activeLabelPrefix).concat(this.getOptionsName(this.state.period));var r=this.props.removeLabel&&""!=this.props.removeLabel?this.props.removeLabel:"Stop watching -";return t.push(c().createElement("button",{type:"button",className:"btn-block",onClick:e.handleSubscribeClick.bind(null,-1)},r)),c().createElement(bo,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:n,options:t,dropdownClassName:"subscription"})}}])&&La(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);qa.propTypes={consumer:p().string,id:p().number,period:p().number,addLabel:p().string,removeLabel:p().string};const Va=qa;function za(e){return za="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},za(e)}function Wa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ha(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $a(e,t,n){return t&&Ha(e.prototype,t),n&&Ha(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ja(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ga(e,t)}function Ga(e,t){return Ga=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ga(e,t)}function Qa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Za(e);if(t){var o=Za(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ya(this,n)}}function Ya(e,t){if(t&&("object"===za(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xa(e)}function Xa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Za(e){return Za=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Za(e)}var es=function(e){Ja(n,e);var t=Qa(n);function n(){return Wa(this,n),t.apply(this,arguments)}return $a(n,[{key:"render",value:function(){var e=this,t=[];this.props.forums.data.forEach((function(n,r){t.push(c().createElement(ts,{key:"f:"+n.itemID,forum:n,onSubscriptionChange:e.props.onSubscriptionChange}))}));var n="".concat(this.props.forums.totalRecords," ").concat(this.props.forumCountLabel?this.props.forumCountLabel:"").concat(1==this.props.forums.totalRecords?"forum":"forums");return c().createElement("div",{className:"thread-container subsection"},this.props.forums.totalPages>1&&c().createElement(Nn,{total:this.props.forums.totalPages,current:this.props.forums.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),c().createElement("div",{className:"thread-filters"},c().createElement("div",{className:"info"},c().createElement("p",{className:"thread-count"},c().createElement("span",null,n)," ",this.props.children)),c().createElement("div",{className:"control"},c().createElement("span",null,"Subscription Type")),c().createElement("div",{className:"sort"},c().createElement("span",null,"Last post"))),c().createElement("div",{className:"thread-wrapper"},t),this.props.forums.totalPages>1&&c().createElement(Nn,{total:this.props.forums.totalPages,current:this.props.forums.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}]),n}(c().Component);es.propTypes={forums:p().object.isRequired,viewer:p().object.isRequired,onPageChanged:p().func.isRequired};var ts=function(e){Ja(n,e);var t=Qa(n);function n(e){var r;return Wa(this,n),(r=t.call(this,e)).onSubscriptionChange=r.onSubscriptionChange.bind(Xa(r)),r}return $a(n,[{key:"onSubscriptionChange",value:function(e){this.props.onSubscriptionChange&&this.props.onSubscriptionChange(this.props.forum.itemID,e)}},{key:"render",value:function(){var e=this.props.forum,t=!0===e.hasNewContent?" new-content":"",n=0===e.subscription?" deleted":"",r="thread clearfix".concat(t).concat(n);return c().createElement("article",{className:r},c().createElement("div",{className:"topic clearfix"},c().createElement("div",{className:"info"},c().createElement("h4",null,c().createElement("a",{href:e.forum.url},e.forum.name)),c().createElement("div",{className:"topic-metrics"},c().createElement("span",null,e.topicCount," topics"),c().createElement("span",null,e.postCount," posts"),c().createElement(la,{displayMode:"Search",path:e.forumPath}))),c().createElement("div",{className:"control"},c().createElement(Va,{consumer:"Forum",id:e.itemID,period:e.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per new topic",value:50},{name:"Notify me on all posts",value:100}],activeLabelPrefix:"",removeLabel:"Stop watching forum -",afterAction:this.onSubscriptionChange})),c().createElement("div",{className:"contributions"},c().createElement(ma,{data:e.lastPostBy,addClass:" latest"}))))}}]),n}(c().Component);ts.propTypes={forum:p().object.isRequired};const ns=es;function rs(e){return rs="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},rs(e)}function os(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function is(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function as(e,t,n){return t&&is(e.prototype,t),n&&is(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ss(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cs(e,t)}function cs(e,t){return cs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},cs(e,t)}function ls(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ps(e);if(t){var o=ps(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return us(this,n)}}function us(e,t){if(t&&("object"===rs(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fs(e)}function fs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ps(e){return ps=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ps(e)}var hs=function(e){ss(n,e);var t=ls(n);function n(){return os(this,n),t.apply(this,arguments)}return as(n,[{key:"render",value:function(){var e=this,t=[];this.props.topics.data.forEach((function(n,r){t.push(c().createElement(ds,{key:"t:"+n.itemID,topic:n,onSubscriptionChange:e.props.onSubscriptionChange}))}));var n="".concat(this.props.topics.totalRecords," ").concat(this.props.topicCountLabel?this.props.topicCountLabel:"").concat(1==this.props.topics.totalRecords?"topic":"topics");return c().createElement("div",{className:"thread-container subsection"},this.props.topics.totalPages>1&&c().createElement(Nn,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),c().createElement("div",{className:"thread-filters"},c().createElement("div",{className:"info"},c().createElement("p",{className:"thread-count"},c().createElement("span",null,n)," ",this.props.children)),c().createElement("div",{className:"control"},c().createElement("span",null,"Subscription Type")),c().createElement("div",{className:"sort"},c().createElement("span",null,"Last post"))),c().createElement("div",{className:"thread-wrapper"},t),this.props.topics.totalPages>1&&c().createElement(Nn,{total:this.props.topics.totalPages,current:this.props.topics.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}]),n}(c().Component);hs.propTypes={topics:p().object.isRequired,viewer:p().object.isRequired,onPageChanged:p().func.isRequired,topicCountLabel:p().string};var ds=function(e){ss(n,e);var t=ls(n);function n(e){var r;return os(this,n),(r=t.call(this,e)).onSubscriptionChange=r.onSubscriptionChange.bind(fs(r)),r}return as(n,[{key:"onSubscriptionChange",value:function(e){this.props.onSubscriptionChange&&this.props.onSubscriptionChange(this.props.topic.itemID,e)}},{key:"render",value:function(){var e=this.props.topic,t=null;"gallery"==e.type.toLowerCase()&&null!=e.thumbUrl&&(t=c().createElement("a",{href:e.url,className:"inline-thumb",style:{backgroundImage:'url("'+e.thumbUrl+'")'}}));var n=!0===e.viewer.hasNewContent?" new-content":"",r=0===e.subscription?" deleted":"",o="thread clearfix".concat(n).concat(r),i=null;if(e.stickyFL)i=c().createElement("span",{className:"sticky"},c().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":i=c().createElement("span",{className:"moved"},"Moved :");break;case"Linked":i=c().createElement("span",{className:"moved"},"Link :")}return c().createElement("article",{className:o},c().createElement("div",{className:"topic clearfix"},t,c().createElement("div",{className:"info"},c().createElement("h4",null,null!=i&&i," ",c().createElement("a",{href:e.url},e.text)),"None"==e.redirectType&&c().createElement("div",{className:"topic-metrics"},c().createElement("span",null,e.postCount," posts"),c().createElement("span",null,e.viewCount," views"),e.rating>0&&c().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&c().createElement("a",{href:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&c().createElement("a",{href:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"),c().createElement(la,{displayMode:"Search",path:e.forumPath}))),c().createElement("div",{className:"control"},c().createElement(Va,{consumer:"Topic",id:e.itemID,period:e.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per topic view",value:50},{name:"Notify me on all new posts",value:100}],activeLabelPrefix:"",removeLabel:"Stop watching topic -",afterAction:this.onSubscriptionChange})),c().createElement("div",{className:"contributions"},c().createElement(ma,{data:e.lastPostBy,addClass:" latest"}))))}}]),n}(c().Component);ds.propTypes={topic:p().object.isRequired};const ys=hs;function ms(e){return ms="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},ms(e)}function vs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bs(e,t){return bs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},bs(e,t)}function gs(e,t){if(t&&("object"===ms(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ws(e)}function ws(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Es(e){return Es=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Es(e)}const Ss=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bs(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Es(r);if(o){var n=Es(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return gs(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).addQuerystring=t.addQuerystring.bind(ws(t)),t.getData=t.getData.bind(ws(t)),t.handleFilterChange=t.handleFilterChange.bind(ws(t)),t.handleNewPage=t.handleNewPage.bind(ws(t)),t.handleSubscriptionChange=t.handleSubscriptionChange.bind(ws(t)),t.hasLoaded=!1,t.mode=t.props.mode,t.parsedQS=dn.parse(e.location.search),t.state={pagedData:null,viewer:null,filter:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getData(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key==e.location.key&&this.mode==e.mode||(this.mode!=e.mode&&(this.hasLoaded=!1,this.mode=e.mode),this.parsedQS=dn.parse(e.location.search),this.getData(e))}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.location.key==e.location.key&&this.mode==e.mode}},{key:"addQuerystring",value:function(e,t,n){var r=[];if(null!=t)for(var o in t)t.hasOwnProperty(o)&&t[o].value&&""!=t[o].value&&r.push("".concat(o,"=").concat(t[o].value));return n>0&&r.push("page="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(e){var t=this.parsedQS.page?this.parsedQS.page:0,n=this,r="/api/dashboard/subscriptions/".concat(this.mode.toLowerCase()).concat(e.location.search),o=!this.hasLoaded;$.getJSON(r).done((function(e,r,i){if(n.hasLoaded=!0,t>0&&null===e.pagedData.totalRecords){var a=n.addQuerystring(n.props.location.pathname,n.state.filter,t-1);this.props.history.push(a)}else n.setState({pagedData:e.pagedData,viewer:e.viewer,filter:e.filter},(function(){o||window.scrollTo(0,0)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.addQuerystring(t.props.location.pathname,t.state.filter,0);t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.addQuerystring(this.props.location.pathname,this.state.filter,e);this.props.history.push(t)}},{key:"handleSubscriptionChange",value:function(e,t){for(var n=this.state.pagedData,r=0;r<n.data.length;r++)n.data[r].itemID===e&&(n.data[r].subscription=t);this.setState({pagedData:n})}},{key:"render",value:function(){if(!1===this.hasLoaded)return c().createElement(On,null);if(!0===this.hasLoaded&&this.state.pagedData&&0==this.state.pagedData.data.length)return c().createElement("div",{className:"subsection no-content"},"No ",this.mode);var e=null;switch(this.mode){case"Forums":e=c().createElement(ns,{forums:this.state.pagedData,viewer:this.state.viewer,onPageChanged:this.handleNewPage,onSubscriptionChange:this.handleSubscriptionChange});break;case"Topics":e=c().createElement(ys,{topics:this.state.pagedData,viewer:this.state.viewer,topicCountLabel:"",onPageChanged:this.handleNewPage,onSubscriptionChange:this.handleSubscriptionChange})}return c().createElement("div",{className:"subsection"},c().createElement("div",{className:"subsection-filter"},c().createElement("h3",null,"Watched ",this.mode),c().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange})),e)}}])&&vs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));var Os=o(3674),_s=o.n(Os);function ks(e){return ks="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},ks(e)}function Cs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ps(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function js(e,t){return js=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},js(e,t)}function Ts(e,t){if(t&&("object"===ks(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function xs(e){return xs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xs(e)}const Rs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&js(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xs(r);if(o){var n=xs(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ts(this,e)});function a(){return Cs(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"cards-container content-section"},this.props.children)}}])&&Ps(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function Ds(e){return Ds="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},Ds(e)}function Ns(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ms(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Is(e,t){return Is=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Is(e,t)}function As(e,t){if(t&&("object"===Ds(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ls(e){return Ls=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ls(e)}var Bs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Is(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ls(r);if(o){var n=Ls(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return As(this,e)});function a(){return Ns(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null;this.props.showProfile&&(e=c().createElement("div",{className:"info"},c().createElement(qo,{profile:this.props.project.profile,showArrow:!0})));var t="text-container".concat(this.props.showProfile?"":" noprofile");return c().createElement("article",{className:"card"},c().createElement("a",{href:this.props.collection.url,className:"card-image"},c().createElement("img",{src:this.props.collection.thumbUrl})),c().createElement("a",{href:this.props.collection.url,className:t},c().createElement("h4",{className:"Playlist"===this.props.collection.type?"video":null,dangerouslySetInnerHTML:mn.createMarkup(this.props.collection.title)}),c().createElement("div",{className:"details clearfix"},c().createElement("span",{className:"count"},this.props.collection.itemCount," Videos"))),e)}}])&&Ms(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Bs.propTypes={collection:p().object.isRequired,showProfile:p().bool},Bs.defaultProps={showProfile:!1};const Fs=Bs;function Us(e){return Us="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},Us(e)}function Ks(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vs(e,t){return Vs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vs(e,t)}function zs(e,t){if(t&&("object"===Us(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ws(e){return Ws=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ws(e)}var Hs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vs(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ws(r);if(o){var n=Ws(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return zs(this,e)});function a(){return Ks(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e,t=c().createElement("div",{className:"loader"},"Loading ..."),n="Gallery"==this.props.mode,r=this;return e=null==this.props.galleryData||0==this.props.galleryData.length?c().createElement("div",null,"No Projects Found"):this.props.galleryData.map((function(e,t){switch(r.props.galleryOf){case"Project":return c().createElement(Qo,{key:e.id,project:e,showProfile:n});case"Collection":return c().createElement(Fs,{key:e.id,collection:e})}})),e=!0===this.props.loadMoreClicked?c().createElement(_s(),{pageStart:0,loadMore:this.props.loadMore,hasMore:this.props.hasMore,threshold:this.props.scrollThreshold,loader:t},e):c().createElement("div",null,e),c().createElement("div",{className:"subsection filter-results"},c().createElement(Rs,null,e),this.props.children)}}])&&qs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Hs.propTypes={mode:p().string,galleryData:p().array.isRequired,galleryOf:p().string,infiniteScroll:p().bool,scrollThreshold:p().number,hasMore:p().bool,loadMore:p().func,loadMoreClicked:p().bool},Hs.defaultProps={mode:"Gallery",scrollThreshold:30,hasMore:!1,loadMoreClicked:!1};const $s=Hs;function Js(e){return Js="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},Js(e)}function Gs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qs(e,t){return Qs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qs(e,t)}function Ys(e,t){if(t&&("object"===Js(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xs(e)}function Xs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zs(e){return Zs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Zs(e)}var ec=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qs(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Zs(r);if(o){var n=Zs(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ys(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onBackButtonEvent=t.onBackButtonEvent.bind(Xs(t)),t.buildQueryString=t.buildQueryString.bind(Xs(t)),t.loadMore=t.loadMore.bind(Xs(t)),t.handleFilterChange=t.handleFilterChange.bind(Xs(t)),t.handleLoadMoreClick=t.handleLoadMoreClick.bind(Xs(t)),t.getData=t.getData.bind(Xs(t)),t.hasMore=t.props.galleryView.gallery.hasMore,t.filterHistory=[],t.state={galleryData:t.props.galleryView.gallery.data,galleryOf:t.props.galleryView.galleryOf,filter:t.props.galleryView.filter,loadMoreClicked:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){window.onpopstate=this.onBackButtonEvent}},{key:"onBackButtonEvent",value:function(e){var t=this.filterHistory.length>0?this.filterHistory.pop():this.props.galleryView.filter;this.getData(t,null,!1)}},{key:"buildQueryString",value:function(e,t){var n=this.props.qs?this.props.qs.slice():[];if(null!=e)for(var r in e)e.hasOwnProperty(r)&&e[r].value&&n.push("".concat(r,"=").concat(e[r].value));t&&n.push("p=".concat(t));var o="";return n.length>0&&(o="?"+n.join("&")),o}},{key:"loadMore",value:function(e){this.getData(this.state.filter,e,!1)}},{key:"handleFilterChange",value:function(e){this.getData(e,null,!0)}},{key:"handleLoadMoreClick",value:function(){this.setState({loadMoreClicked:!0})}},{key:"getData",value:function(e,t,n){var r=this.buildQueryString(e,t),o="/api/".concat(this.props.section,"/get").concat(r),i="/".concat(this.props.section).concat(r),a=this;$.getJSON(o,(function(r){var o;a.hasMore=!(null==r||!r.hasMore)&&r.hasMore;var s=a.state.loadMoreClicked;null===t?(o=r.data,s=!1):o=null!=r&&r.data.length>0?a.state.data.concat(r.data):a.state.data,!0===a.props.updateHistory&&!0===n&&(a.state.filter!=a.props.galleryView.filter&&a.filterHistory.push(JSON.parse(JSON.stringify(a.state.filter))),history.pushState(null,null,i)),a.setState({galleryData:o,filter:e,loadMoreClicked:s})}))}},{key:"render",value:function(){return c().createElement("div",null,c().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange}),c().createElement($s,{galleryData:this.state.galleryData,galleryOf:this.state.galleryOf,mode:this.props.mode,hasMore:this.hasMore,loadMore:this.loadMore,scrollTheshold:this.props.scrollThreshold,loadMoreClicked:this.state.loadMoreClicked},this.hasMore&&!1===this.state.loadMoreClicked&&c().createElement("button",{className:"load-more",onClick:this.handleLoadMoreClick},"Load more")))}}])&&Gs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);ec.propTypes={mode:p().string,galleryView:p().object.isRequired,section:p().string.isRequired,qs:p().array,updateHistory:p().bool,infiniteScroll:p().bool,scrollThreshold:p().number},ec.defaultProps={mode:"Gallery",updateHistory:!0,scrollThreshold:250};const tc=ec;function nc(e){return nc="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},nc(e)}function rc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ic(e,t,n){return t&&oc(e.prototype,t),n&&oc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ac(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sc(e,t)}function sc(e,t){return sc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sc(e,t)}function cc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=uc(e);if(t){var o=uc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return lc(this,n)}}function lc(e,t){if(t&&("object"===nc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function uc(e){return uc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},uc(e)}c().Component;var fc=function(e){ac(n,e);var t=cc(n);function n(e){var r;return rc(this,n),(r=t.call(this,e)).subsData=[{type:"ClientRoute",children:null,text:"Forums",url:"/dashboard/watched/forums"},{type:"ClientRoute",children:null,text:"Topics",url:"/dashboard/watched/topics"}],r.navData=[{type:"ClientRoute",children:null,text:"Projects",url:"/dashboard"},{type:"ClientRoute",children:null,text:"Unread Posts",url:"/dashboard/unread"},{type:"Group",children:r.subsData,text:"Watched",url:""},{type:"ClientRoute",children:null,text:"Preferences",url:"/dashboard/preferences"}],r}return ic(n,[{key:"render",value:function(){return c().createElement("div",null,c().createElement(oo,{profile:this.props.profile}),c().createElement("div",{className:"app"},c().createElement(hn,{defaultTitle:"Dashboard | Foundry Community",titleTemplate:"%s | Foundry Community"}),c().createElement(rt,null,c().createElement(qr,{data:this.navData}),c().createElement(pc,null))))}}]),n}(c().Component),pc=nt(function(e){ac(n,e);var t=cc(n);function n(e){return rc(this,n),t.call(this,e)}return ic(n,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return c().createElement(tt,null,c().createElement(et,{exact:!0,path:"/dashboard"},c().createElement("div",{className:"content-section"},c().createElement(oi,null))),c().createElement(et,{path:"/dashboard/unread"},c().createElement(Ia,null)),c().createElement(et,{path:"/dashboard/watched/forums"},c().createElement(Ss,{mode:"Forums"})),c().createElement(et,{path:"/dashboard/watched/topics"},c().createElement(Ss,{mode:"Topics"})),c().createElement(et,{path:"/dashboard/preferences"},c().createElement(na,null)))}}]),n}(c().Component));const hc=fc;function dc(e){return dc="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},dc(e)}function yc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vc(e,t){return vc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vc(e,t)}function bc(e,t){if(t&&("object"===dc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gc(e){return gc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},gc(e)}const wc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vc(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=gc(r);if(o){var n=gc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return bc(this,e)});function a(){return yc(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"page-error"},c().createElement("div",{dangerouslySetInnerHTML:{__html:this.props.xhr.responseJSON.errorMessage}}),401==this.props.xhr.status&&c().createElement("div",null,"You will be automatically redirected to ",c().createElement("a",{href:this.props.xhr.responseJSON.redirectUrl},"Sign-In")),this.props.returnUrl&&c().createElement("div",null,c().createElement("a",{href:this.props.returnUrl.url},this.props.returnUrl.text)))}}])&&mc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function Ec(e){return Ec="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},Ec(e)}function Sc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oc(e,t){return Oc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Oc(e,t)}function _c(e,t){if(t&&("object"===Ec(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return kc(e)}function kc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cc(e){return Cc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Cc(e)}const Pc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Oc(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Cc(r);if(o){var n=Cc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _c(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).markRoot=t.markRoot.bind(kc(t)),t}return t=a,(n=[{key:"markRoot",value:function(){$.ajax({type:"POST",url:"/api/forum/markroot",contentType:"application/json; charset=utf-8",data:JSON.stringify({rootID:this.props.rootID}),dataType:"json",context:this}).done((function(e,t,n){this.props.afterAction()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return c().createElement("button",{type:"button",className:"btn-link",onClick:this.markRoot},"Mark forums as read")}}])&&Sc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function jc(e){return jc="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},jc(e)}function Tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rc(e,t,n){return t&&xc(e.prototype,t),n&&xc(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nc(e,t)}function Nc(e,t){return Nc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Nc(e,t)}function Mc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Lc(e);if(t){var o=Lc(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ic(this,n)}}function Ic(e,t){if(t&&("object"===jc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ac(e)}function Ac(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lc(e){return Lc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Lc(e)}var Bc=function(e){Dc(n,e);var t=Mc(n);function n(e){var r;return Tc(this,n),(r=t.call(this,e)).setLocal=r.setLocal.bind(Ac(r)),r.buildUrl=r.buildUrl.bind(Ac(r)),r.reload=r.reload.bind(Ac(r)),r.getData=r.getData.bind(Ac(r)),r.createGroup=r.createGroup.bind(Ac(r)),r.isGroup=r.isGroup.bind(Ac(r)),r.notGroup=r.notGroup.bind(Ac(r)),r.Modes={Root:"Root",Group:"Group"},r.mode=r.Modes.Root,r.id=null,r.root=null,r.ajaxError=null,r.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,rootID:null,forumList:null,viewer:null},r}return Rc(n,[{key:"componentDidMount",value:function(){this.setLocal(this.props),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setLocal(e),this.getData()}},{key:"setLocal",value:function(e){e.match.params.id&&e.match.path.startsWith("/discuss/group")?(this.id=e.match.params.id,this.mode=this.Modes.Group):(this.root=e.match.params.root?e.match.params.root:"",this.mode=this.Modes.Root)}},{key:"buildUrl",value:function(){var e="/api/discuss/";switch(this.mode){case this.Modes.Group:e+="group/"+this.id;break;case this.Modes.Root:e+=this.root}return e}},{key:"reload",value:function(){this.getData()}},{key:"getData",value:function(e){var t=this;e=this.buildUrl(),$.getJSON(e).done((function(e,n,r){t.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,rootID:e.rootID,forumList:e.forumList,viewer:e.viewer})})).fail((function(e,n,r){t.ajaxError=e,t.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"createGroup",value:function(e,t){var n=this,r=[],o=[];!0===t&&this.state.viewer.isSignedIn&&o.push(c().createElement(Pc,{key:0,rootID:this.state.rootID,afterAction:this.reload})),r.push(c().createElement(Fc,{key:e.forumID,group:e,childrenData:e.children.filter(this.notGroup),titleLink:this.mode==this.Modes.Root},o));var i=e.children.filter(this.isGroup);if(i.length>0){var a=i.map((function(e,t){return n.createGroup(e,!1)}));r=r.concat(a)}return r}},{key:"isGroup",value:function(e){return"Group"==e.type}},{key:"notGroup",value:function(e){return"Group"!=e.type}},{key:"render",value:function(){var e=this;if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Error)return c().createElement(wc,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}});if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading)return c().createElement(On,null);var t=this.state.forumList.map((function(t,n){return e.createGroup(t,0==n)})),n=null!=this.state.forumList[0].metaDescription?this.state.forumList[0].metaDescription:this.state.forumList[0].description;return c().createElement("div",null,c().createElement(hn,null,c().createElement("title",null,this.state.forumList[0].name),null!=n&&""!=n&&c().createElement("meta",{name:"description",content:n})),c().createElement("div",{className:"subsection"},!1,t))}}]),n}(c().Component),Fc=function(e){Dc(n,e);var t=Mc(n);function n(){return Tc(this,n),t.apply(this,arguments)}return Rc(n,[{key:"render",value:function(){var e=[];return this.props.childrenData.forEach((function(t,n){switch(t.type){case"Discussion":e.push(c().createElement(Kc,{key:t.forumID,forum:t}));break;case"Gallery":e.push(c().createElement(qc,{key:t.forumID,forum:t}));break;case"Link":e.push(c().createElement(Uc,{key:t.forumID,forum:t}))}})),c().createElement("div",{className:"discussion"},c().createElement("div",{className:"group"},c().createElement("div",{className:"group-name clearfix"},this.props.children,c().createElement("h3",null,this.props.titleLink?c().createElement(lt,{to:this.props.group.url},this.props.group.name):this.props.group.name)),c().createElement("div",{className:"forums"},e)))}}]),n}(c().Component),Uc=function(e){Dc(n,e);var t=Mc(n);function n(){return Tc(this,n),t.apply(this,arguments)}return Rc(n,[{key:"render",value:function(){return c().createElement("article",{className:"discuss clearfix"},c().createElement("a",{href:this.props.forum.url},c().createElement("h4",null,this.props.forum.name),c().createElement("p",{className:"caption"},this.props.forum.description)))}}]),n}(c().Component),Kc=function(e){Dc(n,e);var t=Mc(n);function n(){return Tc(this,n),t.apply(this,arguments)}return Rc(n,[{key:"render",value:function(){var e=!0===this.props.forum.viewer.hasNewContent?" new-content":"",t=!0===this.props.forum.viewer.isSubscribed?" subscribed":"",n="discuss clearfix".concat(e).concat(t);return c().createElement("article",{className:n},c().createElement(lt,{to:this.props.forum.url},c().createElement("h4",null,this.props.forum.name),c().createElement("p",{className:"caption"},this.props.forum.description)))}}]),n}(c().Component),qc=function(e){Dc(n,e);var t=Mc(n);function n(){return Tc(this,n),t.apply(this,arguments)}return Rc(n,[{key:"render",value:function(){var e=!0===this.props.forum.viewer.hasNewContent?" new-content":"",t=!0===this.props.forum.viewer.isSubscribed?" subscribed":"",n=null!=this.props.forum.imageStrip?" discuss-gallery ":"",r="discuss clearfix".concat(n).concat(e).concat(t);return c().createElement("article",{className:r},c().createElement(lt,{to:this.props.forum.url},c().createElement("h4",null,this.props.forum.name),c().createElement("p",{className:"caption"},this.props.forum.description)),c().createElement(Vc,{imageStrip:this.props.forum.imageStrip}))}}]),n}(c().Component),Vc=function(e){Dc(n,e);var t=Mc(n);function n(){return Tc(this,n),t.apply(this,arguments)}return Rc(n,[{key:"render",value:function(){if(!this.props.imageStrip)return null;var e=[];return this.props.imageStrip.forEach((function(t,n){e.push(c().createElement("li",{key:t.topicID},c().createElement("a",{href:t.url,style:{backgroundImage:"url("+t.thumbUrl+")"}})))})),c().createElement("ul",{className:"discuss-carousel"},e)}}]),n}(c().Component);const zc=Bc;function Wc(e){return Wc="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},Wc(e)}function Hc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $c(e,t){return $c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$c(e,t)}function Jc(e,t){if(t&&("object"===Wc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Gc(e)}function Gc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qc(e){return Qc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Qc(e)}const Yc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$c(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Qc(r);if(o){var n=Qc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Jc(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleMarkForum=t.handleMarkForum.bind(Gc(t)),t}return t=a,(n=[{key:"handleMarkForum",value:function(e){$.ajax({type:"POST",url:"/api/forum/mark",contentType:"application/json; charset=utf-8",data:JSON.stringify({forumID:this.props.forumID}),dataType:"json",context:this}).done((function(e,t,n){this.props.afterAction()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return c().createElement("span",null,c().createElement("button",{type:"button",className:"btn-link mark-forum",onClick:this.handleMarkForum},"Mark topics as read"))}}])&&Hc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function Xc(e){return Xc="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},Xc(e)}function Zc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function el(e,t){return el=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},el(e,t)}function tl(e,t){if(t&&("object"===Xc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nl(e)}function nl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rl(e){return rl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},rl(e)}const ol=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&el(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=rl(r);if(o){var n=rl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return tl(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleClick=t.handleClick.bind(nl(t)),t}return t=a,(n=[{key:"handleClick",value:function(){this.props.history.push("/discuss/topic/new?id=".concat(this.props.forumID))}},{key:"render",value:function(){return c().createElement("button",{type:"button",className:"btn-primary",onClick:this.handleClick},"Start new discussion")}}])&&Zc(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function il(e){return il="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},il(e)}function al(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function cl(e,t){return cl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},cl(e,t)}function ll(e,t){if(t&&("object"===il(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ul(e){return ul=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ul(e)}var fl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cl(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ul(r);if(o){var n=ul(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ll(this,e)});function a(){return al(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.forum;return c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("div",{className:"row-wrapper clearfix"},c().createElement("div",{className:"with-button"},e.show.newTopic&&!this.props.viewer.isMobile&&c().createElement(ol,{forumID:e.forumID}),c().createElement("h2",{className:"brandDot"},e.name)),c().createElement("div",{className:"forum-meta"},e.show.subscription&&c().createElement(Va,{consumer:"Forum",id:e.forumID,period:e.viewer.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per new topic",value:50},{name:"Notify me on all posts",value:100}],addLabel:"Watch forum +",activeLabelPrefix:"Watching: ",removeLabel:"Stop watching forum -"}),e.show.markAsRead&&c().createElement(Yc,{forumID:e.forumID,afterAction:this.props.afterAction}),c().createElement(la,{displayMode:"Forum",path:e.path})))))}}])&&sl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);fl.propTypes={forum:p().object.isRequired};const pl=fl;function hl(e){return hl="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},hl(e)}function dl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ml(e,t){return ml=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ml(e,t)}function vl(e,t){if(t&&("object"===hl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function bl(e){return bl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bl(e)}var gl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ml(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bl(r);if(o){var n=bl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return vl(this,e)});function a(){return dl(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.topic,t="thread",n=null;"gallery"==e.type.toLowerCase()&&(t="thread gallery",null!=e.thumbUrl&&(n=c().createElement(lt,{to:e.url,className:"thumb"},c().createElement("img",{src:e.thumbUrl}))));var r=!0===e.viewer.hasNewContent?" new-content":"",o=!0===e.viewer.isSubscribed?" subscribed":"",i="".concat(t," clearfix").concat(r).concat(o),a=null;if(e.stickyFL)a=c().createElement("span",{className:"sticky"},c().createElement("i",{className:"fa fa-exclamation-circle","aria-hidden":"true"}));else if("None"!=e.redirectType)switch(e.redirectType){case"Moved":a=c().createElement("span",{className:"moved"},"Moved :");break;case"Linked":a=null!=e.productIcon?c().createElement("img",{src:e.productIcon,alt:"Promoted :"}):c().createElement("span",{className:"moved"},"Promoted :")}return c().createElement("article",{className:i},n,c().createElement("div",{className:"topic"},c().createElement("div",{className:"info"},c().createElement("h4",null,null!=a&&a," ",c().createElement(lt,{to:e.url},e.text)),"None"==e.redirectType&&c().createElement("div",{className:"topic-metrics"},c().createElement("span",null,e.postCount," posts"),c().createElement("span",null,e.viewCount," views"),e.rating>0&&c().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating),e.viewer.showFirstUnreadLink&&c().createElement(lt,{to:"".concat(e.url,"?mode=Unread#NewPost"),className:"alt"},"[first unread]"),e.show.lastPageLink&&c().createElement(lt,{to:"".concat(e.url,"?page=").concat(e.pageCount-1),className:"alt"},"[last page]"))),c().createElement("div",{className:"contributions"},c().createElement(ma,{data:e.addedBy,addClass:" started"})),c().createElement("div",{className:"contributions mobile-hidden"},c().createElement(ma,{data:e.lastPostBy,addClass:" latest"}))))}}])&&yl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);gl.propTypes={topic:p().object.isRequired};const wl=gl;function El(e){return El="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},El(e)}function Sl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ol(e,t){return Ol=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ol(e,t)}function _l(e,t){if(t&&("object"===El(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return kl(e)}function kl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cl(e){return Cl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Cl(e)}const Pl=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ol(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Cl(r);if(o){var n=Cl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _l(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(kl(t)),t.addQuerystring=t.addQuerystring.bind(kl(t)),t.getData=t.getData.bind(kl(t)),t.handleNewPage=t.handleNewPage.bind(kl(t)),t.parsedQS=dn.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.days=t.parsedQS.days?t.parsedQS.days:null,t.ajaxError=null,t.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topics:null,viewer:null,nav:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData(this.page)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=dn.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.days=this.parsedQS.days?this.parsedQS.days:null,this.getData()}},{key:"buildUrl",value:function(){var e="/api/discuss/forum/"+this.props.match.params.id;return this.addQuerystring(e,this.page,this.days)}},{key:"addQuerystring",value:function(e,t,n){var r=[];return t>0&&r.push("page="+t),null!==n&&r.push("days="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topics:t.topics,viewer:t.viewer,nav:t.nav},(function(){mn.updateScrollPosition(!0)}))})).fail((function(t,n,r){e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname;t=this.addQuerystring(t,e,this.days),this.props.history.push(t)}},{key:"render",value:function(){if(this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics)return c().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&c().createElement(On,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&c().createElement(wc,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}}));var e="thread-container".concat("gallery"==this.state.forum.type.toLowerCase()?" gallery":""),t=null;if(this.state.topics.data.length>0){var n=[];this.state.topics.data.forEach((function(e,t){n.push(c().createElement(wl,{key:e.topicID,topic:e}))})),t=c().createElement("div",{className:e},this.state.topics.totalPages>1&&c().createElement(Nn,{total:this.state.topics.totalPages,current:this.state.topics.currentPage,visiblePages:this.state.viewer.isMobile?4:8,onPageChanged:this.handleNewPage,enableKeyEvents:!0}),c().createElement("div",{className:"thread-filters"},c().createElement("div",{className:"info"},c().createElement("p",{className:"thread-count"},c().createElement("span",null,this.state.topics.totalRecords," ",1==this.state.topics.totalRecords?"Topic":"Topics"))),c().createElement("div",{className:"sort"},c().createElement("span",null,"Started")),c().createElement("div",{className:"sort"},c().createElement("span",null,"Last post"))),c().createElement("div",{className:"thread-wrapper"},n),this.state.topics.totalPages>1&&c().createElement(Nn,{total:this.state.topics.totalPages,current:this.state.topics.currentPage,visiblePages:this.state.viewer.isMobile?4:8,onPageChanged:this.handleNewPage}))}else t=c().createElement("div",{className:"subsection no-content"},"No topics available.  Start the conversation.");return c().createElement("div",null,c().createElement(hn,{title:this.state.forum.name}),c().createElement(pl,{forum:this.state.forum,viewer:this.state.viewer,afterAction:this.getData}),t,this.state.forum.show.newTopic&&c().createElement("div",{className:"new-content-button"},c().createElement(ol,{forumID:this.state.forum.forumID})))}}])&&Sl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function jl(e){return jl="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},jl(e)}function Tl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xl(e,t){return xl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xl(e,t)}function Rl(e,t){if(t&&("object"===jl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Dl(e)}function Dl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Nl(e){return Nl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Nl(e)}const Ml=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xl(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Nl(r);if(o){var n=Nl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Rl(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(Dl(t)),t.validate=t.validate.bind(Dl(t)),t.valid=t.valid.bind(Dl(t)),t.getValue=t.getValue.bind(Dl(t)),t.handleCancel=t.handleCancel.bind(Dl(t)),t.handleSubmit=t.handleSubmit.bind(Dl(t)),t.handleTitleChange=t.handleTitleChange.bind(Dl(t)),t.state={isValid:!0},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/discuss/topic/edit?id="+this.props.topic.topicID).done((function(t,n,r){e.refs.title.focus()})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e}),e}},{key:"valid",value:function(){return this.getValue().length>=3}},{key:"getValue",value:function(){return this.refs.title.value}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){if(this.validate()){var e=this.getValue(),t={topicID:this.props.topic.topicID,title:e};$.ajax({type:"POST",url:"/api/discuss/topic/edit?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json",context:this}).done((function(e,t,n){this.props.onSubmit(e.title)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}}},{key:"handleTitleChange",value:function(){this.setState({isValid:this.valid()})}},{key:"render",value:function(){var e="form-group".concat(this.state.isValid?"":" has-error"),t=null;return this.state.isValid||(t=c().createElement(gi,{message:"title required and must be 3 or more characters in length"})),c().createElement("div",{className:e},c().createElement("div",{className:"input-group"},c().createElement("input",{name:"title",ref:"title",defaultValue:this.props.topic.text,className:"form-control",style:{width:"100%"},onChange:this.handleTitleChange}),c().createElement("span",{className:"input-group-btn"},c().createElement("button",{type:"button",className:"btn-default",onClick:this.handleCancel},"Cancel"),c().createElement("button",{type:"button",className:"btn-primary",disabled:!this.state.isValid,onClick:this.handleSubmit},"Submit"))),t)}}])&&Tl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function Il(e){return Il="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},Il(e)}function Al(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ll(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bl(e,t,n){return t&&Ll(e.prototype,t),n&&Ll(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fl(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ul(e,t)}function Ul(e,t){return Ul=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ul(e,t)}function Kl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zl(e);if(t){var o=zl(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ql(this,n)}}function ql(e,t){if(t&&("object"===Il(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vl(e)}function Vl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zl(e){return zl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},zl(e)}var Wl=function(e){Fl(n,e);var t=Kl(n);function n(e){var r;return Al(this,n),(r=t.call(this,e)).handleClose=r.handleClose.bind(Vl(r)),r.handleToggle=r.handleToggle.bind(Vl(r)),r.state={showLinks:!1},r}return Bl(n,[{key:"handleClose",value:function(e){e.preventDefault(),this.state.showLinks&&e.target!=this.refs.action&&this.setState({showLinks:!1})}},{key:"handleToggle",value:function(e){e.preventDefault(),this.setState({showLinks:!this.state.showLinks})}},{key:"render",value:function(){return c().createElement("span",{id:"share"},c().createElement("button",{ref:"action",type:"button",className:"btn-link share",onClick:this.handleToggle},"Share"),!0===this.state.showLinks&&c().createElement(Hl,{onClose:this.handleClose}))}}]),n}(c().Component),Hl=function(){var e=function(e){Fl(n,e);var t=Kl(n);function n(e){var r;return Al(this,n),(r=t.call(this,e)).handleClickOutside=r.handleClickOutside.bind(Vl(r)),r}return Bl(n,[{key:"UNSAFE_componentWillMount",value:function(){this.url="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname)}},{key:"handleClickOutside",value:function(e){this.props.onClose(e)}},{key:"render",value:function(){var e="https://www.facebook.com/sharer/sharer.php?u=".concat(this.url),t="https://twitter.com/intent/tweet?url=".concat(this.url),n="https://www.linkedin.com/shareArticle?mini=true&url=".concat(this.url);return c().createElement("nav",{className:"social"},c().createElement("a",{href:e,target:"_blank"},c().createElement("span",{className:"facebook"},"Facebook")),c().createElement("a",{href:t,target:"_blank"},c().createElement("span",{className:"twitter"},"Twitter")),c().createElement("a",{href:n,target:"_blank"},c().createElement("span",{className:"linkedin"},"Linkedin")))}}]),n}(c().Component);return Tr()(e)}();const $l=Wl;function Jl(e){return Jl="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},Jl(e)}function Gl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ql(e,t){return Ql=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ql(e,t)}function Yl(e,t){if(t&&("object"===Jl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xl(e)}function Xl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zl(e){return Zl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Zl(e)}var eu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ql(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Zl(r);if(o){var n=Zl(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Yl(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleEdit=t.handleEdit.bind(Xl(t)),t.handleCancelEdit=t.handleCancelEdit.bind(Xl(t)),t.handleSubmitEdit=t.handleSubmitEdit.bind(Xl(t)),t.viewMode={TopicView:"TopicView",PostView:"PostView"},t.state={topic:t.props.topic,showEdit:!1},t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({topic:e.topic})}},{key:"handleEdit",value:function(){this.setState({showEdit:!0})}},{key:"handleCancelEdit",value:function(){this.setState({showEdit:!1})}},{key:"handleSubmitEdit",value:function(e){var t=this.state.topic;t.text=e,this.setState({showEdit:!1,topic:t})}},{key:"render",value:function(){var e=this.state.topic;return c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("div",{className:"row-wrapper clearfix"},this.state.showEdit?c().createElement(Ml,{ref:"title",topic:e,onSubmit:this.handleSubmitEdit,onCancel:this.handleCancelEdit}):c().createElement("h2",null,this.props.viewMode===this.viewMode.TopicView&&e.text,this.props.viewMode===this.viewMode.PostView&&c().createElement("span",null,"Post from: ",c().createElement(lt,{to:"".concat(e.url,"?mode=Post&postID=").concat(this.props.post.postID,"#").concat(this.props.post.postID)},e.text)),this.props.viewMode===this.viewMode.TopicView&&e.viewer.canEdit&&c().createElement("button",{type:"button",className:"btn-link light icon icon-after icon-color-white icon-edit",onClick:this.handleEdit},"Edit Title")),null!=e.addedBy&&null!=e.addedBy.profile&&c().createElement(qo,{profile:e.addedBy.profile}),c().createElement("div",{className:"forum-meta"},e.show.subscription&&c().createElement(Va,{consumer:"Topic",id:e.topicID,period:e.viewer.subscription,options:[{name:"Bookmark Only",value:10},{name:"Notify me once per topic view",value:50},{name:"Notify me on all new posts",value:100}],addLabel:"Watch topic +",activeLabelPrefix:"Watching: ",removeLabel:"Stop watching topic -"}),c().createElement($l,null),c().createElement("time",null,e.addedBy.displayDT),c().createElement(la,{displayMode:"Topic",path:this.props.forumPath})),this.props.children)))}}])&&Gl(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);eu.propTypes={topic:p().object,forumPath:p().array},eu.defaultProps={viewMode:"TopicView"};const tu=eu;function nu(e){return nu="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},nu(e)}function ru(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ou(e,t){return ou=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ou(e,t)}function iu(e,t){if(t&&("object"===nu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return au(e)}function au(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function su(e){return su=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},su(e)}var cu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ou(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=su(r);if(o){var n=su(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return iu(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleChange=t.handleChange.bind(au(t)),t.getValue=t.getValue.bind(au(t)),t.setValue=t.setValue.bind(au(t)),t}return t=a,(n=[{key:"handleChange",value:function(){this.props.onChange&&this.props.onChange(this.refs.select.value)}},{key:"getValue",value:function(){return this.refs.select.value}},{key:"setValue",value:function(e){this.refs.select.value=e}},{key:"render",value:function(){var e=this.props.options.map((function(e,t){var n=e.text;return e.display&&(n=e.display),c().createElement("option",{key:e.value,value:e.value,disabled:e.disabled},n)})),t="form-group no-help".concat(this.props.isInline?" form-inline":"");return c().createElement("div",{className:t},this.props.label&&c().createElement("label",{className:"static"},this.props.label),c().createElement("select",{ref:"select",defaultValue:this.props.value,onChange:this.handleChange},e),this.props.children)}}])&&ru(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);cu.propTypes={label:p().string,isInline:p().bool,options:p().array.isRequired,onChange:p().func,value:p().oneOfType([p().string,p().number])},cu.defaultProps={isInline:!1};const lu=cu;function uu(e){return uu="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},uu(e)}function fu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hu(e,t,n){return t&&pu(e.prototype,t),n&&pu(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function du(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yu(e,t)}function yu(e,t){return yu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yu(e,t)}function mu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gu(e);if(t){var o=gu(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vu(this,n)}}function vu(e,t){if(t&&("object"===uu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bu(e)}function bu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gu(e){return gu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},gu(e)}var wu=function(e){du(n,e);var t=mu(n);function n(e){var r;return fu(this,n),(r=t.call(this,e)).setup=r.setup.bind(bu(r)),r.handleEditClick=r.handleEditClick.bind(bu(r)),r.handleEditCancel=r.handleEditCancel.bind(bu(r)),r.handleEditComplete=r.handleEditComplete.bind(bu(r)),r.handleSpamClick=r.handleSpamClick.bind(bu(r)),r.handleSpamCancel=r.handleSpamCancel.bind(bu(r)),r.handleSpamComplete=r.handleSpamComplete.bind(bu(r)),r.state={showPanel:!1,showEdit:!1,showSpam:!1},r}return hu(n,[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/e/topic").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0,showSpam:!1})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(){this.setState({showEdit:!1})}},{key:"handleSpamClick",value:function(){this.setState({showEdit:!1,showSpam:!0})}},{key:"handleSpamCancel",value:function(){this.setState({showSpam:!1})}},{key:"handleSpamComplete",value:function(){this.setState({showSpam:!1})}},{key:"render",value:function(){return this.state.showPanel?c().createElement("div",{className:"topic-editor clearfix"},c().createElement("ul",{className:"list-inline"},c().createElement("li",null,c().createElement("button",{type:"button",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Topic")),c().createElement("li",null,c().createElement("button",{type:"button",onClick:this.handleSpamClick,disabled:this.state.showSpam},"Mark As Spam - Close Topic and Lock Creator's Account")),this.props.topic.viewer.eMessage&&c().createElement("li",{className:"emessage"},this.props.topic.viewer.eMessage)),this.state.showEdit&&c().createElement(Su,{topic:this.props.topic,onCancel:this.handleEditCancel,onComplete:this.handleEditComplete}),this.state.showSpam&&c().createElement(Eu,{topic:this.props.topic,onCancel:this.handleSpamCancel,onComplete:this.handleSpamComplete})):null}}]),n}(c().Component),Eu=nt(function(e){du(n,e);var t=mu(n);function n(e){var r;return fu(this,n),(r=t.call(this,e)).handleCancel=r.handleCancel.bind(bu(r)),r.handleSubmit=r.handleSubmit.bind(bu(r)),r}return hu(n,[{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){$.ajax({type:"POST",url:"/api/forum/e/spam-topic?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",dataType:"json",context:this}).done((function(e,t,n){this.props.history.push(e.data.url),this.props.onComplete()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return c().createElement("div",{className:"report clearfix"},c().createElement("div",{className:"row panel"},c().createElement("div",{className:"col-lg-12"},c().createElement("h4",null,"Warning! Only Use For SPAM!"),c().createElement("p",null,"Are You sure this is SPAM?  Click 'Submit' to CLOSE the topic and LOCK the submitters account."))),c().createElement("ul",{className:"list-inline pull-right"},c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}]),n}(c().Component)),Su=nt(function(e){du(n,e);var t=mu(n);function n(e){var r;return fu(this,n),(r=t.call(this,e)).setup=r.setup.bind(bu(r)),r.handleRootForumChange=r.handleRootForumChange.bind(bu(r)),r.handleStickyChange=r.handleStickyChange.bind(bu(r)),r.handleForumChange=r.handleForumChange.bind(bu(r)),r.handlePlaceholderChange=r.handlePlaceholderChange.bind(bu(r)),r.handleStatusChange=r.handleStatusChange.bind(bu(r)),r.handleClosePostsChange=r.handleClosePostsChange.bind(bu(r)),r.handleCancel=r.handleCancel.bind(bu(r)),r.handleSubmit=r.handleSubmit.bind(bu(r)),r.state={form:null,currentForumID:null},r}return hu(n,[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/e/topic?id="+this.props.topic.topicID).done((function(t,n,r){e.setState({form:t,currentForumID:t.forumID})}))}},{key:"handleRootForumChange",value:function(e){var t=this;$.getJSON("/api/forum/e/forum-list?id="+e).done((function(n,r,o){var i=t.state.form;i.rootID=e,i.forumOptions=n,t.setState({form:i},(function(){var e=t.refs.forum.getValue(),n=t.state.form;e!=n.forumID&&(n.forumID=e,t.setState({form:n}))}))}))}},{key:"handleStickyChange",value:function(e){var t=this.state.form;t.stickyFL=!t.stickyFL,this.setState({form:t})}},{key:"handleForumChange",value:function(e){var t=this.state.form;e!=t.forumID&&(t.forumID=e,this.setState({form:t}))}},{key:"handlePlaceholderChange",value:function(e){if(this.state.form.forumID!=this.state.currentForumID){var t=this.state.form;t.leaveMovedPlaceholderFL=!t.leaveMovedPlaceholderFL,this.setState({form:t})}}},{key:"handleStatusChange",value:function(e){var t=this.state.form;t.status=e,this.setState({form:t})}},{key:"handleClosePostsChange",value:function(e){if("200"==this.state.form.status){var t=this.state.form;t.closePostsFL=!t.closePostsFL,this.setState({form:t})}}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){$.ajax({type:"POST",url:"/api/forum/e/topic?id="+this.props.topic.topicID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:this.state.form}),dataType:"json",context:this}).done((function(e,t,n){this.props.history.push(e.data.url),this.props.onComplete()})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return null===this.state.form?null:c().createElement("div",{className:"clearfix"},c().createElement("div",{className:"row panel"},c().createElement("div",{className:"col-lg-12"},c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"stickyFL",name:"stickyFL",checked:this.state.form.stickyFL,onChange:this.handleStickyChange}),c().createElement("label",{htmlFor:"stickyFL"},"Sticky Topic")))),c().createElement("div",{className:"row panel"},c().createElement("div",{className:"col-lg-12"},c().createElement(lu,{label:"Topic Status",options:this.state.form.statusOptions,value:this.state.form.status,onChange:this.handleStatusChange},c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"closePostsFL",name:"closePostsFL",checked:this.state.form.closePostsFL,disabled:"200"!=this.state.form.status,onChange:this.handleClosePostsChange}),c().createElement("label",{htmlFor:"closePostsFL"},"Close all posts in topic"))))),c().createElement("div",{className:"row panel"},c().createElement("div",{className:"col-md-6"},c().createElement("h3",null,"Move Topic"),c().createElement(lu,{label:"Root",options:this.state.form.rootForumOptions,value:this.state.form.rootID,onChange:this.handleRootForumChange})),c().createElement("div",{className:"col-md-6"},c().createElement("h3",null," "),c().createElement(lu,{ref:"forum",label:"Forum",options:this.state.form.forumOptions,value:this.state.form.forumID,onChange:this.handleForumChange},c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"leaveMovedPlaceholderFL",name:"leaveMovedPlaceholderFL",checked:this.state.form.leaveMovedPlaceholderFL,disabled:this.state.form.forumID==this.state.currentForumID,onChange:this.handlePlaceholderChange}),c().createElement("label",{htmlFor:"leaveMovedPlaceholderFL"},"Leave moved topic placeholder"))))),c().createElement("ul",{className:"list-inline pull-right"},c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}]),n}(c().Component));const Ou=wu;function _u(e){return _u="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},_u(e)}function ku(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pu(e,t){return Pu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pu(e,t)}function ju(e,t){if(t&&("object"===_u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Tu(e){return Tu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Tu(e)}var xu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pu(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Tu(r);if(o){var n=Tu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ju(this,e)});function a(){return ku(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=[],t="";!0===this.props.profile.hasFDot&&(t=" hasFDot",e.push("Foundry Account"));var n="";this.props.profile.badges&&this.props.profile.badges.hasOwnProperty("foundryHero")&&this.props.profile.badges.foundryHero.length>0&&(n=" badge-".concat(this.props.profile.badges.foundryHero[0].badge),e.push(this.props.profile.badges.foundryHero[0].name));var r="profile".concat(t).concat(n),o=e.join(", ");return c().createElement("a",{href:this.props.profile.url,className:r,title:o},c().createElement("span",{className:"profile-name"},this.props.profile.name),c().createElement("span",{className:"profile-image",style:{backgroundImage:"url(".concat(this.props.profile.avatarUrl,")")}}))}}])&&Cu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);xu.propTypes={profile:p().object.isRequired};const Ru=xu;function Du(e){return Du="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},Du(e)}function Nu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mu(e,t){return Mu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Mu(e,t)}function Iu(e,t){if(t&&("object"===Du(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Au(e)}function Au(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lu(e){return Lu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Lu(e)}var Bu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mu(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Lu(r);if(o){var n=Lu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Iu(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(Au(t)),t.state={post:t.props.post,viewer:t.props.viewer},t}return t=a,(n=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/signal",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:"Post",id:this.props.id,value:this.state.viewer?null:1}),dataType:"json",context:this}).then((function(e){this.setState({viewer:e.value,post:e.result})}))}},{key:"render",value:function(){var e="btn-link user-action like".concat(null!==this.state.viewer?" active":""),t=(this.state.post>0?"+":"")+this.state.post;return this.props.allowRating?c().createElement("div",{className:"rating"},c().createElement("button",{type:"button",className:e,onClick:this.onClick},"Like"),c().createElement("span",null,t)):c().createElement("div",{className:"rating metrics dark"},c().createElement("span",{className:"like"},t))}}])&&Nu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Bu.propTypes={id:p().number.isRequired,post:p().number,viewer:p().number,allowRating:p().bool},Bu.defaultProps={post:0,viewer:null,allowRating:!1};const Fu=Bu;function Uu(e){return Uu="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},Uu(e)}function Ku(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vu(e,t){return Vu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vu(e,t)}function zu(e,t){if(t&&("object"===Uu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Wu(e){return Wu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Wu(e)}const Hu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vu(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Wu(r);if(o){var n=Wu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return zu(this,e)});function a(){return Ku(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",null,c().createElement("p",{dangerouslySetInnerHTML:mn.createMarkup(this.props.report.comment)}),c().createElement("div",null,c().createElement("span",null,this.props.report.reportType),c().createElement("span",null,this.props.report.product),c().createElement("span",null,this.props.report.addedBy),c().createElement("span",null,this.props.report.addedDT)))}}])&&qu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function $u(e){return $u="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},$u(e)}function Ju(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qu(e,t){return Qu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qu(e,t)}function Yu(e,t){if(t&&("object"===$u(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xu(e){return Xu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xu(e)}const Zu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qu(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Xu(r);if(o){var n=Xu(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Yu(this,e)});function a(){return Ju(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return null==this.props.reports?null:c().createElement("div",{className:"post-reports"},this.props.reports.map((function(e,t){return c().createElement(Hu,{key:t,report:e})})))}}])&&Gu(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function ef(e){return ef="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},ef(e)}function tf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nf(e,t){return nf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},nf(e,t)}function rf(e,t){if(t&&("object"===ef(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return of(e)}function of(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function af(e){return af=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},af(e)}const sf=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=af(r);if(o){var n=af(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return rf(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleSubmit=t.handleSubmit.bind(of(t)),t.handleChange=t.handleChange.bind(of(t)),t.state={type:null,submitDisabled:!1},t}return t=a,(n=[{key:"handleSubmit",value:function(){var e={postID:this.props.postID,type:this.refs.type.value,report:this.refs.report.value};$.ajax({type:"POST",url:"/api/forum/report/",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success(e.message),e.forceRefresh&&this.props.history.push(e.refreshUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){this.props.onSubmit()}))}},{key:"handleChange",value:function(){this.setState({type:this.refs.type.value,submitDisabled:"2"==this.refs.type.value&&this.refs.report.value.length<3})}},{key:"render",value:function(){var e=null;return"2"==this.state.type&&(e=c().createElement(gi,{message:'Reason required for "other" reports'})),c().createElement("div",{className:"post-report report clearfix"},c().createElement("h4",null,"THIS FORM IS FOR REPORTING BAD POSTS, COMMENTS AND SPAM TO THE MODERATORS!"),c().createElement("p",null,'Please use the "REPLY" button to add a new post to a topic.'),c().createElement("p",null,"Examples for using this reporting feature would be if the post contains foul or offensive language, spam, or abusive language towards another forum member."),c().createElement("p",null,"We try to monitor all of the topics & posts in our forum, but sometimes something can slip through that may offend someone."),c().createElement("p",null,"Thank you for your help."),c().createElement("div",{className:"form-group"},c().createElement("label",{className:"static"},"Report Type"),c().createElement("select",{name:"type",ref:"type",onChange:this.handleChange,className:"form-control"},c().createElement("option",{value:"Spam"},"Spam"),c().createElement("option",{value:"Other"},"Other"))),c().createElement("div",{className:"form-group multiline-text"},c().createElement("label",{className:"static"},"Reason For Reporting"),c().createElement("textarea",{name:"report",ref:"report",onChange:this.handleChange,className:"form-control"}),e),c().createElement("div",{className:"buttons pull-right"},c().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.props.onCancel},"Cancel"),c().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit")))}}])&&tf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function cf(e){return cf="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},cf(e)}function lf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function uf(e,t){return uf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},uf(e,t)}function ff(e,t){if(t&&("object"===cf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pf(e)}function pf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hf(e){return hf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hf(e)}const df=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=hf(r);if(o){var n=hf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ff(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleReport=t.handleReport.bind(pf(t)),t.handleReportClose=t.handleReportClose.bind(pf(t)),t.state={showReport:!1},t}return t=a,(n=[{key:"handleReport",value:function(e){this.setState({showReport:!0})}},{key:"handleReportClose",value:function(e){this.setState({showReport:!1})}},{key:"render",value:function(){return c().createElement("span",null,c().createElement("button",{type:"button",className:"btn-link",onClick:this.handleReport},"Report"),this.state.showReport&&c().createElement(B,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleReportClose,contentStyle:{width:"80%",padding:"40px",backgroundColor:"white"}},c().createElement(sf,{postID:this.props.postID,onCancel:this.handleReportClose,onSubmit:this.handleReportClose})))}}])&&lf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function yf(e){return yf="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},yf(e)}function mf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vf(e,t){return vf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vf(e,t)}function bf(e,t){if(t&&("object"===yf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gf(e)}function gf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wf(e){return wf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},wf(e)}const Ef=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=wf(r);if(o){var n=wf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return bf(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(gf(t)),t.handleSubmit=t.handleSubmit.bind(gf(t)),t.handlePostChange=t.handlePostChange.bind(gf(t)),t.handleReportChange=t.handleReportChange.bind(gf(t)),t.state={post:null,isValid:!0},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/post/edit/?id=".concat(this.props.post.postID)).done((function(t,n,r){e.setState({post:t.data.form.post})})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"handleSubmit",value:function(){var e={postID:this.props.post.postID,type:this.props.link.type,product:"Developer"==this.props.link.type?this.props.link.value:null,post:this.state.post,report:this.refs.report.value};$.ajax({type:"POST",url:"/api/forum/internal-report/",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){alerts.success(e.message)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){this.props.onSubmit()}))}},{key:"handlePostChange",value:function(e){this.setState({post:e.target.value})}},{key:"handleReportChange",value:function(){}},{key:"render",value:function(){if(null==this.state.post)return null;var e=null;this.state.isValid||(e=c().createElement(gi,{message:"post required"}));var t="".concat(this.props.link.value," Report");return"Support"==this.props.link.type&&(t="Support Escalation"),c().createElement("div",{className:"post-report report clearfix"},c().createElement("h4",null,t),c().createElement("div",{className:"form-group multiline-text"},c().createElement("label",{className:"static"},"Post text to be included in report email"),c().createElement("textarea",{name:"post",ref:"post",value:this.state.post,onChange:this.handlePostChange,className:"form-control",rows:"8"}),e),c().createElement("div",{className:"form-group multiline-text"},c().createElement("label",{className:"static"},"Reason For Reporting (Optional)"),c().createElement("textarea",{name:"report",ref:"report",onChange:this.handleReportChange,className:"form-control"})),c().createElement("div",{className:"buttons pull-right"},c().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.props.onCancel},"Cancel"),c().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit")))}}])&&mf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function Sf(e){return Sf="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},Sf(e)}function Of(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _f(e,t){return _f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_f(e,t)}function kf(e,t){if(t&&("object"===Sf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Cf(e)}function Cf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pf(e){return Pf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Pf(e)}const jf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_f(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Pf(r);if(o){var n=Pf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return kf(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleReportClick=t.handleReportClick.bind(Cf(t)),t.handleReportClose=t.handleReportClose.bind(Cf(t)),t.link=null,t.state={showReport:!1},t}return t=a,(n=[{key:"handleReportClick",value:function(e){this.link=e,this.setState({showReport:!0})}},{key:"handleReportClose",value:function(){this.setState({showReport:!1})}},{key:"render",value:function(){var e=this,t=[];return this.props.links.forEach((function(n,r){var o="Add To ".concat(n.value," Report");"Support"===n.type&&(o="Create ".concat(n.value," Ticket")),t.push(c().createElement("button",{type:"button",onClick:e.handleReportClick.bind(null,n)},o))})),c().createElement("span",null,c().createElement(bo,{wrapperTag:"span",actionTag:"buttonLink",actionLabel:"Internal Report",options:t}),this.state.showReport&&c().createElement(B,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleReportClose,contentStyle:{width:"80%",padding:"40px",backgroundColor:"white"}},c().createElement(Ef,{post:this.props.post,link:this.link,onCancel:this.handleReportClose,onSubmit:this.handleReportClose})))}}])&&Of(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function Tf(e){return Tf="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},Tf(e)}function xf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Df(e,t,n){return t&&Rf(e.prototype,t),n&&Rf(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mf(e,t)}function Mf(e,t){return Mf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Mf(e,t)}function If(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Bf(e);if(t){var o=Bf(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Af(this,n)}}function Af(e,t){if(t&&("object"===Tf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Lf(e)}function Lf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bf(e){return Bf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Bf(e)}var Ff=function(e){Nf(n,e);var t=If(n);function n(e){var r;return xf(this,n),(r=t.call(this,e)).filterContent=r.filterContent.bind(Lf(r)),r}return Df(n,[{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=this,t=[],n=[],r=$.grep(this.props.content,this.filterContent),o=$.grep(this.props.content,this.filterContent,!0);return r.forEach((function(n){t.push(c().createElement("li",{key:n.id,className:"view"},c().createElement(Uf,{content:n,postID:e.props.postID})))})),o.forEach((function(t){n.push(c().createElement("li",{key:t.id,className:"dl"},c().createElement(Kf,{content:t,postID:e.props.postID})))})),c().createElement("ul",{className:"content-list clearfix"},t,n)}}]),n}(c().Component);Ff.propTypes={content:p().array,postID:p().number};var Uf=nt(function(e){Nf(n,e);var t=If(n);function n(){return xf(this,n),t.apply(this,arguments)}return Df(n,[{key:"render",value:function(){var e={pathname:"/discuss/post/".concat(this.props.postID,"/content/").concat(this.props.content.id),state:{modal:!0,background:this.props.location}},t="".concat(this.props.content.type," ").concat(null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""," : ").concat(this.props.content.title);return c().createElement("div",{className:"content-view"},c().createElement(lt,{to:e,title:t,className:"link"},c().createElement("img",{src:this.props.content.thumbUrl})),c().createElement("div",{className:"details"},c().createElement("p",{className:"filename"},this.props.content.title)))}}]),n}(c().Component)),Kf=function(e){Nf(n,e);var t=If(n);function n(){return xf(this,n),t.apply(this,arguments)}return Df(n,[{key:"render",value:function(){var e="/forum/post/".concat(this.props.postID,"/content/").concat(this.props.content.id,"/download"),t="".concat(this.props.content.type," : ").concat(this.props.content.title),n="Generic"!=this.props.content.type?c().createElement("p",{className:"attachment-type"},this.props.content.type," ",null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""):null;return c().createElement("div",{className:"content-dl"},c().createElement("a",{href:e,title:t,className:"download icon icon-after icon-arrow icon-color-white"},"Download"),c().createElement("div",{className:"details"},c().createElement("p",{className:"filename"},this.props.content.title),n))}}]),n}(c().Component);const qf=Ff;function Vf(e){return Vf="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},Vf(e)}function zf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wf(e,t){return Wf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wf(e,t)}function Hf(e,t){if(t&&("object"===Vf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $f(e)}function $f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jf(e){return Jf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Jf(e)}var Gf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wf(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Jf(r);if(o){var n=Jf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Hf(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleReply=t.handleReply.bind($f(t)),t.handleQuote=t.handleQuote.bind($f(t)),t.handleEdit=t.handleEdit.bind($f(t)),t.DisplayModes={Topic:"topic",Single:"single"},t}return t=a,(n=[{key:"handleReply",value:function(){this.props.onReply&&this.props.onReply(this.props.post.postID)}},{key:"handleQuote",value:function(){this.props.onQuote&&this.props.onQuote(this.props.post.postID)}},{key:"handleEdit",value:function(){this.props.onEdit&&this.props.onEdit(this.props.post.postID)}},{key:"render",value:function(){var e=this.props.post,t=null!=this.props.depth&&this.props.depth>0?" reply"+this.props.depth:"",n=!0===e.show.opHighlight?" op-highlight":"",r="comment".concat(t).concat(n," clearfix"),o=this.props.viewer.internalReportLinks&&c().createElement(jf,{links:this.props.viewer.internalReportLinks,post:e});return c().createElement("article",{className:r},c().createElement("a",{className:"post-anchor",name:e.postID}),!0===e.show.newPostAnchor&&c().createElement("a",{name:"NewPost"}),c().createElement("div",{className:"comment-header clearfix"},c().createElement("div",null,e.addedBy&&e.addedBy.profile&&e.addedBy.profile.name&&c().createElement(qo,{profile:e.addedBy.profile}),e.addedBy&&null===e.addedBy.profile&&e.addedBy.guestName&&c().createElement("div",{className:"profile"},e.addedBy.guestName)),c().createElement("div",null,c().createElement("div",{className:"report-links"},o,this.props.viewer.isSignedIn&&c().createElement(df,{postID:e.postID}),this.props.displayMode==this.DisplayModes.Topic&&c().createElement("span",null,c().createElement(lt,{to:e.url},"Permalink"))),c().createElement(Fu,{id:e.postID,post:e.rating,viewer:e.viewer.postRating,allowRating:e.viewer.showRating}))),c().createElement("div",{className:"comment-body clearfix"},c().createElement("div",{className:"comment-profile"},e.addedBy&&e.addedBy.profile&&e.addedBy.profile.name&&c().createElement(Ru,{profile:e.addedBy.profile}),e.addedBy&&null===e.addedBy.profile&&e.addedBy.guestName&&c().createElement("div",{className:"profile"},e.addedBy.guestName),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.location&&c().createElement("div",null,e.addedBy.profile.location),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.joinedDT&&c().createElement("div",null,c().createElement("span",null,"Joined")," ",e.addedBy.profile.joinedDT),e.addedBy&&e.addedBy.profile&&e.addedBy.profile.postCount&&c().createElement("div",null,e.addedBy.profile.postCount," ",c().createElement("span",null,e.addedBy.profile.postCount>1?"Posts":"Post"))),c().createElement("div",{className:"comment-body-container clearfix"},c().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}),null!=e.content&&e.content.length>0&&c().createElement(qf,{content:e.content,postID:e.postID}),c().createElement("div",{className:"comment-body-footer"},e.addedBy&&e.addedBy.profile&&!0===e.addedBy.profile.showSignatureFL&&""!=e.addedBy.profile.signature&&c().createElement("span",{className:"signature",dangerouslySetInnerHTML:{__html:e.addedBy.profile.signature}}),!0===e.editedFL&&e.modifiedBy&&e.modifiedBy.profile&&c().createElement("span",{className:"edited"},"edited by: ",e.modifiedBy.profile.name)),c().createElement(Zu,{reports:e.reports}))),c().createElement("div",{className:"comment-footer clearfix"},c().createElement("div",{className:"comment-info"},c().createElement("time",null,e.addedBy.displayDT)),c().createElement("div",{className:"comment-actions-container"},this.props.displayMode==this.DisplayModes.Topic&&this.props.showEditControls&&c().createElement("div",{className:"comment-actions"},c().createElement("button",{type:"button",className:"icon icon-after icon-reply",onClick:this.handleReply},"Reply"),this.props.displayMode==this.DisplayModes.Topic&&c().createElement("button",{type:"button",className:"icon icon-after icon-quote",onClick:this.handleQuote},"Quote"),e.viewer.canEdit&&c().createElement("button",{type:"button",className:"icon icon-after icon-refresh",onClick:this.handleEdit},"Edit")))))}}])&&zf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Gf.propTypes={displayMode:p().string,post:p().object,depth:p().number,viewer:p().object,onReply:p().func,onQuote:p().func,onEdit:p().func,showEditControls:p().bool},Gf.defaultProps={displayMode:"topic",depth:null,showEditControls:!1};const Qf=Gf;function Yf(e){return Yf="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},Yf(e)}function Xf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ep(e,t){return ep=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ep(e,t)}function tp(e,t){if(t&&("object"===Yf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function np(e){return np=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},np(e)}var rp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ep(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=np(r);if(o){var n=np(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return tp(this,e)});function a(){return Xf(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.post,t=null!=this.props.depth&&this.props.depth>0?" reply".concat(this.props.depth):"",n="comment anonymized ".concat(t," clearfix");return c().createElement("article",{className:n},c().createElement("a",{name:e.postID}),!0===e.show.newPostAnchor&&c().createElement("a",{name:"NewPost"}),c().createElement("div",{className:"comment-header clearfix"},c().createElement("div",null)),c().createElement("div",{className:"comment-body clearfix"},c().createElement("div",{className:"comment-profile"}),c().createElement("div",{className:"comment-body-container clearfix"},c().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}))))}}])&&Zf(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);rp.propTypes={post:p().object,depth:p().number},rp.defaultProps={depth:null};const op=rp;function ip(e){return ip="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},ip(e)}function ap(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function cp(e,t){return cp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},cp(e,t)}function lp(e,t){if(t&&("object"===ip(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function up(e){return up=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},up(e)}var fp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=up(r);if(o){var n=up(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return lp(this,e)});function a(){return ap(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(null==this.props.percentComplete||0==this.props.percentComplete)return null;var e={width:this.props.percentComplete+"%"};return c().createElement("div",{className:"progress progress-small"},c().createElement("div",{className:"progress-bar",style:e}))}}])&&sp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);fp.propTypes={percentComplete:p().number.isRequired};const pp=fp;function hp(e){return hp="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},hp(e)}function dp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mp(e,t){return mp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mp(e,t)}function vp(e,t){if(t&&("object"===hp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function bp(e){return bp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bp(e)}const gp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bp(r);if(o){var n=bp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return vp(this,e)});function a(){return dp(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e,t=this.props.data;return"Uploading"!=t.status&&(e=t.message),c().createElement("li",null,c().createElement("span",null,t.name+t.extension),e,"Uploading"==t.status?c().createElement(pp,{percentComplete:t.percentComplete}):null)}}])&&yp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function wp(e){return wp="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},wp(e)}function Ep(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Op(e,t){return Op=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Op(e,t)}function _p(e,t){if(t&&("object"===wp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function kp(e){return kp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},kp(e)}const Cp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Op(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=kp(r);if(o){var n=kp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _p(this,e)});function a(){return Ep(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(0==this.props.uploads.length)return null;var e=this,t=[];return this.props.uploads.forEach((function(n){t.push(c().createElement(gp,{key:n.key,data:n,onUploadDelete:e.props.onUploadDelete}))})),c().createElement("ul",{className:"upload-list"},t)}}])&&Sp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function Pp(e){return Pp="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},Pp(e)}function jp(){return jp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jp.apply(this,arguments)}function Tp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xp(e,t){return xp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xp(e,t)}function Rp(e,t){if(t&&("object"===Pp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Dp(e)}function Dp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Np(e){return Np=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Np(e)}var Mp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Np(r);if(o){var n=Np(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Rp(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onDragEnter=t.onDragEnter.bind(Dp(t)),t.onDragOver=t.onDragOver.bind(Dp(t)),t.onDragLeave=t.onDragLeave.bind(Dp(t)),t.onDrop=t.onDrop.bind(Dp(t)),t.open=t.open.bind(Dp(t)),t.supportMultiple="undefined"==typeof document||!document||!document.createElement||"multiple"in document.createElement("input"),t.state={isDragActive:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.enterCounter=0}},{key:"onDragEnter",value:function(e){e.preventDefault(),++this.enterCounter;var t=e.dataTransfer&&e.dataTransfer.items?e.dataTransfer.items:[],n=Array.prototype.slice.call(t);this.setState({isDragActive:n})}},{key:"onDragOver",value:function(e){return e.preventDefault(),e.stopPropagation(),!1}},{key:"onDragLeave",value:function(e){e.preventDefault(),--this.enterCounter>0||this.setState({isDragActive:!1})}},{key:"onDrop",value:function(e){e.preventDefault(),this.enterCounter=0,this.setState({isDragActive:!1});for(var t=e.dataTransfer?e.dataTransfer.files:e.target.files,n=this.props.multiple?t.length:1,r=[],o=0;o<n;o++){var i=t[o];r.push(i)}this.props.onDrop&&this.props.onDrop.call(this,r,e)}},{key:"open",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"render",value:function(){var e=this,t={onClick:this.open,onDragEnter:this.onDragEnter,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop},n={type:"file",style:{display:"none"},multiple:this.supportMultiple&&this.props.multiple,ref:function(t){return e.fileInputEl=t},onChange:this.onDrop},r=null!=this.props.children?this.props.children:c().createElement("h4",null,c().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),c().createElement("br",null),"Drag and drop one or more files or click in this area to upload");return c().createElement("div",jp({className:"drop-area"+(this.state.isDragActive?" drop-area-active":"")},t,{style:{textAlign:"center"}}),r,c().createElement(Cp,{uploads:this.props.uploads}),c().createElement("input",n))}}])&&Tp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Mp.defaultProps={multiple:!0};const Ip=Mp;function Ap(e){return Ap="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},Ap(e)}function Lp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bp(e,t){return Bp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bp(e,t)}function Fp(e,t){if(t&&("object"===Ap(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Up(e)}function Up(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kp(e){return Kp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Kp(e)}var qp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Kp(r);if(o){var n=Kp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Fp(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onChange=t.onChange.bind(Up(t)),t.onSubmit=t.onSubmit.bind(Up(t)),t.clearInput=t.clearInput.bind(Up(t)),t._validateUrl=t._validateUrl.bind(Up(t)),t.state={isValidUrl:!1},t}return t=a,(n=[{key:"onChange",value:function(e){e.preventDefault();var t=this.refs.url.value,n=this._validateUrl(t);this.setState({isValidUrl:n})}},{key:"onSubmit",value:function(e){e.preventDefault();var t=this.refs.url.value;$.ajax({type:"POST",url:"/staging/hosted",contentType:"application/json; charset=utf-8",data:JSON.stringify({url:t,groupsAllowed:this.props.groupsAllowed}),dataType:"json",context:this}).then((function(e){this.props.onRegister(e.uploads,e.resources,e.content),this.clearInput}))}},{key:"clearInput",value:function(){this.refs.url.value=""}},{key:"_validateUrl",value:function(e){var t=e.toLowerCase();return t.includes("youtube.com")?/youtube\.com\/watch\?v=([a-zA-Z0-9-_]+)/.test(e):t.includes("youtu.be")?/youtu\.be\/([a-zA-Z0-9-_]+)/.test(e):t.includes("vimeo.com")?/vimeo\.com\/([0-9]+)(?:\/([a-f0-9]+))?(?:\?.+)?/.test(e):!!t.includes("sketchfab.com")&&/sketchfab\.com\/models\/([a-zA-Z0-9]+)(?:\?.+?)?/.test(e)}},{key:"render",value:function(){return c().createElement("div",{className:"form-group staging-hosted-content"},c().createElement("h4",null,"Embedding a YouTube or Vimeo video?"),c().createElement("div",{className:"input-group"},c().createElement("input",{type:"text",ref:"url",onChange:this.onChange,placeholder:"Paste Url Here..."}),c().createElement("span",{className:"input-group-btn"},c().createElement("button",{className:"btn btn-primary",disabled:!this.state.isValidUrl,onClick:this.onSubmit},"Submit"))))}}])&&Lp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);qp.propTypes={onRegister:p().func.isRequired};const Vp=qp;function zp(e){return zp="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},zp(e)}function Wp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hp(e,t){return Hp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Hp(e,t)}function $p(e,t){if(t&&("object"===zp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Jp(e)}function Jp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gp(e){return Gp=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Gp(e)}var Qp=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hp(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Gp(r);if(o){var n=Gp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return $p(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(Jp(t)),t.valid=t.valid.bind(Jp(t)),t.getValue=t.getValue.bind(Jp(t)),t.setValue=t.setValue.bind(Jp(t)),t.onChange=t.onChange.bind(Jp(t)),t.state={value:null!=t.props.value?t.props.value.toString():"",isValid:!0,showValidation:!1},t}return t=a,(n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.refs.select.value&&""!=this.refs.select.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){var e=this.props.options.map((function(e,t){var n=e.text;return e.display&&(n=e.display),c().createElement("option",{key:e.value,value:e.value,disabled:e.disabled},n)})),t="form-group".concat(null==this.props.label?" no-label":"").concat(this.props.isInline?" form-inline":"");!0!==this.state.showValidation||this.state.isValid||(t+=" has-error");var n=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?n=c().createElement(gi,{message:this.props.helpMessage}):t+=" no-help":n=c().createElement(gi,{message:this.props.requiredErrorMessage}),c().createElement("div",{className:t},this.props.label&&c().createElement("label",{className:"static"},this.props.label),c().createElement("select",{ref:"select",disabled:this.props.disabled,value:this.state.value,onChange:this.onChange},e),n)}}])&&Wp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Qp.propTypes={options:p().array.isRequired,value:p().oneOfType([p().string,p().number]),label:p().string,helpMessage:p().string,required:p().bool,requiredErrorMessage:p().string,isInline:p().bool,disabled:p().bool,onChange:p().func},Qp.defaultProps={label:null,required:!1,requiredErrorMessage:"input required.",isInline:!1};const Yp=Qp;function Xp(e){return Xp="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},Xp(e)}function Zp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function eh(e,t){return eh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},eh(e,t)}function th(e,t){if(t&&("object"===Xp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nh(e)}function nh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rh(e){return rh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},rh(e)}const oh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=rh(r);if(o){var n=rh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return th(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(nh(t)),t.onSubmit=t.onSubmit.bind(nh(t)),t.onChange=t.onChange.bind(nh(t)),t.onContentTypeChange=t.onContentTypeChange.bind(nh(t)),t.onResourceFormatChange=t.onResourceFormatChange.bind(nh(t)),t.form={url:"",contentType:"",resourceFormat:""},t.state={setupForm:null,isValidUrl:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){null==this.setupForm&&this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/staging/hostedfile").done((function(t,n,r){e.form.contentType=t.contentType,e.form.resourceFormat=t.resourceFormat,e.setState({setupForm:t})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onSubmit",value:function(){this.form.url=this.refs.url.value,$.ajax({type:"POST",url:"/staging/hostedfile",data:this.form,context:this}).done((function(e,t,n){this.props.onRegister(null,e.resources,e.content),this.refs.url.value=""})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){}))}},{key:"onChange",value:function(e){var t=this.refs.url.value;this.setState({isValidUrl:t.startsWith("http://")||t.startsWith("https://")})}},{key:"onContentTypeChange",value:function(e){this.form.contentType=e}},{key:"onResourceFormatChange",value:function(e){this.form.resourceFormat=e}},{key:"render",value:function(){return null==this.state.setupForm?null:c().createElement("div",{className:"form-group staging-hosted-file clearfix"},c().createElement("h4",null,"Attaching a file that's hosted on another server?"),c().createElement("div",{className:"input-group type-and-formats"},c().createElement(Yp,{ref:"contentType",label:"Content Type",value:this.state.setupForm.contentType,options:this.state.setupForm.contentTypeOptions,required:!0,requiredErrorMessage:"Content Type Required",onChange:this.onContentTypeChange}),c().createElement(Yp,{ref:"resourceFormat",label:"Format",value:this.state.setupForm.resourceFormat,options:this.state.setupForm.resourceFormatOptions,required:!0,requiredErrorMessage:"Resource Format Required",onChange:this.onResourceFormatChange})),c().createElement("div",{className:"input-group"},c().createElement("input",{type:"text",ref:"url",onChange:this.onChange,placeholder:"Paste Url Here..."}),c().createElement("span",{className:"input-group-btn"},c().createElement("button",{className:"btn btn-primary",disabled:!this.state.isValidUrl,onClick:this.onSubmit},"Submit"))))}}])&&Zp(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function ih(e){return ih="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},ih(e)}function ah(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ch(e,t,n){return t&&sh(e.prototype,t),n&&sh(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lh(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uh(e,t)}function uh(e,t){return uh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},uh(e,t)}function fh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=dh(e);if(t){var o=dh(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ph(this,n)}}function ph(e,t){if(t&&("object"===ih(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hh(e)}function hh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dh(e){return dh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},dh(e)}var yh=function(e){lh(n,e);var t=fh(n);function n(e){var r;return ah(this,n),(r=t.call(this,e)).onNotificationClose=r.onNotificationClose.bind(hh(r)),r}return ch(n,[{key:"onNotificationClose",value:function(e,t){t.preventDefault(),this.props.onNotificationClose(e,t)}},{key:"render",value:function(){var e=[],t=this;return this.props.notifications.forEach((function(n,r){n.show&&e.push(c().createElement(mh,{key:r,data:n,onNotificationClose:t.onNotificationClose.bind(null,r)}))})),e.length>0?c().createElement("div",null,e):null}}]),n}(c().Component),mh=function(e){lh(n,e);var t=fh(n);function n(){return ah(this,n),t.apply(this,arguments)}return ch(n,[{key:"render",value:function(){var e=this.props.data,t=[];return 1==e.messages.length?t=c().createElement("p",null,e.messages[0]):e.messages.length>1&&(t=c().createElement("ul",null,e.messages.map((function(e,t){return c().createElement("li",{key:t},e)})))),c().createElement("div",{className:"alert alert-danger"},c().createElement("button",{type:"button",className:"close",onClick:this.props.onNotificationClose},c().createElement("i",{className:"glyphicon glyphicon-remove"})),c().createElement("strong",null,e.title),t)}}]),n}(c().Component);const vh=yh;function bh(e){return bh="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},bh(e)}function gh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Eh(e,t){return Eh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Eh(e,t)}function Sh(e,t){if(t&&("object"===bh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oh(e){return Oh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Oh(e)}const _h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Eh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Oh(r);if(o){var n=Oh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Sh(this,e)});function a(){return gh(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.data,t=e.name;return"Missing"==e.status&&(t="Missing : "+e.path),c().createElement("div",{className:"staging-item staging-item-child"+(e.blocking.length>0?" attention":"")},c().createElement("div",{className:"tfmedia"},e.thumb?c().createElement("img",{src:e.thumb,className:"tfthumb"}):null,c().createElement("div",{className:"tfmedia-body"},c().createElement("h4",null,c().createElement("span",{className:"content-type-badge"},e.type),t))))}}])&&wh(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function kh(e){return kh="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},kh(e)}function Ch(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ph(e,t){return Ph=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ph(e,t)}function jh(e,t){if(t&&("object"===kh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Th(e)}function Th(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xh(e){return xh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xh(e)}const Rh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ph(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xh(r);if(o){var n=xh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return jh(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e))._handleChange=t._handleChange.bind(Th(t)),t}return t=a,(n=[{key:"_handleChange",value:function(e){e.preventDefault(),e.stopPropagation(),this.props.onChange(e.target.value)}},{key:"render",value:function(){return c().createElement("div",{className:"form-group"+(this.props.isRenameSuccess?" has-success":" has-error")},c().createElement("label",{className:"static"},"Rename Title"),c().createElement("div",{className:"input-group"},c().createElement("input",{type:"text",value:this.props.inputValue,onChange:this._handleChange}),c().createElement("span",{className:"input-group-addon"},this.props.extension)))}}])&&Ch(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function Dh(e){return Dh="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},Dh(e)}function Nh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mh(e,t){return Mh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Mh(e,t)}function Ih(e,t){if(t&&("object"===Dh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ah(e)}function Ah(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lh(e){return Lh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Lh(e)}var Bh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Lh(r);if(o){var n=Lh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ih(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).checkStatus=t.checkStatus.bind(Ah(t)),t.onRenameChange=t.onRenameChange.bind(Ah(t)),t.handleRename=t.handleRename.bind(Ah(t)),t.handleTargetUsageChange=t.handleTargetUsageChange.bind(Ah(t)),t.handleTargetUsageUpdate=t.handleTargetUsageUpdate.bind(Ah(t)),t.handleDelete=t.handleDelete.bind(Ah(t)),t.handleRegisterContent=t.handleRegisterContent.bind(Ah(t)),t.niceOptionText=t.niceOptionText.bind(Ah(t)),t.EditorStatus={Ready:"ready",ExternalReferences:"externalreferences",TargetUsage:"targetusage",Rename:"rename"},t.state={status:t.checkStatus(t.props.resource),renamedTitle:t.props.resource.nameWithoutExtension,isRenameSuccess:!1,targetUsage:null,isTargetUsageSuccess:!1,showOverlay:!1},t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.resource.blocking[0]==this.props.resource.blocking[0]&&e.resource.group.length==this.props.resource.group.length&&e.resource.status==this.props.resource.status||this.setState({status:this.checkStatus(e.resource)})}},{key:"checkStatus",value:function(e){return"ExternalReferences"==e.blocking[0]?this.EditorStatus.ExternalReferences:e.group.length>1?this.EditorStatus.TargetUsage:"Rename"==e.status?this.EditorStatus.Rename:this.EditorStatus.Ready}},{key:"onRenameChange",value:function(e){$.ajax({type:"GET",url:"/staging/checkrename",data:{itemID:this.props.resource.id,titlePart:encodeURIComponent(e)},context:this}).then((function(t){var n=!t.data;this.setState({renamedTitle:e,isRenameSuccess:n})}))}},{key:"handleRename",value:function(e,t,n){$.ajax({type:"POST",url:"/staging/rename",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id,renamedTitle:encodeURIComponent(this.state.renamedTitle)}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleTargetUsageChange",value:function(e){var t=e.target.value,n=""!=e.target.value;this.setState({targetUsage:t,isTargetUsageSuccess:n})}},{key:"handleTargetUsageUpdate",value:function(e){$.ajax({type:"POST",url:"/staging/usage",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id,targetUsage:this.state.targetUsage}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleDelete",value:function(e){$.ajax({type:"DELETE",url:"/staging",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:this.props.resource.id}),dataType:"json",context:this}).then((function(e){this.props.onResourceUpdate(e.resources,null)}))}},{key:"handleRegisterContent",value:function(e){var t=this;this.setState({showOverlay:!0},(function(){$.ajax({type:"POST",url:"/staging/register",contentType:"application/json; charset=utf-8",data:JSON.stringify({itemID:t.props.resource.id}),dataType:"json",context:t}).then((function(e){var n=[];n.push(e.content),t.props.onResourceUpdate(e.resources,n)}))}))}},{key:"niceOptionText",value:function(e){var t=this.props.resource.type;switch(e){case"Asset":return"Downloadable File: Share file as download for use in applications outside of the browser";case"Portfolio":return"Display in Browser: Use for easy viewing of screen shots, rendered images, and videos directly in the browser.";case"Training":return"Display in Browser: Use for easy viewing of tutorials directly in the browser.";default:return e+" "+t}}},{key:"render",value:function(){if(!this.props.resource)return null;var e=this.props.resource,t=this.state.status==this.EditorStatus.TargetUsage&&!0===this.state.isTargetUsageSuccess,n=this.state.status==this.EditorStatus.Rename&&!0===this.state.isRenameSuccess,r=this.state.status==this.EditorStatus.Ready,o=this;return c().createElement("div",{className:"staging-item-edit clearfix"},this.state.status==this.EditorStatus.Rename&&c().createElement(Rh,{onChange:this.onRenameChange,isRenameSuccess:this.state.isRenameSuccess,inputValue:this.state.renamedTitle,extension:e.extension}),this.state.status==this.EditorStatus.TargetUsage&&c().createElement("div",{className:"form-group"+(this.state.isTargetUsageSuccess?" has-success":" has-error")},this.state.isTargetUsageSuccess&&c().createElement("label",{className:"static"},"Link Content As:"),c().createElement("select",{className:"form-control",onChange:this.handleTargetUsageChange},c().createElement("option",{key:"-1",value:""},"Intended usage"),e.group.map((function(e,t){return c().createElement("option",{key:t,value:e},o.niceOptionText(e))})))),c().createElement("div",{className:"pull-right"},c().createElement("button",{type:"button",className:"btn-default",onClick:this.handleDelete},"Delete"),this.state.status==this.EditorStatus.TargetUsage&&c().createElement("button",{type:"button",className:"btn-primary",disabled:!t,onClick:this.handleTargetUsageUpdate},"Update"),this.state.status==this.EditorStatus.Rename&&c().createElement("button",{type:"button",className:"btn-primary",disabled:!n,onClick:this.handleRename},"Rename"),this.state.status==this.EditorStatus.Ready&&c().createElement("button",{type:"button",className:"btn-primary",disabled:!r,onClick:this.handleRegisterContent},"Save Content")),!0===this.state.showOverlay&&c().createElement("div",{className:"overlay-waiting"},c().createElement("img",{src:"/common/img/assets/spinner.gif"})))}}])&&Nh(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Bh.propTypes={resource:p().object,onResourceUpdate:p().func};const Fh=Bh;function Uh(e){return Uh="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},Uh(e)}function Kh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vh(e,t){return Vh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vh(e,t)}function zh(e,t){if(t&&("object"===Uh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Wh(e){return Wh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Wh(e)}var Hh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Wh(r);if(o){var n=Wh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return zh(this,e)});function a(){return Kh(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.resource,t=[];e.children.forEach((function(e){"Duplicate"!=e.status&&t.push(c().createElement(_h,{key:e.id,data:e}))}));var n="staging-item";this.props.selected&&(n+=" selected"),("Ready"!=e.status||e.blocking.length>0)&&(n+=" attention");var r=c().createElement("p",null,"Ready");if(e.blocking.length>0)switch(e.blocking[0]){case"ExternalReferences":r=c().createElement("p",null,"Upload missing external references.");break;case"Rename":r=c().createElement("p",null,"An Asset with this name already exists, please rename.");break;case"TargetGroup":r=c().createElement("p",null,"Choose how this content item should be used or upload the parent asset.",c().createElement("br",null),c().createElement("br",null),"For example, if this is a texture image used in a material, please upload the material asset.")}return c().createElement("li",null,c().createElement("div",{className:n,onClick:this.props.onResourceSelect.bind(null,e.id)},c().createElement("div",{className:"tfmedia"},e.thumb?c().createElement("img",{src:e.thumb,className:"tfthumb"}):null,c().createElement("div",{className:"tfmedia-body"},c().createElement("h4",null,c().createElement("span",{className:"content-type-badge"},e.type),e.name),r)),this.props.selected?c().createElement(Fh,{resource:e,onResourceUpdate:this.props.onResourceUpdate}):null,t))}}])&&qh(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Hh.propTypes={resource:p().object,selected:p().bool,onResourceSelect:p().func,onResourceUpdate:p().func};const $h=Hh;function Jh(e){return Jh="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},Jh(e)}function Gh(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qh(e,t){return Qh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qh(e,t)}function Yh(e,t){if(t&&("object"===Jh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xh(e)}function Xh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zh(e){return Zh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Zh(e)}var ed=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qh(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Zh(r);if(o){var n=Zh(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Yh(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onResourceSelect=t.onResourceSelect.bind(Xh(t)),t.existsInResources=t.existsInResources.bind(Xh(t)),t.state={selectedId:null},t}return t=a,(n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){if(null==this.state.selectedId||!this.existsInResources(this.state.selectedId,e.resources)){var t=null!=e.resources&&e.resources.length>0?e.resources[0].id:null;t!=this.state.selectedId&&this.setState({selectedId:t})}}},{key:"onResourceSelect",value:function(e,t){t.preventDefault(),t.stopPropagation();var n=e;this.existsInResources(e,this.props.resources)||(n=null),this.setState({selectedId:n})}},{key:"existsInResources",value:function(e,t){for(var n=0;n<t.length;n++)if(t[n].id==e)return!0;return!1}},{key:"render",value:function(){var e=this,t=[];return this.props.resources.forEach((function(n){var r=e.state.selectedId==n.id;t.push(c().createElement($h,{key:n.id,resource:n,selected:r,onResourceSelect:e.onResourceSelect,onResourceUpdate:e.props.onResourceUpdate}))})),t.length<=0?null:c().createElement("div",{className:"tfpanel"},c().createElement("ul",{className:"staging-list"},t))}}])&&Gh(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);ed.propTypes={resources:p().array,onResourceUpdate:p().func};const td=ed;function nd(e){return nd="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},nd(e)}function rd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function od(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function id(e,t){return id=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},id(e,t)}function ad(e,t){if(t&&("object"===nd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function sd(e){return sd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},sd(e)}const cd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&id(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=sd(r);if(o){var n=sd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ad(this,e)});function a(){return rd(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e="".concat(this.props.content.type," - ").concat(this.props.content.format," : ").concat(this.props.content.title);return c().createElement("div",{className:"content-view"},c().createElement("div",{title:e,className:"link"},c().createElement("img",{src:this.props.content.thumbUrl})),c().createElement("div",{className:"details"},c().createElement("p",{className:"filename"},this.props.content.title)),this.props.children)}}])&&od(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function ld(e){return ld="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},ld(e)}function ud(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pd(e,t){return pd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pd(e,t)}function hd(e,t){if(t&&("object"===ld(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function dd(e){return dd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},dd(e)}var yd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pd(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=dd(r);if(o){var n=dd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return hd(this,e)});function a(){return ud(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e="".concat(this.props.content.type," : ").concat(this.props.content.title),t="Generic"!=this.props.content.type?c().createElement("p",{className:"attachment-type"},this.props.content.type," ",null!=this.props.content.formatDisplay?"- "+this.props.content.formatDisplay:""):null;return c().createElement("div",{className:"content-dl"},c().createElement("div",{title:e,className:"download icon icon-after icon-arrow icon-color-white"},"Download"),c().createElement("div",{className:"details"},c().createElement("p",{className:"filename"},this.props.content.title),t),this.props.children)}}])&&fd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);const md=yd;function vd(e){return vd="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},vd(e)}function bd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gd(e,t){return gd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},gd(e,t)}function wd(e,t){if(t&&("object"===vd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ed(e)}function Ed(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sd(e){return Sd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Sd(e)}var Od=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gd(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Sd(r);if(o){var n=Sd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return wd(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).filterContent=t.filterContent.bind(Ed(t)),t}return t=a,(n=[{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=[],t=[],n=$.grep(this.props.content,this.filterContent),r=$.grep(this.props.content,this.filterContent,!0);return n.forEach((function(t){e.push(c().createElement("li",{key:t.id,className:"view"},c().createElement(cd,{content:t})))})),r.forEach((function(e){t.push(c().createElement("li",{key:e.id,className:"dl"},c().createElement(md,{content:e})))})),c().createElement("div",{className:"tfpanel"},c().createElement("ul",{className:"content-list clearfix"},e,t))}}])&&bd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Od.propTypes={content:p().array};const _d=Od;function kd(e){return kd="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},kd(e)}function Cd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pd(e,t){return Pd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pd(e,t)}function jd(e,t){if(t&&("object"===kd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Td(e)}function Td(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xd(e){return xd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xd(e)}var Rd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pd(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xd(r);if(o){var n=xd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return jd(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onNotificationClose=t.onNotificationClose.bind(Td(t)),t.checkDuplicateResource=t.checkDuplicateResource.bind(Td(t)),t.onResourceUpdate=t.onResourceUpdate.bind(Td(t)),t.canClose=t.canClose.bind(Td(t)),t.onUploadDelete=t.onUploadDelete.bind(Td(t)),t.deleteUpload=t.deleteUpload.bind(Td(t)),t.createUploadKey=t.createUploadKey.bind(Td(t)),t.getUploadIndexByFilename=t.getUploadIndexByFilename.bind(Td(t)),t.getUploadIndexByKey=t.getUploadIndexByKey.bind(Td(t)),t.updateNotifications=t.updateNotifications.bind(Td(t)),t.onHostedRegister=t.onHostedRegister.bind(Td(t)),t.onFileDrop=t.onFileDrop.bind(Td(t)),t.nextFile=t.nextFile.bind(Td(t)),t.processFile=t.processFile.bind(Td(t)),t.updateUploadArray=t.updateUploadArray.bind(Td(t)),t.updateResourceAndContentArrays=t.updateResourceAndContentArrays.bind(Td(t)),t.updateUpload=t.updateUpload.bind(Td(t)),t.updateUploadInState=t.updateUploadInState.bind(Td(t)),t.fileProgress=t.fileProgress.bind(Td(t)),t.fileDone=t.fileDone.bind(Td(t)),t.inProcess=!1,t.files=[],t.fileSizeLimit=TFGlobal.stagingFileSizeLimit,t.state={uploads:[],notifications:[],resources:[],content:[]},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){$.ajax({type:"GET",url:"/staging",dataType:"json",context:this}).then((function(e){!0===e.status.isSuccess?this.setState({resources:e.data}):$("#errorModal").find("p").html(e.status.message).end().foundation("reveal","open")}))}},{key:"onNotificationClose",value:function(e,t){var n=this.state.notifications;n[e].show=!1,this.setState({notifications:n})}},{key:"checkDuplicateResource",value:function(e,t){if(void 0!==e)for(var n=0,r=e.length;n<r;n++){if(e[n].name==t&&"Missing"!=e[n].status&&"Duplicate"!=e[n].status)return!0;var o=this.checkDuplicateResource(e[n].children,t);if(null!=o)return o}return null}},{key:"onResourceUpdate",value:function(e,t){this.updateResourceAndContentArrays(e,t)}},{key:"canClose",value:function(){return!(!this.props.closeAfterAutoAcceptContent||0!=this.state.resources.length||0!=this.files.length)}},{key:"onUploadDelete",value:function(e,t){this.deleteUpload(e,null)}},{key:"deleteUpload",value:function(e,t){var n=this.getUploadIndexByKey(e);if(-1!=n){var r=this.state.uploads;r.splice(n,1);var o=this.state.notifications;t&&o.push(t),this.setState({uploads:r,notifications:o})}}},{key:"createUploadKey",value:function(e){return e.split(".").join("-")}},{key:"getUploadIndexByFilename",value:function(e){return this.getUploadIndexByKey(this.createUploadKey(e))}},{key:"getUploadIndexByKey",value:function(e){for(var t=0,n=!1;t<this.state.uploads.length;t++)if(this.state.uploads[t].key==e){n=!0;break}return n?t:-1}},{key:"updateNotifications",value:function(e){var t=this.state.notifications.push(e);this.setState({notifications:t})}},{key:"onHostedRegister",value:function(e,t,n){e&&this.updateUploadArray(e),this.updateResourceAndContentArrays(t,n)}},{key:"onFileDrop",value:function(e){var t=[],n=[],r=[],o=this;e.forEach((function(e){if($.grep(o.files,(function(t){return t.name==e.name})).length>0||-1!=o.getUploadIndexByFilename(e.name)||!0===o.checkDuplicateResource(o.state.resources,e.name)){var i={title:e.name,level:"Danger",messages:["Duplicate File"],show:!0};r.push(i)}else if(Math.floor(e.size/1024)>o.fileSizeLimit){var a={title:e.name,level:"Danger",messages:["File Too Large"],show:!0};r.push(a)}else{var s={key:o.createUploadKey(e.name),name:mn.getFileNameWithoutExtension(e.name),extension:mn.getFileExtension(e.name),type:e.type,status:"New",message:"Checking...",percentComplete:0};t.push(s),n.push(e)}})),this.setState({uploads:this.state.uploads.concat(t),notifications:r.concat(this.state.notifications)},(function(){for(var e=0,t=0;t<n.length;++t){var r=n[t],i=o.getUploadIndexByFilename(r.name);$.ajax({type:"GET",url:"/staging/validate",data:{mimeType:encodeURIComponent(r.type),filename:encodeURIComponent(r.name),groupsAllowed:this.props.groupsAllowed},contentType:"application/json; charset=utf-8",context:r,dataType:"json",traditional:!0}).done((function(e){if(!0===e.status.isSuccess)o.files.push(this),o.updateUpload(i,"Ready","Waiting to upload...",null);else{var t={title:r.name,level:"Danger",messages:[e.status.message],show:!0};o.deleteUpload(o.state.uploads[i].key,t)}})).fail((function(e,t,n){var a={title:r.name,level:"Danger",messages:["Error On File Recognition"],show:!0};o.deleteUpload(o.state.uploads[i].key,a)})).always((function(){++e==n.length&&(o.inProcess||o.nextFile())}))}}))}},{key:"nextFile",value:function(){this.inProcess=!0,0!=this.files.length?this.processFile(this.files.shift()):this.inProcess=!1}},{key:"processFile",value:function(e){var t=this.getUploadIndexByFilename(e.name),n=new FormData;n.append(e.name,e),n.append("groupsAllowed",this.props.groupsAllowed),this.updateUpload(t,"Uploading","Uploading...",null);var r=this;$.ajax({type:"POST",url:"/staging/upload",contentType:!1,processData:!1,data:n,context:e,xhr:function(){var e=$.ajaxSettings.xhr();return e.upload&&(e.upload.addEventListener("progress",r.fileProgress.bind(null,t)),e.upload.addEventListener("load",r.fileDone.bind(null,t))),e}}).done((function(e,t,n){r.updateUploadArray(e.uploads),r.updateResourceAndContentArrays(e.resources,e.content),r.nextFile()})).fail((function(e,t,n){alert(this.name+" : "+n)}))}},{key:"updateUploadArray",value:function(e){if(-1!=this.getUploadIndexByFilename(e.filename)){var t=null;if(!0!==e.status.isSuccess){for(var n=e.status.message?[e.status.message]:[],r=0;r<e.children.length;r++)!1===e.children[r].status.isSuccess&&n.push(e.children[r].status.message+" : "+e.children[r].filename);t={title:e.filename,level:"Danger",messages:n,show:!0}}this.deleteUpload(this.createUploadKey(e.filename),t)}}},{key:"updateResourceAndContentArrays",value:function(e,t){var n=null!=e&&e.length>0;if(null==t||0==t.length)this.setState({resources:e});else if(!0===this.props.autoAcceptContent)this.props.onAccept(t,this.canClose()&&!n),this.setState({resources:e});else{var r=t;null!=this.state.content&&0!=this.state.content.length&&(r=t.concat(this.state.content)),this.setState({resources:e,content:r})}}},{key:"updateUpload",value:function(e,t,n,r){var o=this.state.uploads[e];null!=o&&(null!=t&&(o.status=t),null!=n&&(o.message=n),null!=r&&(o.percentComplete=r),this.updateUploadInState(o,e))}},{key:"updateUploadInState",value:function(e,t){var n=this.state.uploads.slice();n[t]=e,this.setState({uploads:n})}},{key:"fileProgress",value:function(e,t){if(t.lengthComputable){var n=Math.round(t.loaded/t.total*100);this.updateUpload(e,null,null,n)}}},{key:"fileDone",value:function(e,t){this.updateUpload(e,"Loaded",null,100)}},{key:"render",value:function(){var e=this.props.autoAcceptContent?null:c().createElement("button",{className:"btn-primary",onClick:this.props.onAccept.bind(null,this.state.content),disabled:0==this.state.content.length},"Accept"),t=this.props.showCancel?c().createElement("button",{className:"btn-default",onClick:this.props.onCancel},this.props.cancelButtonLabel):null,n=!1;return!this.props.showHostedContent||null!=this.props.groupsAllowed&&-1==this.props.groupsAllowed.indexOf("Portfolio")&&-1==this.props.groupsAllowed.indexOf("Training")||(n=!0),c().createElement("div",{className:"content-staging"},c().createElement(vh,{notifications:this.state.notifications,onNotificationClose:this.onNotificationClose}),c().createElement("div",{style:{padding:"20px 20px 0 20px",border:"1px solid #ccc",marginBottom:"20px"}},!0===this.props.showUpload&&c().createElement(Ip,{onDrop:this.onFileDrop,uploads:this.state.uploads,multiple:this.props.allowMultipleFiles},this.props.children),!0===n&&c().createElement(Vp,{onRegister:this.onHostedRegister}),!0===this.props.showHostedFile&&c().createElement(oh,{onRegister:this.onHostedRegister})),c().createElement(td,{resources:this.state.resources,onResourceUpdate:this.onResourceUpdate}),null!=this.state.content&&this.state.content.length>0&&c().createElement(_d,{content:this.state.content,test:"no content selected"}),(null!=e||null!=t)&&c().createElement("div",{style:{textAlign:"right"}},t," ",e))}}])&&Cd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Rd.propTypes={groupsAllowed:p().array,allowMultipleFiles:p().bool,autoAcceptContent:p().bool,closeAfterAutoAcceptContent:p().bool,showCancel:p().bool,cancelButtonLabel:p().string,onCancel:p().func,showUpload:p().bool,showHostedContent:p().bool,showHostedFile:p().bool},Rd.defaultProps={groupsAllowed:null,allowMultipleFiles:!0,closeAfterAutoAcceptContent:!0,autoAcceptContent:!0,showCancel:!1,cancelButtonLabel:"Cancel",showUpload:!0,showHostedContent:!0,showHostedFile:!1};const Dd=Rd;function Nd(e){return Nd="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},Nd(e)}function Md(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Id(e,t){return Id=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Id(e,t)}function Ad(e,t){if(t&&("object"===Nd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ld(e)}function Ld(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bd(e){return Bd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Bd(e)}var Fd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Id(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bd(r);if(o){var n=Bd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ad(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleClickDelete=t.handleClickDelete.bind(Ld(t)),t.filterContent=t.filterContent.bind(Ld(t)),t}return t=a,(n=[{key:"handleClickDelete",value:function(e){this.props.onDeleteContent(e)}},{key:"filterContent",value:function(e,t){return"Portfolio"==e.group||"Training"==e.group}},{key:"render",value:function(){var e=this,t=[],n=[],r=$.grep(this.props.content,this.filterContent),o=$.grep(this.props.content,this.filterContent,!0);return r.forEach((function(n,r){var o,i=[];i.push(c().createElement("a",{onClick:e.handleClickDelete.bind(null,n.id)},"Delete")),o=c().createElement("div",{className:"edit"},c().createElement(bo,{wrapperTag:"span",actionTag:"anchor",actionLabel:c().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})),t.push(c().createElement("li",{key:n.id,className:"view"},c().createElement(cd,{content:n},o)))})),o.forEach((function(t,r){var o,i=[];i.push(c().createElement("a",{onClick:e.handleClickDelete.bind(null,t.id)},"Delete")),o=c().createElement("div",{className:"edit"},c().createElement(bo,{wrapperTag:"span",actionTag:"anchor",actionLabel:c().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})),n.push(c().createElement("li",{key:t.id,className:"dl"},c().createElement(md,{content:t},o)))})),c().createElement("div",{className:"tfpanel"},c().createElement("ul",{className:"content-list clearfix"},t,n))}}])&&Md(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Fd.propTypes={content:p().array,onDeleteContent:p().func};const Ud=Fd;function Kd(e){return Kd="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},Kd(e)}function qd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vd(e,t){return Vd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vd(e,t)}function zd(e,t){if(t&&("object"===Kd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wd(e)}function Wd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hd(e){return Hd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Hd(e)}var $d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vd(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hd(r);if(o){var n=Hd(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return zd(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(Wd(t)),t.valid=t.valid.bind(Wd(t)),t.getValue=t.getValue.bind(Wd(t)),t.clear=t.clear.bind(Wd(t)),t.addMarkup=t.addMarkup.bind(Wd(t)),t.openLink=t.openLink.bind(Wd(t)),t.addLink=t.addLink.bind(Wd(t)),t.openEmbed=t.openEmbed.bind(Wd(t)),t.addEmbed=t.addEmbed.bind(Wd(t)),t.openImageLink=t.openImageLink.bind(Wd(t)),t.addImageLink=t.addImageLink.bind(Wd(t)),t.handleCloseOverlay=t.handleCloseOverlay.bind(Wd(t)),t.openContent=t.openContent.bind(Wd(t)),t.addContent=t.addContent.bind(Wd(t)),t.handleDeleteContent=t.handleDeleteContent.bind(Wd(t)),t.handlePreview=t.handlePreview.bind(Wd(t)),t.handleSimpleMarkupChange=t.handleSimpleMarkupChange.bind(Wd(t)),t.handlePostChange=t.handlePostChange.bind(Wd(t)),t.handleFocus=t.handleFocus.bind(Wd(t)),t.focus=t.focus.bind(Wd(t)),t.Modes={Attract:"attract",Post:"post",Embed:"embed",Link:"link",Image:"image",Content:"content",Preview:"preview"},t.Embeds={},t.Embeds.YOUTUBE={action:"YOUTUBE",label:"Enter YouTube Video ID:",button:"Add YouTube video to post"},t.Embeds.VIMEO={action:"VIMEO",label:"Enter Vimeo Video ID:",button:"Add Vimeo video to post"},t.Embeds.SKETCHFAB={action:"SKETCHFAB",label:"Enter Sketchfab Model View Url or Model ID:",button:"Add Sketchfab model to post"},t.overlayLabel="",t.overlayButton="",t.action="",t.state={mode:t.props.mode,simpleMarkupFL:!0,preview:null,isValid:!1,showValidation:!1},t}return t=a,n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.refs.post.value=e.value}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return this.getValue().post.length>=3}},{key:"getValue",value:function(){return{post:this.refs.post.value,simpleMarkupFL:this.refs.simpleMarkupFL.checked}}},{key:"clear",value:function(){this.refs.post.value=""}},{key:"addMarkup",value:function(e){var t,n=this.refs.post;if(document.selection){if(n.focus(),sel=document.selection.createRange(),0==sel.text.length)return;(t=sel.text)&&(sel.text="["+e+"]"+t+"[/"+e+"]")}else{if(n.selectionEnd-n.selectionStart==0)return;(t=n.value.substring(n.selectionStart,n.selectionEnd))&&(n.value=n.value.substring(0,n.selectionStart)+"["+e+"]"+t+"[/"+e+"]"+n.value.substring(n.selectionEnd,n.value.length))}this.handlePostChange()}},{key:"openLink",value:function(){var e,t=this.refs.post;if(document.selection){if(t.focus(),sel=document.selection.createRange(),0!=sel.text.length&&(e=sel.text),e)return sel.text="[URL]"+e+"[/URL]",void this.handlePostChange()}else if(t.selectionEnd-t.selectionStart!=0&&(e=t.value.substring(t.selectionStart,t.selectionEnd)),e)return t.value=t.value.substring(0,t.selectionStart)+"[URL]"+e+"[/URL]"+t.value.substring(t.selectionEnd,t.value.length),void this.handlePostChange();this.setState({mode:this.Modes.Link})}},{key:"addLink",value:function(){var e=this.refs.post,t=this.refs.link.value,n=this.refs.linktext.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text=n?'[URL="'+t+'"]'+n+"[/URL]":"[URL]"+t+"[/URL]")):t&&(e.value=n?e.value.substring(0,e.selectionStart)+'[URL="'+t+'"]'+n+"[/URL]"+e.value.substring(e.selectionEnd,e.value.length):e.value.substring(0,e.selectionStart)+"[URL]"+t+"[/URL]"+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"openEmbed",value:function(e){this.overlayLabel=this.Embeds[e].label,this.overlayButton=this.Embeds[e].button,this.action=e,this.setState({mode:this.Modes.Embed})}},{key:"addEmbed",value:function(){var e=this.refs.post,t=this.refs.embed.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text="["+this.action+'="'+t+'"]')):t&&(e.value=e.value.substring(0,e.selectionStart)+"["+this.action+'="'+t+'"]'+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"openImageLink",value:function(){var e,t=this.refs.post;if(document.selection){if(t.focus(),sel=document.selection.createRange(),0!=sel.text.length&&(e=sel.text),null!=e&&"null"!=e&&""!=e)return sel.text="[IMG]"+e+"[/IMG]",void this.handlePostChange()}else if(t.selectionEnd-t.selectionStart!=0&&(e=t.value.substring(t.selectionStart,t.selectionEnd)),null!=e&&"null"!=e&&""!=e)return t.value=t.value.substring(0,t.selectionStart)+"[IMG]"+e+"[/IMG]"+t.value.substring(t.selectionEnd,t.value.length),void this.handlePostChange();this.setState({mode:this.Modes.Image})}},{key:"addImageLink",value:function(){var e=this.refs.post,t=this.refs.image.value;document.selection?(e.focus(),sel=document.selection.createRange(),t&&(sel.text="[IMG]"+t+"[/IMG]")):t&&(e.value=e.value.substring(0,e.selectionStart)+"[IMG]"+t+"[/IMG]"+e.value.substring(e.selectionEnd,e.value.length)),this.setState({mode:this.Modes.Post}),this.handlePostChange()}},{key:"handleCloseOverlay",value:function(){this.setState({mode:this.Modes.Post})}},{key:"openContent",value:function(){this.setState({mode:this.Modes.Content})}},{key:"addContent",value:function(e){if(null!=e||e.length>0){var t=e;null!=this.props.content&&0!=this.props.content.length&&(t=this.props.content.concat(e)),this.props.onContentChange(t)}this.setState({mode:this.Modes.Post})}},{key:"handleDeleteContent",value:function(e){if(null!=this.props.content&&0!=this.props.content.length){for(var t=this.props.content,n=null,r=0;r<t.length;r++)t[r].id==e&&(n=r);null!=n&&(t.splice(n,1),this.props.onContentChange(t))}}},{key:"handlePreview",value:function(){this.state.mode!=this.Modes.Preview?this.validate()&&this.setState({mode:this.Modes.Preview},(function(){var e=this.getValue(),t={post:e.post,simpleMarkupFL:e.simpleMarkupFL};$.ajax({type:"POST",url:"/api/forum/post/preview",contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json",context:this}).done((function(e,t,n){this.setState({preview:e.data})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))})):this.handleCloseOverlay()}},{key:"handleSimpleMarkupChange",value:function(e){this.setState({simpleMarkupFL:e.target.checked}),this.props.onChange&&this.props.onChange(this.getValue())}},{key:"handlePostChange",value:function(){!0===this.state.showValidation&&this.setState({isValid:this.valid()}),this.props.onChange&&this.props.onChange(this.getValue())}},{key:"handleFocus",value:function(){this.state.mode===this.Modes.Attract&&this.setState({mode:this.Modes.Post},(function(){this.props.onFocus&&this.props.onFocus()}))}},{key:"focus",value:function(){this.refs.post.focus()}},{key:"render",value:function(){var e="post-editor-input".concat(!0!==this.state.showValidation||this.state.isValid?"":" has-error"),t=this.state.mode==this.Modes.Attract?"Join the conversation...":"",n=null;return!0!==this.state.showValidation||this.state.isValid||(n=c().createElement(gi,{message:"post required and must be 3 or more characters in length"})),c().createElement("div",null,c().createElement("div",{className:"post-editor-primary"},this.state.mode!=this.Modes.Attract&&c().createElement("ul",{className:"post-edit-controls"},c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"B")},"B")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"I")},"I")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"QUOTE")},"Quote")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"CODE")},"Inline Code")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.addMarkup.bind(null,"CODEBLOCK")},"Code Block")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openLink},"Add Link")),"Discussion"==this.props.type&&c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openImageLink},"Add Image Link")),"Discussion"==this.props.type&&c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"YOUTUBE")},"YouTube")),"Discussion"==this.props.type&&c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"VIMEO")},"Vimeo")),"Discussion"==this.props.type&&c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",disabled:!this.state.simpleMarkupFL,onClick:this.openEmbed.bind(null,"SKETCHFAB")},"Sketchfab")),"Discussion"==this.props.type&&c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",onClick:this.openContent},"Attach Content"))),c().createElement("div",{className:e},c().createElement("textarea",{name:"post",ref:"post",placeholder:t,defaultValue:this.props.value,className:"form-control",rows:"12",onFocus:this.handleFocus,onChange:this.handlePostChange,disabled:!this.props.enabled,tabIndex:"2"}),n),null!=this.props.content&&this.props.content.length>0&&c().createElement(Ud,{content:this.props.content,onDeleteContent:this.handleDeleteContent}),this.state.mode==this.Modes.Content&&c().createElement(B,{onClose:this.handleCloseOverlay,contentStyle:{width:"100%",padding:"20px",backgroundColor:"white"}},c().createElement(Dd,{closeAfterAutoAcceptContent:!1,autoAcceptContent:!1,onAccept:this.addContent,showCancel:!0,onCancel:this.handleCloseOverlay},c().createElement("h4",null,c().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),c().createElement("br",null),"Drag and drop one or more files or click in this area to upload"))),this.state.mode==this.Modes.Embed&&c().createElement("div",{className:"post-editor-overlay dark clearfix"},c().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},c().createElement("i",{className:"glyphicon glyphicon-remove"})),c().createElement("div",{className:"form-group light"},c().createElement("label",{className:"static"},this.overlayLabel),c().createElement("input",{type:"text",ref:"embed",name:"embed"})),c().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addEmbed},this.overlayButton)),this.state.mode==this.Modes.Link&&c().createElement("div",{className:"post-editor-overlay dark clearfix"},c().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},c().createElement("i",{className:"glyphicon glyphicon-remove"})),c().createElement("div",{className:"form-group light"},c().createElement("label",{className:"static"},"Enter Full Url: "),c().createElement("input",{type:"text",ref:"link",name:"link",placeholder:"http://...",className:"form-control"})),c().createElement("div",{className:"form-group light"},c().createElement("label",{className:"static"},"Enter Text for the Link (Leave blank to display full address):"),c().createElement("input",{type:"text",ref:"linktext",name:"linktext"})),c().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addLink},"Add Link")),this.state.mode==this.Modes.Image&&c().createElement("div",{className:"post-editor-overlay dark clearfix"},c().createElement("button",{type:"button",className:"close light",onClick:this.handleCloseOverlay},c().createElement("i",{className:"glyphicon glyphicon-remove"})),c().createElement("div",{className:"form-group light"},c().createElement("label",{className:"static"},"Enter Image Url: "),c().createElement("input",{type:"text",ref:"image",name:"image",placeholder:"http://..."})),c().createElement("button",{type:"button",className:"btn-primary pull-right",onClick:this.addImageLink},"Add Image Link")),this.state.mode==this.Modes.Preview&&c().createElement("div",{className:"post-editor-overlay clearfix"},c().createElement("button",{type:"button",className:"close",onClick:this.handleCloseOverlay},c().createElement("i",{className:"glyphicon glyphicon-remove"})),c().createElement("article",{className:"comment preview"},c().createElement("div",{className:"comment-body"},c().createElement("div",{className:"comment-body-container"},c().createElement("div",{className:"comment-body-content clearfix",dangerouslySetInnerHTML:{__html:this.state.preview}})))))),this.state.mode!=this.Modes.Attract&&c().createElement("div",{className:"clearfix"},c().createElement("div",{className:"form-group form-inline",style:{marginTop:"10px",marginRight:"10px"}},c().createElement("input",{type:"checkbox",id:"simpleMarkupFL",name:"simpleMarkupFL",ref:"simpleMarkupFL",checked:this.state.simpleMarkupFL,onChange:this.handleSimpleMarkupChange}),c().createElement("label",{htmlFor:"simpleMarkupFL"},"Enable Simple Markup")),this.state.simpleMarkupFL&&c().createElement("button",{type:"button",className:"btn-default",name:"preview",onClick:this.handlePreview},"Preview"),c().createElement("div",{className:"pull-right"},this.props.children)))}}],n&&qd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);$d.propTypes={type:p().string},$d.defaultProps={mode:"post",type:"Post"};const Jd=$d;function Gd(e){return Gd="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},Gd(e)}function Qd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yd(e,t){return Yd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Yd(e,t)}function Xd(e,t){if(t&&("object"===Gd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zd(e)}function Zd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ey(e){return ey=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ey(e)}const ty=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yd(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ey(r);if(o){var n=ey(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Xd(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).tick=t.tick.bind(Zd(t)),t.format=t.format.bind(Zd(t)),t.state={secondsRemaining:0},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setState({secondsRemaining:this.props.secondsRemaining}),this.interval=setInterval(this.tick,1e3)}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"tick",value:function(){this.setState({secondsRemaining:this.state.secondsRemaining-1}),this.state.secondsRemaining<=0&&(clearInterval(this.interval),this.props.onCountdownFinished&&this.props.onCountdownFinished())}},{key:"format",value:function(e,t){var n=e;for(var r in t){var o=new RegExp("{"+r+"}","gm");n=n.replace(o,t[r])}return n}},{key:"render",value:function(){var e=Math.floor(this.state.secondsRemaining/60),t=this.state.secondsRemaining%60;e<=9&&(e="0"+e),t<=9&&(t="0"+t);var n="".concat(e,":").concat(t);return c().createElement("div",null,this.format(this.props.message,{time:n}))}}])&&Qd(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function ny(e){return ny="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ny(e)}function ry(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oy(e,t){return oy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},oy(e,t)}function iy(e,t){if(t&&("object"===ny(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ay(e)}function ay(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sy(e){return sy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},sy(e)}var cy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oy(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=sy(r);if(o){var n=sy(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return iy(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(ay(t)),t.buildUrl=t.buildUrl.bind(ay(t)),t.handleSubmit=t.handleSubmit.bind(ay(t)),t.handleCancel=t.handleCancel.bind(ay(t)),t.handleDelayEnd=t.handleDelayEnd.bind(ay(t)),t.handlePostChange=t.handlePostChange.bind(ay(t)),t.handleContentChange=t.handleContentChange.bind(ay(t)),t.handleStatusChange=t.handleStatusChange.bind(ay(t)),t.handleSubscribeChange=t.handleSubscribeChange.bind(ay(t)),t.profile=null,t.editor=null,t.state={form:null,submitDisabled:!1,delay:!1,delayTimeSpan:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){"attract"!=this.props.mode&&"display"!=this.props.mode&&this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON(this.buildUrl()).done((function(t,n,r){e.profile=t.data.profile,e.editor=t.data.editor,e.setState({form:t.data.form},(function(){!0===this.props.autoFocus&&e.refs.post.focus()}))})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.props.onCancel()}))}},{key:"buildUrl",value:function(){return"/api/forum/post/".concat(this.props.mode,"?type=").concat(this.props.type,"&id=").concat(this.props.itemID)+"".concat(null!=this.props.postID?"&postID="+this.props.postID:"")}},{key:"handleSubmit",value:function(){if(this.refs.post.validate()){var e=this;this.setState({submitDisabled:!0},(function(){var t=this.state.form;null!=t.content&&t.content.length>0&&(t.contentList=t.content.map((function(e,t){return e.id}))),$.ajax({type:"POST",url:e.buildUrl(),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:t}),dataType:"json"}).done((function(t,n,r){switch(t.data.result){case"Success":e.props.onSubmit(t.data);break;case"Delay":e.setState({delay:!0,delayTimeSpan:t.data.timeSpan})}})).fail((function(t,n,r){alerts.error(t.responseJSON.errorMessage),e.setState({submitDisabled:!1})}))}))}}},{key:"handleCancel",value:function(){this.refs.post.clear(),this.props.onCancel()}},{key:"handleDelayEnd",value:function(){this.setState({submitDisabled:!1,delay:!1,delayTimeSpan:null})}},{key:"handlePostChange",value:function(e){var t=this.state.form;t.post=e.post,t.simpleMarkupFL=e.simpleMarkupFL,this.setState({form:t})}},{key:"handleContentChange",value:function(e){var t=this.state.form;t.content=e,this.setState({form:t})}},{key:"handleStatusChange",value:function(e){var t=this.state.form;t.status=e,this.setState({form:t})}},{key:"handleSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribeFL=e.target.checked,this.setState({form:t})}},{key:"render",value:function(){return null==this.state.form?null:c().createElement("div",{className:"post-editor",id:"postEditor"},c().createElement(qo,{profile:this.profile,showLink:!1,showAvatar:!0,colorClassName:"dark"}),c().createElement(Jd,{ref:"post",type:this.props.type,value:this.state.form.post,content:this.state.form.content,onChange:this.handlePostChange,onContentChange:this.handleContentChange,enabled:!0},"new"==this.props.mode&&0==this.editor.subscription&&c().createElement("div",{className:"form-group form-inline",style:{marginTop:"10px",marginRight:"10px"}},c().createElement("input",{type:"checkbox",id:"subscribeFL",name:"subscribeFL",ref:"autoSubscribeFL",checked:this.state.form.autoSubscribeFL,onChange:this.handleSubscribeChange}),c().createElement("label",{htmlFor:"subscribeFL"}," Watch discussion +")),this.editor&&this.editor.e&&c().createElement(lu,{options:this.state.form.statusOptions,value:this.state.form.status,onChange:this.handleStatusChange,isInline:!0}),c().createElement("span",{className:"button-group"},c().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel"),c().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit"))),this.state.delay&&c().createElement(ty,{secondsRemaining:this.state.delayTimeSpan,message:"We're sorry, You have to wait {time} before posting.",onCountdownFinished:this.handleDelayEnd}))}}])&&ry(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);cy.propTypes={mode:p().string,itemID:p().number,type:p().string,viewer:p().object,autoFocus:p().bool,onSubmit:p().func.isRequired,onCancel:p().func.isRequired},cy.defaultProps={autoFocus:!0,mode:"new",type:"Post"};const ly=cy;function uy(e){return uy="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},uy(e)}function fy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function py(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hy(e,t,n){return t&&py(e.prototype,t),n&&py(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dy(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yy(e,t)}function yy(e,t){return yy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yy(e,t)}function my(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gy(e);if(t){var o=gy(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return vy(this,n)}}function vy(e,t){if(t&&("object"===uy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return by(e)}function by(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gy(e){return gy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},gy(e)}var wy=function(e){dy(n,e);var t=my(n);function n(e){var r;return fy(this,n),(r=t.call(this,e)).handleNew=r.handleNew.bind(by(r)),r.handleReply=r.handleReply.bind(by(r)),r.handleQuote=r.handleQuote.bind(by(r)),r.handleEdit=r.handleEdit.bind(by(r)),r.handleSubmit=r.handleSubmit.bind(by(r)),r.handleCancel=r.handleCancel.bind(by(r)),r.Modes={Display:"display",New:"new",Edit:"edit",Reply:"reply",Quote:"quote"},r.state={mode:r.props.mode,targetID:null},r}return hy(n,[{key:"componentDidUpdate",value:function(){if(this.state.mode==this.Modes.New){var e=document.getElementById("postEditor");e&&e.scrollIntoView()}}},{key:"handleNew",value:function(){this.setState({mode:this.Modes.New,targetID:null})}},{key:"handleReply",value:function(e){this.setState({mode:this.Modes.Reply,targetID:e})}},{key:"handleQuote",value:function(e){this.setState({mode:this.Modes.Quote,targetID:e})}},{key:"handleEdit",value:function(e){this.setState({mode:this.Modes.Edit,targetID:e})}},{key:"handleSubmit",value:function(e){var t=this;this.setState({mode:this.Modes.Display,targetID:null},(function(){t.props.history.push(e.url)}))}},{key:"handleCancel",value:function(){this.setState({mode:this.Modes.Display,targetID:null})}},{key:"render",value:function(){var e=this,t=[];if(this.props.posts){this.props.posts.data.forEach((function(n,r){e.state.mode==e.Modes.Edit&&n.postID==e.state.targetID?t.push(c().createElement(ly,{key:0,mode:e.state.mode,type:"Discussion",itemID:n.postID,viewer:e.props.viewer,onSubmit:e.handleSubmit,onCancel:e.handleCancel})):"GDPRRemoval"===n.status?t.push(c().createElement(op,{key:n.postID,post:n})):t.push(c().createElement(Qf,{key:n.postID,post:n,viewer:e.props.viewer,onReply:e.handleReply,onQuote:e.handleQuote,onEdit:e.handleEdit,showEditControls:e.props.topic.show.newPost})),e.state.mode!=e.Modes.Quote&&e.state.mode!=e.Modes.Reply||n.postID!=e.state.targetID||t.push(c().createElement(ly,{key:0,mode:e.state.mode,type:"Discussion",itemID:e.props.topic.topicID,postID:n.postID,viewer:e.props.viewer,onSubmit:e.handleSubmit,onCancel:e.handleCancel}))})),this.state.mode==this.Modes.New&&t.push(c().createElement(ly,{key:0,mode:this.state.mode,type:"Discussion",itemID:this.props.topic.topicID,viewer:this.props.viewer,onSubmit:e.handleSubmit,onCancel:this.handleCancel}));var n=null;return this.props.topic.show.newPost&&this.state.mode==this.Modes.Display&&(n=c().createElement(Ey,{onClick:this.handleNew})),c().createElement("div",null,c().createElement("div",{className:"comment-container forum"},this.props.posts.totalPages>1&&c().createElement(Nn,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}),t,this.props.posts.totalPages>1&&c().createElement(Nn,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged})),n)}return c().createElement("div",{className:"subsection comment"},c().createElement("div",{className:"comment-container"},c().createElement("h4",null,"No Content")))}}]),n}(c().Component);wy.propTypes={mode:p().string,topic:p().object,posts:p().object,viewer:p().object,onPageChanged:p().func};var Ey=function(e){dy(n,e);var t=my(n);function n(){return fy(this,n),t.apply(this,arguments)}return hy(n,[{key:"render",value:function(){return c().createElement("div",{className:"new-content-button"},c().createElement("button",{type:"button",className:"btn-primary",onClick:this.props.onClick},"Reply To Topic"))}}]),n}(c().Component);const Sy=nt(wy);function Oy(e){return Oy="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},Oy(e)}function _y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ky(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cy(e,t){return Cy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Cy(e,t)}function Py(e,t){if(t&&("object"===Oy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function jy(e){return jy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},jy(e)}var Ty=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cy(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=jy(r);if(o){var n=jy(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Py(this,e)});function a(){return _y(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null;return null!=this.props.limitHeight&&(e={maxHeight:this.props.limitHeight}),c().createElement("div",{className:"image-element"},c().createElement("img",{src:this.props.content.data,style:e}),this.props.children)}}])&&ky(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Ty.propTypes={content:p().object.isRequired,limitHeight:p().number};const xy=Ty;function Ry(e){return Ry="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},Ry(e)}function Dy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ny(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function My(e,t){return My=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},My(e,t)}function Iy(e,t){if(t&&("object"===Ry(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ay(e){return Ay=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ay(e)}var Ly=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&My(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ay(r);if(o){var n=Ay(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Iy(this,e)});function a(){return Dy(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"text-element",dangerouslySetInnerHTML:mn.createMarkup(this.props.content.data)})}}])&&Ny(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Ly.propTypes={content:p().object.isRequired};const By=Ly;function Fy(e){return Fy="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},Fy(e)}function Uy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ky(e,t){return Ky=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ky(e,t)}function qy(e,t){if(t&&("object"===Fy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Vy(e)}function Vy(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zy(e){return zy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},zy(e)}var Wy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ky(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=zy(r);if(o){var n=zy(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return qy(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setHeight=t.setHeight.bind(Vy(t)),t.handleResize=t.handleResize.bind(Vy(t)),t.aspect=t.props.content.attributes.height/t.props.content.attributes.width,t.state={height:t.props.content.attributes.height},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"componentDidMount",value:function(){this.setHeight()}},{key:"setHeight",value:function(){var e=this.refs.video.offsetWidth*this.aspect;this.props.limitHeight&&this.props.limitHeight<e&&(e=this.props.limitHeight),this.setState({height:e})}},{key:"handleResize",value:function(e){this.setHeight()}},{key:"render",value:function(){var e=null;switch(this.props.content.format){case"YouTube":case"Vimeo":var t=null;switch(this.props.content.format){case"YouTube":t="https://www.youtube.com/embed/"+this.props.content.data;break;case"Vimeo":var n=this.props.content.data,r="";if(-1!=n.indexOf(":")){var o=n.split(":");n=o[0],r="h=".concat(o[1],"&")}t="https://player.vimeo.com/video/".concat(n,"?").concat(r,"byline=0&portrait=0")}e=c().createElement("iframe",{ref:"video",height:this.state.height,src:t,frameBorder:"0",allowFullScreen:!0});break;case"Wistia":var i="wistia_embed wistia_async_".concat(this.props.content.data),a={height:this.state.height,display:"inline-block"};e=c().createElement("div",{ref:"video",className:i,style:a}," ");break;case"QuickTime":e=c().createElement("video",{ref:"video",height:this.state.height,src:this.props.content.data,controls:"controls"},c().createElement("embed",{src:this.props.content.data,scale:"tofit",autoPlay:"false",loop:"true",controller:"true",airPlay:"allow",pluginsPage:"http://www.apple.com/quicktime/download/"}));break;default:e=c().createElement("video",{ref:"video",height:this.state.height,src:this.props.content.data,controls:"controls"})}return c().createElement("div",{className:"video-element"},e)}}])&&Uy(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Wy.propTypes={content:p().object.isRequired,limitHeight:p().number};const Hy=Wy;function $y(e){return $y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$y(e)}function Jy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qy(e,t){return Qy=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qy(e,t)}function Yy(e,t){if(t&&("object"===$y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xy(e){return Xy=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xy(e)}var Zy=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qy(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Xy(r);if(o){var n=Xy(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Yy(this,e)});function a(){return Jy(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",null,c().createElement("img",{src:this.props.content.thumbUrl}),c().createElement("div",{className:"details"},c().createElement("p",{className:"type"},this.props.content.type),c().createElement("p",{className:"filename"},this.props.content.title)),this.props.children)}}])&&Gy(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Zy.propTypes={content:p().object.isRequired};const em=Zy;function tm(e){return tm="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},tm(e)}function nm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function rm(e,t){return rm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},rm(e,t)}function om(e,t){if(t&&("object"===tm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return im(e)}function im(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function am(e){return am=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},am(e)}var sm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rm(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=am(r);if(o){var n=am(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return om(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setHeight=t.setHeight.bind(im(t)),t.handleResize=t.handleResize.bind(im(t)),t.aspect=.625,t.state={height:0},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&window.removeEventListener("resize",this.handleResize)}},{key:"componentDidMount",value:function(){this.setHeight()}},{key:"setHeight",value:function(){var e=this.refs.video.offsetWidth*this.aspect;this.props.limitHeight&&this.props.limitHeight<e&&(e=this.props.limitHeight),this.setState({height:e})}},{key:"handleResize",value:function(e){this.setHeight()}},{key:"render",value:function(){var e=null;return"Sketchfab"===this.props.content.format&&(e="https://sketchfab.com/models/"+this.props.content.data+"/embed"),c().createElement("div",{className:"embedded3d-element"},c().createElement("iframe",{ref:"video",height:this.state.height,src:e,frameBorder:"0",allowFullScreen:!0}))}}])&&nm(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);sm.propTypes={content:p().object.isRequired};const cm=sm;function lm(e){return lm="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},lm(e)}function um(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pm(e,t){return pm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},pm(e,t)}function hm(e,t){if(t&&("object"===lm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},dm(e)}var ym=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pm(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=dm(r);if(o){var n=dm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return hm(this,e)});function a(){return um(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(null==this.props.content)return null;switch(this.props.content.type){case"Image":return c().createElement(xy,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight},this.props.children);case"Text":return c().createElement(By,{display:this.props.display,content:this.props.content});case"Video":return c().createElement(Hy,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight});case"Embedded3DViewer":return c().createElement(cm,{display:this.props.display,content:this.props.content,limitHeight:this.props.limitHeight});default:return c().createElement(em,{display:this.props.display,content:this.props.content},this.props.children)}}}])&&fm(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);ym.propTypes={display:p().string,limitHeight:p().number},ym.defaultProps={display:"inline",limitHeight:null};const mm=ym;function vm(e){return vm="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},vm(e)}function bm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function gm(e,t){return gm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},gm(e,t)}function wm(e,t){if(t&&("object"===vm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Em(e)}function Em(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sm(e){return Sm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Sm(e)}var Om=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gm(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Sm(r);if(o){var n=Sm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return wm(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).updateValues=t.updateValues.bind(Em(t)),t.onThumbClick=t.onThumbClick.bind(Em(t)),t.changePrimary=t.changePrimary.bind(Em(t)),t.onOverlayOpen=t.onOverlayOpen.bind(Em(t)),t.onOverlayClose=t.onOverlayClose.bind(Em(t)),t.onChangeThumb=t.onChangeThumb.bind(Em(t)),t.onChangePrimary=t.onChangePrimary.bind(Em(t)),t.windowHeight=null,t.containerWidth=null,t.visibleThumbCount=null,t.showThumbNav=!1,t.showPrimaryNav=!1,t.state={currentIndex:0,thumbStartIndex:0,primary:t.props.gallery?t.props.gallery.primary:null,height:null,showOverlay:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.windowHeight=window.innerHeight,null!=this.props.gallery&&null==this.state.height&&this.updateValues()}},{key:"componentDidUpdate",value:function(){null!=this.props.gallery&&null==this.state.height&&this.updateValues()}},{key:"updateValues",value:function(){this.containerWidth=this.wrapper.offsetWidth,null!=this.props.gallery.content&&this.props.gallery.content.length>1&&(this.showPrimaryNav=!0),this.visibleThumbCount=Math.floor(this.containerWidth/this.props.thumbWidth),null==this.props.gallery.content||this.visibleThumbCount>=this.props.gallery.content.length?this.showThumbNav=!1:(this.showThumbNav=!0,this.visibleThumbCount*this.props.thumbWidth+2*this.props.navWidth>this.containerWidth&&(this.visibleThumbCount=this.visibleThumbCount-1));var e=this.state.showOverlay?this.windowHeight-80-100-5:this.wrapper.offsetWidth*this.props.aspectMultiplier;this.setState({height:e,thumbStartIndex:0})}},{key:"onThumbClick",value:function(e,t){t.preventDefault(),this.changePrimary(e)}},{key:"changePrimary",value:function(e){if(e!=this.state.currentIndex){var t=this.props.gallery.content[e].id,n=this.state.thumbStartIndex;e<this.state.thumbStartIndex?n=e:e>this.state.thumbStartIndex+this.visibleThumbCount-1&&(n+=1);var r=this,o=mn.format(this.props.dataUrl,t);$.getJSON(o).done((function(t,o,i){r.setState({primary:t,currentIndex:e,thumbStartIndex:n})})).fail((function(e,t,n){}))}}},{key:"onOverlayOpen",value:function(){this.setState({showOverlay:!0,height:null})}},{key:"onOverlayClose",value:function(){this.setState({showOverlay:!1,height:null})}},{key:"onChangeThumb",value:function(e,t){t.preventDefault();var n=this.state.thumbStartIndex+e;n<0?n=0:n>this.props.gallery.content.length-this.visibleThumbCount&&(n=this.props.gallery.content.length-this.visibleThumbCount),this.setState({thumbStartIndex:n})}},{key:"onChangePrimary",value:function(e,t){var n=this.state.currentIndex+e;n<0?n=0:n>this.props.gallery.content.length-1&&(n=this.props.gallery.content.length-1),this.changePrimary(n)}},{key:"render",value:function(){if(null==this.props.gallery)return null;var e=this;if(null==this.state.height||null==this.state.primary){e=this;var t=c().createElement("div",{className:"embedded-gallery-test",ref:function(t){e.wrapper=t}}," ");return!0===this.state.showOverlay?c().createElement(B,{closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.onOverlayClose,contentStyle:{width:"100%",height:e.windowHeight-80}},t):t}var n="embedded-gallery";!0===this.state.showOverlay&&(n+=" overlay");var r=[];if(null!=this.props.gallery.content){var o=this.state.currentIndex>0,i=this.state.currentIndex<this.props.gallery.content.length-1,a=this.state.thumbStartIndex+(this.visibleThumbCount-1);a>this.props.gallery.content.length-1&&(a=this.props.gallery.content.length-1);for(var s=this.state.thumbStartIndex>0,l=a<this.props.gallery.content.length-1,u=this.state.thumbStartIndex;u<=a;u++){var f=this.props.gallery.content[u],p=e.state.currentIndex===u?"active":"";r.push(c().createElement("a",{key:f.id,href:"#",className:p,style:{backgroundImage:"url("+f.thumbUrl+")"},onClick:e.onThumbClick.bind(null,u)}))}}var h=c().createElement("div",{className:n,style:this.props.style},c().createElement("div",{className:"primary-container"},c().createElement("div",{className:"primary",style:{height:this.state.height}},this.props.children&&!this.state.showOverlay&&c().createElement("div",{className:"child-controls"},this.props.children),!this.state.showOverlay&&c().createElement("span",{className:"open-overlay glyphicon glyphicon-fullscreen",onClick:this.onOverlayOpen}),c().createElement(mm,{content:this.state.primary,limitHeight:this.state.height}),this.showPrimaryNav&&c().createElement("button",{className:"nav left",onClick:this.onChangePrimary.bind(null,-1),disabled:!o},c().createElement("span",{className:"glyphicon glyphicon-menu-left"})),this.showPrimaryNav&&c().createElement("button",{className:"nav right",onClick:this.onChangePrimary.bind(null,1),disabled:!i},c().createElement("span",{className:"glyphicon glyphicon-menu-right"})))),null!=this.props.gallery.content&&this.props.gallery.content.length>1&&c().createElement("div",{className:"thumbs"},c().createElement("div",{className:"clearfix"},this.showThumbNav&&c().createElement("button",{className:"nav",onClick:this.onChangeThumb.bind(null,-1),disabled:!s},c().createElement("span",{className:"glyphicon glyphicon-menu-left"})),r,this.showThumbNav&&c().createElement("button",{className:"nav",onClick:this.onChangeThumb.bind(null,1),disabled:!l},c().createElement("span",{className:"glyphicon glyphicon-menu-right"})))));return!0===this.state.showOverlay?c().createElement(B,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!0,onClose:this.onOverlayClose,contentStyle:{width:"100%"}},h):h}}])&&bm(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Om.propTypes={gallery:p().object,aspectMultiplier:p().number,thumbWidth:p().number,navWidth:p().number},Om.defaultProps={aspectMultiplier:1,thumbWidth:160,navWidth:30};const _m=Om,km=function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return e[n];return null},Cm=function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return n;return null},Pm=function(e,t){if(null!=e&&0!=e.length)for(var n=0;n<e.length;n++)e[n].id==t&&e.splice(n,1)},jm=function(e){return{id:e.id,tagData:e.tagData,categoryData:e.categoryData,productData:e.productData}};var Tm=o(2066),xm=o.n(Tm);function Rm(e){return Rm="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},Rm(e)}function Dm(){return Dm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dm.apply(this,arguments)}function Nm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mm(e,t){return Mm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Mm(e,t)}function Im(e,t){if(t&&("object"===Rm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Am(e)}function Am(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lm(e){return Lm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Lm(e)}var Bm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mm(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Lm(r);if(o){var n=Lm(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Im(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onShowCrop=t.onShowCrop.bind(Am(t)),t.onCancel=t.onCancel.bind(Am(t)),t.onAccept=t.onAccept.bind(Am(t)),t.onCropComplete=t.onCropComplete.bind(Am(t)),t._pixelCrop=null,t.state={showCrop:!1},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this._maxHeight=.95*$(window).height();var e=new Image;e.src=this.props.src;var t=this;e.onload=function(){t._imgWidth=this.width,t._imgHeight=this.height,t.onShowCrop()}}},{key:"onShowCrop",value:function(){this.setState({showCrop:!0})}},{key:"onCancel",value:function(){this.props.onCancel()}},{key:"onAccept",value:function(){this.props.onAccept(this._pixelCrop)}},{key:"onCropComplete",value:function(e,t){this._pixelCrop=t}},{key:"render",value:function(){var e=this,t=null;if(this._imgHeight>this._maxHeight){var n=(this._maxHeight-100)/this._imgHeight;t={style:{width:this._imgWidth*n+"px",margin:"0 auto"}}}var r=this.props.size.width/this.props.size.height,o={crop:{aspect:r},minWidth:this.props.size.width/this._imgWidth*100,minHeight:this.props.size.height/this._imgHeight*100};return r>=1?o.crop.height=100:o.crop.width=100,c().createElement("div",{className:"imagecrop-editor clearfix"},c().createElement("div",t,this.state.showCrop?c().createElement(xm(),Dm({src:this.props.src},o,{onComplete:function(t,n){return e.onCropComplete(t,n)}})):null),c().createElement("div",{className:"pull-right"},c().createElement("button",{className:"btn-default",onClick:this.onCancel},"Cancel"),c().createElement("button",{className:"btn-primary",onClick:this.onAccept},"Accept")))}}])&&Nm(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Bm.propTypes={onCancel:p().func.isRequired,onAccept:p().func.isRequired,src:p().string.isRequired,size:p().object.isRequired};const Fm=Bm;function Um(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Km(e,t){if(e){if("string"==typeof e)return Um(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Um(e,t):void 0}}function qm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||Km(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){Vm(e,t,n[t])}))}return e}function Wm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hm(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $m(e,t,n){return t&&Hm(e.prototype,t),n&&Hm(e,n),e}function Jm(e){return Jm="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},Jm(e)}function Gm(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qm(e,t){if(t&&("object"===Jm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Gm(e)}function Ym(e){return Ym=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ym(e)}function Xm(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&we(e,t)}var Zm=o(1031),ev=o.n(Zm);var tv=function(){function e(){Wm(this,e),Vm(this,"refs",{})}return $m(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(nv)}}]),e}();function nv(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function rv(e,t){return Object.keys(e).reduce((function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n}),{})}var ov={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},iv=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];return"ms"===t?"ms":t&&t.length?t[0].toUpperCase()+t.substr(1):""}();function av(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function sv(e,t){e.style["".concat(iv,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function cv(e,t){e.style["".concat(iv,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function lv(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function uv(e,t,n){return Math.max(e,Math.min(n,t))}function fv(e){return"px"===e.substr(-2)?parseFloat(e):0}function pv(e){var t=window.getComputedStyle(e);return{bottom:fv(t.marginBottom),left:fv(t.marginLeft),right:fv(t.marginRight),top:fv(t.marginTop)}}function hv(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function dv(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function yv(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function mv(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function vv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:vv(e.parentNode,t,r)}}function bv(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}function gv(e){var t=e.lockOffset,n=e.width,r=e.height,o=t,i=t,a="px";if("string"==typeof t){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);ev()(null!==s,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),o=parseFloat(t),i=parseFloat(t),a=s[1]}return ev()(isFinite(o)&&isFinite(i),"lockOffset value should be a finite. Given %s",t),"%"===a&&(o=o*n/100,i=i*r/100),{x:o,y:i}}function wv(e){var t=e.height,n=e.width,r=e.lockOffset,o=Array.isArray(r)?r:[r,r];ev()(2===o.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",r);var i=qm(o,2),a=i[0],s=i[1];return[gv({height:t,lockOffset:a,width:n}),gv({height:t,lockOffset:s,width:n})]}function Ev(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return n.test(t[e])}))}(e)?e:Ev(e.parentNode):null}function Sv(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:fv(t.gridColumnGap),y:fv(t.gridRowGap)}:{x:0,y:0}}var Ov="BUTTON",_v="INPUT",kv="OPTION",Cv="TEXTAREA",Pv="SELECT";function jv(e){var t,n="input, textarea, select, canvas, [contenteditable]",r=e.querySelectorAll(n),o=e.cloneNode(!0);return(t=o.querySelectorAll(n),function(e){if(Array.isArray(e))return Um(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Km(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(e,t){"file"!==e.type&&(e.value=r[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),"CANVAS"===e.tagName&&r[t].width>0&&r[t].height>0&&e.getContext("2d").drawImage(r[t],0,0)})),o}function Tv(e){return null!=e.sortableHandle}var xv=function(){function e(t,n){Wm(this,e),this.container=t,this.onScrollCallback=n}return $m(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,o=e.maxTranslate,i=e.width,a=e.height,s={x:0,y:0},c={x:1,y:1},l=this.container,u=l.scrollTop,f=l.scrollLeft,p=l.scrollHeight,h=l.scrollWidth,d=0===u,y=p-u-l.clientHeight==0,m=0===f,v=h-f-l.clientWidth==0;n.y>=o.y-a/2&&!y?(s.y=1,c.y=10*Math.abs((o.y-a/2-n.y)/a)):n.x>=o.x-i/2&&!v?(s.x=1,c.x=10*Math.abs((o.x-i/2-n.x)/i)):n.y<=r.y+a/2&&!d?(s.y=-1,c.y=10*Math.abs((n.y-a/2-r.y)/a)):n.x<=r.x+i/2&&!m&&(s.x=-1,c.x=10*Math.abs((n.x-i/2-r.x)/i)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===s.x&&0===s.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:c.x*s.x,top:c.y*s.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}(),Rv={axis:p().oneOf(["x","y","xy"]),contentWindow:p().any,disableAutoscroll:p().bool,distance:p().number,getContainer:p().func,getHelperDimensions:p().func,helperClass:p().string,helperContainer:p().oneOfType([p().func,"undefined"==typeof HTMLElement?p().any:p().instanceOf(HTMLElement)]),hideSortableGhost:p().bool,keyboardSortingTransitionDuration:p().number,lockAxis:p().string,lockOffset:p().oneOfType([p().number,p().string,p().arrayOf(p().oneOfType([p().number,p().string]))]),lockToContainerEdges:p().bool,onSortEnd:p().func,onSortMove:p().func,onSortOver:p().func,onSortStart:p().func,pressDelay:p().number,pressThreshold:p().number,keyCodes:p().shape({lift:p().arrayOf(p().number),drop:p().arrayOf(p().number),cancel:p().arrayOf(p().number),up:p().arrayOf(p().number),down:p().arrayOf(p().number)}),shouldCancelStart:p().func,transitionDuration:p().number,updateBeforeSortStart:p().func,useDragHandle:p().bool,useWindowAsScrollContainer:p().bool},Dv={lift:[32],drop:[32],cancel:[27],up:[38,37],down:[40,39]},Nv={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:Dv,shouldCancelStart:function(e){return-1!==[_v,Cv,Pv,kv,Ov].indexOf(e.target.tagName)||!!lv(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},Mv=Object.keys(Rv);function Iv(e){ev()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}function Av(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}var Lv,Bv=(0,s.createContext)({manager:{}}),Fv={index:p().number.isRequired,collection:p().oneOfType([p().number,p().string]),disabled:p().bool},Uv=Object.keys(Fv);function Kv(e){return Kv="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},Kv(e)}function qv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zv(e,t){return zv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},zv(e,t)}function Wv(e,t){if(t&&("object"===Kv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Hv(e)}function Hv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $v(e){return $v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$v(e)}var Jv=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zv(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$v(r);if(o){var n=$v(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Wv(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(Hv(t)),t.validate=t.validate.bind(Hv(t)),t.valid=t.valid.bind(Hv(t)),t.getContent=t.getContent.bind(Hv(t)),t.getNodes=t.getNodes.bind(Hv(t)),t.hasContent=t.hasContent.bind(Hv(t)),t.addContent=t.addContent.bind(Hv(t)),t.onEditThumbnail=t.onEditThumbnail.bind(Hv(t)),t.onAcceptCrop=t.onAcceptCrop.bind(Hv(t)),t.onCancelCrop=t.onCancelCrop.bind(Hv(t)),t.onDeleteContent=t.onDeleteContent.bind(Hv(t)),t.onSortEnd=t.onSortEnd.bind(Hv(t)),t.onUpdate=t.onUpdate.bind(Hv(t)),t.imageCropSize=null,t.thumbCropData=null,t.state={content:null!=t.props.content?t.props.content:[],showImageCropModal:!1,imageCropIndex:null,isValid:t.valid(),showValidation:!1},t}return t=a,n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/content/cover-size").done((function(t,n,r){e.imageCropSize=t}))}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getContent",value:function(){return{content:this.state.content,thumbCropData:this.thumbCropData}}},{key:"getNodes",value:function(){return this.state.content.map((function(e,t){return{id:mn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null}}))}},{key:"hasContent",value:function(){return null!=this.state&&null!=this.state.content&&this.state.content.length>0}},{key:"addContent",value:function(e){var t=this,n=mn.cloneArray(this.state.content);(null!=e||e.length>0)&&(n=this.state.content.concat(e)),this.setState({content:n},(function(){t.onUpdate()}))}},{key:"onEditThumbnail",value:function(e){var t=Cm(this.state.content,e);null!=t&&this.setState({showImageCropModal:!0,imageCropIndex:t})}},{key:"onAcceptCrop",value:function(e){var t=this.state.content[this.state.imageCropIndex].id;0==this.state.imageCropIndex?this.thumbCropData={id:t,crop:e}:this.thumbCropData=null;var n=this;$.ajax({type:"POST",url:"/api/content/".concat(t,"/cover/edit"),contentType:"application/json; charset=utf-8",data:JSON.stringify({crop:e}),dataType:"json",context:this}).done((function(e,t,r){var o=n.state.content;o[n.state.imageCropIndex].thumbUrl=e,n.setState({content:o,showImageCropModal:!1,imageCropIndex:null})})).fail((function(e,t,r){alerts.error(e.responseJSON.errorMessage),n.setState({showImageCropModal:!1,imageCropIndex:null})}))}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1,imageCropIndex:null})}},{key:"onDeleteContent",value:function(e){var t=this,n=mn.cloneArray(this.state.content);Pm(n,e),this.setState({content:n},(function(){t.onUpdate()}))}},{key:"onSortEnd",value:function(e){var t,n,r,o=this,i=this.state.content;this.setState({content:(t=i,n=e.oldIndex,r=e.newIndex,(t=t.slice()).splice(r<0?t.length+r:r,0,t.splice(n,1)[0]),t)},(function(){o.onUpdate()}))}},{key:"onUpdate",value:function(){this.props.onUpdate&&this.props.onUpdate(this.state.content)}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t="";!0===this.props.required&&(t+=" required");var n=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(n=c().createElement(gi,{message:this.props.helpMessage})):n=c().createElement(gi,{message:this.props.requiredErrorMessage}),c().createElement("div",{className:e},this.props.label&&c().createElement("label",{className:t},this.props.label),c().createElement("div",{className:"tfpanel"},c().createElement(Gv,{content:this.state.content,staticContent:this.staticContent,onSortEnd:this.onSortEnd,useDragHandle:!0,axis:"xy",onEditThumbnail:this.onEditThumbnail,onDelete:this.onDeleteContent})),n,c().createElement(Dd,{groupsAllowed:["Portfolio"],closeAfterAutoAcceptContent:!1,autoAcceptContent:!0,onAccept:this.addContent,showCancel:!1},c().createElement("h4",null,c().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),c().createElement("br",null),"Drag and drop one or more files or click in this area to upload")),!0!==this.state.showValidation||this.state.isValid?null:c().createElement(gi,{message:"At least one content item (image/video) is required"}),this.props.children,this.state.showImageCropModal&&c().createElement(B,null,c().createElement(Fm,{src:this.state.content[this.state.imageCropIndex].coverUrl,size:this.imageCropSize,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}],n&&Vv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Jv.propTypes=(qv(Lv={label:p().string,placeholder:p().string,helpMessage:p().string,content:p().array,required:p().bool,requiredErrorMessage:p().string,fileSizeLimit:p().number},"required",p().bool),qv(Lv,"requiredErrorMessage",p().string),Lv),Jv.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};var Gv=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;Wm(this,n),Vm(Gm(Gm(t=Qm(this,Ym(n).call(this,e)))),"state",{}),Vm(Gm(Gm(t)),"handleStart",(function(e){var n=t.props,r=n.distance,o=n.shouldCancelStart;if(2!==e.button&&!o(e)){t.touched=!0,t.position=yv(e);var i=lv(e.target,(function(e){return null!=e.sortableInfo}));if(i&&i.sortableInfo&&t.nodeIsChild(i)&&!t.state.sorting){var a=t.props.useDragHandle,s=i.sortableInfo,c=s.index,l=s.collection;if(s.disabled)return;if(a&&!lv(e.target,Tv))return;t.manager.active={collection:l,index:c},mv(e)||"A"!==e.target.tagName||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),Vm(Gm(Gm(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),Vm(Gm(Gm(t)),"handleMove",(function(e){var n=t.props,r=n.distance,o=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var i=yv(e),a={x:t.position.x-i.x,y:t.position.y-i.y},s=Math.abs(a.x)+Math.abs(a.y);t.delta=a,r||o&&!(s>=o)?r&&s>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),Vm(Gm(Gm(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),Vm(Gm(Gm(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),Vm(Gm(Gm(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n=p.sortableInfo.index,r=pv(p),o=Sv(t.container),l=t.scrollContainer.getBoundingClientRect(),y=a({index:n,node:p,collection:h});if(t.node=p,t.margin=r,t.gridGap=o,t.width=y.width,t.height=y.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=l,t.index=n,t.newIndex=n,t.axis={x:i.indexOf("x")>=0,y:i.indexOf("y")>=0},t.offsetEdge=vv(p,t.container),t.initialOffset=yv(d?zm({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(jv(p)),av(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-r.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-r.top,"px"),width:"".concat(t.width,"px")}),d&&t.helper.focus(),c&&(t.sortableGhost=p,av(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},d){var m=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,v=m.top,b=m.left,g=m.width,w=v+m.height,E=b+g;t.axis.x&&(t.minTranslate.x=b-t.boundingClientRect.left,t.maxTranslate.x=E-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=v-t.boundingClientRect.top,t.maxTranslate.y=w-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:l.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:l.left+l.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:l.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:l.top+l.height)-t.boundingClientRect.top-t.height/2);s&&s.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?e.target:t.contentWindow,d?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(ov.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),ov.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:n}),u&&u({node:p,index:n,collection:h,isKeySorting:d,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),d&&t.keyMove(0)},o=t.props,i=o.axis,a=o.getHelperDimensions,s=o.helperClass,c=o.hideSortableGhost,l=o.updateBeforeSortStart,u=o.onSortStart,f=o.useWindowAsScrollContainer,p=n.node,h=n.collection,d=t.manager.isKeySorting,y=function(){if("function"==typeof l){t._awaitingUpdateBeforeSortStart=!0;var n=Av((function(){var t=p.sortableInfo.index;return Promise.resolve(l({collection:h,index:t,node:p,isKeySorting:d},e)).then((function(){}))}),(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return y&&y.then?y.then(r):r()}}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),Vm(Gm(Gm(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.cancelable&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),Vm(Gm(Gm(t)),"handleSortEnd",(function(e){var n=t.props,r=n.hideSortableGhost,o=n.onSortEnd,i=t.manager,a=i.active.collection,s=i.isKeySorting,c=t.manager.getOrderedRefs();t.listenerNode&&(s?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(ov.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),ov.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&av(t.sortableGhost,{opacity:"",visibility:""});for(var l=0,u=c.length;l<u;l++){var f=c[l],p=f.node;f.edgeOffset=null,f.boundingClientRect=null,sv(p,null),cv(p,null),f.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof o&&o({collection:a,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:s,nodes:c},e),t.touched=!1})),Vm(Gm(Gm(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var r=zm({},t.translate),o=0,i=0;return t.axis.x&&(r.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),o=t.translate.x-r.x),t.axis.y&&(r.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),i=t.translate.y-r.y),t.translate=r,sv(t.helper,t.translate),t.scrollContainer.scrollLeft+=o,void(t.scrollContainer.scrollTop+=i)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),Vm(Gm(Gm(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),Vm(Gm(Gm(t)),"handleKeyDown",(function(e){var n=e.keyCode,r=t.props,o=r.shouldCancelStart,i=r.keyCodes,a=zm({},Dv,void 0===i?{}:i);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||a.lift.includes(n)&&!o(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),a.lift.includes(n)&&!t.manager.active?t.keyLift(e):a.drop.includes(n)&&t.manager.active?t.keyDrop(e):a.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):a.up.includes(n)?t.keyMove(-1):a.down.includes(n)&&t.keyMove(1))})),Vm(Gm(Gm(t)),"keyLift",(function(e){var n=e.target,r=lv(n,(function(e){return null!=e.sortableInfo})).sortableInfo,o=r.index,i=r.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:o,collection:i},t.handlePress(e)})),Vm(Gm(Gm(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),r=n[n.length-1].node.sortableInfo.index,o=t.newIndex+e,i=t.newIndex;if(!(o<0||o>r)){t.prevIndex=i,t.newIndex=o;var a=bv(t.newIndex,t.prevIndex,t.index),s=n.find((function(e){return e.node.sortableInfo.index===a})),c=s.node,l=t.containerScrollDelta,u=s.boundingClientRect||dv(c,l),f=s.translate||{x:0,y:0},p=u.top+f.y-l.top,h=u.left+f.x-l.left,d=i<o,y=d&&t.axis.x?c.offsetWidth-t.width:0,m=d&&t.axis.y?c.offsetHeight-t.height:0;t.handleSortMove({pageX:h+y,pageY:p+m,ignoreTransition:0===e})}})),Vm(Gm(Gm(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),Vm(Gm(Gm(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),Vm(Gm(Gm(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,r=e.target,o=lv(r,(function(e){return null!=e.sortableInfo}));return o&&o.sortableInfo&&!o.sortableInfo.disabled&&(n?Tv(r):r.sortableInfo)}));var r=new tv;return Iv(e),t.manager=r,t.wrappedInstance=(0,s.createRef)(),t.sortableContextValue={manager:r},t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return Xm(n,t),$m(n,[{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then((function(n){e.container=n,e.document=e.container.ownerDocument||document;var r=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof r?r():r,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:Ev(e.container)||e.container,e.autoScroller=new xv(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return ov[t].forEach((function(n){return e.container.addEventListener(n,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return ov[t].forEach((function(n){return e.container.removeEventListener(n,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,r=t.lockOffset,o=t.lockToContainerEdges,i=t.transitionDuration,a=t.keyboardSortingTransitionDuration,s=void 0===a?i:a,c=this.manager.isKeySorting,l=e.ignoreTransition,u=yv(e),f={x:u.x-this.initialOffset.x,y:u.y-this.initialOffset.y};if(f.y-=window.pageYOffset-this.initialWindowScroll.top,f.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=f,o){var p=qm(wv({height:this.height,lockOffset:r,width:this.width}),2),h=p[0],d=p[1],y={x:this.width/2-h.x,y:this.height/2-h.y},m={x:this.width/2-d.x,y:this.height/2-d.y};f.x=uv(this.minTranslate.x+y.x,this.maxTranslate.x-m.x,f.x),f.y=uv(this.minTranslate.y+y.y,this.maxTranslate.y-m.y,f.y)}"x"===n?f.y=0:"y"===n&&(f.x=0),c&&s&&!l&&cv(this.helper,s),sv(this.helper,f)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,r=e.onSortOver,o=this.containerScrollDelta,i=this.windowScrollDelta,a=this.manager.getOrderedRefs(),s=this.offsetEdge.left+this.translate.x+o.left,c=this.offsetEdge.top+this.translate.y+o.top,l=this.manager.isKeySorting,u=this.newIndex;this.newIndex=null;for(var f=0,p=a.length;f<p;f++){var h=a[f].node,d=h.sortableInfo.index,y=h.offsetWidth,m=h.offsetHeight,v={height:this.height>m?m/2:this.height/2,width:this.width>y?y/2:this.width/2},b=l&&d>this.index&&d<=u,g=l&&d<this.index&&d>=u,w={x:0,y:0},E=a[f].edgeOffset;E||(E=vv(h,this.container),a[f].edgeOffset=E,l&&(a[f].boundingClientRect=dv(h,o)));var S=f<a.length-1&&a[f+1],O=f>0&&a[f-1];S&&!S.edgeOffset&&(S.edgeOffset=vv(S.node,this.container),l&&(S.boundingClientRect=dv(S.node,o))),d!==this.index?(t&&cv(h,t),this.axis.x?this.axis.y?g||d<this.index&&(s+i.left-v.width<=E.left&&c+i.top<=E.top+v.height||c+i.top+v.height<=E.top)?(w.x=this.width+this.marginOffset.x,E.left+w.x>this.containerBoundingRect.width-v.width&&S&&(w.x=S.edgeOffset.left-E.left,w.y=S.edgeOffset.top-E.top),null===this.newIndex&&(this.newIndex=d)):(b||d>this.index&&(s+i.left+v.width>=E.left&&c+i.top+v.height>=E.top||c+i.top+v.height>=E.top+m))&&(w.x=-(this.width+this.marginOffset.x),E.left+w.x<this.containerBoundingRect.left+v.width&&O&&(w.x=O.edgeOffset.left-E.left,w.y=O.edgeOffset.top-E.top),this.newIndex=d):b||d>this.index&&s+i.left+v.width>=E.left?(w.x=-(this.width+this.marginOffset.x),this.newIndex=d):(g||d<this.index&&s+i.left<=E.left+v.width)&&(w.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=d)):this.axis.y&&(b||d>this.index&&c+i.top+v.height>=E.top?(w.y=-(this.height+this.marginOffset.y),this.newIndex=d):(g||d<this.index&&c+i.top<=E.top+v.height)&&(w.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=d))),sv(h,w),a[f].translate=w):n&&(this.sortableGhost=h,av(h,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),l&&(this.newIndex=u);var _=l?this.prevIndex:u;r&&this.newIndex!==_&&r({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:_,isKeySorting:l,nodes:a,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return ev()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.wrappedInstance.current}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?(0,h.findDOMNode)(this):e(r.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,s.createElement)(Bv.Provider,{value:this.sortableContextValue},(0,s.createElement)(e,Se({ref:t},rv(this.props,Mv))))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(s.Component),Vm(t,"displayName",hv("sortableList",e)),Vm(t,"defaultProps",Nv),Vm(t,"propTypes",Rv),n}((function(e){var t=e.content,n=e.onEditThumbnail,r=e.onDelete,o=null!=t&&t.length>1,i=t.map((function(e,t){return c().createElement(Yv,{key:e.id,index:t,contentItem:e,onEditThumbnail:n,onDelete:r},o&&c().createElement(Qv,null))}));return c().createElement("ul",{className:"gallery-editor-content"},i)})),Qv=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;Wm(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return Vm(Gm(Gm(t=Qm(this,(e=Ym(n)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,s.createRef)()),t}return Xm(n,t),$m(n,[{key:"componentDidMount",value:function(){(0,h.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return ev()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,s.createElement)(e,Se({ref:t},this.props))}}]),n}(s.Component),Vm(t,"displayName",hv("sortableHandle",e)),n}((function(){return c().createElement("span",{className:"handle no-select"},"::")})),Yv=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){var e,t;Wm(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return Vm(Gm(Gm(t=Qm(this,(e=Ym(n)).call.apply(e,[this].concat(o))))),"wrappedInstance",(0,s.createRef)()),t}return Xm(n,t),$m(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,o=(0,h.findDOMNode)(this);o.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=o,this.ref={node:o},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return ev()(r.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.wrappedInstance.current}},{key:"render",value:function(){var t=r.withRef?this.wrappedInstance:null;return(0,s.createElement)(e,Se({ref:t},rv(this.props,Uv)))}}]),n}(s.Component),Vm(t,"displayName",hv("sortableElement",e)),Vm(t,"contextType",Bv),Vm(t,"propTypes",Fv),Vm(t,"defaultProps",{collection:0}),n}((function(e){var t=e.children,n=e.contentItem,r=e.onEditThumbnail,o=e.onDelete,i=[];return i.push(c().createElement("a",{onClick:r.bind(null,n.id)},"Edit Thumbnail")),i.push(c().createElement("a",{onClick:o.bind(null,n.id)},"Delete")),c().createElement("li",{className:"gallery-editor-content-item"},c().createElement("img",{className:"no-drag",src:n.thumbUrl}),c().createElement("div",{className:"edit"},t,!n.hasOwnProperty("isStatic")&&c().createElement(bo,{wrapperTag:"span",actionTag:"anchor",actionLabel:c().createElement("span",{className:"glyphicon glyphicon-pencil"}),dropdownClassName:"right-align",options:i})))}));const Xv=Jv;function Zv(e){return Zv="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},Zv(e)}function eb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function tb(e,t){return tb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},tb(e,t)}function nb(e,t){if(t&&("object"===Zv(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return rb(e)}function rb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ob(e){return ob=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ob(e)}var ib=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ob(r);if(o){var n=ob(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return nb(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleEditClick=t.handleEditClick.bind(rb(t)),t.handleEditCancel=t.handleEditCancel.bind(rb(t)),t.handleEditSaveChanges=t.handleEditSaveChanges.bind(rb(t)),t.state={mode:"view"},t}return t=a,(n=[{key:"handleEditClick",value:function(){this.setState({mode:"edit"})}},{key:"handleEditCancel",value:function(){this.setState({mode:"view"})}},{key:"handleEditSaveChanges",value:function(){var e={headerContentList:null,thumbCropData:null};if(!this.refs.header.validate())return!1;var t=this.refs.header.getContent();null!=t&&(t.content.length>0&&(e.headerContentList=t.content.map((function(e,t){return e.id}))),e.thumbCropData=t.thumbCropData),$.ajax({type:"POST",url:"/api/discuss/topic/".concat(this.props.topic.topicID,"/header"),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({mode:"view"},(function(){this.props.onUpdate(e.header)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage),this.setState({submitDisabled:!1})}))}},{key:"render",value:function(){return"view"==this.state.mode?c().createElement("div",{className:"forum-project-gallery"},c().createElement(_m,{gallery:this.props.topic.header,aspectMultiplier:.5625,dataUrl:"/api/discuss/topic/".concat(this.props.topic.topicID,"/header/{0}")},this.props.topic.viewer.canEdit&&c().createElement("div",{className:"edit"},c().createElement("button",{className:"icon icon-after icon-edit",onClick:this.handleEditClick},"Edit Gallery")))):c().createElement("div",{className:"container subsection gallery-editor"},c().createElement("label",null,"Gallery Content"),c().createElement("p",null,"Add images and videos to your gallery.  The first item will be used for the cover image."),c().createElement(Xv,{ref:"header",content:this.props.topic.header.content,required:!0},c().createElement("div",{style:{textAlign:"right"}},c().createElement("button",{onClick:this.handleEditCancel},"Cancel"),c().createElement("button",{onClick:this.handleEditSaveChanges},"Save Changes"))))}}])&&eb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);ib.propTypes={onUpdate:p().func};const ab=ib;function sb(e){return sb="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},sb(e)}function cb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lb(e,t){return lb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},lb(e,t)}function ub(e,t){if(t&&("object"===sb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fb(e)}function fb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pb(e){return pb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},pb(e)}const hb=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=pb(r);if(o){var n=pb(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ub(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(fb(t)),t.addQuerystring=t.addQuerystring.bind(fb(t)),t.getData=t.getData.bind(fb(t)),t.handleNewPage=t.handleNewPage.bind(fb(t)),t.handleHeaderGalleryUpdate=t.handleHeaderGalleryUpdate.bind(fb(t)),t.parsedQS=dn.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.mode=t.parsedQS.mode?t.parsedQS.mode:null,t.postID=t.parsedQS.postID?t.parsedQS.postID:null,t.show=t.parsedQS.show?t.parsedQS.show:null,t.ajaxError=null,t.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,posts:null,viewer:null,nav:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&(this.parsedQS=dn.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.mode=this.parsedQS.mode?this.parsedQS.mode:null,this.postID=this.parsedQS.postID?this.parsedQS.postID:null,this.show=this.parsedQS.show?this.parsedQS.show:null,this.getData())}},{key:"componentDidUpdate",value:function(){}},{key:"buildUrl",value:function(){var e="/api/discuss/topic/"+this.props.match.params.id;return this.addQuerystring(e,this.mode,this.postID,this.page,this.show)}},{key:"addQuerystring",value:function(e,t,n,r,o){var i=[];return null!==t&&i.push("mode="+t),null!=n&&i.push("postID="+n),null!=o&&i.push("show="+o),r>0&&i.push("page="+r),i.length>0&&(e+="?"+i.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,posts:t.posts,viewer:t.viewer,nav:t.nav},(function(){mn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.push(t.responseJSON.redirectUrl):(e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname;t=this.addQuerystring(t,null,null,e,this.show),this.props.history.push(t)}},{key:"handleHeaderGalleryUpdate",value:function(e){var t=JSON.parse(JSON.stringify(this.state.topic));t.header=e,this.setState({topic:t})}},{key:"render",value:function(){return this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics?c().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&c().createElement(On,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&c().createElement(wc,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}})):c().createElement("div",null,c().createElement(hn,{title:this.state.topic.text,meta:[{property:"og:url",content:"".concat(location.origin).concat(this.state.topic.url)},{property:"og:type",content:"article"},{property:"og:title",content:this.state.topic.text}]}),c().createElement(tu,{topic:this.state.topic,forumPath:this.state.forum.path},this.state.posts&&this.state.topic.viewer.e&&c().createElement(Ou,{topic:this.state.topic})),this.state.topic.header&&null!=this.state.topic.header&&c().createElement(ab,{topic:this.state.topic,onUpdate:this.handleHeaderGalleryUpdate}),c().createElement(Sy,{mode:"display",topic:this.state.topic,posts:this.state.posts,viewer:this.state.viewer,onPageChanged:this.handleNewPage}))}}])&&cb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function db(e){return db="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},db(e)}function yb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mb(e,t){return mb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mb(e,t)}function vb(e,t){if(t&&("object"===db(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bb(e)}function bb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gb(e){return gb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},gb(e)}const wb=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=gb(r);if(o){var n=gb(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return vb(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(bb(t)),t.addQuerystring=t.addQuerystring.bind(bb(t)),t.getData=t.getData.bind(bb(t)),t.parsedQS=dn.parse(e.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.mode=t.parsedQS.mode?t.parsedQS.mode:null,t.postID=t.parsedQS.postID?t.parsedQS.postID:null,t.show=t.parsedQS.show?t.parsedQS.show:null,t.ajaxError=null,t.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,posts:null,viewer:null,nav:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&(this.parsedQS=dn.parse(e.location.search),this.page=this.parsedQS.page?this.parsedQS.page:0,this.mode=this.parsedQS.mode?this.parsedQS.mode:null,this.postID=this.parsedQS.postID?this.parsedQS.postID:null,this.show=this.parsedQS.show?this.parsedQS.show:null,this.getData())}},{key:"buildUrl",value:function(){var e="/api/discuss/link/"+this.props.match.params.id;return this.addQuerystring(e,this.mode,this.postID,this.page,this.show)}},{key:"addQuerystring",value:function(e,t,n,r,o){var i=[];return null!==t&&i.push("mode="+t),null!=n&&i.push("postID="+n),null!=o&&i.push("show="+o),r>0&&i.push("page="+r),i.length>0&&(e+="?"+i.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,posts:t.posts,viewer:t.viewer,nav:t.nav},(function(){mn.updateScrollPosition(!0)}))})).fail((function(t,n,r){303==t.status?e.props.history.replace(t.responseJSON.redirectUrl):(e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics?c().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&c().createElement(On,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&c().createElement(wc,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}})):null}}])&&yb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function Eb(e){return Eb="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},Eb(e)}function Sb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ob(e,t){return Ob=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ob(e,t)}function _b(e,t){if(t&&("object"===Eb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return kb(e)}function kb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cb(e){return Cb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Cb(e)}const Pb=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ob(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Cb(r);if(o){var n=Cb(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _b(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).buildUrl=t.buildUrl.bind(kb(t)),t.addQuerystring=t.addQuerystring.bind(kb(t)),t.getData=t.getData.bind(kb(t)),t.ajaxError=null,t.state={loadStatus:TFWeb.Enums.LoadStatus.Loading,forum:null,topic:null,post:null,viewer:null,nav:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content forum"),this.getData()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.getData()}},{key:"buildUrl",value:function(){var e="/api/discuss/post/"+this.props.match.params.id;return this.addQuerystring(e)}},{key:"addQuerystring",value:function(e){var t=[];return t.length>0&&(e+="?"+t.join("&")),e}},{key:"getData",value:function(){var e=this,t=this.buildUrl();$.getJSON(t).done((function(t,n,r){e.setState({loadStatus:TFWeb.Enums.LoadStatus.Loaded,forum:t.forum,topic:t.topic,post:t.post,viewer:t.viewer,nav:t.nav})})).fail((function(t,n,r){e.ajaxError=t,e.setState({loadStatus:TFWeb.Enums.LoadStatus.Error})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading||this.state.loadStatus==TFWeb.Enums.LoadStatus.Error||null===this.state.forum||null===this.state.topics||null===this.state.posts?c().createElement("div",{className:"no-banner"},this.state.loadStatus==TFWeb.Enums.LoadStatus.Loading&&c().createElement(On,null),this.state.loadStatus==TFWeb.Enums.LoadStatus.Error&&c().createElement(wc,{xhr:this.ajaxError,returnUrl:{text:"Return To The Main Forum",url:"/discuss"}})):c().createElement("div",null,c().createElement(hn,{title:this.state.topic.text}),c().createElement(tu,{viewMode:"PostView",topic:this.state.topic,post:this.state.post,forumPath:this.state.forum.path}),c().createElement("div",{className:"subsection comment"},c().createElement("div",{className:"comment-container"},c().createElement(Qf,{post:this.state.post,topic:this.state.topic,viewer:this.state.viewer,displayMode:"single"}))))}}])&&Sb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function jb(e){return jb="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},jb(e)}function Tb(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rb(e,t,n){return t&&xb(e.prototype,t),n&&xb(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Db(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nb(e,t)}function Nb(e,t){return Nb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Nb(e,t)}function Mb(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Lb(e);if(t){var o=Lb(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Ib(this,n)}}function Ib(e,t){if(t&&("object"===jb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ab(e)}function Ab(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lb(e){return Lb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Lb(e)}var Bb=function(e){Db(n,e);var t=Mb(n);function n(e){var r;Tb(this,n),(r=t.call(this,e)).setup=r.setup.bind(Ab(r)),r.handleCancel=r.handleCancel.bind(Ab(r)),r.handleSubmit=r.handleSubmit.bind(Ab(r)),r.handleDelayEnd=r.handleDelayEnd.bind(Ab(r)),r.handleTopicChange=r.handleTopicChange.bind(Ab(r)),r.handlePostChange=r.handlePostChange.bind(Ab(r)),r.handleContentChange=r.handleContentChange.bind(Ab(r)),r.handleSubscribeChange=r.handleSubscribeChange.bind(Ab(r)),r.handleTopicLinkChange=r.handleTopicLinkChange.bind(Ab(r)),r.parsedQS=dn.parse(e.location.search),r.viewer=null,r.forum=null;var o=r.props.location.pathname.split("/");return r.state={enabled:!1,type:o[2],mode:o[3],itemID:r.parsedQS.id,form:null,postValue:r.props.value?r.props.value:"",submitDisabled:!1,delay:!1,delayTimeSpan:null},r}return Rb(n,[{key:"componentDidMount",value:function(){$("body").attr("class","hero-regular light"),this.setup()}},{key:"setup",value:function(){var e="/api/discuss/topic/new?id="+this.state.itemID,t=this;$.getJSON(e).done((function(e,n,r){t.viewer=e.data.viewer,t.forum=e.data.forum,t.setState({enabled:!0,form:e.data.form,postValue:e.data.form.post})})).fail((function(e,n,r){alerts.error(e.responseJSON.errorMessage),t.props.history.goBack()}))}},{key:"handleCancel",value:function(){this.props.history.goBack()}},{key:"handleSubmit",value:function(){var e=!0;"topic"==this.state.type&&(e=this.refs.topic.validate());var t=!0;"Gallery"===this.state.form.type&&(t=this.refs.header.validate());var n=this.refs.post.validate();e&&t&&n&&this.setState({submitDisabled:!0},(function(){var e=this.state.form;if("Gallery"===this.state.form.type){var t=this.refs.header.getContent();null!=t&&(t.content.length>0&&(e.headerContentList=t.content.map((function(e,t){return e.id}))),e.thumbCropData=t.thumbCropData)}null!=e.postContent&&e.postContent.length>0&&(e.postContentList=e.postContent.map((function(e,t){return e.id}))),$.ajax({type:"POST",url:"/api/discuss/topic/new?id="+this.state.itemID,contentType:"application/json; charset=utf-8",data:JSON.stringify({form:e}),dataType:"json",context:this}).done((function(e,t,n){switch(e.data.result){case"Success":this.props.history.push(e.data.url);break;case"Delay":this.setState({delay:!0,delayTimeSpan:e.data.timeSpan})}})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage),this.setState({submitDisabled:!1})}))}))}},{key:"handleDelayEnd",value:function(){this.setState({submitDisabled:!1,delay:!1,delayTimeSpan:null})}},{key:"handleTopicChange",value:function(e){var t=this.state.form;t.title=e,this.setState({form:t})}},{key:"handlePostChange",value:function(e){var t=this.state.form;t.post=e.post,t.simpleMarkupFL=e.simpleMarkupFL,this.setState({form:t})}},{key:"handleContentChange",value:function(e){var t=this.state.form;t.postContent=e,this.setState({form:t})}},{key:"handleSubscribeChange",value:function(e){var t=this.state.form;t.autoSubscribeFL=e.target.checked,this.setState({form:t})}},{key:"handleTopicLinkChange",value:function(e){var t=this.state.form;t.topicLinkFL=e.target.checked,this.setState({form:t})}},{key:"render",value:function(){return null==this.state.form?null:c().createElement("div",null,c().createElement("section",{id:"heroBanner",className:"default"},c().createElement("div",{className:"hero-content"},c().createElement("h2",null,"Start a new discussion in ",this.forum.name))),c().createElement("div",{className:"container subsection"},c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement(Fb,{ref:"topic",value:this.state.form.topic,onChange:this.handleTopicChange,enabled:this.state.enabled},c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"subscribeFL",name:"subscribeFL",ref:"autoSubscribeFL",checked:this.state.form.autoSubscribeFL,onChange:this.handleSubscribeChange}),c().createElement("label",{htmlFor:"subscribeFL"},"Watch topic +")),this.viewer.e&&this.forum.allowTopicLink&&c().createElement("div",{className:"form-group"},c().createElement("input",{type:"checkbox",id:"linkFL",name:"linkFL",ref:"topicTopicFL",onChange:this.handleTopicLinkChange}),c().createElement("label",{htmlFor:"linkFL"},"Create Topic Link in News & Announcements"))),"Gallery"===this.state.form.type&&c().createElement("div",{className:"gallery-editor"},c().createElement("label",null,"Gallery Content"),c().createElement("p",null,"Add images and videos to your gallery.  The first item will be used for the cover image."),c().createElement(Xv,{ref:"header",content:this.state.form.headerContent,required:!0})),c().createElement("div",{className:"post-editor"},c().createElement(qo,{profile:this.viewer.profile,showLink:!1,showAvatar:!0,colorClassName:"dark"}),c().createElement(Jd,{ref:"post",type:"Discussion",value:null!=this.state.form.post?this.state.form.post:"",content:this.state.form.postContent,onChange:this.handlePostChange,onContentChange:this.handleContentChange,enabled:this.state.enabled},c().createElement("span",{className:"button-group"},c().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel"),c().createElement("button",{type:"button",className:"btn-primary",name:"submit",disabled:this.state.submitDisabled,onClick:this.handleSubmit},"Submit"))),this.state.delay&&c().createElement(ty,{secondsRemaining:this.state.delayTimeSpan,message:"We're sorry, You have to wait {time} before posting.",onCountdownFinished:this.handleDelayEnd}))))))}}]),n}(c().Component),Fb=function(e){Db(n,e);var t=Mb(n);function n(e){var r;return Tb(this,n),(r=t.call(this,e)).validate=r.validate.bind(Ab(r)),r.valid=r.valid.bind(Ab(r)),r.getValue=r.getValue.bind(Ab(r)),r.handleTopicChange=r.handleTopicChange.bind(Ab(r)),r.handleFocus=r.handleFocus.bind(Ab(r)),r.handleBlur=r.handleBlur.bind(Ab(r)),r.state={isValid:!1,showValidation:!1},r}return Rb(n,[{key:"componentDidMount",value:function(){this.handleTopicChange()}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return this.getValue().length>=3}},{key:"getValue",value:function(){return this.refs.title.value}},{key:"handleTopicChange",value:function(){!0===this.state.showValidation&&this.setState({isValid:this.valid()}),this.props.onChange&&this.props.onChange(this.refs.title.value)}},{key:"handleFocus",value:function(){}},{key:"handleBlur",value:function(){}},{key:"render",value:function(){var e="form-group".concat(!0!==this.state.showValidation||this.state.isValid?"":" has-error"),t=null;return!0!==this.state.showValidation||this.state.isValid||(t=c().createElement(gi,{message:"topic required and must be 3 or more characters in length"})),c().createElement("div",{className:e},c().createElement("label",{className:"static"},"Discussion Title"),c().createElement("input",{type:"text",name:"title",ref:"title",defaultValue:this.props.value,placeholder:"Enter a discussion title",maxLength:"255",onChange:this.handleTopicChange,onFocus:this.handleFocus,onBlur:this.handleBlur,disabled:!this.props.enabled,tabIndex:"1",autoFocus:!0}),t,this.props.children)}}]),n}(c().Component);const Ub=nt(Bb);function Kb(e){return Kb="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},Kb(e)}function qb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vb(e,t){return Vb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vb(e,t)}function zb(e,t){if(t&&("object"===Kb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wb(e)}function Wb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hb(e){return Hb=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Hb(e)}var $b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hb(r);if(o){var n=Hb(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return zb(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(Wb(t)),t.valid=t.valid.bind(Wb(t)),t.getValue=t.getValue.bind(Wb(t)),t.setValue=t.setValue.bind(Wb(t)),t.onChange=t.onChange.bind(Wb(t)),t.handleFocus=t.handleFocus.bind(Wb(t)),t.handleBlur=t.handleBlur.bind(Wb(t)),t.state={value:null!=t.props.value?t.props.value:"",validate:!1,isValid:!0,showValidation:!1},t}return t=a,(n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?t=c().createElement(gi,{message:this.props.helpMessage}):e+=" no-help":t=c().createElement(gi,{message:this.props.requiredErrorMessage}),c().createElement("div",{className:e},c().createElement("label",{className:"dynamic",htmlFor:this.props.name},this.props.label),c().createElement("input",{name:this.props.name,type:"text",value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),t,this.props.children)}}])&&qb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);$b.propTypes={name:p().string,label:p().string,placeholder:p().string,helpMessage:p().string,required:p().bool,requiredErrorMessage:p().string,onChange:p().func},$b.defaultProps={required:!1,requiredErrorMessage:"input required."};const Jb=$b;function Gb(e){return Gb="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},Gb(e)}function Qb(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yb(e,t){return Yb=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Yb(e,t)}function Xb(e,t){if(t&&("object"===Gb(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zb(e)}function Zb(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eg(e){return eg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},eg(e)}var tg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yb(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=eg(r);if(o){var n=eg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Xb(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getValue=t.getValue.bind(Zb(t)),t.setValue=t.setValue.bind(Zb(t)),t.setDisabled=t.setDisabled.bind(Zb(t)),t.onChange=t.onChange.bind(Zb(t)),t.state={value:!!t.props.value&&t.props.value,disabled:!!t.props.disabled&&t.props.disabled},t}return t=a,(n=[{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==e&&(t=!1),this.setState({value:t})}},{key:"setDisabled",value:function(e){this.setState({disabled:e})}},{key:"onChange",value:function(e){var t=this,n=e.target.checked;this.setState({value:n},(function(){t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){return c().createElement("div",{className:"form-group no-help"},c().createElement("input",{ref:"checkbox",type:"checkbox",id:this.props.name,name:this.props.name,checked:this.state.value,disabled:this.state.disabled,onChange:this.onChange}),c().createElement("label",{htmlFor:this.props.name},this.props.label))}}])&&Qb(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);tg.propTypes={name:p().string.isRequired,label:p().string.isRequired,value:p().bool,disabled:p().bool,onChange:p().func};const ng=tg;function rg(e){return rg="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},rg(e)}function og(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ig(e,t){return ig=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ig(e,t)}function ag(e,t){if(t&&("object"===rg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sg(e)}function sg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cg(e){return cg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},cg(e)}var lg=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ig(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=cg(r);if(o){var n=cg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ag(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setValue=t.setValue.bind(sg(t)),t.getValue=t.getValue.bind(sg(t)),t.setDisabled=t.setDisabled.bind(sg(t)),t.onChange=t.onChange.bind(sg(t)),t.state={value:!!t.props.value&&t.props.value,disabled:!!t.props.disabled&&t.props.disabled},t}return t=a,(n=[{key:"setValue",value:function(e){this.setState({value:e})}},{key:"getValue",value:function(){return this.state.value}},{key:"setDisabled",value:function(e){this.setState({disabled:e})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){t.props.onChange&&t.props.onChange(n)}))}},{key:"render",value:function(){var e=this,t=this.props.options.map((function(t,n){return c().createElement("label",{key:t.value,className:"clearfix multi-select"},c().createElement("input",{name:e.props.name,checked:e.state.value==t.value,value:t.value,disabled:e.state.disabled,onChange:e.onChange,type:"radio"}),c().createElement("span",{className:"radio-multi-label"},t.text))})),n=this.props.label?c().createElement("label",{className:"static"},this.props.label):null;return c().createElement("div",{className:"form-group"},n,c().createElement("div",{className:"multi-radio-container"},t))}}])&&og(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);lg.propTypes={name:p().string.isRequired,label:p().string,options:p().array.isRequired,value:p().string,disabled:p().bool,onChange:p().func};const ug=lg;function fg(e){return fg="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},fg(e)}function pg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dg(e,t,n){return t&&hg(e.prototype,t),n&&hg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yg(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mg(e,t)}function mg(e,t){return mg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mg(e,t)}function vg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=gg(e);if(t){var o=gg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return bg(this,n)}}function bg(e,t){if(t&&("object"===fg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gg(e){return gg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},gg(e)}var wg=function(e){yg(n,e);var t=vg(n);function n(){return pg(this,n),t.apply(this,arguments)}return dg(n,[{key:"render",value:function(){var e=[];return this.props.posts.data.forEach((function(t,n){e.push(c().createElement(Eg,{key:"p:"+t.postID,post:t}))})),c().createElement("div",{className:"thread-container subsection"},this.props.posts.totalPages>1?c().createElement(Nn,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged},c().createElement("span",{className:"result-count"},this.props.posts.totalRecords," ",1==this.props.posts.totalRecords?"post":"posts")):c().createElement("div",{className:"gallery-list-info"},c().createElement("span",{className:"result-count"},this.props.posts.totalRecords," ",1==this.props.posts.totalRecords?"Post":"Posts")),e,this.props.posts.totalPages>1&&c().createElement(Nn,{total:this.props.posts.totalPages,current:this.props.posts.currentPage,visiblePages:this.props.viewer.isMobile?4:8,onPageChanged:this.props.onPageChanged}))}}]),n}(c().Component),Eg=function(e){yg(n,e);var t=vg(n);function n(){return pg(this,n),t.apply(this,arguments)}return dg(n,[{key:"render",value:function(){var e=this.props.post;return c().createElement("article",{className:"post-extended"},c().createElement("div",{className:"post-header"},c().createElement("h3",null,c().createElement("a",{href:e.topicUrl},e.topicTitle)),c().createElement(la,{displayMode:"Search",path:e.forumPath})),c().createElement("div",{className:"post-body"},c().createElement("div",{className:"comment-body-content",dangerouslySetInnerHTML:{__html:e.text}}),c().createElement("div",{className:"post-footer"},c().createElement(ma,{data:e.addedBy,addClass:" started"}),e.rating>0&&c().createElement("span",{className:"icon icon-after icon-liked"},"+",e.rating))))}}]),n}(c().Component);const Sg=wg;function Og(e){return Og="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},Og(e)}function _g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cg(e,t,n){return t&&kg(e.prototype,t),n&&kg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pg(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jg(e,t)}function jg(e,t){return jg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jg(e,t)}function Tg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Dg(e);if(t){var o=Dg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xg(this,n)}}function xg(e,t){if(t&&("object"===Og(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Rg(e)}function Rg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dg(e){return Dg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Dg(e)}var Ng=function(e){Pg(n,e);var t=Tg(n);function n(e){var r;return _g(this,n),(r=t.call(this,e)).setup=r.setup.bind(Rg(r)),r.getData=r.getData.bind(Rg(r)),r.handleSearch=r.handleSearch.bind(Rg(r)),r.updateFormFromAdvanced=r.updateFormFromAdvanced.bind(Rg(r)),r.handleNewPage=r.handleNewPage.bind(Rg(r)),r.addQuerystring=r.addQuerystring.bind(Rg(r)),r.handleAdvancedClick=r.handleAdvancedClick.bind(Rg(r)),r.handleDisplayChange=r.handleDisplayChange.bind(Rg(r)),r.clearForm=r.clearForm.bind(Rg(r)),r.handleClear=r.handleClear.bind(Rg(r)),r.page=0,r.form={query:null,display:"Posts",sortOptions:null,sortBy:null},r.state={hasLoaded:!1,showLoader:!1,showAdvanced:!1,display:"Posts",results:null,viewer:null},r}return Cg(n,[{key:"componentDidMount",value:function(){this.setup()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.parsedQS=dn.parse(e.location.search),e.location&&e.location.search&&this.parsedQS.q?(null!=e.location.search&&null!=this.parsedQS.page?this.page=this.parsedQS.page:this.page=0,this.getData()):(this.page=0,this.handleClear())}},{key:"setup",value:function(){var e=this;$.getJSON("/api/forum/search").done((function(t,n,r){e.form=t.form,e.setState({hasLoaded:!0})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"getData",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/forum/search".concat(this.page>0?"?page=".concat(this.page):""),contentType:"application/json; charset=utf-8",data:JSON.stringify({form:this.form}),dataType:"json",context:this}).done((function(e,n,r){t.setState({showLoader:!1,results:e.searchResults,viewer:e.viewer},(function(){mn.updateScrollPosition(!0)}))})).fail((function(e,n,r){t.setState({showLoader:!1,results:null,viewer:null},(function(){alerts.error(e.responseJSON.errorMessage)}))})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleSearch",value:function(e){if(e.preventDefault(),this.page=0,this.refs.query.validate()){this.form.query=this.refs.query.getValue(),this.form.limitToTopicTitle=this.refs.limitToTopicTitle.getValue(),this.form.display=this.refs.display.getValue(),this.form.sortBy=this.refs.sort.getValue(),!0===this.state.showAdvanced&&this.updateFormFromAdvanced();var t=this;this.setState({results:null,viewer:null,showLoader:!0},(function(){var e=t.addQuerystring(t.props.location.pathname);t.props.history.push(e)}))}}},{key:"updateFormFromAdvanced",value:function(){var e=this.refs.advanced.getValue();this.form.profile=e.profile,this.form.limitToProfile=e.limitToProfile,this.form.limitToForums=e.limitToForums}},{key:"handleNewPage",value:function(e){this.page=e;var t=this.addQuerystring(this.props.location.pathname);this.props.history.push(t)}},{key:"addQuerystring",value:function(e){var t=[];return null!=this.form&&(this.form.query&&""!=this.form.query&&t.push("q="+encodeURIComponent(this.form.query)),this.form.display&&"Posts"!=this.form.display&&t.push("display="+encodeURIComponent(this.form.display)),this.form.sortBy&&"Newest"!=this.form.sortBy&&t.push("sortBy="+encodeURIComponent(this.form.sortBy))),this.page>0&&t.push("page="+this.page),t.length>0&&(e+="?"+t.join("&")),e}},{key:"handleAdvancedClick",value:function(e){e.preventDefault(),this.state.showAdvanced&&this.updateFormFromAdvanced(),this.setState({showAdvanced:!this.state.showAdvanced})}},{key:"handleDisplayChange",value:function(e){this.form.display=e,this.refs.limitToTopicTitle.setDisabled("Topics"!=e),null!=this.state.results?this.setState({display:e,results:null}):this.setState({display:e})}},{key:"clearForm",value:function(){this.form.query=null,this.form.display="Posts",this.form.profile=null,this.form.limitToProfile=!1,this.form.limitToForums=[],this.form.sortBy="Newest"}},{key:"handleClear",value:function(e){e&&e.preventDefault(),this.refs.query.setValue(null),this.refs.display.setValue("Posts"),this.refs.limitToTopicTitle.setValue(!1),this.refs.limitToTopicTitle.setDisabled(!0),!0===this.state.showAdvanced&&this.refs.advanced.clearValues(),this.page=0,this.clearForm(),this.setState({display:"Posts",results:null,viewer:null})}},{key:"render",value:function(){if(!this.state.hasLoaded)return c().createElement(On,null);var e=null;return!0===this.state.showLoader?e=c().createElement(On,null):null!=this.state.results&&(null==this.state.results.data||0==this.state.results.data.length?e=c().createElement("div",{className:"no-content"},"No Results Found"):"Topics"==this.form.display?e=c().createElement(ja,{topics:this.state.results,viewer:this.state.viewer,onPageChanged:this.handleNewPage}):"Posts"==this.form.display&&(e=c().createElement(Sg,{posts:this.state.results,viewer:this.state.viewer,onPageChanged:this.handleNewPage}))),c().createElement("div",null,c().createElement(hn,null,c().createElement("title",null,"Forum Search"),c().createElement("meta",{name:"description",content:"Search and discover all of our Forums in our Community."})),c().createElement("div",{className:"subsection"},c().createElement("div",{className:"forum-search-container"},c().createElement("form",{onSubmit:this.handleSearch},c().createElement(Jb,{ref:"query",name:"query",label:"Search",placeholder:"Search...",required:!0,requiredErrorMessage:"Search query required."}),c().createElement("div",{className:"clearfix"},c().createElement("div",{className:"panel-left",style:{verticalAlign:"baseline"}},c().createElement("div",{className:"panel-inline",style:{marginRight:"20px"}},c().createElement(ug,{ref:"display",name:"first",label:"Display",options:[{text:"Posts",value:"Posts"},{text:"Topics",value:"Topics"}],value:this.form.display,onChange:this.handleDisplayChange})),c().createElement("div",{className:"panel-inline"},c().createElement(ng,{ref:"limitToTopicTitle",name:"limitToTopicTitle",label:"Limit search to topic title",value:!1,disabled:"Topics"!=this.state.display}))),c().createElement("div",{className:"panel-right"},c().createElement(lu,{ref:"sort",label:"Sort by",options:"Posts"==this.state.display?this.form.postSortOptions:this.form.topicSortOptions,value:this.form.sortBy}))),c().createElement("div",{className:"forum-search-advanced"},c().createElement("a",{href:"#",onClick:this.handleAdvancedClick},"Advanced Options ",c().createElement("span",{className:"caret"}))),this.state.showAdvanced&&c().createElement(Mg,{ref:"advanced",form:this.form}),c().createElement("div",{className:"forum-search-button"},c().createElement("button",{className:"btn btn-default",type:"button",onClick:this.handleClear},"Clear"),c().createElement("button",{className:"btn btn-primary",type:"submit"},"Search"))),e)))}}]),n}(c().Component),Mg=function(e){Pg(n,e);var t=Tg(n);function n(e){var r;return _g(this,n),(r=t.call(this,e)).getValue=r.getValue.bind(Rg(r)),r.clearValues=r.clearValues.bind(Rg(r)),r}return Cg(n,[{key:"getValue",value:function(){return{profile:this.refs.profile.getValue(),limitToProfile:this.refs.limitToProfile.getValue(),limitToForums:this.refs.limitToForums.getSelectedForums()}}},{key:"clearValues",value:function(){this.refs.profile.setValue(""),this.refs.limitToProfile.setValue(!1),this.refs.limitToForums.clearSelectedForums()}},{key:"render",value:function(){return c().createElement("div",{className:"forum-search-advanced-container clearfix"},c().createElement("div",{className:"panel-left form-group"},c().createElement("label",{className:"static"},"Filter results by forums"),c().createElement(Gi,{ref:"limitToForums",forums:this.props.form.limitToForumOptions,selectedForums:this.props.form.limitToForums,style:{marginTop:"10px"}})),c().createElement("div",{className:"panel-right"},c().createElement(Jb,{ref:"profile",name:"profile",label:"Filter results by profile",placeholder:"Filter results by profile...",required:!1},c().createElement(ng,{ref:"limitToProfile",name:"limitToProfile",label:"Limit to topics started by profile",value:!1}))))}}]),n}(c().Component);const Ig=nt(Ng);function Ag(e){return Ag="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},Ag(e)}function Lg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bg(e,t){return Bg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bg(e,t)}function Fg(e,t){if(t&&("object"===Ag(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ug(e)}function Ug(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Kg(e){return Kg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Kg(e)}const qg=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bg(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Kg(r);if(o){var n=Kg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Fg(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getData=t.getData.bind(Ug(t)),t.postID=t.props.match.params.id,t.contentID=t.props.match.params.contentid,t.isModal=t.props.location.state&&t.props.location.state.modal,t.state={content:null,support:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.isModal||$("body").attr("class","hero-content forum"),this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/forum/content-view?postID=".concat(this.postID,"&contentID=").concat(this.contentID)).done((function(t,n,r){e.setState({content:t.content,support:t.support})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){if(null==this.state.content)return null;this.isModal&&"Video"==this.state.content.type&&$(".tf-overlay-content").css("width","100%");var e=null,t=null;return this.isModal||(e="contentview-container",t="contentview-body"),c().createElement("div",{className:e},!this.isModal&&c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("div",{className:"row-wrapper clearfix"},c().createElement("h2",null,"Content from topic: ",this.state.support.title),c().createElement("h3",null,c().createElement(lt,{to:this.state.support.url},c().createElement("i",{className:"fa fa-long-arrow-left"})," View Post"))))),c().createElement("div",{className:t},c().createElement(mm,{content:this.state.content})))}}])&&Lg(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function Vg(e){return Vg="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},Vg(e)}function zg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wg(e,t){return Wg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wg(e,t)}function Hg(e,t){if(t&&("object"===Vg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $g(e)}function $g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jg(e){return Jg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Jg(e)}var Gg=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wg(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Jg(r);if(o){var n=Jg(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Hg(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleOverlayClose=t.handleOverlayClose.bind($g(t)),t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"handleOverlayClose",value:function(){this.props.history.goBack()}},{key:"render",value:function(){var e=this.props.location.state&&this.props.location.state.background;return c().createElement(tt,null,c().createElement(et,{path:["/discuss/forum/:id/:slug?","/discuss/projects/:id/:slug?","/discuss/topic/new","/discuss/topic/:id/:slug?","/discuss/link/:id/:slug?","/discuss/post/:id","/discuss/post/:id/content/:contentid"]},c().createElement(tt,{location:e||this.props.location},c().createElement(et,{path:"/discuss/forum/:id/:slug?",component:Pl}),c().createElement(et,{path:"/discuss/projects/:id/:slug?",component:Pl}),c().createElement(et,{path:"/discuss/topic/new",component:Ub}),c().createElement(et,{path:"/discuss/topic/:id/:slug?",component:hb}),c().createElement(et,{path:"/discuss/link/:id/:slug?",component:wb}),c().createElement(et,{path:"/discuss/post/:id/content/:contentid",component:qg}),c().createElement(et,{path:"/discuss/post/:id",component:Pb})),e&&c().createElement(et,{path:"/discuss/post/:id/content/:contentid"},c().createElement(B,{showClose:!0,closeOnEsc:!0,closeOnOutsideClick:!0,onClose:this.handleOverlayClose},c().createElement(qg,null)))),c().createElement(et,{path:["/discuss/search","/discuss/group/:id/:slug?","/discuss/:root","/discuss"]},c().createElement("section",{id:"heroBanner",style:{backgroundImage:"url(/common/img/assets/headers/discuss_header_3.jpg)"}},c().createElement("div",{className:"hero-content"},c().createElement("h2",{className:"brandDot"},"Discuss"))),c().createElement(tt,null,c().createElement(et,{path:"/discuss/search",component:Ig}),c().createElement(et,{path:"/discuss/group/:id/:slug?",component:zc}),c().createElement(et,{path:"/discuss/:root",component:zc}),c().createElement(et,{exact:!0,path:"/discuss",component:zc}))))}}])&&zg(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));const Qg=function(e){return c().createElement("div",{className:"app"},c().createElement(hn,{defaultTitle:"Discuss | Foundry Community",titleTemplate:"%s | Foundry Community"}),c().createElement(rt,null,c().createElement(Gg,null)))};function Yg(e){return Yg="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},Yg(e)}function Xg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ew(e,t){return ew=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ew(e,t)}function tw(e,t){if(t&&("object"===Yg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function nw(e){return nw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},nw(e)}var rw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ew(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=nw(r);if(o){var n=nw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return tw(this,e)});function a(){return Xg(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=[];this.props.project.tagLinks&&(this.props.project.tagLinks.contentType&&(e=this.props.project.tagLinks.contentType.map((function(e,t){return c().createElement("span",{key:"c".concat(t),className:"type-c"},c().createElement("a",{href:e.url},e.text))}))),this.props.project.tagLinks.product&&(e=e.concat(this.props.project.tagLinks.product.map((function(e,t){return c().createElement("span",{key:"p".concat(t),className:"type-p"},c().createElement("a",{href:e.url},e.text))})))),this.props.project.tagLinks.usageRights&&(e=e.concat(this.props.project.tagLinks.usageRights.map((function(e,t){return c().createElement("span",{key:"u".concat(t),className:"type-u"},c().createElement("a",{href:e.url},e.text))})))));var t=null!=this.props.project.title&&""!=this.props.project.title?this.props.project.title:"Untitled ".concat(this.props.project.type," Project");return c().createElement("article",{className:"card"},c().createElement("a",{href:this.props.project.url,className:"card-image"},c().createElement("img",{src:this.props.project.thumbUrl})),c().createElement("div",{className:"text-container"},c().createElement("h4",null,c().createElement("a",{href:this.props.project.url,dangerouslySetInnerHTML:mn.createMarkup(t)})),c().createElement("div",{className:"tag-links"},e),this.props.children))}}])&&Zg(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);rw.propTypes={project:p().object.isRequired};const ow=rw;function iw(e){return iw="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},iw(e)}function aw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function cw(e,t){return cw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},cw(e,t)}function lw(e,t){if(t&&("object"===iw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function uw(e){return uw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},uw(e)}var fw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=uw(r);if(o){var n=uw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return lw(this,e)});function a(){return aw(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this,t=this.props.galleryData.map((function(t,n){switch(e.props.galleryOf){case"Project":return"Catalogue"===t.type?c().createElement(ow,{key:t.id,project:t}):c().createElement(Qo,{key:t.id,project:t});case"Collection":return c().createElement(Fs,{key:t.id,collection:t})}}));return c().createElement(Rs,null,c().createElement("div",null,t))}}])&&sw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);fw.propTypes={galleryData:p().array.isRequired,galleryOf:p().string};const pw=fw;function hw(e){return hw="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},hw(e)}function dw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mw(e,t){return mw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mw(e,t)}function vw(e,t){if(t&&("object"===hw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function bw(e){return bw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bw(e)}var gw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bw(r);if(o){var n=bw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return vw(this,e)});function a(){return dw(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null;this.props.collection.attributes.duration&&(e=mn.niceDuration(this.props.collection.attributes.duration));var t=null;null!=this.props.collection.experienceLevel&&"None"!=this.props.collection.experienceLevel&&(t=TFWeb.Resources.UI.getString("Experience.".concat(this.props.collection.experienceLevel)));var n=null;null!=this.props.collection.bulletPoints&&this.props.collection.bulletPoints.length>0&&(n=this.props.collection.bulletPoints.map((function(e,t){return c().createElement("div",{className:e.type.toLowerCase(),key:t},e.title,", ",c().createElement("span",{dangerouslySetInnerHTML:mn.createMarkup(e.text)}))})));var r=null;if(null!=this.props.collection.productReleases){var o="foundry foundry-".concat(this.props.collection.productReleases.logoClass);r=c().createElement("div",{className:"software"},c().createElement("i",{className:o})," ",this.props.collection.productReleases.names.map((function(e,t){return c().createElement("span",{key:t},e)})))}return c().createElement("article",{className:"card course"},c().createElement("a",{href:this.props.collection.url,className:"card-image"},c().createElement("img",{src:this.props.collection.thumbUrl})),c().createElement("a",{href:this.props.collection.url,className:"text-container"},c().createElement("h4",{className:"Playlist"===this.props.collection.type?"video":null,dangerouslySetInnerHTML:mn.createMarkup(this.props.collection.title)}),this.props.collection.itemCount>0&&c().createElement("div",{className:"duration"},c().createElement("span",null,this.props.collection.itemCount," ",1==this.props.collection.itemCount?TFWeb.Resources.UI.Video:TFWeb.Resources.UI.Videos,null!=e?",":"")," ",null!=e&&c().createElement("span",null,e)),n,c().createElement("div",{className:"description",dangerouslySetInnerHTML:mn.createMarkup(this.props.collection.description)})),(null!=r||null!=t)&&c().createElement("div",{className:"info"},null!=r&&r,null!=t&&c().createElement("div",{className:"experience"},t)))}}])&&yw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);gw.propTypes={collection:p().object.isRequired},gw.defaultProps={showProfile:!1};const ww=gw;function Ew(e){return Ew="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},Ew(e)}function Sw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ow(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _w(e,t){return _w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_w(e,t)}function kw(e,t){if(t&&("object"===Ew(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Cw(e){return Cw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Cw(e)}var Pw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_w(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Cw(r);if(o){var n=Cw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return kw(this,e)});function a(){return Sw(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e,t=this;return null==this.props.gallery.data||0==this.props.gallery.data.length?e=c().createElement("div",{className:"no-content"},"No Content Found"):(e=this.props.gallery.data.map((function(e,n){switch(t.props.galleryOf){case"Project":return"Catalogue"===e.type?c().createElement(ow,{key:e.id,project:e}):c().createElement(Qo,{key:e.id,project:e,showProfile:!0});case"Collection":return"Course"===e.type?c().createElement(ww,{key:e.id,collection:e}):c().createElement(Fs,{key:e.id,collection:e})}})),e=c().createElement("div",null,e)),c().createElement("div",{className:"cards-container"},this.props.children&&this.props.children,this.props.gallery.totalPages>1&&c().createElement(Nn,{total:this.props.gallery.totalPages,current:this.props.gallery.currentPage,visiblePages:8,onPageChanged:this.props.onPageChanged}),e,this.props.gallery.totalPages>1&&c().createElement(Nn,{total:this.props.gallery.totalPages,current:this.props.gallery.currentPage,visiblePages:8,onPageChanged:this.props.onPageChanged}))}}])&&Ow(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Pw.propTypes={gallery:p().object.isRequired,galleryOf:p().string},Pw.defaultProps={galleryOf:"Project"};const jw=Pw;function Tw(e){return Tw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tw(e)}function xw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dw(e,t){return Dw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Dw(e,t)}function Nw(e,t){if(t&&("object"===Tw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Mw(e){return Mw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Mw(e)}var Iw=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mw(r);if(o){var n=Mw(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Nw(this,e)});function a(){return xw(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"asset-download"},c().createElement("div",{className:"info"},c().createElement("img",{src:this.props.content.thumbUrl}),c().createElement("div",null,c().createElement("p",{className:"title"},this.props.content.title),c().createElement("span",{className:"format"},this.props.content.resourceFormat),c().createElement("span",{className:"filesize"},this.props.content.size))),this.props.children)}}])&&Rw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Iw.propTypes={content:p().object};const Aw=Iw;function Lw(e){return Lw="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},Lw(e)}function Bw(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Uw(e,t,n){return t&&Fw(e.prototype,t),n&&Fw(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kw(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qw(e,t)}function qw(e,t){return qw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},qw(e,t)}function Vw(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Hw(e);if(t){var o=Hw(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zw(this,n)}}function zw(e,t){if(t&&("object"===Lw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ww(e)}function Ww(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hw(e){return Hw=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Hw(e)}var $w=function(e){Kw(n,e);var t=Vw(n);function n(e){var r;return Bw(this,n),(r=t.call(this,e)).getData=r.getData.bind(Ww(r)),r.onCartClick=r.onCartClick.bind(Ww(r)),r.handleCartClose=r.handleCartClose.bind(Ww(r)),r.refresh=r.refresh.bind(Ww(r)),r.addToCart=r.addToCart.bind(Ww(r)),r.onRemoveFromCart=r.onRemoveFromCart.bind(Ww(r)),r.onRemoveAllFromCart=r.onRemoveAllFromCart.bind(Ww(r)),r.onDownloadAll=r.onDownloadAll.bind(Ww(r)),r.state={loadStatus:a.LoadStatus.PreLoad,showCart:!1,content:null,highlightCount:!1},r}return Uw(n,[{key:"componentDidMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/share/cart/get").done((function(t,n,r){e.setState({loadStatus:a.LoadStatus.Loaded,content:t})})).fail((function(t,n,r){e.ajaxError=t}))}},{key:"onCartClick",value:function(){this.setState({showCart:!0})}},{key:"handleCartClose",value:function(e){this.setState({showCart:!1})}},{key:"refresh",value:function(){this.getData()}},{key:"addToCart",value:function(e){$.ajax({type:"POST",url:"/api/share/cart/add",contentType:"application/json; charset=utf-8",data:JSON.stringify({id:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({content:e,highlightCount:!0},(function(){var e=this;setTimeout((function(){e.setState({highlightCount:!1})}),1e3)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onRemoveFromCart",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/share/cart/remove",contentType:"application/json; charset=utf-8",data:JSON.stringify({id:e}),dataType:"json",context:this}).done((function(e,n,r){t.setState({content:e})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onRemoveAllFromCart",value:function(){var e=this;$.ajax({type:"POST",url:"/api/share/cart/remove-all",contentType:"application/json; charset=utf-8",dataType:"json",context:this}).done((function(t,n,r){e.setState({content:null})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onDownloadAll",value:function(e){this.setState({showCart:!1,loadStatus:a.LoadStatus.PreLoad,content:null},(function(){window.location.replace("/share/cart/download?format="+e)}))}},{key:"render",value:function(){var e="asset-download-cart".concat(!0===this.props.inline?" inline":""),t=this.state.content?this.state.content.length:0,n="count".concat(!0===this.state.highlightCount?" highlight":"");return c().createElement("div",{className:e,ref:"cart"},c().createElement("button",{type:"button",className:"btn btn-small show-cart",onClick:this.onCartClick},"Download Cart ",c().createElement("i",{className:"fa fa-shopping-cart"}),t>0&&c().createElement("span",{className:n},t)),!0===this.state.showCart&&this.state.loadStatus==a.LoadStatus.Loading&&c().createElement(On,null),!0===this.state.showCart&&this.state.loadStatus==a.LoadStatus.Loaded&&c().createElement(B,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!0,onClose:this.handleCartClose,contentStyle:{backgroundColor:"white"}},c().createElement(Jw,{content:this.state.content,onRemoveFromCart:this.onRemoveFromCart,onRemoveAllFromCart:this.onRemoveAllFromCart,onDownloadAll:this.onDownloadAll})))}}]),n}(c().Component);$w.propTypes={inline:p().bool},$w.defaultProps={inline:!1};var Jw=function(e){Kw(n,e);var t=Vw(n);function n(){return Bw(this,n),t.apply(this,arguments)}return Uw(n,[{key:"render",value:function(){var e=[],t=this.props.content?this.props.content.length:0;return t>0?this.props.content.forEach((function(t,n){e.push(c().createElement(Aw,{key:t.id,content:t},c().createElement("button",{className:"remove",type:"button",onClick:this.props.onRemoveFromCart.bind(null,t.data)},c().createElement("i",{className:"glyphicon glyphicon-remove"}))))}),this):e.push(c().createElement("div",{key:"e",className:"empty"},"Download Cart is empty")),c().createElement("div",{className:"asset-download-cart-contents clearfix"},t>1&&c().createElement("div",{style:{textAlign:"right",marginBottom:"10px"}},c().createElement("button",{type:"button",onClick:this.props.onRemoveAllFromCart},"Clear Download Cart")),e,t>0&&c().createElement("div",{className:"asset-download-cart-buttons"},c().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.props.onDownloadAll.bind(null,"ModoPackage")},"Download All as Modo Package (.lpk)"),c().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.props.onDownloadAll.bind(null,"Zip")},"Download All as Zip")))}}]),n}(c().Component);const Gw=$w;function Qw(e){return Qw="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},Qw(e)}function Yw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Xw(e,t){return Xw=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Xw(e,t)}function Zw(e,t){if(t&&("object"===Qw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return eE(e)}function eE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tE(e){return tE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},tE(e)}const nE=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xw(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=tE(r);if(o){var n=tE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Zw(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getIndex=t.getIndex.bind(eE(t)),t.buildQuerystring=t.buildQuerystring.bind(eE(t)),t.getData=t.getData.bind(eE(t)),t.handleFilterChange=t.handleFilterChange.bind(eE(t)),t.handleNewPage=t.handleNewPage.bind(eE(t)),t.state={hasLoaded:!1,filter:null,gallery:null,galleryOf:null,viewer:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getIndex()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key!=e.location.key&&this.getData(e)}},{key:"getIndex",value:function(){var e=this,t="/api/".concat(this.props.section,"/get-index").concat(this.props.location.search);$.getJSON(t).done((function(t,n,r){e.setState({gallery:t.gallery,galleryOf:t.galleryOf,filter:t.filter,viewer:t.viewer,hasLoaded:!0},(function(){$("#globalFooter").removeClass("hide")}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"buildQuerystring",value:function(e,t){var n=[];if(null!=e)for(var r in e)e.hasOwnProperty(r)&&null!=e[r]&&e[r].value&&""!=e[r].value&&n.push("".concat(r,"=").concat(e[r].value));t&&t>0&&n.push("page=".concat(t));var o="";return n.length>0&&(o="?"+n.join("&")),o}},{key:"getData",value:function(e){var t=this,n="/api/".concat(this.props.section,"/get").concat(e.location.search);$.getJSON(n).done((function(n,r,o){var i=t.state.filter;if(i&&null!=i&&e.location.search&&null!=e.location.search){var a=dn.parse(e.location.search);for(var s in i)if(i.hasOwnProperty(s)&&null!=i[s]){var c="";a[s]&&(c=a[s]),i[s].value=c}}if(null!=n.filter)for(var s in n.filter)i[s]=n.filter[s];t.setState({gallery:n.gallery,galleryOf:n.galleryOf,filter:i},(function(){mn.updateScrollPosition(!0)}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.props.location.pathname;e+=t.buildQuerystring(t.state.filter,0),t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.props.location.pathname+this.buildQuerystring(this.state.filter,e);this.props.history.push(t)}},{key:"render",value:function(){return!1===this.state.hasLoaded?c().createElement(On,null):!0===this.state.hasLoaded&&null==this.state.gallery?c().createElement("div",{className:"no-content"},"No Content Found"):c().createElement("div",{className:"grid-gallery"},c().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange}),c().createElement(jw,{gallery:this.state.gallery,galleryOf:this.state.galleryOf,onPageChanged:this.handleNewPage},"share"==this.props.section&&this.state.viewer&&!0===this.state.viewer.isSignedIn&&c().createElement(Gw,{inline:this.state.gallery.totalPages>1})))}}])&&Yw(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function rE(e){return rE="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},rE(e)}function oE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aE(e,t,n){return t&&iE(e.prototype,t),n&&iE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cE(e,t)}function cE(e,t){return cE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},cE(e,t)}function lE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=pE(e);if(t){var o=pE(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return uE(this,n)}}function uE(e,t){if(t&&("object"===rE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fE(e)}function fE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pE(e){return pE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},pE(e)}var hE=nt(function(e){sE(n,e);var t=lE(n);function n(e){return oE(this,n),t.call(this,e)}return aE(n,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))})),$("#globalFooter").removeClass("hide")}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){return c().createElement(tt,null,c().createElement(et,{path:"/watch/:product/heroes",component:function(e){return c().createElement(yE,{section:"watch/".concat(e.match.params.product,"/heroes")})}}),c().createElement(et,{path:"/watch/media"},c().createElement(mE,null)),c().createElement(et,{path:"/watch"},c().createElement(dE,null)))}}]),n}(c().Component)),dE=function(e){sE(n,e);var t=lE(n);function n(e){var r;return oE(this,n),(r=t.call(this,e)).getData=r.getData.bind(fE(r)),r.state={hasLoaded:!1,heroes:null,media:null},r}return aE(n,[{key:"componentDidMount",value:function(){this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/watch/get-landing").done((function(t,n,r){e.setState({heroes:t.heroes,media:t.media,hasLoaded:!0})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return!1===this.state.hasLoaded?c().createElement(On,null):c().createElement(c().Fragment,null,c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("h2",{className:"brandDot"},"Become a Better Artist"))),c().createElement("div",{className:"subsection"},c().createElement("div",{className:"subsection-intro"},c().createElement("h3",null,"Modo Heroes"),c().createElement(lt,{className:"cta",to:"/watch/modo/heroes"},"View All")),c().createElement(pw,{galleryData:this.state.heroes,galleryOf:"Project"})),c().createElement("div",{className:"subsection"},c().createElement("div",{className:"subsection-intro"},c().createElement("h3",null,"Latest Videos"),c().createElement(lt,{className:"cta",to:"/watch/media"},"View All")),c().createElement(pw,{galleryData:this.state.media,galleryOf:"Project"})))}}]),n}(c().Component);function yE(e){return c().createElement(c().Fragment,null,c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("h2",{className:"brandDot"},"Modo Heroes"),c().createElement("h3",null,"Where Modo skills are a superpower"))),c().createElement("div",{className:"content-section"},c().createElement(nE,{type:"Training",section:e.section})))}function mE(e){return c().createElement(c().Fragment,null,c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("h2",{className:"brandDot"},"Become a Better Artist"))),c().createElement("div",{className:"content-section"},c().createElement(nE,{type:"Training",section:"watch"})))}const vE=function(e){return c().createElement("div",{className:"app"},c().createElement(hn,{defaultTitle:"Watch | Foundry Community",titleTemplate:"%s | Foundry Community"}),c().createElement(rt,null,c().createElement(hE,null)))};function bE(e){return bE="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},bE(e)}function gE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function EE(e,t){return EE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},EE(e,t)}function SE(e,t){if(t&&("object"===bE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function OE(e){return OE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},OE(e)}const _E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=OE(r);if(o){var n=OE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return SE(this,e)});function a(){return gE(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("nav",{className:"full-width-tabs"},c().createElement("div",{className:"mobile-options-wrapper"},c().createElement("ul",{className:"tftabs"},this.props.tabs.map((function(e,t){return c().createElement("li",{key:t},e)})))))}}])&&wE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function kE(e){return kE="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},kE(e)}function CE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function PE(e,t){return PE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},PE(e,t)}function jE(e,t){if(t&&("object"===kE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return TE(e)}function TE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xE(e){return xE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xE(e)}var RE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xE(r);if(o){var n=xE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return jE(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(TE(t)),t.state={profileFollowCount:t.props.profileFollowCount,isFollowed:t.props.isFollowed},t}return t=a,(n=[{key:"onClick",value:function(e){e.preventDefault(),$.ajax({type:"POST",url:"/api/social/follow",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,profile:this.props.profile,value:!this.state.isFollowed}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isFollowed:e.value,profileFollowCount:e.result})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return c().createElement("div",{className:"follow-wrapper"},this.state.isFollowed?c().createElement("a",{href:"#",className:"follow-cta button icon icon-after icon-close",onClick:this.onClick},"Stop Following"):c().createElement("a",{href:"#",className:"follow-cta button icon icon-after icon-add",onClick:this.onClick},"Follow"),c().createElement("span",{className:"followers icon icon-before icon-account",title:"Followers"},this.state.profileFollowCount))}}])&&CE(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);RE.propTypes={consumer:p().string.isRequired,profile:p().string.isRequired,isFollowed:p().bool},RE.defaultProps={isFollowed:!1};const DE=RE;function NE(e){return NE="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},NE(e)}function ME(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IE(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function AE(e,t,n){return t&&IE(e.prototype,t),n&&IE(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LE(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BE(e,t)}function BE(e,t){return BE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},BE(e,t)}function FE(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qE(e);if(t){var o=qE(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return UE(this,n)}}function UE(e,t){if(t&&("object"===NE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return KE(e)}function KE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qE(e){return qE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qE(e)}var VE=function(e){LE(n,e);var t=FE(n);function n(e){var r;ME(this,n),(r=t.call(this,e)).onMetricsChange=r.onMetricsChange.bind(KE(r)),r.profileFollowCount=r.props.profile.metrics.profileFollow;var o=r.props.profile.metrics;return delete o.profileFollow,r.state={metrics:o},r}return AE(n,[{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.profile;!0===e.viewer.canEdit&&e.url;var t=null;if(e.viewer.isSignedIn&&!e.viewer.canEdit){var n=!1;null!=e.viewer.actions&&null!=e.viewer.actions.follow&&(n=e.viewer.actions.follow.value),t=c().createElement(DE,{consumer:"Profile",profile:e.name,isFollowed:n,profileFollowCount:this.profileFollowCount,onChange:this.onMetricsChange})}else t=c().createElement("div",{className:"follow-wrapper"},c().createElement("span",{className:"followers icon icon-before icon-account"},this.profileFollowCount," Followers"));var r={backgroundImage:"url(".concat(e.avatarUrl,")")};return c().createElement("section",{className:"profile-details-section"},c().createElement(hn,{title:e.name}),c().createElement("div",{className:"main"},c().createElement("div",{className:"intro centred clearfix"},c().createElement("div",{className:"user-info"},c().createElement("div",{className:"profile"},c().createElement("div",{className:"profile-image",style:r}),c().createElement("p",{className:"profile-name"},e.name," ",!0===e.viewer.canEdit&&c().createElement("a",{href:e.url+"/edit",className:"icon icon-after icon-refresh edit"},"Edit")," ",e.viewer.e&&e.viewer.e.link&&c().createElement("a",{href:e.viewer.e.link,className:"icon icon-after icon-arrow edit"},"Account")),e.occupation&&c().createElement("p",{className:"profile-tagline"},e.occupation),e.location&&c().createElement("p",{className:"profile-location",dangerouslySetInnerHTML:{__html:e.location}}),c().createElement("p",{className:"profile-joined"},"Joined ",e.joined),e.site&&c().createElement("a",{href:e.site,className:"profile-website"},e.site)),null!=e.badges&&c().createElement(zE,{badges:e.badges}),c().createElement("div",{className:"profile-stats clearfix"},c().createElement(Qr,{metrics:this.state.metrics,displayClass:"dark"})),c().createElement("div",{className:"profile-ctas"},t)))))}}]),n}(c().Component);VE.propTypes={profile:p().object.isRequired};var zE=function(e){LE(n,e);var t=FE(n);function n(e){return ME(this,n),t.call(this,e)}return AE(n,[{key:"render",value:function(){var e=this;if(null==this.props.badges)return null;var t=Object.keys(this.props.badges).map((function(t,n){return e.props.badges[t].map((function(e,t){return c().createElement("li",{key:n+":"+t},c().createElement("span",{className:e.badge},e.name))}))}));return c().createElement("ul",{className:"profile-badges list-inline"},t)}}]),n}(c().Component);zE.propTypes={badges:p().object.isRequired};const WE=VE;function HE(e){return HE="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},HE(e)}function $E(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function JE(e,t){return JE=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},JE(e,t)}function GE(e,t){if(t&&("object"===HE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return QE(e)}function QE(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YE(e){return YE=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},YE(e)}var XE=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JE(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=YE(r);if(o){var n=YE(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return GE(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleDelete=t.handleDelete.bind(QE(t)),t.handleUnpublish=t.handleUnpublish.bind(QE(t)),t}return t=a,n=[{key:"handleDelete",value:function(e){this.props.onDelete(this.props.type,e)}},{key:"handleUnpublish",value:function(e){this.props.onUnpublish(this.props.type,e)}},{key:"render",value:function(){var e=this.props.viewer.isOwner?c().createElement("a",{href:"/project/new",className:"edit-cta icon icon-after icon-add"},"Upload new project"):null,t=this.props.projectGallery.hasMore?c().createElement("button",{type:"button",className:"load-more",onClick:this.props.onViewAll.bind(null,this.props.profile.urlSafeName,this.props.type)},"View all"):null,n=this.props.projectGallery.data.map((function(e,t){return c().createElement(Qo,{key:e.id,project:e,showProfile:!1})}));return c().createElement("div",{className:"subsection"},c().createElement("div",{className:"subsection-intro"},c().createElement("h3",null,this.props.label),c().createElement("p",{className:"project-count"},this.props.projectGallery.totalRecords," Projects"),e),c().createElement("div",{className:"content-section"},c().createElement(Rs,null,c().createElement("div",null,n)),t))}}],n&&$E(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);XE.propTypes={projectGallery:p().object.isRequired,viewer:p().object,profile:p().object,type:p().string,label:p().string,onViewAll:p().func,onDelete:p().func,onUnpublish:p().func};const ZE=XE;function eS(e){return eS="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},eS(e)}function tS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nS(e,t){return nS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},nS(e,t)}function rS(e,t){if(t&&("object"===eS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return oS(e)}function oS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iS(e){return iS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},iS(e)}const aS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=iS(r);if(o){var n=iS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return rS(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onViewAll=t.onViewAll.bind(oS(t)),t.state={hasLoaded:!1,profile:null,viewer:null,projectDictionaries:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){var e=this;$.getJSON("/api/profile/"+this.props.profile.routeName+"/projects").done((function(t){e.setState({hasLoaded:!0,profile:t.profile,viewer:t.viewer,projectDictionaries:t.projectDictionaries})})).fail((function(t){e.setState({hasLoaded:!0})})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"onViewAll",value:function(e,t){var n=this;$.getJSON("/api/profile/"+e+"/projects/"+t).done((function(e){var r=n.state.projectDictionaries;r[t].data=r[t].data.concat(e.projectDictionaries.data),r[t].hasMore=!1,n.setState({projectDictionaries:r})})).fail((function(e){}))}},{key:"render",value:function(){if(!this.state.hasLoaded)return c().createElement(On,null);var e=null,t=[];if(null!=this.state.projectDictionaries)for(var n in TFWeb.Enums.ProjectTypes){var r=n.toLowerCase();this.state.projectDictionaries.hasOwnProperty(r)&&t.push(c().createElement(ZE,{key:n,onViewAll:this.onViewAll,viewer:this.state.viewer,profile:this.state.profile,projectGallery:this.state.projectDictionaries[r],label:n,type:r}))}else e=this.state.viewer.isOwner?c().createElement("div",{className:"subsection no-content"},c().createElement("a",{href:"/project/new"},"+ Start your portfolio by sharing a project today!")):c().createElement("div",{className:"subsection no-content"},c().createElement("p",null,this.state.profile.name," hasn't shared any projects.  Encourage them to start their portfolio today."));return c().createElement("div",null,e,t)}}])&&tS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function sS(e){return sS="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},sS(e)}function cS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lS(e,t){return lS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},lS(e,t)}function uS(e,t){if(t&&("object"===sS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fS(e)}function fS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pS(e){return pS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},pS(e)}const hS=nt(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=pS(r);if(o){var n=pS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return uS(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).addQuerystring=t.addQuerystring.bind(fS(t)),t.getData=t.getData.bind(fS(t)),t.handleFilterChange=t.handleFilterChange.bind(fS(t)),t.handleNewPage=t.handleNewPage.bind(fS(t)),t.hasLoaded=!1,t.mode=t.props.mode,t.parsedQS=dn.parse(t.props.location.search),t.page=t.parsedQS.page?t.parsedQS.page:0,t.state={pagedData:null,viewer:null,filter:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.getData(this.props)}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.props.location.key==e.location.key&&this.mode==e.mode||(this.mode!=e.mode&&(this.hasLoaded=!1,this.mode=e.mode),this.parsedQS=dn.parse(e.location.search),this.getData(e))}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.location.key==e.location.key&&this.mode==e.mode}},{key:"addQuerystring",value:function(e,t,n){var r=[];if(null!=t)for(var o in t)t.hasOwnProperty(o)&&t[o].value&&""!=t[o].value&&r.push("".concat(o,"=").concat(t[o].value));return n>0&&r.push("page="+n),r.length>0&&(e+="?"+r.join("&")),e}},{key:"getData",value:function(e){var t=this,n="/api/profile/".concat(this.props.profile.routeName,"/").concat(this.mode.toLowerCase()).concat(e.location.search),r=!this.hasLoaded;$.getJSON(n).done((function(e,n,o){t.hasLoaded=!0,t.setState({pagedData:e.pagedData,viewer:e.viewer,filter:e.filter},(function(){if(!r){var e=document.querySelector("div.app");e&&e.scrollIntoView()}}))})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"handleFilterChange",value:function(e){var t=this;this.setState({filter:e},(function(){var e=t.addQuerystring(t.props.location.pathname,t.state.filter,0);t.props.history.push(e)}))}},{key:"handleNewPage",value:function(e){var t=this.addQuerystring(this.props.location.pathname,this.state.filter,e);this.props.history.push(t)}},{key:"render",value:function(){if(!1===this.hasLoaded)return c().createElement(On,null);if(!0===this.hasLoaded&&this.state.pagedData&&0==this.state.pagedData.data.length)return c().createElement("div",{className:"subsection no-content"},"No ",this.mode);var e=null;switch(this.mode){case"Topics":e=c().createElement(ja,{topics:this.state.pagedData,viewer:this.state.viewer,topicCountLabel:"",onPageChanged:this.handleNewPage});break;case"Posts":e=c().createElement(Sg,{posts:this.state.pagedData,viewer:this.state.viewer,onPageChanged:this.handleNewPage})}return c().createElement("div",{className:"subsection"},c().createElement("div",{className:"subsection-filter"},c().createElement("h3",null,"Forum ",this.mode),c().createElement(Mo,{filter:this.state.filter,onChange:this.handleFilterChange})),e)}}])&&cS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component));function dS(e){return dS="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},dS(e)}function yS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vS(e,t){return vS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vS(e,t)}function bS(e,t){if(t&&("object"===dS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gS(e){return gS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},gS(e)}var wS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=gS(r);if(o){var n=gS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return bS(this,e)});function a(){return yS(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this,t=this.props.list.map((function(t,n){if(e.props.path){var r="".concat(e.props.path,"?product=").concat(encodeURIComponent(t.product));return c().createElement("span",{key:n,className:"tag product"},c().createElement("a",{href:r},c().createElement("img",{src:t.logo,alt:t.product})))}return c().createElement("span",{key:n,className:"tag product"},c().createElement("img",{src:t.logo,alt:t.product}))}));return c().createElement("div",null,this.props.children?this.props.children:c().createElement("h4",null,TFWeb.Resources.UI.Products),c().createElement("div",{className:"tags"},t))}}])&&mS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);wS.propTypes={list:p().array,path:p().string},wS.defaultProps={list:[]};const ES=wS;function SS(e){return SS="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},SS(e)}function OS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _S(e,t){return _S=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_S(e,t)}function kS(e,t){if(t&&("object"===SS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function CS(e){return CS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},CS(e)}const PS=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_S(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=CS(r);if(o){var n=CS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return kS(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).state={hasLoaded:!1,about:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){var e=this;$.getJSON("/api/profile/"+this.props.profile.routeName+"/about",(function(t){e.setState({hasLoaded:!0,about:t.result})})).fail((function(e){})).always((function(){$("#globalFooter").removeClass("hide")}))}},{key:"render",value:function(){return c().createElement("div",{className:"subsection subsection-about"},c().createElement("div",{className:"subsection-about-left"},c().createElement("h3",null,"Bio"),this.state.about&&c().createElement("p",{dangerouslySetInnerHTML:{__html:this.state.about.description}})),c().createElement("div",{className:"subsection-about-right"},this.state.about&&c().createElement(ES,{list:this.state.about.productExperience},c().createElement("h3",null,"Software Experience"))))}}])&&OS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function jS(e){return jS="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},jS(e)}function TS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function RS(e,t,n){return t&&xS(e.prototype,t),n&&xS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function DS(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NS(e,t)}function NS(e,t){return NS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},NS(e,t)}function MS(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=AS(e);if(t){var o=AS(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return IS(this,n)}}function IS(e,t){if(t&&("object"===jS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function AS(e){return AS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},AS(e)}var LS=function(e){DS(n,e);var t=MS(n);function n(e){return TS(this,n),t.call(this,e)}return RS(n,[{key:"componentDidMount",value:function(){$("body").attr("class","profile-details editable")}},{key:"render",value:function(){return c().createElement("div",{className:"app"},c().createElement(hn,{defaultTitle:"Profile",titleTemplate:"%s | Foundry Community"}),c().createElement(FS,null),c().createElement(WE,{profile:this.props.profile}),c().createElement(rt,null,c().createElement(BS,{profile:this.props.profile})))}}]),n}(c().Component),BS=nt(function(e){DS(n,e);var t=MS(n);function n(e){return TS(this,n),t.call(this,e)}return RS(n,[{key:"UNSAFE_componentWillMount",value:function(){this.unlisten=this.props.history.listen((function(e,t){window.ga&&(window.ga("set","page",e.pathname+e.search),window.ga("send","pageview"))}))}},{key:"componentWillUnmount",value:function(){this.unlisten()}},{key:"render",value:function(){var e=this,t=[c().createElement(mt,{to:"/profile/".concat(this.props.profile.routeName),isActive:function(){return e.props.location.pathname==e.props.profile.url},activeClassName:"selected"},"Portfolio"),c().createElement(mt,{to:"/profile/".concat(this.props.profile.routeName,"/topics"),activeClassName:"selected"},"Topics"),c().createElement(mt,{to:"/profile/".concat(this.props.profile.routeName,"/posts"),activeClassName:"selected"},"Posts"),c().createElement(mt,{to:"/profile/".concat(this.props.profile.routeName,"/about"),activeClassName:"selected"},"About")];return c().createElement("div",null,c().createElement(_E,{tabs:t}),c().createElement(tt,null,c().createElement(et,{path:"/profile/:name/posts"},c().createElement(hS,{mode:"Posts",profile:this.props.profile})),c().createElement(et,{path:"/profile/:name/topics"},c().createElement(hS,{mode:"Topics",profile:this.props.profile})),c().createElement(et,{path:"/profile/:name/about"},c().createElement(PS,{profile:this.props.profile})),c().createElement(et,{exact:!0,path:"/profile/:name"},c().createElement(aS,{profile:this.props.profile}))))}}]),n}(c().Component)),FS=function(e){DS(n,e);var t=MS(n);function n(){return TS(this,n),t.apply(this,arguments)}return RS(n,[{key:"render",value:function(){return c().createElement("section",{id:"heroBanner",className:"hero-profile",style:{backgroundImage:"url('/common/img/assets/headers/dashboard_header.png')"}})}}]),n}(c().Component);const US=LS;function KS(e){return KS="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},KS(e)}function qS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zS(e,t){return zS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},zS(e,t)}function WS(e,t){if(t&&("object"===KS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function HS(e){return HS=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},HS(e)}const $S=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=HS(r);if(o){var n=HS(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return WS(this,e)});function a(){return qS(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"app"},c().createElement(hn,{defaultTitle:"Share | Foundry Community",titleTemplate:"%s | Foundry Community"}),c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("h2",{className:"brandDot"},"Discover Assets"))),c().createElement(rt,null,c().createElement(et,{path:"/share"},c().createElement("div",{className:"content-section"},c().createElement(nE,{type:"Asset",section:"share"})))))}}])&&VS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component),JS=function(e){return c().createElement("div",{className:"app"},c().createElement(hn,{defaultTitle:"Explore | Foundry Community",titleTemplate:"%s | Foundry Community"}),c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("h2",{className:"brandDot"},"Discover Portfolios"))),c().createElement(rt,null,c().createElement(et,{path:"/explore"},c().createElement("div",{className:"content-section"},c().createElement(nE,{type:"Portfolio",section:"explore"})))))};function GS(e){return GS="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},GS(e)}function QS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function YS(e,t){return YS=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},YS(e,t)}function XS(e,t){if(t&&("object"===GS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ZS(e)}function ZS(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eO(e){return eO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},eO(e)}var tO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&YS(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=eO(r);if(o){var n=eO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return XS(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(ZS(t)),t.state={isLiked:t.props.isLiked},t}return t=a,(n=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/like",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:!this.state.isLiked}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isLiked:e.value}),null!=e.result&&e.result>=0&&this.props.onChange&&this.props.onChange("likes",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e="project-action btn-link like".concat(this.state.isLiked?" active":"");return c().createElement("span",null,c().createElement("button",{type:"button",className:e,onClick:this.onClick},"Like"))}}])&&QS(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);tO.propTypes={consumer:p().string.isRequired,id:p().number.isRequired,isLiked:p().bool,onChange:p().func},tO.defaultProps={isLiked:!1};const nO=tO;function rO(e){return rO="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},rO(e)}function oO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iO(e,t){return iO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},iO(e,t)}function aO(e,t){if(t&&("object"===rO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sO(e)}function sO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cO(e){return cO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},cO(e)}var lO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=cO(r);if(o){var n=cO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return aO(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onClick=t.onClick.bind(sO(t)),t.state={isWatched:t.props.isWatched},t}return t=a,(n=[{key:"onClick",value:function(){$.ajax({type:"POST",url:"/api/social/watch",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:!this.state.isWatched}),dataType:"json",context:this}).done((function(e,t,n){this.setState({isWatched:e.value}),null!=e.result&&e.result>=0&&this.props.onChange("watch",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e="project-action btn-link watch".concat(this.state.isWatched?" active":"");return c().createElement("button",{type:"button",className:e,onClick:this.onClick},"Watch")}}])&&oO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function uO(e){return uO="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},uO(e)}function fO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hO(e,t){return hO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},hO(e,t)}function dO(e,t){if(t&&("object"===uO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function yO(e){return yO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},yO(e)}lO.propTypes={consumer:p().string.isRequired,id:p().number.isRequired,isWatched:p().bool},lO.defaultProps={isWatched:!1};var mO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yO(r);if(o){var n=yO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return dO(this,e)});function a(){return fO(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return c().createElement("span",{key:t,className:"tag category"},c().createElement("a",{href:e.value},e.text))}));return c().createElement("div",null,c().createElement("h4",null,TFWeb.Resources.UI.Categories),c().createElement("div",{className:"tags"},e))}}])&&pO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);mO.propTypes={list:p().array,path:p().string.isRequired},mO.defaultProps={list:[]};const vO=mO;function bO(e){return bO="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},bO(e)}function gO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function EO(e,t){return EO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},EO(e,t)}function SO(e,t){if(t&&("object"===bO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function OO(e){return OO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},OO(e)}var _O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=OO(r);if(o){var n=OO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return SO(this,e)});function a(){return gO(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this,t=this.props.list.map((function(t,n){if(e.props.path){var r="".concat(e.props.path,"?tags=").concat(encodeURIComponent(t));return c().createElement("span",{key:n,className:"tag"},c().createElement("a",{href:r},t))}return c().createElement("span",{key:n,className:"tag"},t)})),n=null!=this.props.label&&"undefined"!=this.props.label?this.props.label:TFWeb.Resources.UI.Tags;return c().createElement("div",null,c().createElement("h4",null,n),c().createElement("div",{className:"tags"},t))}}])&&wO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);_O.propTypes={list:p().array,path:p().string,label:p().string},_O.defaultProps={list:[]};const kO=_O;function CO(e){return CO="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},CO(e)}function PO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jO(e,t){return jO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jO(e,t)}function TO(e,t){if(t&&("object"===CO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return xO(e)}function xO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RO(e){return RO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},RO(e)}var DO=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jO(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=RO(r);if(o){var n=RO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return TO(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).initValue=t.initValue.bind(xO(t)),t.validate=t.validate.bind(xO(t)),t.valid=t.valid.bind(xO(t)),t.getValue=t.getValue.bind(xO(t)),t.setValue=t.setValue.bind(xO(t)),t.onChange=t.onChange.bind(xO(t)),t.handleFocus=t.handleFocus.bind(xO(t)),t.handleBlur=t.handleBlur.bind(xO(t)),t.changeLocale=t.changeLocale.bind(xO(t)),t.state={currentCulture:Object.keys(TFGlobal.cultures)[0],value:t.initValue(t.props.value),validate:!1,isValid:!0,showValidation:!1},t}return t=a,n=[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.value!==this.state.value&&this.setState({value:e.value})}},{key:"initValue",value:function(e){var t=null!=e?e:{};return Object.keys(TFGlobal.cultures).forEach((function(e){t.hasOwnProperty(e)||(t[e]="")})),t}},{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value.en}},{key:"getValue",value:function(){var e=JSON.parse(JSON.stringify(this.state.value));return Object.keys(e).forEach((function(t){""==e[t]&&delete e[t]})),e}},{key:"setValue",value:function(e){var t=this.initValue(e);this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=JSON.parse(JSON.stringify(this.state.value));n[this.state.currentCulture]=e.target.value,this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(e.target.value)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"changeLocale",value:function(e){this.setState({currentCulture:e})}},{key:"render",value:function(){var e=this,t="localized-string-editor form-group";!0!==this.state.showValidation||this.state.isValid||(t+=" has-error");var n=null;!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(n=c().createElement(gi,{message:this.props.helpMessage})):n=c().createElement(gi,{message:this.props.requiredErrorMessage});var r,o=Object.keys(TFGlobal.cultures).map((function(t,n){var r=t==e.state.currentCulture?"active":"";return""!=e.state.value[t]&&(r+=" hasText"),c().createElement("li",{key:n},c().createElement("a",{onClick:e.changeLocale.bind(null,t),className:r},TFGlobal.cultures[t]))}));return r=1==this.props.rows?c().createElement("input",{name:this.props.name,value:this.state.value[this.state.currentCulture],placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}):c().createElement("textarea",{name:this.props.name,type:"text",rows:this.props.rows,value:this.state.value[this.state.currentCulture],placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),c().createElement("div",{className:t},c().createElement("label",{className:"dynamic",htmlFor:this.props.name},this.props.label),c().createElement("div",null,r,c().createElement("ul",null,o)),n,this.props.children)}}],n&&PO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);DO.propTypes={value:p().object,rows:p().number,name:p().string,label:p().string,placeholder:p().string,helpMessage:p().string,required:p().bool,requiredErrorMessage:p().string,onChange:p().func},DO.defaultProps={rows:5,required:!1,requiredErrorMessage:"input required."};const NO=DO;function MO(e){return MO="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},MO(e)}function IO(){return IO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IO.apply(this,arguments)}function AO(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function BO(e,t,n){return t&&LO(e.prototype,t),n&&LO(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function FO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&UO(e,t)}function UO(e,t){return UO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},UO(e,t)}function KO(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=zO(e);if(t){var o=zO(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return qO(this,n)}}function qO(e,t){if(t&&("object"===MO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return VO(e)}function VO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zO(e){return zO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},zO(e)}var WO=function(e){FO(n,e);var t=KO(n);function n(e){var r;return AO(this,n),(r=t.call(this,e)).validate=r.validate.bind(VO(r)),r.valid=r.valid.bind(VO(r)),r.getTags=r.getTags.bind(VO(r)),r.updateTags=r.updateTags.bind(VO(r)),r.onDelete=r.onDelete.bind(VO(r)),r.getTagIndex=r.getTagIndex.bind(VO(r)),r.handleKeyDown=r.handleKeyDown.bind(VO(r)),r.setInputWidth=r.setInputWidth.bind(VO(r)),r.resetInput=r.resetInput.bind(VO(r)),r.onBlur=r.onBlur.bind(VO(r)),r.handleGroupFocus=r.handleGroupFocus.bind(VO(r)),r.handleGroupBlur=r.handleGroupBlur.bind(VO(r)),r.inputDefaultLength=16,r.inputCharWidth=8,r.state={tags:r.props.tags?r.props.tags:[],highlightIndex:null,inputWidth:r.inputDefaultLength*r.inputCharWidth,validate:!1,isValid:!0===r.props.required&&null!=r.props.tags&&r.props.tags.length>0,showValidation:!1,hasFocus:!1},r}return BO(n,[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.tags&&this.state.tags.length>0}},{key:"getTags",value:function(){return this.state.tags}},{key:"updateTags",value:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];-1==this.state.tags.indexOf(r)&&t.push(r)}if(t.length>0){var o=this.state.tags.concat(t);this.setState({tags:o})}}},{key:"onDelete",value:function(e){var t=this.state.tags;t.splice(e,1),this.setState({tags:t,isValid:this.valid()})}},{key:"getTagIndex",value:function(e){for(var t=0;t<this.state.tags.length;t++)if(this.state.tags[t].toLowerCase()==e.toLowerCase())return t;return null}},{key:"handleKeyDown",value:function(e){var t=this,n=this.refs.input.value;if(188==e.keyCode){e.preventDefault();var r=this.getTagIndex(n);if(null==r){var o=this.state.tags;o.push(n),this.setState({tags:o,isValid:this.valid()}),this.resetInput()}else this.setState({highlightIndex:r}),this.setInputWidth(n.length),setTimeout((function(){t.setState({highlightIndex:null})}),1e3)}else 27==e.keyCode?(e.preventDefault(),this.resetInput()):this.setInputWidth(n.length)}},{key:"setInputWidth",value:function(e){if(e>this.inputDefaultLength){var t=e*this.inputCharWidth;t>this.state.inputWidth&&this.setState({inputWidth:t})}}},{key:"resetInput",value:function(){this.setState({inputWidth:this.inputDefaultLength*this.inputCharWidth}),this.refs.input.value=""}},{key:"onBlur",value:function(){this.resetInput()}},{key:"handleGroupFocus",value:function(){this.setState({hasFocus:!0})}},{key:"handleGroupBlur",value:function(){this.setState({hasFocus:!1})}},{key:"render",value:function(){var e=this,t=this.state.tags.map((function(t,n){var r="";return e.state.highlightIndex==n&&(r+="highlight"),c().createElement(HO,{key:t,className:r,data:t,onDelete:e.onDelete.bind(null,n)})})),n={style:{width:this.state.inputWidth}},r="tag-editor form-group";!0!==this.state.showValidation||this.state.isValid?!0===this.state.hasFocus&&(r+=" has-focus"):r+=" has-error";var o="active";!0===this.props.required&&(o+=" required");var i=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(i=c().createElement(gi,{message:this.props.helpMessage})):i=c().createElement(gi,{message:this.props.requiredErrorMessage}),c().createElement("div",{className:r,onFocus:this.handleGroupFocus,onBlur:this.handleGroupBlur},this.props.label&&c().createElement("label",{className:o},this.props.label),c().createElement("div",null,t,c().createElement("input",IO({type:"text",ref:"input",placeholder:this.props.placeholder,onKeyDown:this.handleKeyDown,onBlur:this.onBlur},n))),i)}}]),n}(c().Component);WO.propTypes={tags:p().array,label:p().string,placeholder:p().string,helpMessage:p().string,required:p().bool,requiredErrorMessage:p().string},WO.defaultProps={label:"Tags",placeholder:"Add New Tag...",helpMessage:"Enter tags separated by a comma.",required:!1,requiredErrorMessage:"At least one item is required"};var HO=function(e){FO(n,e);var t=KO(n);function n(){return AO(this,n),t.apply(this,arguments)}return BO(n,[{key:"render",value:function(){return c().createElement("span",{className:this.props.className},this.props.data," ",c().createElement("button",{type:"button",className:"close",onClick:this.props.onDelete},c().createElement("span",null,"×")))}}]),n}(c().Component);const $O=WO;function JO(e){return JO="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},JO(e)}function GO(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function QO(e,t){return QO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},QO(e,t)}function YO(e,t){if(t&&("object"===JO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return XO(e)}function XO(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZO(e){return ZO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ZO(e)}const e_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&QO(e,t)}(s,e);var t,n,r,o,i=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ZO(r);if(o){var n=ZO(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return YO(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=i.call(this,e)).setup=t.setup.bind(XO(t)),t.handleCancel=t.handleCancel.bind(XO(t)),t.handleSubmit=t.handleSubmit.bind(XO(t)),t.form=null,t.state={loadStatus:a.LoadStatus.PreLoad},t}return t=s,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/project/"+this.props.id).done((function(t,n,r){e.form=t,e.setState({loadStatus:a.LoadStatus.Loaded})}))}},{key:"handleCancel",value:function(){this.props.onCancel()}},{key:"handleSubmit",value:function(){this.refs.titleLocalizations.validate()&&this.refs.product.validate()&&this.refs.category.validate()&&(this.form.titleLocalizations=this.refs.titleLocalizations.getValue(),this.form.descriptionLocalizations=this.refs.descriptionLocalizations.getValue(),this.form.productData=this.refs.product.getSelectedOptions(),this.form.categoryData=this.refs.category.getSelectedOptions(),this.form.tagData=this.refs.tags.getTags(),$.ajax({type:"POST",url:"/admintia/api/project/"+this.props.id,data:this.form,dataType:"json",context:this}).done((function(e,t,n){window.location.replace(e.data.url)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})))}},{key:"render",value:function(){return this.state.loadStatus!=a.LoadStatus.Loaded?c().createElement(On,null):c().createElement("div",{className:"clearfix"},c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12",style:{marginBottom:"20px"}},c().createElement(NO,{ref:"titleLocalizations",label:"Title",placeholder:"Name your project...",value:this.form.titleLocalizations,rows:1,required:!0,requiredErrorMessage:"English title required at minimum."})),c().createElement("div",{className:"col-md-12"},c().createElement(NO,{ref:"descriptionLocalizations",label:"Project Description",placeholder:"Project description...",value:this.form.descriptionLocalizations,rows:10,required:!1,requiredErrorMessage:"English description required at minimum."})),c().createElement("div",{className:"col-md-6"},c().createElement(Di,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.form.productData})),c().createElement("div",{className:"col-md-6"},c().createElement(Di,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.form.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.form.categoryData})),c().createElement("div",{className:"col-md-12"},c().createElement($O,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.form.tagData}))),c().createElement("ul",{className:"list-inline pull-right"},c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Submit"))))}}])&&GO(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(c().Component);function t_(e){return t_="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},t_(e)}function n_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r_(e,t){return r_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r_(e,t)}function o_(e,t){if(t&&("object"===t_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i_(e)}function i_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a_(e){return a_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a_(e)}const s_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=a_(r);if(o){var n=a_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return o_(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(i_(t)),t.handleEditClick=t.handleEditClick.bind(i_(t)),t.handleEditCancel=t.handleEditCancel.bind(i_(t)),t.handleEditComplete=t.handleEditComplete.bind(i_(t)),t.state={showPanel:!1,showEdit:!1,showSpam:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/project/").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(){this.setState({showEdit:!1})}},{key:"render",value:function(){return c().createElement("div",{className:"topic-editor clearfix"},c().createElement("ul",{className:"list-inline"},c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-small",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Project")),this.props.project.viewer.eMessage&&c().createElement("li",{className:"emessage"},this.props.project.viewer.eMessage)),this.state.showEdit&&c().createElement(e_,{id:this.props.project.id,onCancel:this.handleEditCancel}))}}])&&n_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function c_(e){return c_="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},c_(e)}function l_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u_(e,t){return u_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u_(e,t)}function f_(e,t){if(t&&("object"===c_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p_(e)}function p_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h_(e){return h_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h_(e)}var d_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=h_(r);if(o){var n=h_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return f_(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onMetricsChange=t.onMetricsChange.bind(p_(t)),t.state={metrics:t.props.project.metrics},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=[];e.content.forEach((function(e,n){t.push(c().createElement(mm,{key:e.id,content:e}))}),this);var n=null;if(!0===this.props.isSignedIn){var r=!1;null!=e.viewer.actions&&(null!=e.viewer.actions.like&&(r=e.viewer.actions.like.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),n=[],!1===e.viewer.isOwner&&n.push(c().createElement(nO,{key:0,consumer:"Project",id:e.id,isLiked:r,onChange:this.onMetricsChange}))}var o=null;return!0===e.isFeatured?o=c().createElement("h3",null,c().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(o=c().createElement("h3",null,"Work in progress")),c().createElement("div",null,c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("div",{className:"row-wrapper"},o,c().createElement("h2",{dangerouslySetInnerHTML:mn.createMarkup(e.title)}),c().createElement(qo,{profile:e.profile}),c().createElement("div",{className:"hero-meta clearfix"},n,c().createElement($l,null),c().createElement("time",null,"Published ",e.publishedDT),c().createElement(Qr,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&c().createElement(s_,{project:e})))),c().createElement("div",{className:"portfolio-project-gallery"},t),c().createElement("div",{className:"project-info-block"},c().createElement("div",{className:"project-info-container clearfix"},c().createElement("div",{className:"project-info-block-section"},c().createElement("h4",null,"Project info"),c().createElement("div",{className:"description",dangerouslySetInnerHTML:mn.createMarkup(e.description)})),c().createElement("div",{className:"project-info-block-section"},c().createElement(vO,{list:e.categories,path:this.props.filterPath}),c().createElement(kO,{list:e.tags,path:this.props.filterPath}),c().createElement(ES,{list:e.products,path:this.props.filterPath})))))}}])&&l_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);d_.propTypes={project:p().object,isSignedIn:p().bool,filterPath:p().string},d_.defaultProps={isSignedIn:!1,filterPath:"/explore"};const y_=d_;function m_(e){return m_="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},m_(e)}function v_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b_(e,t){return b_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b_(e,t)}function g_(e,t){if(t&&("object"===m_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return w_(e)}function w_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E_(e){return E_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E_(e)}var S_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=E_(r);if(o){var n=E_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return g_(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getData=t.getData.bind(w_(t)),t.state={hasLoaded:!1,collections:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){null!=this.props.projectID&&this.getData()}},{key:"getData",value:function(){var e=this;$.getJSON("/api/playlist/containing/"+this.props.projectID).done((function(t,n,r){e.setState({hasLoaded:!0,collections:t.collections})})).fail((function(e,t,n){}))}},{key:"render",value:function(){if(!1===this.state.hasLoaded||!0===this.state.hasLoaded&&null===this.state.collections)return null;var e=this.state.collections.map((function(e,t){return c().createElement(Fs,{key:e.id,collection:e})}));return c().createElement("div",{className:"subsection project"},c().createElement("div",{className:"subsection-intro"},c().createElement("h3",null,"Courses and Playlists containing this video")),c().createElement("div",{className:"content-section"},c().createElement(Rs,null,c().createElement("div",null,e))))}}])&&v_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);S_.propTypes={projectID:p().number};const O_=S_;function __(e){return __="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},__(e)}function k_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function C_(e,t){return C_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},C_(e,t)}function P_(e,t){if(t&&("object"===__(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return j_(e)}function j_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T_(e){return T_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},T_(e)}var x_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&C_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=T_(r);if(o){var n=T_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return P_(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onMetricsChange=t.onMetricsChange.bind(j_(t)),t.state={metrics:t.props.project.metrics},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=null;if(!0===this.props.isSignedIn){var n=!1;null!=e.viewer.actions&&(null!=e.viewer.actions.like&&(n=e.viewer.actions.like.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),t=[],!1===this.props.project.viewer.isOwner&&t.push(c().createElement(nO,{key:0,consumer:"Project",id:e.id,isLiked:n,onChange:this.onMetricsChange}))}var r=null;return!0===e.isFeatured?r=c().createElement("h3",null,c().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(r=c().createElement("h3",null,"Work in progress")),c().createElement("div",null,c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("div",{className:"row-wrapper"},r,c().createElement("h2",{dangerouslySetInnerHTML:mn.createMarkup(e.title)}),c().createElement(qo,{profile:e.profile}),c().createElement("div",{className:"hero-meta clearfix"},t,c().createElement($l,null),c().createElement("time",null,"Published ",e.publishedDT),c().createElement(Qr,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&c().createElement(s_,{project:e})))),c().createElement("div",{className:"training-project-gallery"},c().createElement(mm,{display:"hero",content:e.content[0]})),c().createElement("div",{className:"project-info-block"},c().createElement("div",{className:"project-info-container clearfix"},c().createElement("div",{className:"project-info-block-section"},c().createElement("h4",null,"Project info"),c().createElement("div",{className:"description",dangerouslySetInnerHTML:mn.createMarkup(e.description)})),c().createElement("div",{className:"project-info-block-section"},c().createElement(vO,{list:e.categories,path:this.props.filterPath}),c().createElement(kO,{list:e.tags,path:this.props.filterPath}),c().createElement(ES,{list:e.products,path:this.props.filterPath})))),c().createElement(O_,{projectID:e.id}))}}])&&k_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);x_.propTypes={project:p().object,isSignedIn:p().bool,filterPath:p().string},x_.defaultProps={isSignedIn:!1,filterPath:"/watch"};const R_=x_;function D_(e){return D_="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_(e)}function N_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function M_(e,t){return M_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},M_(e,t)}function I_(e,t){if(t&&("object"===D_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function A_(e){return A_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A_(e)}var L_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=A_(r);if(o){var n=A_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return I_(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=i.call(this,e),e=Object.assign({},e),t.state={uniqueness:(Math.random()+"").replace(".",""),value:e.value||0,stars:[],halfStar:{at:Math.floor(e.value),hidden:e.half&&e.value%1<.5}},t.state.config={count:e.count,size:e.size,char:e.char,color1:e.color1,color2:e.color2,half:e.half,edit:e.edit},t}return t=a,n=[{key:"componentDidMount",value:function(){this.setState({stars:this.getStars(this.state.value)})}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({stars:this.getStars(e.value),value:e.value,halfStar:{at:Math.floor(e.value),hidden:this.state.config.half&&e.value%1<.5}})}},{key:"isDecimal",value:function(e){return e%1!=0}},{key:"getRate",value:function(){return this.state.config.half?Math.floor(this.state.value):Math.round(this.state.value)}},{key:"getStars",value:function(e){void 0===e&&(e=this.getRate());for(var t=[],n=0;n<this.state.config.count;n++)t.push({active:n<=e-1});return t}},{key:"mouseOver",value:function(e){var t=this.state,n=t.config,r=t.halfStar;if(n.edit){var o=Number(e.target.getAttribute("data-index"));if(n.half){var i=this.moreThanHalf(e,n.size);r.hidden=i,i&&(o+=1),r.at=o}else o+=1;this.setState({stars:this.getStars(o)})}}},{key:"moreThanHalf",value:function(e,t){var n=e.target,r=e.clientX-n.getBoundingClientRect().left;return(r=Math.round(Math.abs(r)))>t/2}},{key:"mouseLeave",value:function(){var e=this.state,t=e.value,n=e.halfStar,r=e.config;r.edit&&(r.half&&(n.hidden=!this.isDecimal(t),n.at=Math.floor(this.state.value)),this.setState({stars:this.getStars()}))}},{key:"clicked",value:function(e){var t=this.state,n=t.config,r=t.halfStar;if(n.edit){var o,i=Number(e.target.getAttribute("data-index"));if(n.half){var a=this.moreThanHalf(e,n.size);r.hidden=a,a&&(i+=1),o=a?i:i+.5,r.at=i}else o=i+=1;this.setState({value:o,stars:this.getStars(i)}),this.props.onChange(o)}}},{key:"renderHalfStarStyleElement",value:function(){var e=this.state,t=e.config,n=e.uniqueness;return c().createElement("style",{dangerouslySetInnerHTML:{__html:U_(t.color2,n)}})}},{key:"renderStars",value:function(){var e=this,t=this.state,n=t.halfStar,r=t.stars,o=t.uniqueness,i=t.config,a=i.color1,s=i.color2,l=i.size,u=i.char,f=i.half,p=i.edit;return r.map((function(t,r){var i="";f&&!n.hidden&&n.at===r&&(i="react-stars-".concat(o));var h=Object.assign({},F_,{color:t.active?s:a,cursor:p?"pointer":"default",fontSize:"".concat(l,"px")});return c().createElement("span",{className:i,style:h,key:r,"data-index":r,"data-forhalf":u,onMouseOver:e.mouseOver.bind(e),onMouseMove:e.mouseOver.bind(e),onMouseLeave:e.mouseLeave.bind(e),onClick:e.clicked.bind(e)},u)}))}},{key:"render",value:function(){var e=this.props.className;return c().createElement("span",{className:e,style:B_},this.state.config.half?this.renderHalfStarStyleElement():"",this.renderStars())}}],n&&N_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);L_.propTypes={className:p().string,edit:p().bool,half:p().bool,value:p().number,count:p().number,char:p().string,size:p().number,color1:p().string,color2:p().string},L_.defaultProps={edit:!0,half:!0,value:0,count:5,char:"★",size:15,color1:"gray",color2:"#ffd700",onChange:function(){}};var B_={overflow:"hidden",position:"relative"},F_={position:"relative",overflow:"hidden",cursor:"pointer",display:"block",float:"left"},U_=function(e,t){return"\n    .react-stars-".concat(t,":before {\n      position: absolute;\n      overflow: hidden;\n      display: block;\n      z-index: 1;\n      top: 0; left: 0;\n      width: 50%;\n      content: attr(data-forhalf);\n      color: ").concat(e,";\n  }")};const K_=L_;function q_(e){return q_="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},q_(e)}function V_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z_(e,t){return z_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},z_(e,t)}function W_(e,t){if(t&&("object"===q_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return H_(e)}function H_(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $_(e){return $_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$_(e)}var J_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&z_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=$_(r);if(o){var n=$_(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return W_(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onChange=t.onChange.bind(H_(t)),t.state={rating:t.props.rating},t}return t=a,(n=[{key:"onChange",value:function(e){$.ajax({type:"POST",url:"/api/social/rate/",contentType:"application/json; charset=utf-8",data:JSON.stringify({type:this.props.consumer,id:this.props.id,value:e}),dataType:"json",context:this}).done((function(e,t,n){this.setState({rating:e.value}),null!=e.result&&e.result>=0&&this.props.onChange&&this.props.onChange("rating",e.result)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){return c().createElement(K_,{className:"rate",value:this.state.rating,onChange:this.onChange,count:5,half:!1,size:24,color1:"rgba(255,255,255,.5)",color2:"#FCB434"})}}])&&V_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);J_.propTypes={consumer:p().string.isRequired,id:p().number.isRequired,rating:p().number,onChange:p().func},J_.defaultProps={rating:null};const G_=J_;function Q_(e){return Q_="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},Q_(e)}function Y_(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function X_(e,t){return X_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},X_(e,t)}function Z_(e,t){if(t&&("object"===Q_(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ek(e)}function ek(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tk(e){return tk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},tk(e)}const nk=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X_(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=tk(r);if(o){var n=tk(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Z_(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onAction=t.onAction.bind(ek(t)),t.state={hasLoaded:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){var e=this;$.getJSON("/api/legal/agreement/".concat(this.props.license)).done((function(t,n,r){e.title=t.title,e.text=t.text,e.setState({hasLoaded:!0})})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"onAction",value:function(e){!0===e?$.ajax({type:"POST",url:"/api/legal/agreement/".concat(this.props.license),contentType:"application/json; charset=utf-8",data:JSON.stringify({agree:e}),dataType:"json",context:this}).done((function(t,n,r){this.props.onAction(this.props.license,e,t)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)})):this.props.onAction(e,null)}},{key:"render",value:function(){return this.state.hasLoaded?c().createElement("div",{className:"license-agreement"},c().createElement("h1",null,this.title),c().createElement("div",{className:"license-view"},c().createElement("div",{dangerouslySetInnerHTML:mn.createMarkup(this.text)})),c().createElement("div",{style:{textAlign:"right"}},c().createElement("button",{onClick:this.onAction.bind(null,!1)},"Cancel"),c().createElement("button",{onClick:this.onAction.bind(null,!0)},"I Agree"))):null}}])&&Y_(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function rk(e){return rk="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},rk(e)}function ok(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ik(e,t){return ik=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ik(e,t)}function ak(e,t){if(t&&("object"===rk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sk(e)}function sk(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ck(e){return ck=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ck(e)}var lk=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ik(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ck(r);if(o){var n=ck(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ak(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getTOS=t.getTOS.bind(sk(t)),t.addToCart=t.addToCart.bind(sk(t)),t.onDownload=t.onDownload.bind(sk(t)),t.handleTOS=t.handleTOS.bind(sk(t)),t.closeTOS=t.closeTOS.bind(sk(t)),t.DownloadType={Download:1,Cart:2},t.download=null,t.tos=[],t.state={showTOS:!1,tos:null},t}return t=a,n=[{key:"getTOS",value:function(e){}},{key:"addToCart",value:function(e){var t=this.props.list[e];if(null==t.viewer.licenseAgreement)return this.download={type:this.DownloadType.Cart,index:e,format:null},this.setState({showTOS:!0,tos:t.license}),!1;this.refs.cart.addToCart(t.data)}},{key:"onDownload",value:function(e,t){var n=this.props.list[e];if(null==n.viewer.licenseAgreement)return this.download={type:this.DownloadType.Download,index:e,format:t},this.setState({showTOS:!0,tos:n.license}),!1;var r="/share/".concat(this.props.projectID,"/content/").concat(n.data,"/download");null!=t&&(r+="?format=".concat(t)),window.location.replace(r)}},{key:"handleTOS",value:function(e,t,n){for(var r=this,o=0;o<=this.props.list.length-1;o++)this.props.list[o].license==e&&(this.props.list[o].viewer.licenseAgreement=n);this.setState({showTOS:!1,tos:null},(function(){if(t&&null!=r.download)switch(r.download.type){case r.DownloadType.Download:r.onDownload(r.download.index,r.download.format);break;case r.DownloadType.Cart:r.addToCart(r.download.index)}}))}},{key:"closeTOS",value:function(){!0===this.state.showTOS&&this.setState({showTOS:!1})}},{key:"render",value:function(){var e=[];return this.props.list.forEach((function(t,n){var r=[];if(this.props.viewer.isSignedIn||this.props.viewer.isDassault){var o,i=t.format;"ModoPackage"===t.format&&(i="Modo Package (.lpk)",o=c().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.onDownload.bind(null,n,"zip")},"Download as Zip")),r.push(c().createElement("li",{key:"d"},c().createElement("button",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.onDownload.bind(null,n,null)},"Download ",i),o)),this.props.viewer.isSignedIn&&r.push(c().createElement("li",{key:"c"},c().createElement("button",{type:"button",className:"button btn-small",onClick:this.addToCart.bind(null,n)},"Add to Download Cart")))}else r=c().createElement("li",null,c().createElement("a",{href:this.props.viewer.signInUrl,className:"button btn-small icon icon-after icon-download"},"Sign in to download"));e.push(c().createElement(Aw,{key:t.id,content:t},c().createElement("ul",{className:"files"},r)))}),this),c().createElement("div",{style:{position:"relative"}},c().createElement("h4",{className:"clearfix"},"Downloads ",!0===this.props.viewer.isSignedIn&&c().createElement(Gw,{ref:"cart",inline:!0})),c().createElement("div",{className:"share-downloads"},e),this.state.showTOS&&c().createElement(B,{closeOnEsc:!0,closeOnOutsideClick:!0,showClose:!1,onClose:this.closeTOS,contentStyle:{backgroundColor:"white",padding:"40px"}},c().createElement(nk,{id:6,license:this.state.tos,onAction:this.handleTOS})))}}],n&&ok(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);lk.propTypes={projectID:p().number,list:p().array,viewer:p().object};const uk=lk;function fk(e){return fk="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},fk(e)}function pk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dk(e,t){return dk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},dk(e,t)}function yk(e,t){if(t&&("object"===fk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function mk(e){return mk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},mk(e)}var vk=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dk(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=mk(r);if(o){var n=mk(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return yk(this,e)});function a(){return pk(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(null==this.props.licenses||0==this.props.licenses.length)return null;var e=[];return this.props.licenses.forEach((function(t,n){var r="";for(n=0;n<t.entities.length;n++)n>0&&(n<t.entities.length-1?r+=", ":n==t.entities.length-1&&(r+=" & ")),r+=t.entities[n];e.push(c().createElement("li",{key:n},c().createElement("span",null,r)," ",t.entities.length>1?"are":"is"," shared under the ",c().createElement("a",{href:t.url},t.title)," license."))})),c().createElement("ul",{className:"license-smalltext-view"},e)}}])&&hk(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);vk.propTypes={licenses:p().array};const bk=vk;function gk(e){return gk="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},gk(e)}function wk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ek(e,t){return Ek=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ek(e,t)}function Sk(e,t){if(t&&("object"===gk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ok(e)}function Ok(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _k(e){return _k=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_k(e)}var kk=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ek(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_k(r);if(o){var n=_k(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Sk(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onMetricsChange=t.onMetricsChange.bind(Ok(t)),t.state={metrics:t.props.project.metrics},t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"render",value:function(){var e=this.props.project,t=null;if(!0===e.viewer.isSignedIn){var n=null;null!=e.viewer.actions&&(null!=e.viewer.actions.rate&&(n=e.viewer.actions.rate.value),null!=e.viewer.actions.watch&&e.viewer.actions.watch.value),t=[],!1===e.viewer.isOwner&&t.push(c().createElement(G_,{key:0,consumer:"Project",id:e.id,rating:n}))}var r=null;return!0===e.isFeatured?r=c().createElement("h3",null,c().createElement("span",{className:"featured"},"Featured")):"WorkInProgress"===e.completionStatus&&(r=c().createElement("h3",null,"Work in progress")),c().createElement("div",null,c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("div",{className:"row-wrapper"},r,c().createElement("h2",{dangerouslySetInnerHTML:mn.createMarkup(e.title)}),c().createElement(qo,{profile:e.profile}),c().createElement("div",{className:"hero-meta clearfix"},t,c().createElement($l,null),c().createElement("time",null,"Published ",e.publishedDT),c().createElement(Qr,{metrics:this.state.metrics,displayClass:"light"})),e.viewer.e&&c().createElement(s_,{project:e})))),c().createElement("div",{className:"project-info-block"},c().createElement("div",{className:"project-info-container clearfix"},c().createElement("div",{className:"project-info-block-section"},c().createElement(_m,{gallery:e.gallery,style:{marginBottom:"20px"},dataUrl:"/api/project/".concat(e.id,"/content/{0}")})),c().createElement("div",{className:"project-info-block-section"},c().createElement("h4",null,"Project info"),c().createElement("div",{className:"description",dangerouslySetInnerHTML:mn.createMarkup(e.description)}),c().createElement(uk,{list:e.content,projectID:e.id,viewer:e.viewer}),c().createElement(vO,{list:e.categories,path:this.props.filterPath}),c().createElement(kO,{list:e.tags,path:this.props.filterPath}),c().createElement(ES,{list:e.products,path:this.props.filterPath}),c().createElement(bk,{licenses:e.licenses})))))}}])&&wk(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);kk.propTypes={project:p().object,filterPath:p().string},kk.defaultProps={filterPath:"/share"};const Ck=kk;function Pk(e){return Pk="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},Pk(e)}function jk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Tk(e,t){return Tk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Tk(e,t)}function xk(e,t){if(t&&("object"===Pk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Rk(e)}function Rk(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dk(e){return Dk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Dk(e)}var Nk=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tk(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Dk(r);if(o){var n=Dk(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return xk(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleTabClick=t.handleTabClick.bind(Rk(t)),t.setTab=t.setTab.bind(Rk(t)),t.state={selectedIndex:t.props.selectedIndex},t}return t=a,(n=[{key:"handleTabClick",value:function(e,t){t.preventDefault(),t.stopPropagation(),this.setTab(e)}},{key:"setTab",value:function(e){this.setState({selectedIndex:e})}},{key:"render",value:function(){var e=this,t=[];if(Array.isArray(this.props.children))for(var n=0;n<this.props.children.length;n++)this.props.children[n].props.visible&&t.push(this.props.children[n]);else t.push(this.props.children);return c().createElement("div",{className:this.props.className},c().createElement("ul",{className:"tftabs"},t.map((function(n,r){if(n.props.visible){var o="".concat(e.state.selectedIndex==r?"selected":"");return c().createElement("li",{key:r,className:1==t.length?"single":""},c().createElement("a",{href:"#",className:o,onClick:e.handleTabClick.bind(null,r)},n.props.label))}}))),t[this.state.selectedIndex])}}])&&jk(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Nk.propTypes={selectedIndex:p().number,children:p().oneOfType([p().array,p().element]).isRequired,className:p().string},Nk.defaultProps={selectedIndex:0,className:""};const Mk=Nk;function Ik(e){return Ik="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},Ik(e)}function Ak(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bk(e,t){return Bk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bk(e,t)}function Fk(e,t){if(t&&("object"===Ik(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Uk(e){return Uk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Uk(e)}var Kk=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bk(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Uk(r);if(o){var n=Uk(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Fk(this,e)});function a(){return Ak(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"tftabs-panel"},this.props.children)}}])&&Lk(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Kk.propTypes={label:p().string.isRequired,children:p().node.isRequired},Kk.defaultProps={visible:!0};const qk=Kk;function Vk(e){return Vk="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},Vk(e)}function zk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wk(e,t){return Wk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Wk(e,t)}function Hk(e,t){if(t&&("object"===Vk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return $k(e)}function $k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jk(e){return Jk=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Jk(e)}var Gk=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wk(e,t)}(s,e);var t,n,r,o,i=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Jk(r);if(o){var n=Jk(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Hk(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=i.call(this,e)).setup=t.setup.bind($k(t)),t.handleCancel=t.handleCancel.bind($k(t)),t.handleSubmit=t.handleSubmit.bind($k(t)),t.onCourseTypeChange=t.onCourseTypeChange.bind($k(t)),t.state={form:t.props.form?t.props.form:null,loadStatus:t.props.form?a.LoadStatus.Loaded:a.LoadStatus.PreLoad},t}return t=s,(n=[{key:"componentDidMount",value:function(){null==this.state.form&&this.setup()}},{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.form!==this.state.form&&this.setState({form:e.form})}},{key:"setup",value:function(){var e=this;$.getJSON("/admintia/api/collection/"+this.props.id).done((function(t,n,r){e.setState({form:t,loadStatus:a.LoadStatus.Loaded})}))}},{key:"handleCancel",value:function(){this.props.onCancel&&this.props.onCancel()}},{key:"handleSubmit",value:function(){var e=this;if(this.refs.titleLocalizations.validate()){var t={courseType:this.refs.courseType.getValue(),titleLocalizations:this.refs.titleLocalizations.getValue(),coverDescriptionLocalizations:this.refs.coverDescriptionLocalizations.getValue(),descriptionLocalizations:this.refs.descriptionLocalizations.getValue(),productData:this.refs.product.getSelectedOptions(),categoryData:this.refs.category.getSelectedOptions(),tagData:this.refs.tags.getTags()};$.ajax({type:"POST",url:"/admintia/api/collection/"+this.props.id,data:t,dataType:"json",context:this}).done((function(t,n,r){e.props.onSubmit&&e.props.onSubmit(t.data.form),alerts.success("updated")})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}}},{key:"onCourseTypeChange",value:function(e){var t=JSON.parse(JSON.stringify(this.state.form));t.courseType=e,this.setState({form:t})}},{key:"render",value:function(){if(this.state.loadStatus!=a.LoadStatus.Loaded)return c().createElement(On,null);var e=10,t="Full Description",n="Full (overview) description...";switch(this.state.form.courseType){case"Article":e=30,t="Article Body",n="Article body...";break;case"Link":e=1,t="Target Url",n="Target url the course card will link to (absolute url, not relative)..."}return c().createElement("div",{className:"admin-collection-form clearfix"},c().createElement("div",{className:"row",style:{marginBottom:"20px",borderBottom:"1px solid #EEE"}},c().createElement("div",{className:"col-md-12"},c().createElement(ug,{ref:"courseType",name:"courseType",label:"Course Type",options:this.state.form.courseTypeOptions,value:this.state.form.courseType,onChange:this.onCourseTypeChange}))),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement(NO,{ref:"titleLocalizations",label:"Title",placeholder:"Name your collection...",value:this.state.form.titleLocalizations,rows:1,required:!0,requiredErrorMessage:"English title required at minimum."}))),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement(NO,{ref:"coverDescriptionLocalizations",label:"Cover Description",placeholder:"Cover (simple) description...",value:this.state.form.coverDescriptionLocalizations,rows:5,required:!1,requiredErrorMessage:"English cover description required at minimum."}))),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement(NO,{ref:"descriptionLocalizations",label:t,placeholder:n,value:this.state.form.descriptionLocalizations,rows:e,required:!1,requiredErrorMessage:"English description required at minimum."}))),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-6"},c().createElement(Di,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!1,options:this.state.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.state.form.productData})),c().createElement("div",{className:"col-md-6"},c().createElement(Di,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!1,options:this.state.form.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.state.form.categoryData}))),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement($O,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.state.form.tagData}))),c().createElement("ul",{className:"list-inline pull-right"},c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-default",name:"cancel",onClick:this.handleCancel},"Cancel")),c().createElement("li",null,c().createElement("button",{type:"button",className:"btn-primary",name:"submit",onClick:this.handleSubmit},"Save Changes"))))}}])&&zk(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(c().Component);Gk.propTypes={id:p().number.isRequired,form:p().object,onCancel:p().func,onSubmit:p().func};const Qk=Gk;function Yk(e){return Yk="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},Yk(e)}function Xk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zk(e,t){return Zk=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Zk(e,t)}function eC(e,t){if(t&&("object"===Yk(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return tC(e)}function tC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nC(e){return nC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},nC(e)}const rC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zk(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=nC(r);if(o){var n=nC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return eC(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(tC(t)),t.handleEditClick=t.handleEditClick.bind(tC(t)),t.handleEditCancel=t.handleEditCancel.bind(tC(t)),t.handleEditComplete=t.handleEditComplete.bind(tC(t)),t.state={showPanel:!1,showEdit:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/collection/e").done((function(t,n,r){e.setState({showPanel:!0})}))}},{key:"handleEditClick",value:function(){this.setState({showEdit:!0})}},{key:"handleEditCancel",value:function(){this.setState({showEdit:!1})}},{key:"handleEditComplete",value:function(e){window.location.reload(!0)}},{key:"render",value:function(){return c().createElement("div",{className:"topic-editor clearfix"},c().createElement("button",{type:"button",className:"btn-small",onClick:this.handleEditClick,disabled:this.state.showEdit},"Edit Collection"),this.state.showEdit&&c().createElement(Qk,{id:this.props.id,onSubmit:this.handleEditComplete,onCancel:this.handleEditCancel}))}}])&&Xk(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function oC(e){return oC="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},oC(e)}function iC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sC(e,t){return sC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sC(e,t)}function cC(e,t){if(t&&("object"===oC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function lC(e){return lC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},lC(e)}var uC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=lC(r);if(o){var n=lC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return cC(this,e)});function a(){return iC(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.duration)return null;var e=mn.niceDuration(this.props.duration);return c().createElement("div",{className:"duration clearfix"},c().createElement("h4",null,TFWeb.Resources.UI.Length),c().createElement("div",{className:"length",dangerouslySetInnerHTML:mn.createMarkup(e)}))}}])&&aC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);uC.propTypes={duration:p().number};const fC=uC;function pC(e){return pC="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},pC(e)}function hC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yC(e,t){return yC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yC(e,t)}function mC(e,t){if(t&&("object"===pC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function vC(e){return vC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vC(e)}const bC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vC(r);if(o){var n=vC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return mC(this,e)});function a(){return hC(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this,t=this.props.playlist.map((function(t,n){var r=null,o=null;t.video.attributes.duration&&(r=mn.niceDuration(t.video.attributes.duration),!t.viewer||!0!==t.viewer.hasWatchedAll||null!=t.viewer.timestamp&&0!=t.viewer.timestamp?t.viewer&&null!=t.viewer.timestamp&&0!=t.viewer.timestamp&&(o=100*(t.viewer.timestamp/t.video.attributes.duration).toFixed(2)):o=100);var i="".concat(e.props.playerUrl,"?start=").concat(n);return c().createElement("li",{key:n},c().createElement("a",{href:i},c().createElement("div",{className:"thumb",style:{backgroundImage:"url("+t.thumbUrl+")"}}),c().createElement("div",{className:"info-container"},c().createElement("div",{className:"info"},c().createElement("span",{className:"title",dangerouslySetInnerHTML:mn.createMarkup(t.title)}),t.viewer&&1==t.viewer.hasWatchedAll&&c().createElement("span",{className:"watched fa fa-check-circle-o"}),null!=r&&c().createElement("span",{className:"duration"},r)),null!=o&&c().createElement(pp,{percentComplete:o}))))}));return c().createElement("div",{className:"curriculum"},c().createElement("ol",null,t))}}])&&dC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function gC(e){return gC="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},gC(e)}function wC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function EC(e,t){return EC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},EC(e,t)}function SC(e,t){if(t&&("object"===gC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return OC(e)}function OC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _C(e){return _C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_C(e)}var kC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_C(r);if(o){var n=_C(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return SC(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).onDownload=t.onDownload.bind(OC(t)),t}return t=a,n=[{key:"onDownload",value:function(e){var t=this.props.files[e],n="/collection/".concat(this.props.id,"/content/").concat(t.id,"/download");window.location.replace(n)}},{key:"render",value:function(){var e=this;if(null==this.props.files||0==this.props.files.length)return null;var t=this.props.files.map((function(t,n){return c().createElement("li",{onClick:e.onDownload.bind(null,n),key:n},c().createElement("div",{className:"title"},t.title),t.attributes&&t.attributes.size&&c().createElement("div",{className:"filesize icon icon-after icon-download"},mn.niceFileSize(t.attributes.size)))}));return c().createElement("ul",{className:"playlist-files"},t)}}],n&&wC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);kC.propTypes={id:p().number.isRequired,files:p().array};const CC=kC;function PC(e){return PC="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},PC(e)}function jC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function TC(e,t){return TC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},TC(e,t)}function xC(e,t){if(t&&("object"===PC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return RC(e)}function RC(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DC(e){return DC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},DC(e)}var NC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=DC(r);if(o){var n=DC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return xC(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).handleEditContentClick=t.handleEditContentClick.bind(RC(t)),t.startingIndex=0,t}return t=a,(n=[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"handleEditContentClick",value:function(){this.setState({mode:this.Modes.Edit})}},{key:"render",value:function(){var e=this,t="Watch Playlist";return this.props.collection.viewer&&(this.props.collection.viewer.hasWatchedAll?t="Watch Again":(this.props.collection.viewer.timestamp||this.props.collection.viewer.startIndex>0)&&(t="Continue Watching")),c().createElement("div",null,c().createElement("section",{id:"heroBanner"},c().createElement("div",{className:"hero-content"},c().createElement("h2",{className:"brandDot full",dangerouslySetInnerHTML:mn.createMarkup(this.props.collection.title)}),this.props.collection.viewer.e&&c().createElement(rC,{id:this.props.collection.id}))),c().createElement("div",{className:"playlist-header"},c().createElement("div",{className:"teaser"},null!=this.props.collection.teaser?c().createElement(mm,{display:"hero",content:this.props.collection.teaser}):c().createElement("img",{src:this.props.collection.thumbUrl})),c().createElement("div",{className:"info playlist-data"},c().createElement(fC,{duration:this.props.collection.attributes.duration}),!1,c().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-arrow",href:this.props.collection.playerUrl},t))),c().createElement(Mk,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},c().createElement(qk,{label:TFWeb.Resources.UI.Overview,visible:!0},this.props.collection.description&&""!=this.props.collection.description&&c().createElement("div",{className:"description",dangerouslySetInnerHTML:mn.createMarkup(this.props.collection.description)}),c().createElement(bC,{playlist:this.props.collection.playlist,playerUrl:this.props.collection.playerUrl}),c().createElement(kO,{list:this.props.collection.tags,path:this.props.filterPath}),c().createElement(ES,{list:this.props.collection.products,path:this.props.filterPath})),c().createElement(qk,{label:TFWeb.Resources.UI.Files,visible:null!=this.props.collection.files&&this.props.collection.files.length>0},c().createElement(CC,{id:this.props.collection.id,files:this.props.collection.files}))))}}])&&jC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);NC.propTypes={collection:p().object,filterPath:p().string},NC.defaultProps={filterPath:"/watch"};const MC=NC;function IC(e){return IC="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},IC(e)}function AC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function BC(e,t){return BC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},BC(e,t)}function FC(e,t){if(t&&("object"===IC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function UC(e){return UC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},UC(e)}var KC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=UC(r);if(o){var n=UC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return FC(this,e)});function a(){return AC(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list)return null;var e=this.props.list.map((function(e,t){return c().createElement("li",{key:t},c().createElement("a",{href:e.url},e.title))}));return c().createElement("div",{className:"gallery-membership"},"Course in ",c().createElement("ul",null,e))}}])&&LC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);KC.propTypes={list:p().array};const qC=KC;function VC(e){return VC="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},VC(e)}function zC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function HC(e,t){return HC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},HC(e,t)}function $C(e,t){if(t&&("object"===VC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function JC(e){return JC=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},JC(e)}const GC=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=JC(r);if(o){var n=JC(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return $C(this,e)});function a(){return zC(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=null,t=null,n=null;return this.props.bannerImage&&(e={backgroundImage:"url(".concat(this.props.bannerImage.fileName,")")},t="bannerBkgImg",n={paddingTop:"70px"}),c().createElement("section",{id:"heroBanner",className:t,style:e},c().createElement("div",{className:"hero-content"},c().createElement("div",{className:"row-wrapper",style:n},c().createElement("h2",{className:"brandDot full",dangerouslySetInnerHTML:mn.createMarkup(this.props.title)}),this.props.children)))}}])&&WC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);function QC(e){return QC="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},QC(e)}function YC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ZC(e,t){return ZC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ZC(e,t)}function eP(e,t){if(t&&("object"===QC(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function tP(e){return tP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},tP(e)}var nP=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZC(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=tP(r);if(o){var n=tP(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return eP(this,e)});function a(){return YC(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return c().createElement("span",{key:t},e)}));return c().createElement("div",{className:"instructors clearfix"},c().createElement("h4",null,this.props.list.length>1?TFWeb.Resources.UI.Instructors:TFWeb.Resources.UI.Instructor),c().createElement("div",{className:"instructor"},e))}}])&&XC(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);nP.propTypes={list:p().array},nP.defaultProps={list:[]};const rP=nP;function oP(e){return oP="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},oP(e)}function iP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sP(e,t){return sP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},sP(e,t)}function cP(e,t){if(t&&("object"===oP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function lP(e){return lP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},lP(e)}var uP=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sP(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=lP(r);if(o){var n=lP(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return cP(this,e)});function a(){return iP(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return c().createElement("span",{key:t},e)}));return c().createElement("div",{className:"captions clearfix"},c().createElement("h4",null,TFWeb.Resources.UI.Captions),c().createElement("div",{className:"closed-captions"},e))}}])&&aP(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);uP.propTypes={list:p().array},uP.defaultProps={list:[]};const fP=uP;function pP(e){return pP="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},pP(e)}function hP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yP(e,t){return yP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},yP(e,t)}function mP(e,t){if(t&&("object"===pP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function vP(e){return vP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},vP(e)}var bP=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yP(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vP(r);if(o){var n=vP(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return mP(this,e)});function a(){return hP(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.list||0==this.props.list.length)return null;var e=this.props.list.map((function(e,t){return c().createElement("span",{key:t},e)}));return c().createElement("div",{className:"releases clearfix"},c().createElement("h4",null,TFWeb.Resources.UI.VersionRequired),c().createElement("div",{className:"software"},e))}}])&&dP(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);bP.propTypes={list:p().array},bP.defaultProps={list:[]};const gP=bP;function wP(e){return wP="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},wP(e)}function EP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function OP(e,t){return OP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},OP(e,t)}function _P(e,t){if(t&&("object"===wP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function kP(e){return kP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},kP(e)}var CP=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OP(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=kP(r);if(o){var n=kP(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return _P(this,e)});function a(){return EP(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){if(!this.props.experienceLevel||"None"==this.props.experienceLevel)return null;var e=TFWeb.Resources.UI.getString("Experience.".concat(this.props.experienceLevel));return c().createElement("div",{className:"experience clearfix"},c().createElement("h4",null,TFWeb.Resources.UI.Level),c().createElement("div",{className:"experience-level",dangerouslySetInnerHTML:mn.createMarkup(e)}))}}])&&SP(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);CP.propTypes={experienceLevel:p().string};const PP=CP;function jP(e){return jP="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},jP(e)}function TP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function RP(e,t,n){return t&&xP(e.prototype,t),n&&xP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function DP(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&NP(e,t)}function NP(e,t){return NP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},NP(e,t)}function MP(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=LP(e);if(t){var o=LP(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return IP(this,n)}}function IP(e,t){if(t&&("object"===jP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return AP(e)}function AP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LP(e){return LP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},LP(e)}var BP=function(e){DP(n,e);var t=MP(n);function n(e){var r;return TP(this,n),(r=t.call(this,e)).onMetricsChange=r.onMetricsChange.bind(AP(r)),r.viewDownloads=r.viewDownloads.bind(AP(r)),r.startingIndex=0,r.state={metrics:r.props.collection.metrics},r}return RP(n,[{key:"componentDidMount",value:function(){$("body").attr("class","hero-content"),$("#globalFooter").removeClass("hide")}},{key:"onMetricsChange",value:function(e,t){var n=this.state.metrics;n[e]=t,this.setState({metrics:n})}},{key:"viewDownloads",value:function(){this.tabs.setTab(1)}},{key:"render",value:function(){var e=this,t=this.props.collection,n=null;if(!0===t.viewer.isSignedIn){var r=null;null!=t.viewer.actions&&null!=t.viewer.actions.rate&&(r=t.viewer.actions.rate.value),(n=[]).push(c().createElement(G_,{key:0,consumer:"Collection",id:t.id,rating:r}))}var o=null;if(null!=this.props.collection.playlist&&this.props.collection.playlist.length>0){var i=TFWeb.Resources.UI.CoursePlayButton.StartTheCourse;this.props.collection.viewer&&(this.props.collection.viewer.hasWatchedAll?i=TFWeb.Resources.UI.CoursePlayButton.WatchAgain:(this.props.collection.viewer.timestamp||this.props.collection.viewer.startIndex>0)&&(i=TFWeb.Resources.UI.CoursePlayButton.ContinueWatching)),o=c().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-arrow",href:this.props.collection.playerUrl},i)}else null!=this.props.collection.files&&this.props.collection.files.length>0&&(o=c().createElement("a",{className:"button btn-primary btn-primary-dark icon icon-after icon-download",onClick:this.viewDownloads},"View Course Files"));var a=null;null!=this.props.collection.bulletPoints&&this.props.collection.bulletPoints.length>0&&(a=this.props.collection.bulletPoints.map((function(e,t){var n=e.type.toLowerCase()+" clearfix";return c().createElement("div",{className:n,key:t},c().createElement("h4",null,e.title),c().createElement("div",{className:"length",dangerouslySetInnerHTML:mn.createMarkup(e.text)}))})));var s;return s=null!=this.props.collection.teaser?c().createElement(mm,{display:"hero",content:this.props.collection.teaser},!1):c().createElement(FP,{src:this.props.collection.thumbUrl,playerUrl:this.props.collection.playerUrl,showButton:"Standard"==this.props.collection.courseType&&null!=this.props.collection.playlist&&this.props.collection.playlist.length>0}),c().createElement("div",{className:"course"},c().createElement(GC,{title:this.props.collection.title,bannerImage:this.props.collection.bannerImage},c().createElement("div",{className:"hero-meta clearfix"},n,c().createElement($l,null),c().createElement(qC,{list:this.props.collection.galleryMembership}),c().createElement(Qr,{metrics:this.state.metrics,displayClass:"light"}))),c().createElement("div",{className:"playlist-header"},this.props.collection.galleryReturnNav&&c().createElement("div",{className:"gallery-link"},c().createElement("a",{href:this.props.collection.galleryReturnNav.url,className:"icon icon-before icon-backarrow"},this.props.collection.galleryReturnNav.text)),c().createElement("div",{className:"teaser"},c().createElement("div",null,s)),c().createElement("div",{className:"info playlist-data"},c().createElement(rP,{list:this.props.collection.instructors}),c().createElement(PP,{experienceLevel:this.props.collection.experienceLevel}),c().createElement(fC,{duration:this.props.collection.attributes.duration}),c().createElement(gP,{list:this.props.collection.productReleases}),c().createElement(fP,{list:this.props.collection.captions}),!1,a,o)),c().createElement(Mk,{ref:function(t){e.tabs=t},selectedIndex:0,className:"playlist-tabs"},c().createElement(qk,{label:TFWeb.Resources.UI.Overview,visible:!0},this.props.collection.description&&""!=this.props.collection.description&&c().createElement("div",{className:"course-body",dangerouslySetInnerHTML:mn.createMarkup(this.props.collection.description)}),c().createElement(bC,{playlist:this.props.collection.playlist,playerUrl:this.props.collection.playerUrl}),!1,!1),c().createElement(qk,{label:TFWeb.Resources.UI.CourseFiles,visible:null!=this.props.collection.files&&this.props.collection.files.length>0},c().createElement(CC,{id:this.props.collection.id,files:this.props.collection.files}))))}}]),n}(c().Component);BP.propTypes={collection:p().object,filterPath:p().string},BP.defaultProps={filterPath:"/watch"};var FP=function(e){DP(n,e);var t=MP(n);function n(){return TP(this,n),t.apply(this,arguments)}return RP(n,[{key:"render",value:function(){return c().createElement("div",{className:"teaser-image"},c().createElement("img",{src:this.props.src}),this.props.showButton&&c().createElement("a",{className:"play-button",href:this.props.playerUrl}))}}]),n}(c().Component);FP.propTypes={src:p().string,playerUrl:p().string,showButton:p().bool},FP.defaultProps={showButton:!1};const UP=BP;var KP=o(2452);function qP(e){return qP="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},qP(e)}function VP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function WP(e,t,n){return t&&zP(e.prototype,t),n&&zP(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function HP(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$P(e,t)}function $P(e,t){return $P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$P(e,t)}function JP(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=YP(e);if(t){var o=YP(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return GP(this,n)}}function GP(e,t){if(t&&("object"===qP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return QP(e)}function QP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YP(e){return YP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},YP(e)}var XP=function(e){HP(n,e);var t=JP(n);function n(e){var r;return VP(this,n),(r=t.call(this,e)).handleResize=r.handleResize.bind(QP(r)),r.handleUnload=r.handleUnload.bind(QP(r)),r.setMediaDimensions=r.setMediaDimensions.bind(QP(r)),r.onPlaylistClick=r.onPlaylistClick.bind(QP(r)),r.setIndex=r.setIndex.bind(QP(r)),r.setTimestamp=r.setTimestamp.bind(QP(r)),r.captureTimestamp=r.captureTimestamp.bind(QP(r)),r.getCurrentTime=r.getCurrentTime.bind(QP(r)),r.onReady=r.onReady.bind(QP(r)),r.onStart=r.onStart.bind(QP(r)),r.onPlay=r.onPlay.bind(QP(r)),r.onProgress=r.onProgress.bind(QP(r)),r.onPause=r.onPause.bind(QP(r)),r.onSeek=r.onSeek.bind(QP(r)),r.onEnded=r.onEnded.bind(QP(r)),r.handleReplayVideo=r.handleReplayVideo.bind(QP(r)),r.handleNextVideo=r.handleNextVideo.bind(QP(r)),r.onCancel=r.onCancel.bind(QP(r)),r.playingNextTitle=r.playingNextTitle.bind(QP(r)),r.onTogglePlaylist=r.onTogglePlaylist.bind(QP(r)),r.playerState={Video:"Video",Next:"Next",Completed:"Completed"},r.videoPlayer=null,r.mediaWidth=null,r.mediaHeight=null,r.firstPlay=!0,r.elapsedTimeInterval=10,r.state={playerState:r.playerState.Video,index:r.props.collection.viewer&&r.props.collection.viewer.startIndex?r.props.collection.viewer.startIndex:0,showPlaylist:!0},r}return WP(n,[{key:"componentDidMount",value:function(){this.setMediaDimensions()}},{key:"UNSAFE_componentWillMount",value:function(){"undefined"!=typeof window&&(window.addEventListener("resize",this.handleResize),window.addEventListener("unload",this.handleUnload))}},{key:"componentWillUnmount",value:function(){"undefined"!=typeof window&&(window.removeEventListener("resize",this.handleResize),window.removeEventListener("unload",this.handleUnload))}},{key:"componentDidUpdate",value:function(){this.setMediaDimensions()}},{key:"handleResize",value:function(e){this.setMediaDimensions()}},{key:"handleUnload",value:function(e){this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}])}},{key:"setMediaDimensions",value:function(){this.mediaWidth=this.media.offsetWidth;var e=.5625*this.media.offsetWidth;this.mediaHeight=e}},{key:"onPlaylistClick",value:function(e){this.captureTimestamp(),this.setIndex(e)}},{key:"setIndex",value:function(e){if(e!=this.state.index){var t=this.playerState.Video;null==e&&(t=this.playerState.Completed),this.setState({playerState:t,index:e})}}},{key:"setTimestamp",value:function(e){if(this.props.collection.viewer.isSignedIn&&null!=e&&0!=e.length){for(var t=[],n=0;n<e.length;n++){var r=e[n].index;this.props.collection.playlist[r].viewer.timestamp=e[n].seconds,!0===e[n].hasEnded&&(this.props.collection.playlist[r].viewer.hasWatchedAll=!0),t.push({p:this.props.collection.playlist[r].id,pc:this.props.collection.playlist[r].viewer.hasWatchedAll,t:e[n].seconds})}var o=this.props.collection.viewer.hasWatchedAll;if(!o)for(o=!0,n=0;n<=this.props.collection.playlist.length-1;n++)if(!1===this.props.collection.playlist[n].viewer.hasWatchedAll){o=!1;break}var i={id:this.props.collection.id,plc:o,pt:t};$.ajax({type:"POST",url:"/api/playlist/timestamp",contentType:"application/json; charset=utf-8",data:JSON.stringify(i),dataType:"json",context:this})}}},{key:"captureTimestamp",value:function(){this.player&&this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}])}},{key:"getCurrentTime",value:function(){if(!this.player)return 0;var e=this.player.getCurrentTime();return null==e&&(e=0),e}},{key:"onReady",value:function(){this.player&&1==this.firstPlay&&null!=this.props.collection.viewer&&null!=this.props.collection.viewer.timestamp&&this.player.seekTo(Math.floor(this.props.collection.viewer.timestamp),"seconds"),this.firstPlay=!1}},{key:"onStart",value:function(){}},{key:"onPlay",value:function(){var e=this.getCurrentTime();this.currentTime=Math.trunc(e),this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onProgress",value:function(e){e&&e.playedSeconds&&!isNaN(e.playedSeconds)&&!isNaN(this.currentTime)&&Math.abs(Math.trunc(e.playedSeconds)-this.currentTime)>=this.elapsedTimeInterval&&(this.currentTime=Math.trunc(e.playedSeconds),this.setTimestamp([{index:this.state.index,seconds:this.getCurrentTime(),hasEnded:!1}]))}},{key:"onPause",value:function(){var e=this.getCurrentTime();this.currentTime=Math.trunc(e),this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onSeek",value:function(e){this.currentTime=e,this.setTimestamp([{index:this.state.index,seconds:e,hasEnded:!1}])}},{key:"onEnded",value:function(){var e=[{index:this.state.index,seconds:0,hasEnded:!0}],t=this.state.index+1,n=t>this.props.collection.playlist.length-1;n||e.push({index:t,seconds:0,hasEnded:!1}),this.setTimestamp(e),n?this.setIndex(null):this.setState({playerState:this.playerState.Next})}},{key:"handleReplayVideo",value:function(){this.setState({playerState:this.playerState.Video})}},{key:"handleNextVideo",value:function(){this.setIndex(this.state.index+1)}},{key:"onCancel",value:function(){}},{key:"playingNextTitle",value:function(){return this.state.index+1>this.props.collection.playlist.length-1?"":this.props.collection.playlist[this.state.index+1].title}},{key:"onTogglePlaylist",value:function(){this.setState({showPlaylist:!this.state.showPlaylist},(function(){this.setMediaDimensions()}))}},{key:"render",value:function(){var e=this,t=null,n=null;switch(this.state.playerState){case this.playerState.Video:var r=this.props.collection.playlist[this.state.index],o=r.video,i=null,a={};switch(o.format){case"Vimeo":i="https://vimeo.com/"+o.data;break;case"Wistia":i="https://home.wistia.com/medias/"+o.data;break;case"YouTube":i="https://www.youtube.com/watch?v="+o.data,a={youtube:{playerVars:{rel:0}}}}t=c().createElement(KP.ZP,{ref:function(t){e.player=t},url:i,config:a,controls:!0,playing:!0,onReady:this.onReady,onStart:this.onStart,onPlay:this.onPlay,onProgress:this.onProgress,onPause:this.onPause,onSeek:this.onSeek,onEnded:this.onEnded,loop:!1,width:"100%",height:"100%",className:"react-player"}),n=c().createElement("div",{className:"media-description"},c().createElement("h4",null,r.title));break;case this.playerState.Next:t=c().createElement(tj,{secondsRemaining:5,title:this.playingNextTitle(),message:"The video will automatically start in {time} seconds",onNext:this.handleNextVideo,onCancel:this.onCancel,onReplay:this.handleReplayVideo,width:this.mediaWidth,height:this.mediaHeight});break;case this.playerState.Completed:t=c().createElement(ZP,{title:this.props.collection.title,url:this.props.collection.url,width:this.mediaWidth,height:this.mediaHeight})}return null==t?null:c().createElement("div",{className:"playlist-viewer",ref:function(t){e.viewer=t}},c().createElement("div",{className:"media-container"},c().createElement("div",{className:"controls",ref:function(t){e.controls=t}},c().createElement("h3",null,c().createElement("a",{href:this.props.collection.url,className:"icon icon-before icon-backarrow icon-color-white"},this.props.collection.title)),!1),c().createElement("div",{className:"media",ref:function(t){e.media=t}},c().createElement("div",{ref:function(t){e.mediaContainer=t},className:"player-wrapper"},t)),n),c().createElement("div",{className:"playlist-container"},c().createElement(ej,{playlist:this.props.collection.playlist,currentIndex:this.state.index,onPlaylistClick:this.onPlaylistClick})))}}]),n}(c().Component),ZP=function(e){HP(n,e);var t=JP(n);function n(){return VP(this,n),t.apply(this,arguments)}return WP(n,[{key:"render",value:function(){var e={width:this.props.width?this.props.width:"auto",height:this.props.height?this.props.height:"auto"};return c().createElement("div",{className:"playlist-dialog playlist-completed",style:e},c().createElement("div",null,"Congratulations. You have completed ",c().createElement("span",null,this.props.title)),c().createElement("a",{href:this.props.url,className:"button"},"Return to overview"))}}]),n}(c().Component),ej=function(e){HP(n,e);var t=JP(n);function n(e){var r;return VP(this,n),(r=t.call(this,e)).scrollToItem=r.scrollToItem.bind(QP(r)),r.state={showPlaylist:!0},r}return WP(n,[{key:"componentDidMount",value:function(){this.scrollToItem()}},{key:"componentDidUpdate",value:function(e,t){this.scrollToItem()}},{key:"scrollToItem",value:function(){if(!($(document).width()<=1024)){var e=document.getElementsByClassName("now-playing");null!=e&&e.length>0&&(mn.isOnScreen(e[0])||e[0].scrollIntoView({behavior:"smooth",block:"center"}))}}},{key:"render",value:function(){var e=this,t=this.props.playlist.map((function(t,n){var r=n==e.props.currentIndex?"now-playing":"",o=null;return t.video.attributes.duration&&(o=mn.niceDuration(t.video.attributes.duration)),c().createElement("li",{key:n,className:r,onClick:e.props.onPlaylistClick.bind(null,n)},c().createElement("div",{className:"thumb",style:{backgroundImage:"url("+t.thumbUrl+")"}}),c().createElement("div",{className:"info"},c().createElement("h4",{dangerouslySetInnerHTML:mn.createMarkup(t.title)}),null!=o&&c().createElement("span",{className:"duration"},o)))})),n="playlist-items".concat(this.state.showPlaylist?"":" collapsed");return c().createElement("div",{className:n},c().createElement("ol",null,t))}}]),n}(c().Component),tj=function(e){HP(n,e);var t=JP(n);function n(e){var r;return VP(this,n),(r=t.call(this,e)).tick=r.tick.bind(QP(r)),r.onReplay=r.onReplay.bind(QP(r)),r.onCancel=r.onCancel.bind(QP(r)),r.onNext=r.onNext.bind(QP(r)),r.format=r.format.bind(QP(r)),r.state={secondsRemaining:null},r}return WP(n,[{key:"componentDidMount",value:function(){this.setState({secondsRemaining:this.props.secondsRemaining}),this.interval=setInterval(this.tick,1e3)}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"tick",value:function(){this.setState({secondsRemaining:this.state.secondsRemaining-1}),this.state.secondsRemaining<=0&&(clearInterval(this.interval),this.props.onNext&&this.props.onNext())}},{key:"onReplay",value:function(){this.props.onReplay&&this.props.onReplay()}},{key:"onCancel",value:function(){var e=this;clearInterval(this.interval),this.setState({secondsRemaining:null},(function(){e.props.onCancel&&e.props.onCancel()}))}},{key:"onNext",value:function(){this.props.onNext&&this.props.onNext()}},{key:"format",value:function(e,t){if(""==e||null==t)return e;var n=e;for(var r in t){var o=new RegExp("{"+r+"}","gm");n=n.replace(o,t[r])}return n}},{key:"render",value:function(){var e=null;null!=this.state.secondsRemaining&&(e="".concat(this.state.secondsRemaining%60));var t={width:this.props.width?this.props.width:"auto",height:this.props.height?this.props.height:"auto"},n=this.props.title?"Playing Next: ".concat(this.props.title):null;return c().createElement("div",{className:"playlist-dialog playing-next",style:t},c().createElement("div",null,null!=n&&n,null!=e&&c().createElement("span",null,this.format(this.props.message,{time:e})," ",c().createElement("button",{className:"btn-small",disabled:null==e,onClick:this.onCancel},"Cancel")," ")),c().createElement("div",null,c().createElement("button",{className:"btn-primary icon icon-before icon-refresh",onClick:this.onReplay},"Replay"),c().createElement("button",{className:"btn-primary icon icon-after icon-arrow",onClick:this.onNext},"Next")))}}]),n}(c().Component);const nj=XP;function rj(e){return rj="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},rj(e)}function oj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ij(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aj(e,t){return aj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},aj(e,t)}function sj(e,t){if(t&&("object"===rj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function cj(e){return cj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},cj(e)}var lj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aj(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=cj(r);if(o){var n=cj(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return sj(this,e)});function a(){return oj(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"button-group"},this.props.currentStage>1&&c().createElement("button",{type:"button",onClick:this.props.onChange.bind(null,this.props.currentStage-1),className:"btn-default icon icon-before icon-backarrow"},"Back"),c().createElement("button",{id:"btnCancel",type:"button",onClick:this.props.onCancel,className:"btn-default"},"Cancel"),this.props.currentStage<this.props.totalStages&&c().createElement("button",{type:"button",onClick:this.props.onChange.bind(null,this.props.currentStage+1),className:"btn-default icon icon-after icon-arrow"},"Continue"))}}])&&ij(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);lj.propTypes={currentStage:p().number.isRequired,totalStages:p().number.isRequired,onChange:p().func,onCancel:p().func};const uj=lj;function fj(e){return fj="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},fj(e)}function pj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dj(e,t){return dj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},dj(e,t)}function yj(e,t){if(t&&("object"===fj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function mj(e){return mj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},mj(e)}var vj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dj(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=mj(r);if(o){var n=mj(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return yj(this,e)});function a(){return pj(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this,t=this.props.stages.map((function(t,n){var r="";return n+1===e.props.currentStage&&(r="active"),c().createElement("li",{key:n,className:r},t)}));return c().createElement("ol",{className:"steps"},t)}}])&&hj(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);vj.propTypes={stages:p().array.isRequired,currentStage:p().number.isRequired};const bj=vj;function gj(e){return gj="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},gj(e)}function wj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ej(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sj(e,t){return Sj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Sj(e,t)}function Oj(e,t){if(t&&("object"===gj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _j(e){return _j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_j(e)}var kj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sj(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_j(r);if(o){var n=_j(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Oj(this,e)});function a(){return wj(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=this.props.stages.length;return c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-6"},c().createElement(bj,{stages:this.props.stages,currentStage:this.props.currentStage})),c().createElement("div",{className:"col-md-6 text-right button-row"},c().createElement(uj,{currentStage:this.props.currentStage,totalStages:e,onChange:this.props.onChange,onCancel:this.props.onCancel})))}}])&&Ej(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);kj.propTypes={stages:p().array.isRequired,currentStage:p().number.isRequired,onChange:p().func,onCancel:p().func};const Cj=kj;function Pj(e){return Pj="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},Pj(e)}function jj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xj(e,t){return xj=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xj(e,t)}function Rj(e,t){if(t&&("object"===Pj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Dj(e){return Dj=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Dj(e)}var Nj=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xj(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Dj(r);if(o){var n=Dj(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Rj(this,e)});function a(){return jj(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){return c().createElement("div",{className:"tfnode placeholder-node"},c().createElement("hr",null),c().createElement("div",null,!0===this.props.showContent?c().createElement("button",{className:"btn btn-default btn-sm text-left",onClick:this.props.onAddContent},c().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),c().createElement("br",null),this.props.title," Content"):null,!0===this.props.showText?c().createElement("button",{className:"btn btn-default btn-sm text-left",onClick:this.props.onAddText},c().createElement("strong",null,"A"),c().createElement("br",null),this.props.title," Text"):null))}}])&&Tj(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);Nj.propTypes={showContent:p().bool,showText:p().bool,onAddContent:p().func,onAddText:p().func},Nj.defaultProps={showContent:!0,showText:!0};const Mj=Nj;var Ij=o(7704);function Aj(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function Lj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aj(n,!0).forEach((function(t){Bj(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aj(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fj=function(e,t){if(null==e)return t;for(var n=(p=2,function(e){if(Array.isArray(e))return e}(f=t)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(f,p)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),r=n[0],o=n[1],i=Lj({},r),a=function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(o),s=0,c=Object.keys(e);s<c.length;s++){var l=c[s];if(r.hasOwnProperty(l)){var u=r[l];i[l]=Lj({},u,{},e[l])}else i[l]=e[l],a.push(l)}var f,p;return[i,a]};var Uj={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"};const Kj=function(e){if(null==e)return e;for(var t={},n=!1,r=0,o=Object.keys(e);r<o.length;r++){var i=o[r],a=i;Uj.hasOwnProperty(i)&&(a=Uj[i],n=!0),t[a]=e[i]}return n?t:e};var qj=/^(moz|ms|o|webkit)-/,Vj=/^\d+$/,zj=/([A-Z])/g,Wj={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Hj=function(e){return Object.keys(e).map((function(t){var n=function(e,t){var n;return"string"==typeof t?n=Vj.test(t):(n=!0,t=String(t)),n&&"0"!==t&&!0!==Wj[e]?t+"px":t}(t,e[t]),r=function(e){return e.replace(zj,"-$1").toLowerCase().replace(qj,"-$1-")}(t);return"".concat(r,": ").concat(n)})).join("; ")};var $j,Jj,Gj,Qj="header-one",Yj="header-two",Xj="header-three",Zj="header-four",eT="header-five",tT="header-six",nT="unordered-list-item",rT="ordered-list-item",oT="blockquote",iT="code-block",aT="atomic",sT="LINK",cT="IMAGE",lT="BOLD",uT="CODE",fT="ITALIC",pT="STRIKETHROUGH",hT="UNDERLINE",dT=o(46),yT=new dT.OrderedSet;function mT(e,t){for(var n=yT,r=yT,o=[],i=0,a=0,s=e.length;a<s;a++){r=n;var c=t.get(a);n=c?c.getStyle():yT,a>0&&!(0,dT.is)(n,r)&&(o.push([e.slice(i,a),r]),i=a)}return o.push([e.slice(i),n]),o}function vT(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function bT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vT(n,!0).forEach((function(t){ET(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vT(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gT(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function wT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ET(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ST=lT,OT=uT,_T=fT,kT=pT,CT=hT,PT=/^data-([a-z0-9-]+)$/,jT=(ET($j={},ST,{element:"strong"}),ET($j,OT,{element:"code"}),ET($j,_T,{element:"em"}),ET($j,kT,{element:"del"}),ET($j,CT,{element:"u"}),$j),TT=[ST,_T,CT,kT,OT],xT=(ET(Jj={},sT,{url:"href",href:"href",rel:"rel",target:"target",title:"title",className:"class"}),ET(Jj,cT,{src:"src",height:"height",width:"width",alt:"alt",className:"class"}),Jj),RT=(ET(Gj={},sT,(function(e,t){for(var n=xT.hasOwnProperty(e)?xT[e]:{},r=t.getData(),o={},i=0,a=Object.keys(r);i<a.length;i++){var s=a[i],c=r[s];n.hasOwnProperty(s)?o[n[s]]=c:PT.test(s)&&(o[s]=c)}return o})),ET(Gj,cT,(function(e,t){for(var n=xT.hasOwnProperty(e)?xT[e]:{},r=t.getData(),o={},i=0,a=Object.keys(r);i<a.length;i++){var s=a[i],c=r[s];n.hasOwnProperty(s)?o[n[s]]=c:PT.test(s)&&(o[s]=c)}return o})),Gj);function DT(e,t){switch(e){case Qj:return["h1"];case Yj:return["h2"];case Xj:return["h3"];case Zj:return["h4"];case eT:return["h5"];case tT:return["h6"];case nT:case rT:return["li"];case oT:return["blockquote"];case iT:return["pre","code"];case aT:return["figure"];default:return null===t?[]:[t||"p"]}}var NT=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ET(this,"blocks",void 0),ET(this,"contentState",void 0),ET(this,"currentBlock",void 0),ET(this,"indentLevel",void 0),ET(this,"output",void 0),ET(this,"totalBlocks",void 0),ET(this,"wrapperTag",void 0),ET(this,"options",void 0),ET(this,"inlineStyles",void 0),ET(this,"inlineStyleFn",void 0),ET(this,"styleOrder",void 0),null==n&&(n={}),this.contentState=t,this.options=n;var r=gT(Fj(n.inlineStyles,[jT,TT]),2),o=r[0],i=r[1];this.inlineStyles=o,this.inlineStyleFn=n.inlineStyleFn,this.styleOrder=i}var t,n;return t=e,(n=[{key:"generate",value:function(){for(this.output=[],this.blocks=this.contentState.getBlocksAsArray(),this.totalBlocks=this.blocks.length,this.currentBlock=0,this.indentLevel=0,this.wrapperTag=null;this.currentBlock<this.totalBlocks;)this.processBlock();return this.closeWrapperTag(),this.output.join("").trim()}},{key:"processBlock",value:function(){var e=this.options,t=e.blockRenderers,n=e.defaultBlockTag,r=this.blocks[this.currentBlock],o=r.getType(),i=function(e){switch(e){case nT:return"ul";case rT:return"ol";default:return null}}(o);this.wrapperTag!==i&&(this.wrapperTag&&this.closeWrapperTag(),i&&this.openWrapperTag(i)),this.indent();var a=null!=t&&t.hasOwnProperty(o)?t[o]:null,s=a?a(r):null;if(null!=s)return this.output.push(s),this.output.push("\n"),void(this.currentBlock+=1);this.writeStartTag(r,n),this.output.push(this.renderBlockContent(r));var c=this.getNextBlock();if(function(e){switch(e){case nT:case rT:return!0;default:return!1}}(o)&&c&&c.getDepth()===r.getDepth()+1){this.output.push("\n");var l=this.wrapperTag;this.wrapperTag=null,this.indentLevel+=1,this.currentBlock+=1,this.processBlocksAtDepth(c.getDepth()),this.wrapperTag=l,this.indentLevel-=1,this.indent()}else this.currentBlock+=1;this.writeEndTag(r,n)}},{key:"processBlocksAtDepth",value:function(e){for(var t=this.blocks[this.currentBlock];t&&t.getDepth()===e;)this.processBlock(),t=this.blocks[this.currentBlock];this.closeWrapperTag()}},{key:"getNextBlock",value:function(){return this.blocks[this.currentBlock+1]}},{key:"writeStartTag",value:function(e,t){var n,r=DT(e.getType(),t);if(this.options.blockStyleFn){var o=this.options.blockStyleFn(e)||{},i=o.attributes,a=o.style;if(i=Kj(i),null!=a){var s=Hj(a);i=null==i?{style:s}:bT({},i,{style:s})}n=MT(i)}else n="";var c=!0,l=!1,u=void 0;try{for(var f,p=r[Symbol.iterator]();!(c=(f=p.next()).done);c=!0){var h=f.value;this.output.push("<".concat(h).concat(n,">"))}}catch(e){l=!0,u=e}finally{try{c||null==p.return||p.return()}finally{if(l)throw u}}}},{key:"writeEndTag",value:function(e,t){var n=DT(e.getType(),t);if(1===n.length)this.output.push("</".concat(n[0],">\n"));else{var r=[],o=!0,i=!1,a=void 0;try{for(var s,c=n[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value;r.unshift("</".concat(l,">"))}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}this.output.push(r.join("")+"\n")}}},{key:"openWrapperTag",value:function(e){this.wrapperTag=e,this.indent(),this.output.push("<".concat(e,">\n")),this.indentLevel+=1}},{key:"closeWrapperTag",value:function(){var e=this.wrapperTag;e&&(this.indentLevel-=1,this.indent(),this.output.push("</".concat(e,">\n")),this.wrapperTag=null)}},{key:"indent",value:function(){this.output.push("  ".repeat(this.indentLevel))}},{key:"withCustomInlineStyles",value:function(e,t){if(!this.inlineStyleFn)return e;var n=this.inlineStyleFn(t);if(!n)return e;var r=n.element,o=void 0===r?"span":r,i=n.attributes,a=n.style,s=MT(bT({},i,{style:a&&Hj(a)}));return"<".concat(o).concat(s,">").concat(e,"</").concat(o,">")}},{key:"renderBlockContent",value:function(e){var t=this,n=e.getType(),r=e.getText();return""===r?"<br>":function(e,t){for(var n=null,r=null,o=[],i=0,a=0,s=e.length;a<s;a++){r=n;var c=t.get(a);n=c?c.getEntity():null,a>0&&n!==r&&(o.push([r,mT(e.slice(i,a),t.slice(i,a))]),i=a)}return o.push([n,mT(e.slice(i),t.slice(i))]),o}(r=this.preserveWhitespace(r),e.getCharacterList()).map((function(e){var r,o=gT(e,2),i=o[0],a=o[1].map((function(e){var r=gT(e,2),o=r[0],i=r[1],a=function(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split(" ").join("&nbsp;").split("\n").join("<br>\n")}(o),s=!0,c=!1,l=void 0;try{for(var u,f=t.styleOrder[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var p=u.value;if((p!==OT||n!==iT)&&i.has(p)){var h=t.inlineStyles[p],d=h.element,y=h.attributes,m=h.style;if(null==d&&(d="span"),y=Kj(y),null!=m){var v=Hj(m);y=null==y?{style:v}:bT({},y,{style:v})}var b=MT(y);a="<".concat(d).concat(b,">").concat(a,"</").concat(d,">")}}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}return t.withCustomInlineStyles(a,i)})).join(""),s=i?t.contentState.getEntity(i):null,c=null==s?null:s.getType().toUpperCase();if(null!=s&&t.options.entityStyleFn&&(r=t.options.entityStyleFn(s))){var l=r,u=l.element,f=l.attributes,p=l.style;if(null==u&&(u="span"),f=Kj(f),null!=p){var h=Hj(p);f=null==f?{style:h}:bT({},f,{style:h})}var d=MT(f);return"<".concat(u).concat(d,">").concat(a,"</").concat(u,">")}if(null!=c&&c===sT){var y=MT(RT.hasOwnProperty(c)?RT[c](c,s):null);return"<a".concat(y,">").concat(a,"</a>")}if(null!=c&&c===cT){var m=MT(RT.hasOwnProperty(c)?RT[c](c,s):null);return"<img".concat(m,"/>")}return a})).join("")}},{key:"preserveWhitespace",value:function(e){for(var t=e.length,n=new Array(t),r=0;r<t;r++)" "!==e[r]||0!==r&&r!==t-1&&" "!==e[r-1]?n[r]=e[r]:n[r]=" ";return n.join("")}}])&&wT(t.prototype,n),e}();function MT(e){if(null==e)return"";for(var t=[],n=0,r=Object.keys(e);n<r.length;n++){var o=r[n],i=e[o];null!=i&&t.push(" ".concat(o,'="').concat((i+"").split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;"),'"'))}return t.join("")}function IT(e,t,n){for(var r=e.text,o=e.characterMeta,i=t.length,a=n.length,s=[],c=o.slice(0,0),l=0,u=r.indexOf(t);-1!==u;)s.push(r.slice(l,u)+n),c=c.concat(o.slice(l,u),AT(o.slice(u,u+1),a)),l=u+i,u=r.indexOf(t,l);return s.push(r.slice(l)),c=c.concat(o.slice(l)),{text:s.join(""),characterMeta:c}}function AT(e,t){for(var n=e.slice(0,0);t-- >0;)n=n.concat(e);return n}var LT="unstyled",BT="header-one",FT="header-two",UT="header-three",KT="header-four",qT="header-five",VT="header-six",zT="unordered-list-item",WT="ordered-list-item",HT="blockquote",$T="code-block",JT="atomic",GT="LINK",QT="IMAGE",YT="BOLD",XT="CODE",ZT="ITALIC",ex="STRIKETHROUGH",tx="UNDERLINE";new dT.OrderedSet;var nx={a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,var:1,video:1,wbr:1,acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1},rx={area:1,base:1,br:1,col:1,colgroup:1,command:1,dl:1,embed:1,head:1,hgroup:1,hr:1,iframe:1,img:1,input:1,keygen:1,link:1,meta:1,ol:1,optgroup:1,option:1,param:1,script:1,select:1,source:1,style:1,table:1,tbody:1,textarea:1,tfoot:1,thead:1,title:1,tr:1,track:1,ul:1,wbr:1,basefont:1,dialog:1,dir:1,isindex:1},ox={img:1};function ix(e){return ix="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},ix(e)}function ax(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function sx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ux=/^data:/i,fx=(0,dT.OrderedSet)(),px=new Ij.ContentBlock({key:(0,Ij.genKey)(),text:"",type:LT,characterList:(0,dT.List)(),depth:0}),hx=/(\r\n|\r|\n)/g,dx="\r",yx=/^data-([a-z0-9-]+)$/,mx={a:{href:"url",rel:"rel",target:"target",title:"title"},img:{src:"src",alt:"alt",width:"width",height:"height"}},vx=function(e,t){var n={};if(mx.hasOwnProperty(e))for(var r=mx[e],o=0;o<t.attributes.length;o++){var i=t.attributes[o],a=i.name,s=i.value;if("string"==typeof s){var c=s;r.hasOwnProperty(a)?n[r[a]]=c:yx.test(a)&&(n[a]=c)}}return n},bx={a:function(e,t,n){var r,o=vx(t,n);if(null!=(r=o.url)&&!r.match(ux))return e.createEntity(GT,o)},img:function(e,t,n){var r=vx(t,n);if(null!=r.src)return e.createEntity(QT,r)}},gx=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};sx(this,e),lx(this,"contentStateForEntities",void 0),lx(this,"blockStack",void 0),lx(this,"blockList",void 0),lx(this,"depth",void 0),lx(this,"options",void 0),lx(this,"inlineCreators",{Style:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return{type:"STYLE",style:e}})),Entity:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MUTABLE";return{type:"ENTITY",entityKey:t.createEntity(e,wx(n),r)}}}),this.options=n,this.contentStateForEntities=Ij.ContentState.createFromBlockArray([]),this.blockStack=[],this.blockList=[],this.depth=0}var t,n;return t=e,n=[{key:"process",value:function(e){this.processBlockElement(e);var t=[];return this.blockList.forEach((function(e){var n=function(e){var t="",n=(0,dT.Seq)();return e.forEach((function(e){t+=e.text,n=n.concat(e.characterMeta)})),{text:t,characterMeta:n}}(e.textFragments),r=n.text,o=n.characterMeta,i=!1;if(r===dx&&(i=!0,r=""),"pre"===e.tagName){var a=function(e,t){return"\n"===e.charAt(0)&&(e=e.slice(1),t=t.slice(1)),{text:e,characterMeta:t}}(r,o);r=a.text,o=a.characterMeta}else{var s=function(e,t){var n=function(e,t){for(;" "===e.charAt(0);)e=e.slice(1),t=t.slice(1);return{text:e,characterMeta:t}}(e=e.replace(/[ \t\n]/g," "),t),r=function(e,t){for(;" "===e.slice(-1);)e=e.slice(0,-1),t=t.slice(0,-1);return{text:e,characterMeta:t}}(e=n.text,t=n.characterMeta);e=r.text,t=r.characterMeta;for(var o=e.length;o--;)" "===e.charAt(o)&&" "===e.charAt(o-1)&&(e=e.slice(0,o)+e.slice(o+1),t=t.slice(0,o).concat(t.slice(o+1)));var i=IT({text:e,characterMeta:t},"\r ",dx),a=IT({text:e=i.text,characterMeta:t=i.characterMeta}," \r",dx);return{text:e=a.text,characterMeta:t=a.characterMeta}}(r,o);r=s.text,o=s.characterMeta}((r=r.split(dx).join("\n")).length||i)&&t.push(new Ij.ContentBlock({key:(0,Ij.genKey)(),text:r,type:e.type,characterList:o.toList(),depth:e.depth,data:e.data?(0,dT.Map)(e.data):(0,dT.Map)()}))})),t.length||(t=[px]),Ij.ContentState.createFromBlockArray(t,this.contentStateForEntities.getEntityMap())}},{key:"getBlockTypeFromTagName",value:function(e){var t=this.options.blockTypes;if(t&&t[e])return t[e];switch(e){case"li":return"ol"===this.blockStack.slice(-1)[0].tagName?WT:zT;case"blockquote":return HT;case"h1":return BT;case"h2":return FT;case"h3":return UT;case"h4":return KT;case"h5":return qT;case"h6":return VT;case"pre":return $T;case"figure":return JT;default:return LT}}},{key:"processBlockElement",value:function(e){if(e){var t,n,r=this.options.customBlockFn,o=e.nodeName.toLowerCase();if(r){var i=r(e);null!=i&&(t=i.type,n=i.data)}var a=!0;if(null==t&&(a=!1,t=this.getBlockTypeFromTagName(o)),t===$T){var s=e.getAttribute("data-language");s&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ax(n,!0).forEach((function(t){lx(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ax(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{language:s}))}var c=function(e){switch(e){case zT:case WT:return!0;default:return!1}}(t),l=!rx.hasOwnProperty(o);if(!a&&t===LT){var u=this.blockStack.slice(-1)[0];u&&(t=u.type)}var f={tagName:o,textFragments:[],type:t,styleStack:[fx],entityStack:[null],depth:c?this.depth:0,data:n};l&&(this.blockList.push(f),c&&(this.depth+=1)),this.blockStack.push(f),null!=e.childNodes&&Array.from(e.childNodes).forEach(this.processNode,this),this.blockStack.pop(),l&&c&&(this.depth-=1)}}},{key:"processInlineElement",value:function(e){var t=e.nodeName.toLowerCase();if("br"!==t){var n=this.blockStack.slice(-1)[0],r=n.styleStack.slice(-1)[0],o=n.entityStack.slice(-1)[0],i=this.options.customInlineFn,a=i?i(e,this.inlineCreators):null;if(null!=a)switch(a.type){case"STYLE":r=r.add(a.style);break;case"ENTITY":o=a.entityKey}else r=function(e,t,n){switch(t){case"b":case"strong":return e.add(YT);case"i":case"em":return e.add(ZT);case"u":case"ins":return e.add(tx);case"code":return e.add(XT);case"s":case"del":return e.add(ex);default:return n&&n[t]?e.add(n[t]):e}}(r,t,this.options.elementStyles),bx.hasOwnProperty(t)&&(o=bx[t](this,t,e)||o);n.styleStack.push(r),n.entityStack.push(o),null!=e.childNodes&&Array.from(e.childNodes).forEach(this.processNode,this),ox.hasOwnProperty(t)&&this.processText(" "),n.entityStack.pop(),n.styleStack.pop()}else this.processText(dx)}},{key:"processTextNode",value:function(e){var t=e.nodeValue;t=(t=t.replace(hx,"\n")).split("​").join(dx),this.processText(t)}},{key:"processText",value:function(e){var t=this.blockStack.slice(-1)[0],n=t.styleStack.slice(-1)[0],r=t.entityStack.slice(-1)[0],o=Ij.CharacterMetadata.create({style:n,entity:r}),i=(0,dT.Repeat)(o,e.length);t.textFragments.push({text:e,characterMeta:i})}},{key:"processNode",value:function(e){if(1===e.nodeType){var t=e,n=t.nodeName.toLowerCase();nx.hasOwnProperty(n)?this.processInlineElement(t):this.processBlockElement(t)}else 3===e.nodeType&&this.processTextNode(e)}},{key:"createEntity",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MUTABLE";return this.contentStateForEntities=this.contentStateForEntities.createEntity(e,n,t),this.contentStateForEntities.getLastCreatedEntityKey()}}],n&&cx(t.prototype,n),e}();function wx(e){var t={};if(null!==e&&"object"===ix(e)&&!Array.isArray(e))for(var n=e,r=0,o=Object.keys(n);r<o.length;r++){var i=o[r],a=n[i];"string"==typeof a&&(t[i]=a)}return t}function Ex(e){var t;return"undefined"!=typeof DOMParser?t=(new DOMParser).parseFromString(e,"text/html"):(t=document.implementation.createHTMLDocument("")).documentElement&&(t.documentElement.innerHTML=e),t.body||t.createElement("body")}var Sx={};function Ox(e){return Ox="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},Ox(e)}function _x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cx(e,t,n){return t&&kx(e.prototype,t),n&&kx(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Px(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jx(e,t)}function jx(e,t){return jx=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jx(e,t)}function Tx(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Rx(e);if(t){var o=Rx(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xx(this,n)}}function xx(e,t){if(t&&("object"===Ox(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Rx(e){return Rx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Rx(e)}var Dx=function(e){Px(n,e);var t=Tx(n);function n(e){var r;return _x(this,n),(r=t.call(this,e)).state={editorState:r._setHTML(),hasFocus:!1},r.focus=function(){return r._handleFocus()},r.blur=function(){return r._handleBlur()},r.onChange=function(e){return r.setState({editorState:e})},r.handleKeyCommand=function(e){return r._handleKeyCommand(e)},r.toggleBlockType=function(e){return r._toggleBlockType(e)},r.toggleInlineStyle=function(e){return r._toggleInlineStyle(e)},r.getHTML=function(){return r._getHTML()},r}return Cx(n,[{key:"componentDidMount",value:function(){this._handleFocus()}},{key:"_handleFocus",value:function(){this.setState({hasFocus:!0}),this.refs.editor.focus()}},{key:"_handleBlur",value:function(){this.setState({hasFocus:!1})}},{key:"_handleKeyCommand",value:function(e){var t=this.state.editorState,n=Ij.RichUtils.handleKeyCommand(t,e);return!!n&&(this.onChange(n),!0)}},{key:"_toggleBlockType",value:function(e){this.onChange(Ij.RichUtils.toggleBlockType(this.state.editorState,e))}},{key:"_toggleInlineStyle",value:function(e){this.onChange(Ij.RichUtils.toggleInlineStyle(this.state.editorState,e))}},{key:"_setHTML",value:function(){if(this.props.importValue){var e=(t=this.props.importValue,r=(n=Sx).parser,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["parser"]),null==r&&(r=Ex),function(e,t){return new gx(t).process(e)}(r(t),o));return Ij.EditorState.createWithContent(e)}return Ij.EditorState.createEmpty();var t,n,r,o}},{key:"_getHTML",value:function(){return e=this.state.editorState.getCurrentContent(),new NT(e,undefined).generate();var e}},{key:"render",value:function(){var e=this.state.editorState;return c().createElement("div",{className:"RichEditor-root"},!0===this.state.hasFocus?c().createElement("div",{className:"text-node-controls",onClick:this.focus},c().createElement(Fx,{editorState:e,onToggle:this.toggleInlineStyle}),c().createElement(Lx,{editorState:e,onToggle:this.toggleBlockType})):null,c().createElement("div",{className:"RichEditor-editor",onClick:this.focus,onFocus:this.focus,onBlur:this.blur},c().createElement(Ij.Editor,{blockStyleFn:Mx,customStyleMap:Nx,editorState:e,handleKeyCommand:this.handleKeyCommand,onChange:this.onChange,ref:"editor",spellCheck:!0})))}}]),n}(c().Component),Nx={CODE:{backgroundColor:"rgba(0, 0, 0, 0.05)",fontFamily:'"Inconsolata", "Menlo", "Consolas", monospace',fontSize:16,padding:2}};function Mx(e){return"blockquote"===e.getType()?"RichEditor-blockquote":null}var Ix=function(e){Px(n,e);var t=Tx(n);function n(){var e;return _x(this,n),(e=t.call(this)).onToggle=function(t){t.preventDefault(),e.props.onToggle(e.props.style)},e}return Cx(n,[{key:"render",value:function(){var e="RichEditor-styleButton";return this.props.active&&(e+=" RichEditor-activeButton"),c().createElement("span",{className:e,onMouseDown:this.onToggle},this.props.label)}}]),n}(c().Component),Ax=[{label:"Blockquote",style:"blockquote"}],Lx=function(e){var t=e.editorState,n=t.getSelection(),r=t.getCurrentContent().getBlockForKey(n.getStartKey()).getType();return c().createElement("span",{className:"RichEditor-controls"},Ax.map((function(t){return c().createElement(Ix,{key:t.label,active:t.style===r,label:t.label,onToggle:e.onToggle,style:t.style})})))},Bx=[{label:"Bold",style:"BOLD"},{label:"Italic",style:"ITALIC"}],Fx=function(e){var t=e.editorState.getCurrentInlineStyle();return c().createElement("span",{className:"RichEditor-controls"},Bx.map((function(n){return c().createElement(Ix,{key:n.label,active:t.has(n.style),label:n.label,onToggle:e.onToggle,style:n.style})})))};const Ux=Dx;function Kx(e){return Kx="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},Kx(e)}function qx(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zx(e,t){return zx=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},zx(e,t)}function Wx(e,t){if(t&&("object"===Kx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Hx(e){return Hx=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Hx(e)}var $x=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zx(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Hx(r);if(o){var n=Hx(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Wx(this,e)});function a(){return qx(this,a),i.apply(this,arguments)}return t=a,(n=[{key:"render",value:function(){var e=!0===this.props.showDelete?c().createElement("button",{type:"button",className:"btn",onClick:this.props.onDelete},this.props.deleteButtonLabel," ",c().createElement("i",{className:"glyphicon glyphicon-remove"})):null,t=!0===this.props.showReplace?c().createElement("button",{type:"button",className:"btn",onClick:this.props.onReplace},this.props.replaceButtonLabel," ",c().createElement("i",{className:"glyphicon glyphicon-repeat"})):null;return c().createElement("div",{className:"controls"},e,t,null!=this.props.index&&this.props.index>0?c().createElement("button",{type:"button",className:"btn",title:"Move Up",onClick:this.props.onMoveUp},"Move Up ",c().createElement("i",{className:"glyphicon glyphicon-arrow-up"})):null,null!=this.props.index&&this.props.index<this.props.indexOf-1?c().createElement("button",{type:"button",className:"btn",title:"Move Down",onClick:this.props.onMoveDown},"Move Down ",c().createElement("i",{className:"glyphicon glyphicon-arrow-down"})):null)}}])&&Vx(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);$x.propTypes={index:p().number,indexOf:p().number,showDelete:p().bool,showReplace:p().bool,deleteButtonLabel:p().string,replaceButtonLabel:p().string,onDelete:p().func,onReplace:p().func,onMoveUp:p().func,onMoveDown:p().func},$x.defaultProps={index:null,showDelete:!1,showReplace:!1,deleteButtonLabel:"Remove",replaceButtonLabel:"Replace"};const Jx=$x;function Gx(e){return Gx="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},Gx(e)}function Qx(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yx(e,t){return Yx=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Yx(e,t)}function Xx(e,t){if(t&&("object"===Gx(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zx(e)}function Zx(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eR(e){return eR=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},eR(e)}var tR=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yx(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=eR(r);if(o){var n=eR(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Xx(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(Zx(t)),t.valid=t.valid.bind(Zx(t)),t.getNodes=t.getNodes.bind(Zx(t)),t.getContent=t.getContent.bind(Zx(t)),t.hasContent=t.hasContent.bind(Zx(t)),t.onSave=t.onSave.bind(Zx(t)),t.tryAddStagingNode=t.tryAddStagingNode.bind(Zx(t)),t.getStagingIndex=t.getStagingIndex.bind(Zx(t)),t.onAddText=t.onAddText.bind(Zx(t)),t.onAddContent=t.onAddContent.bind(Zx(t)),t.onAcceptContent=t.onAcceptContent.bind(Zx(t)),t.onDeleteNode=t.onDeleteNode.bind(Zx(t)),t.onMoveUpNode=t.onMoveUpNode.bind(Zx(t)),t.onMoveDownNode=t.onMoveDownNode.bind(Zx(t)),t.updateNodeOrder=t.updateNodeOrder.bind(Zx(t)),t.deleteContentItem=t.deleteContentItem.bind(Zx(t)),t.getContentItem=t.getContentItem.bind(Zx(t)),t._content=t.props.importContent?t.props.importContent:[],t._nodes=t.props.importNodes?t.props.importNodes:[],t.tryAddStagingNode(),t.state={nodes:t._nodes,isValid:t.valid(),showValidation:!1},t}return t=a,n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getNodes",value:function(){return this.onSave(),this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onSave",value:function(){var e=this.getStagingIndex();null!=e&&this._nodes.splice(e,1);for(var t=0;t<this._nodes.length;t++)if("Text"==this._nodes[t].type){var n=this.refs[this._nodes[t].id].getHTML();this._nodes[t].data=n}}},{key:"tryAddStagingNode",value:function(){if(!this.hasContent()){var e={id:mn.generateUID(),type:"Staging",usage:null,data:null,children:null};this._nodes.unshift(e)}}},{key:"getStagingIndex",value:function(){for(var e=0;e<this._nodes.length;e++)if("Staging"==this._nodes[e].type)return e;return null}},{key:"onAddText",value:function(e,t){null!=t&&t.preventDefault();var n={id:mn.generateUID(),type:"Text",usage:"Content",data:"",children:null},r=this._nodes.length;null!==e&&(r=e),this._nodes.splice(r,0,n),this.setState({nodes:this._nodes})}},{key:"onAddContent",value:function(e,t){null!=t&&t.preventDefault();var n={id:mn.generateUID(),type:"Staging",usage:null,data:null,children:null},r=this._nodes.length;null!==e&&(r=e),this._nodes.splice(r,0,n),this.setState({nodes:this._nodes})}},{key:"onAcceptContent",value:function(e,t){var n=[],r=this;e.forEach((function(e){r._content.push(e);var t={id:mn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n.push(t)}));var o=this._nodes.length,i=this.getStagingIndex();null!==i&&(o=i+1);var a=this._nodes;this._nodes=a.slice(0,o).concat(n).concat(a.slice(o)),t&&this._nodes.splice(i,1),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onDeleteNode",value:function(e,t){null!=t&&t.preventDefault();var n=this._nodes.splice(e,1);"Content"==n[0].type&&this.deleteContentItem(n[0].data),this.tryAddStagingNode(),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onMoveUpNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e-1)}},{key:"onMoveDownNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e+1)}},{key:"updateNodeOrder",value:function(e,t){this._nodes.splice(t,0,this._nodes.splice(e,1)[0]),this.setState({nodes:this._nodes})}},{key:"deleteContentItem",value:function(e){for(var t=0;t<this._content.length;t++)this._content[t].id==e&&this._content.splice(t,1)}},{key:"getContentItem",value:function(e){for(var t=0;t<this._content.length;t++)if(this._content[t].id==e)return this._content[t];return null}},{key:"render",value:function(){var e="tfnode-editor form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=[],n=null,r=null;return this.state.nodes.forEach((function(e,o){switch(n=o,"Staging"==e.type||null!=r&&"Staging"==r.type||t.push(c().createElement(Mj,{key:mn.generateUID(),title:"Insert",onAddText:this.onAddText.bind(null,o),onAddContent:this.onAddContent.bind(null,o)})),e.type){case"Staging":t.push(c().createElement("div",{className:"tfnode",key:e.id},this.hasContent()?c().createElement(Jx,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Cancel Content Upload",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}):null,c().createElement(Dd,{groupsAllowed:["Portfolio"],onAccept:this.onAcceptContent,onCancel:this.onHideStaging},c().createElement("h4",null,c().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),c().createElement("br",null),"Drag and drop one or more files or click in this area to upload"))));break;case"Text":t.push(c().createElement("div",{className:"tfnode text-node",key:e.id},c().createElement(Jx,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Text",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}),c().createElement(Ux,{ref:e.id,importValue:e.data})));break;case"Content":var i=this.getContentItem(e.data);t.push(c().createElement("div",{className:"tfnode content-node",key:e.id},c().createElement(Jx,{index:o,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Content",onDelete:this.onDeleteNode.bind(null,o),onMoveUp:this.onMoveUpNode.bind(null,o),onMoveDown:this.onMoveDownNode.bind(null,o)}),c().createElement(mm,{ref:e.id,key:e.id,content:i})))}r=e}),this),null!=n&&"Staging"!=this.state.nodes[n].type&&t.push(c().createElement(Mj,{key:mn.generateUID(),title:"Add",onAddText:this.onAddText.bind(null,null),onAddContent:this.onAddContent.bind(null,null)})),c().createElement("div",{className:e},t,!0!==this.state.showValidation||this.state.isValid?null:c().createElement(gi,{message:"At least one content item (image/video) is required"}))}}],n&&Qx(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);tR.propTypes={fileSizeLimit:p().number,importContent:p().array,importNodes:p().array,required:p().bool,requiredErrorMessage:p().string,onChange:p().func},tR.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};const nR=tR;function rR(e){return rR="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},rR(e)}function oR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iR(e,t){return iR=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},iR(e,t)}function aR(e,t){if(t&&("object"===rR(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return sR(e)}function sR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cR(e){return cR=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},cR(e)}var lR=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iR(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=cR(r);if(o){var n=cR(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return aR(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(sR(t)),t.valid=t.valid.bind(sR(t)),t.getNodes=t.getNodes.bind(sR(t)),t.getContent=t.getContent.bind(sR(t)),t.hasContent=t.hasContent.bind(sR(t)),t.onStagingCancel=t.onStagingCancel.bind(sR(t)),t.onAddContent=t.onAddContent.bind(sR(t)),t.onAcceptContent=t.onAcceptContent.bind(sR(t)),t.getContentItem=t.getContentItem.bind(sR(t)),t._content=t.props.importContent?t.props.importContent:[],t._nodes=t.props.importNodes?t.props.importNodes:[],t.state={nodes:t._nodes,showStaging:!t.hasContent(),isValid:t.valid(),showValidation:!1},t}return t=a,(n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&this.hasContent()}},{key:"getNodes",value:function(){return this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onStagingCancel",value:function(){this.setState({showStaging:!1})}},{key:"onAddContent",value:function(e,t){null!=t&&t.preventDefault(),this.setState({showStaging:!0})}},{key:"onAcceptContent",value:function(e,t){var n=[];e.forEach((function(e){var t={id:mn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n.push(t)})),this._content=e,this._nodes=n,this.setState({nodes:this._nodes,isValid:this.valid(),showStaging:!1})}},{key:"getContentItem",value:function(e){for(var t=0;t<this._content.length;t++)if(this._content[t].id==e)return this._content[t];return null}},{key:"render",value:function(){var e="tfnode-editor form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=[];if(this.state.showStaging)t.push(c().createElement("div",{className:"tfnode",key:0},this.hasContent()?c().createElement(Jx,{showReplace:!0,onReplace:this.onStagingCancel,replaceButtonLabel:"Cancel Replace"}):null,c().createElement(Dd,{groupsAllowed:["Training"],allowMultipleFiles:!1,onAccept:this.onAcceptContent,autoAcceptContent:!0,closeAfterAutoAcceptContent:!0},c().createElement("h4",null,c().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),c().createElement("br",null),"Drag and drop a video or click in this area to upload"))));else{var n=this.getContentItem(this.state.nodes[0].data);t.push(c().createElement("div",{className:"tfnode content-node",key:1},c().createElement(Jx,{showReplace:!0,onReplace:this.onAddContent.bind(null,null,null),replaceButtonLabel:"Replace Video"}),c().createElement(mm,{content:n})))}return c().createElement("div",{className:e},t,!0!==this.state.showValidation||this.state.isValid?null:c().createElement(gi,{message:"At least one content item (image/video) is required"}))}}])&&oR(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);lR.propTypes={fileSizeLimit:p().number,importContent:p().array,importNodes:p().array,required:p().bool,requiredErrorMessage:p().string,onChange:p().func},lR.defaultProps={required:!1,requiredErrorMessage:"At least on content item is required."};const uR=lR;function fR(e){return fR="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},fR(e)}function pR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dR(e,t,n){return t&&hR(e.prototype,t),n&&hR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yR(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mR(e,t)}function mR(e,t){return mR=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mR(e,t)}function vR(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=wR(e);if(t){var o=wR(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return bR(this,n)}}function bR(e,t){if(t&&("object"===fR(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return gR(e)}function gR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wR(e){return wR=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},wR(e)}var ER=function(e){yR(n,e);var t=vR(n);function n(e){var r;pR(this,n),(r=t.call(this,e)).getThumbnailData=r.getThumbnailData.bind(gR(r)),r.getContentIndex=r.getContentIndex.bind(gR(r)),r.updateContent=r.updateContent.bind(gR(r)),r.onSelectThumbnail=r.onSelectThumbnail.bind(gR(r)),r.onAcceptCrop=r.onAcceptCrop.bind(gR(r)),r.onShowCrop=r.onShowCrop.bind(gR(r)),r.onCancelCrop=r.onCancelCrop.bind(gR(r));var o=null;return null!=r.props.content&&(o=null!=r.props.contentThumbnail?r.getContentIndex(r.props.content,r.props.contentThumbnail.id):0),r.state={content:null!=r.props.content?r.props.content:[],selectedContentIndex:o,showImageCropModal:!1,crop:null!=r.props.contentThumbnail?r.props.contentThumbnail.crop:null},r}return dR(n,[{key:"getThumbnailData",value:function(){return null==this.state.selectedContentIndex?null:{id:this.state.content[this.state.selectedContentIndex].id,crop:this.state.crop}}},{key:"getContentIndex",value:function(e,t){if(null==e||0==e.length)return null;for(var n=0;n<e.length;n++)if(e[n].id==t)return n;return null}},{key:"updateContent",value:function(e){var t=null,n=null;e.length>0&&null!=this.state.content&&this.state.content.length>0&&(null!=this.state.selectedContentIndex&&(t=this.state.content[this.state.selectedContentIndex].id),null!=t&&(n=this.getContentIndex(e,t))),null==n&&e.length>0&&(n=0),this.setState({content:e,selectedContentIndex:n})}},{key:"onSelectThumbnail",value:function(e,t){this.setState({selectedContentIndex:t,crop:null})}},{key:"onAcceptCrop",value:function(e){this.setState({crop:e,showImageCropModal:!1})}},{key:"onShowCrop",value:function(){this.setState({showImageCropModal:!0})}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1})}},{key:"render",value:function(){!0!==this.state.showValidation||this.state.isValid,this.props.required;var e=null;!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage&&(e=c().createElement(HelpBlock,{message:this.props.helpMessage})):e=c().createElement(HelpBlock,{message:this.props.requiredErrorMessage});var t=null!=this.state.content&&this.state.content.length>0&&null!=this.state.selectedContentIndex?this.state.content[this.state.selectedContentIndex].id:null;return c().createElement("div",{className:"form-group thumbnail-editor clearfix"},c().createElement("label",{className:"static"},this.props.label),c().createElement("div",null,c().createElement(OR,{size:this.props.size,id:t,crop:this.state.crop}),c().createElement("div",{className:"controls",style:{marginLeft:this.props.size.width+10}},c().createElement("ul",{className:"list-unstyled"},this.state.content.length>1&&c().createElement("li",null,c().createElement(SR,{content:this.state.content,onSelectThumbnail:this.onSelectThumbnail})),c().createElement("li",null,c().createElement("button",{className:"btn-default",type:"button",onClick:this.onShowCrop},"Edit Thumbnail")))),e),this.state.showImageCropModal&&c().createElement(B,null,c().createElement(Fm,{src:this.state.content[this.state.selectedContentIndex].coverUrl,size:this.props.size,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}]),n}(c().Component);ER.propTypes={size:p().object.isRequired,content:p().array,contentThumbnail:p().object,label:p().string.isRequired,helpMessage:p().string};var SR=function(e){yR(n,e);var t=vR(n);function n(){return pR(this,n),t.apply(this,arguments)}return dR(n,[{key:"render",value:function(){var e=[],t=this;return this.props.content.forEach((function(n,r){e.push(c().createElement("div",{key:n.id,onClick:t.props.onSelectThumbnail.bind(null,n.id,r)},c().createElement("img",{style:{width:"200px",height:"auto"},src:n.thumbUrl})))})),c().createElement(bo,{wrapperTag:"div",actionTag:"button",actionLabel:"Select Cover Image",options:e,dropdownClassName:"thumbnails"})}}]),n}(c().Component);SR.propTypes={content:p().array.isRequired,onSelectThumbnail:p().func.isRequired};var OR=function(e){yR(n,e);var t=vR(n);function n(){return pR(this,n),t.apply(this,arguments)}return dR(n,[{key:"render",value:function(){var e={width:this.props.size.width,height:this.props.size.height},t="/project/cover?id="+this.props.id;return null!=this.props.crop&&(t+="&x="+this.props.crop.x+"&y="+this.props.crop.y+"&w="+this.props.crop.width+"&h="+this.props.crop.height),c().createElement("div",{className:"thumb",style:e},null!=this.props.id?c().createElement("img",{src:t}):null)}}]),n}(c().Component);OR.propTypes={size:p().object.isRequired,id:p().number,crop:p().object};const _R=ER;function kR(e){return kR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kR(e)}function CR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function PR(e,t){return PR=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},PR(e,t)}function jR(e,t){if(t&&("object"===kR(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return TR(e)}function TR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xR(e){return xR=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},xR(e)}var RR=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&PR(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=xR(r);if(o){var n=xR(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return jR(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(TR(t)),t.valid=t.valid.bind(TR(t)),t.getValue=t.getValue.bind(TR(t)),t.setValue=t.setValue.bind(TR(t)),t.onChange=t.onChange.bind(TR(t)),t.handleFocus=t.handleFocus.bind(TR(t)),t.handleBlur=t.handleBlur.bind(TR(t)),t.state={value:null!=t.props.value?t.props.value:"",validate:!1,isValid:!0,showValidation:!1},t}return t=a,(n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){return!1===this.props.required||!0===this.props.required&&null!=this.state.value&&""!=this.state.value}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(e){var t=e;null==t&&(t=""),this.setState({value:t})}},{key:"onChange",value:function(e){var t=this,n=e.target.value;this.setState({value:n},(function(){this.validate(),t.props.onChange&&t.props.onChange(n)}))}},{key:"handleFocus",value:function(e){}},{key:"handleBlur",value:function(e){}},{key:"render",value:function(){var e="form-group";!0!==this.state.showValidation||this.state.isValid||(e+=" has-error");var t=null;return!0!==this.state.showValidation||this.state.isValid?this.props.helpMessage?t=c().createElement(gi,{message:this.props.helpMessage}):e+=" no-help":t=c().createElement(gi,{message:this.props.requiredErrorMessage}),c().createElement("div",{className:e},c().createElement("label",{className:"dynamic for-textarea",htmlFor:this.props.name},this.props.label),c().createElement("textarea",{name:this.props.name,rows:this.props.rows,value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onFocus:this.handleFocus,onBlur:this.handleBlur}),t,this.props.children)}}])&&CR(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);RR.propTypes={name:p().string,rows:p().number,label:p().string,placeholder:p().string,helpMessage:p().string,required:p().bool,requiredErrorMessage:p().string,onChange:p().func},RR.defaultProps={rows:7,required:!1,requiredErrorMessage:"input required."};const DR=RR;function NR(e){return NR="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},NR(e)}function MR(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IR(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function AR(e,t,n){return t&&IR(e.prototype,t),n&&IR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LR(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BR(e,t)}function BR(e,t){return BR=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},BR(e,t)}function FR(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=qR(e);if(t){var o=qR(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return UR(this,n)}}function UR(e,t){if(t&&("object"===NR(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return KR(e)}function KR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qR(e){return qR=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qR(e)}var VR=function(e){LR(n,e);var t=FR(n);function n(e){var r;return MR(this,n),(r=t.call(this,e)).changeStage=r.changeStage.bind(KR(r)),r.processLastStage=r.processLastStage.bind(KR(r)),r.editCancel=r.editCancel.bind(KR(r)),r.onContentDelete=r.onContentDelete.bind(KR(r)),r.onPublishToProfileChange=r.onPublishToProfileChange.bind(KR(r)),r.onPublishToForumChange=r.onPublishToForumChange.bind(KR(r)),r.onPublishAsHeroChange=r.onPublishAsHeroChange.bind(KR(r)),r.onSubmit=r.onSubmit.bind(KR(r)),r.stages=["Upload Content","Add Info","Publish"],r.form=r.props.form,r.state={currentStage:1},r}return AR(n,[{key:"changeStage",value:function(e){var t=!1,n=e>this.state.currentStage;switch(this.state.currentStage){case 1:this.form.deliverablesContentNodes=this.refs.contentEditor.getNodes(),this.form.deliverablesContentData=this.refs.contentEditor.getContent(),null!=this.form.thumbCropData&&null!=this.form.thumbCropData&&null!=this.form.thumbCropData.id&&null==Cm(this.form.deliverablesContentData,this.form.thumbCropData.id)&&(this.form.thumbCropData=null),t=this.refs.contentEditor.validate();break;case 2:this.form.title=this.refs.title.getValue(),this.form.thumbCropData=this.refs.thumbnailEditor.getThumbnailData(),this.form.description=this.refs.description.getValue(),this.form.productData=this.refs.product.getSelectedOptions(),this.form.categoryData=this.refs.category.getSelectedOptions(),this.form.tagData=this.refs.tags.getTags(),t=this.refs.title.validate()&&this.refs.description.validate()&&this.refs.product.validate()&&this.refs.category.validate();break;case 3:this.processLastStage()}!0!==t&&n||this.setState({currentStage:e})}},{key:"processLastStage",value:function(){if(this.form.completionStatusOptions.selectedValue=this.refs.status.getValue(),this.form.publishedToProfileFL=this.refs.publishToProfile.getValue(),"Portfolio"==this.props.projectType){var e=this.refs.publishToForum.getValue();if(this.form.publishedToForumFL=e.checked,this.form.publishedToForumID=e.forumID,!this.refs.publishToForum.validate())return!1}return"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&!0===this.form.viewer.isHero&&(this.form.publishAsHeroFL=this.refs.publishAsHero.getValue()),!0}},{key:"editCancel",value:function(){window.location.replace(this.form.returnUrl)}},{key:"onContentDelete",value:function(e){}},{key:"onPublishToProfileChange",value:function(e){}},{key:"onPublishToForumChange",value:function(e){}},{key:"onPublishAsHeroChange",value:function(e){}},{key:"onSubmit",value:function(){var e=!0;if(3==this.state.currentStage&&(e=this.processLastStage()),"Portfolio"==this.props.projectType&&!e)return!1;var t={deliverablesContentNodes:this.form.deliverablesContentNodes,title:this.form.title,thumbCropData:this.form.thumbCropData,description:this.form.description,productData:this.form.productData,categoryData:this.form.categoryData,tagData:this.form.tagData,completionStatus:this.form.completionStatusOptions.selectedValue,publishedToProfileFL:this.form.publishedToProfileFL,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()};"Portfolio"==this.props.projectType&&(t.publishedToForumFL=this.form.publishedToForumFL,t.publishedToForumID=this.form.publishedToForumID),"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&!0===this.form.viewer.isHero&&(t.publishAsHeroFL=this.form.publishAsHeroFL);var n=this;$.ajax({type:"POST",url:"/api/project/".concat(this.form.id,"/edit/"),data:t}).done((function(e,t,r){alerts.success("Project Saved"),window.location.replace(n.form.returnUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e;switch(this.state.currentStage){case 1:switch(this.props.projectType){case"Portfolio":e=c().createElement(nR,{ref:"contentEditor",importNodes:this.form.deliverablesContentNodes,importContent:this.form.deliverablesContentData,onDelete:this.onContentDelete,required:!0});break;case"Training":e=c().createElement(uR,{ref:"contentEditor",importNodes:this.form.deliverablesContentNodes,importContent:this.form.deliverablesContentData,onDelete:this.onContentDelete,required:!0})}break;case 2:e=c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement(Jb,{ref:"title",label:"Title",placeholder:"Name your project...",value:this.form.title,required:!0,requiredErrorMessage:"Title required."})),c().createElement("div",{className:"col-md-12"},c().createElement(_R,{ref:"thumbnailEditor",size:this.form.thumbnailSize,contentThumbnail:this.form.thumbCropData,content:this.form.deliverablesContentData,label:"Project Cover Image"})),c().createElement("div",{className:"col-md-12"},c().createElement(DR,{ref:"description",label:"Description",placeholder:"Project description...",value:this.form.description,rows:10,required:!0,requiredErrorMessage:"Description required."})),c().createElement("div",{className:"col-md-6"},c().createElement(Di,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.form.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.form.productData})),c().createElement("div",{className:"col-md-6"},c().createElement(Di,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.form.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.form.categoryData})),c().createElement("div",{className:"col-md-12"},c().createElement($O,{ref:"tags",label:"Tags",placeholder:"Add Tag...",tags:this.form.tagData})));break;case 3:e=c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement("fieldset",null,c().createElement("legend",null,"Project Status"),c().createElement(ug,{ref:"status",name:"status",options:this.form.completionStatusOptions.items,value:this.form.completionStatusOptions.selectedValue}))),c().createElement("div",{className:"col-md-12"},c().createElement("fieldset",{className:"project-publish"},c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-6"},c().createElement("legend",null,"Publishing status"))),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-6"},c().createElement(ng,{ref:"publishToProfile",name:"publishToProfile",label:"Publish To Profile",value:this.form.publishedToProfileFL,onChange:this.onPublishToProfileChange}))),"Portfolio"==this.props.projectType&&c().createElement(zR,{ref:"publishToForum",checked:this.form.publishedToForumFL,forumID:this.form.publishedToForumID,options:this.form.publishedToForumOptions,forumPath:this.form.publishedToForumPath,topicUrl:this.form.publishedToForumTopicUrl}),"Training"==this.props.projectType&&this.form.viewer&&this.form.viewer.isHero&&1==this.form.viewer.isHero&&c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-6"},c().createElement("legend",null,"Foundry Heroes"),c().createElement(ng,{ref:"publishAsHero",name:"publishAsHero",label:"Allow Publish As Hero Project",value:this.form.publishAsHeroFL,onChange:this.onPublishAsHeroChange}))))),c().createElement("div",{style:{textAlign:"center"}},c().createElement("button",{id:"btnSave",type:"button",value:"Save",name:"save",className:"btn-primary",onClick:this.onSubmit},"Save Project Changes")))}return c().createElement("div",null,c().createElement("section",{id:"heroBanner",className:"default"},c().createElement("div",{className:"hero-content"},c().createElement("h2",null,"Project Edit"))),c().createElement("div",{className:"container subsection",id:"projectEdit"},c().createElement(Cj,{stages:this.stages,currentStage:this.state.currentStage,onChange:this.changeStage,onCancel:this.editCancel}),e))}}]),n}(c().Component);VR.propTypes={form:p().object.isRequired,projectType:p().string.isRequired};var zR=function(e){LR(n,e);var t=FR(n);function n(e){var r;return MR(this,n),(r=t.call(this,e)).validate=r.validate.bind(KR(r)),r.valid=r.valid.bind(KR(r)),r.getValue=r.getValue.bind(KR(r)),r.onCheckboxChange=r.onCheckboxChange.bind(KR(r)),r.onForumChange=r.onForumChange.bind(KR(r)),r.checked=r.props.checked,r.forumID=r.props.forumID,r.state={disabled:!r.props.checked,isValid:!0,showValidation:!1},r}return AR(n,[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){if(!1===this.checked||null!=this.props.forumPath)return!0;var e=!1;return!0===this.checked&&(e=this.refs.forumSelect.validate()),!0===this.checked&&e&&null!=this.forumID}},{key:"getValue",value:function(){return{checked:this.checked,forumID:this.forumID}}},{key:"onCheckboxChange",value:function(e){this.checked=e,this.setState({disabled:!e})}},{key:"onForumChange",value:function(e){this.forumID=e}},{key:"render",value:function(){var e;return e=null!=this.props.forumPath?c().createElement("div",{className:"project-publish-forum"},c().createElement("p",null,"Forum: ",c().createElement("a",{href:this.props.forumPath.url},this.props.forumPath.name)),c().createElement("p",null,"Topic: ",c().createElement("a",{href:this.props.topicUrl},"Link"))):c().createElement(Yp,{ref:"forumSelect",value:this.props.forumID,options:this.props.options,required:!0,requiredErrorMessage:"Forum selection required to publish to forum",disabled:this.state.disabled,onChange:this.onForumChange}),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-6"},c().createElement(ng,{ref:"checkbox",name:"publishToForum",label:"Publish To Forum",value:this.props.checked,onChange:this.onCheckboxChange})),c().createElement("div",{className:"col-md-6"},e))}}]),n}(c().Component);const WR=VR;function HR(e){return HR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HR(e)}function $R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function JR(e,t){return JR=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},JR(e,t)}function GR(e,t){if(t&&("object"===HR(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return QR(e)}function QR(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YR(e){return YR=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},YR(e)}var XR=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&JR(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=YR(r);if(o){var n=YR(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return GR(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).setup=t.setup.bind(QR(t)),t.openInput=t.openInput.bind(QR(t)),t.inputChange=t.inputChange.bind(QR(t)),t.onEditThumbnail=t.onEditThumbnail.bind(QR(t)),t.onAcceptCrop=t.onAcceptCrop.bind(QR(t)),t.onCancelCrop=t.onCancelCrop.bind(QR(t)),t.imageCropSize=null,t.thumbCropData=null,t.state={src:t.props.src,showImageCropModal:!1},t}return t=a,(n=[{key:"componentDidMount",value:function(){this.setup()}},{key:"setup",value:function(){var e=this;$.getJSON("/api/content/cover-size").done((function(t,n,r){e.imageCropSize=t}))}},{key:"openInput",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"inputChange",value:function(e){var t=(e.dataTransfer?e.dataTransfer.files:e.target.files)[0],n=new FormData;n.append(t.name,t);var r=this;$.ajax({type:"POST",url:"/api/content/".concat(this.props.content.id,"/cover/replace"),contentType:!1,data:n,processData:!1}).done((function(e,t,n){r.setState({src:e.thumbUrl},(function(){this.props.onChange&&this.props.onChange(e)}))})).fail((function(e,t,n){alerts.error(n.error)}))}},{key:"onEditThumbnail",value:function(){this.setState({showImageCropModal:!0})}},{key:"onAcceptCrop",value:function(e){var t=this;$.ajax({type:"POST",url:"/api/content/".concat(this.props.content.id,"/cover/edit"),contentType:"application/json; charset=utf-8",data:JSON.stringify({crop:e}),dataType:"json",context:this}).done((function(e,n,r){var o=Utils.clone(this.props.content);o.thumbUrl=e,t.setState({showImageCropModal:!1,src:e},(function(){this.props.onChange&&this.props.onChange(o)}))})).fail((function(e,n,r){alerts.error(e.responseJSON.errorMessage),t.setState({showImageCropModal:!1})}))}},{key:"onCancelCrop",value:function(){this.setState({showImageCropModal:!1})}},{key:"render",value:function(){var e=this,t={type:"file",style:{display:"none"},multiple:!1,ref:function(t){return e.fileInputEl=t},onChange:this.inputChange},n=[];return n.push(c().createElement("button",{key:0,onClick:this.openInput},"Replace Content Cover")),n.push(c().createElement("button",{key:1,onClick:this.onEditThumbnail.bind(null,this.props.id)},"Edit Thumbnail")),c().createElement("div",{className:"cover-editor"},c().createElement("img",{className:"no-drag",src:this.state.src}),c().createElement("div",{className:"edit"},n),c().createElement("input",t),this.state.showImageCropModal&&c().createElement(B,null,c().createElement(Fm,{src:this.props.content.coverUrl,size:this.imageCropSize,onAccept:this.onAcceptCrop,onCancel:this.onCancelCrop})))}}])&&$R(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);XR.propTypes={content:p().object,id:p().number,src:p().string,onChange:p().func};const ZR=XR;function eD(e){return eD="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},eD(e)}function tD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nD(e,t){return nD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},nD(e,t)}function rD(e,t){if(t&&("object"===eD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return oD(e)}function oD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iD(e){return iD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},iD(e)}var aD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nD(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=iD(r);if(o){var n=iD(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return rD(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(oD(t)),t.getContentForm=t.getContentForm.bind(oD(t)),t.getTags=t.getTags.bind(oD(t)),t.getProducts=t.getProducts.bind(oD(t)),t.onContentChange=t.onContentChange.bind(oD(t)),t.state={content:t.props.content,contentForm:null!=t.props.contentForm?t.props.contentForm:null},t}return t=a,(n=[{key:"componentDidMount",value:function(){if(null==this.state.contentForm){var e=this;$.ajax({type:"GET",url:"/staging/asset",data:{itemID:this.state.content.id},context:this}).done((function(t){var n=t;null!=n.categoryData&&0!=n.categoryData.length||null!=n.productData&&0!=n.productData.length||null!=n.tagData&&0!=n.tagData.length||null==n.defaultProductData||!(n.defaultProductData.length>0)||(n.productData=n.defaultProductData),e.setState({contentForm:n})}))}}},{key:"validate",value:function(){var e=this.refs.category.validate(),t=this.refs.product.validate();return e&&t}},{key:"getContentForm",value:function(){return this.state.contentForm}},{key:"getTags",value:function(){return this.refs.tags.getTags()}},{key:"getProducts",value:function(){return this.refs.product.getSelectedOptions()}},{key:"onContentChange",value:function(e){var t=this;this.setState({content:e},(function(){t.props.onContentChange&&t.props.onContentChange(e)}))}},{key:"render",value:function(){return c().createElement("div",{className:"tfnode asset-node"},c().createElement("div",{style:{textAlign:"right"}},this.props.children),c().createElement("div",{className:"details"},c().createElement("h4",null,c().createElement("span",{className:"content-type"},this.state.content.type)," ",this.state.content.title)),c().createElement("div",{className:"editors"},c().createElement(ZR,{content:this.state.content,id:this.state.content.id,src:this.state.content.thumbUrl,onChange:this.onContentChange}),c().createElement("div",{className:"data-editors"},null!=this.state.contentForm&&c().createElement(Di,{ref:"product",helpMessage:"Select one or more products and arrange them in order of importance.",required:!0,requiredErrorMessage:"At least one product is required.",options:this.state.contentForm.productOptions,placeholderOption:{text:"Select tools *",value:"-1"},selectedOptions:this.state.contentForm.productData}),null!=this.state.contentForm&&c().createElement(Di,{ref:"category",helpMessage:"Select one or more categories and arrange them in the order of importance.",required:!0,requiredErrorMessage:"At least one category is required.",options:this.state.contentForm.categoryOptions,placeholderOption:{text:"Select categories *",value:"-1"},selectedOptions:this.state.contentForm.categoryData}),null!=this.state.contentForm&&c().createElement($O,{ref:"tags",label:"Content Tags",placeholder:"Add Tag...",tags:this.state.contentForm.tagData}))))}}])&&tD(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);aD.propTypes={content:p().object.isRequired,contentForm:p().object,onContentChange:p().func};const sD=aD;function cD(e){return cD="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},cD(e)}function lD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function uD(e,t){return uD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},uD(e,t)}function fD(e,t){if(t&&("object"===cD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pD(e)}function pD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hD(e){return hD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hD(e)}var dD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&uD(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=hD(r);if(o){var n=hD(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return fD(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(pD(t)),t.valid=t.valid.bind(pD(t)),t.getNodes=t.getNodes.bind(pD(t)),t.getContent=t.getContent.bind(pD(t)),t.getContentForms=t.getContentForms.bind(pD(t)),t.getExtraInfo=t.getExtraInfo.bind(pD(t)),t.hasContent=t.hasContent.bind(pD(t)),t.onAcceptContent=t.onAcceptContent.bind(pD(t)),t.onDeleteNode=t.onDeleteNode.bind(pD(t)),t.onMoveUpNode=t.onMoveUpNode.bind(pD(t)),t.onMoveDownNode=t.onMoveDownNode.bind(pD(t)),t.updateNodeOrder=t.updateNodeOrder.bind(pD(t)),t.getContentForm=t.getContentForm.bind(pD(t)),t.onContentChange=t.onContentChange.bind(pD(t)),t._content=t.props.contentData?t.props.contentData:[],t._contentForms=t.props.contentForms?t.props.contentForms:[],t._nodes=t.props.contentNodes?t.props.contentNodes:[],t.state={nodes:t._nodes,isValid:t.valid(),showValidation:!1},t}return t=a,n=[{key:"validate",value:function(){var e=this.valid();return this.setState({isValid:e,showValidation:!0}),e}},{key:"valid",value:function(){var e=this,t=!0;return Object.keys(this.refs).forEach((function(n){var r=e.refs[n].validate();t=t&&r})),!1===this.props.required||!0===this.props.required&&this.hasContent()&&t}},{key:"getNodes",value:function(){return this._nodes}},{key:"getContent",value:function(){return this._content}},{key:"getContentForms",value:function(){var e=this,t=[];return Object.keys(this.refs).forEach((function(n){t.push(e.refs[n].getContentForm())})),t}},{key:"getExtraInfo",value:function(){var e=this,t=[],n=[];return Object.keys(this.refs).forEach((function(r){t=t.concat(e.refs[r].getTags()),n=n.concat(e.refs[r].getProducts())})),{tags:mn.arrayUnique(t),products:mn.arrayUnique(n)}}},{key:"hasContent",value:function(){return null!=this._content&&this._content.length>0}},{key:"onAcceptContent",value:function(e,t){var n=this;e.forEach((function(e){n._content.push(e);var t={id:mn.generateUID(),type:"Content",usage:"Content",data:e.id,children:null};n._nodes.push(t)})),this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onDeleteNode",value:function(e,t){null!=t&&t.preventDefault();var n=this._nodes.splice(e,1);if("Content"==n[0].type){var r=n[0].data;Pm(this._content,r),this.props.onDelete&&this.props.onDelete(r)}this.setState({nodes:this._nodes,isValid:this.valid()})}},{key:"onMoveUpNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e-1)}},{key:"onMoveDownNode",value:function(e,t){t.preventDefault(),this.updateNodeOrder(e,e+1)}},{key:"updateNodeOrder",value:function(e,t){this._nodes.splice(t,0,this._nodes.splice(e,1)[0]),this.setState({nodes:this._nodes})}},{key:"getContentForm",value:function(e){for(var t=0;t<this._contentForms.length;t++)if(this._contentForms[t].id==e)return this._contentForms[t];return null}},{key:"onContentChange",value:function(e){var t=Cm(this._content,e.id);null!=t&&(this._content[t]=e)}},{key:"render",value:function(){var e="tfnode-editor";!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid||(e+=" has-error");var t=[];return this.state.nodes.forEach((function(e,n){if("Content"===e.type){var r=km(this._content,e.data),o=this.getContentForm(e.data);t.push(c().createElement(sD,{ref:e.id,key:"c:"+e.id,content:r,contentForm:o,onContentChange:this.onContentChange},c().createElement(Jx,{index:n,indexOf:this.state.nodes.length,showDelete:!0,deleteButtonLabel:"Remove Content",onDelete:this.onDeleteNode.bind(null,n),onMoveUp:this.onMoveUpNode.bind(null,n),onMoveDown:this.onMoveDownNode.bind(null,n)})))}t.push(c().createElement("div",{key:"p:"+n,className:"tfnode placeholder-node",style:{marginBottom:"20px"}},c().createElement("hr",null)))}),this),c().createElement("div",{className:e},t,c().createElement(Dd,{groupsAllowed:["Asset"],closeAfterAutoAcceptContent:!1,autoAcceptContent:!0,onAccept:this.onAcceptContent,onCancel:this.onHideStaging},c().createElement("h4",null,c().createElement("span",{className:"glyphicon glyphicon-arrow-up"}),c().createElement("br",null),"Drag and drop one or more files or click in this area to upload")),!0!==this.state.showValidation||0!=this.state.nodes.length||this.state.isValid?null:c().createElement(gi,{message:"At least one content item (image/video) is required"}))}}],n&&lD(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);dD.propTypes={fileSizeLimit:p().number,contentNodes:p().array,contentData:p().array,contentForms:p().array,required:p().bool,requiredErrorMessage:p().string,onChange:p().func,onDelete:p().func},dD.defaultProps={required:!1,requiredErrorMessage:"At least one content item is required."};const yD=dD;function mD(e){return mD="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},mD(e)}function vD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bD(e,t){return bD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},bD(e,t)}function gD(e,t){if(t&&("object"===mD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wD(e)}function wD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ED(e){return ED=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ED(e)}var SD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bD(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=ED(r);if(o){var n=ED(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return gD(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).changeStage=t.changeStage.bind(wD(t)),t.processLastStage=t.processLastStage.bind(wD(t)),t.updateSupportContent=t.updateSupportContent.bind(wD(t)),t.editCancel=t.editCancel.bind(wD(t)),t.onContentDelete=t.onContentDelete.bind(wD(t)),t.onPublishToProfileChange=t.onPublishToProfileChange.bind(wD(t)),t.onSubmit=t.onSubmit.bind(wD(t)),t.stages=["Upload Asset","Upload Example Gallery","Add Info","Publish"],t.form=t.props.form,t.projectTagsAndProducts=null,t.state={currentStage:1},t}return t=a,(n=[{key:"changeStage",value:function(e){var t=!1,n=e>this.state.currentStage;switch(this.state.currentStage){case 1:this.form.deliverablesContentNodes=this.refs.contentEditor.getNodes(),this.form.contentForms=this.refs.contentEditor.getContentForms();var r=this.refs.contentEditor.getContent();this.form.supportContentData=this.updateSupportContent(r),this.projectTagsAndProducts=this.refs.contentEditor.getExtraInfo(),(null==this.form.title||""==this.form.title)&&null!=r&&r.length>0&&(this.form.title=r[0].title),t=this.refs.contentEditor.validate();break;case 2:this.form.supportContentData=this.refs.supportContentEditor.getContent().content,this.form.supportContentNodes=this.refs.supportContentEditor.getNodes(),null!=this.form.thumbCropData&&null!=this.form.thumbCropData&&null!=this.form.thumbCropData.id&&null==Cm(this.form.supportContentData,this.form.thumbCropData.id)&&(this.form.thumbCropData=null),t=!0;break;case 3:this.form.title=this.refs.title.getValue(),this.form.thumbCropData=this.refs.thumbnailEditor.getThumbnailData(),this.form.description=this.refs.description.getValue(),t=this.refs.title.validate()&&this.refs.description.validate();break;case 4:this.processLastStage()}!0!==t&&n||this.setState({currentStage:e})}},{key:"processLastStage",value:function(){this.form.completionStatusOptions.selectedValue=this.refs.status.getValue(),this.form.publishedToProfileFL=this.refs.publishToProfile.getValue(),this.form.commentsStatusOptions.selectedValue=this.refs.commentStatus.getValue()}},{key:"updateSupportContent",value:function(e){for(var t=this.form.supportContentData,n=[],r=0;r<e.length;r++){for(var o=!1,i=0;i<t.length;i++)t[i].id==e[r].id&&(t[i]=e[r],t[i].isStatic=!0,o=!0);o||(e[r].isStatic=!0,n.push(e[r]))}return n.length>0&&(t=t.concat(n)),t}},{key:"editCancel",value:function(){window.location.replace(this.form.returnUrl)}},{key:"onContentDelete",value:function(e){Pm(this.form.supportContentData,e)}},{key:"onPublishToProfileChange",value:function(e){this.refs.commentStatus.setDisabled(!e)}},{key:"onSubmit",value:function(){4==this.state.currentStage&&this.processLastStage();var e={deliverablesContentNodes:this.form.deliverablesContentNodes,contentForms:this.form.contentForms.map((function(e){return jm(e)})),supportContentNodes:this.form.supportContentNodes,title:this.form.title,thumbCropData:this.form.thumbCropData,description:this.form.description,completionStatus:this.form.completionStatusOptions.selectedValue,publishedToProfileFL:this.form.publishedToProfileFL,commentsStatus:this.form.commentsStatusOptions.selectedValue,__RequestVerificationToken:$('input[name="__RequestVerificationToken"]').val()},t=this;$.ajax({type:"POST",url:"/api/project/".concat(this.form.id,"/edit/"),data:e}).done((function(e,n,r){alerts.success("Project Saved"),window.location.replace(t.form.returnUrl)})).fail((function(e,t,n){alerts.error(e.responseJSON.errorMessage)}))}},{key:"render",value:function(){var e;switch(this.state.currentStage){case 1:e=c().createElement(yD,{ref:"contentEditor",contentNodes:this.form.deliverablesContentNodes,contentData:this.form.deliverablesContentData,contentForms:this.form.contentForms,onDelete:this.onContentDelete,required:!0});break;case 2:e=c().createElement("div",{className:"container subsection gallery-editor"},c().createElement("label",null,"Example Gallery"),c().createElement("p",null,"Add images and video examples to show off the shared asset.  Drag thumbnails to change the order."),c().createElement(Xv,{ref:"supportContentEditor",content:this.form.supportContentData}));break;case 3:e=c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement(Jb,{ref:"title",label:"Title",placeholder:"Name your project...",value:this.form.title,required:!0,requiredErrorMessage:"Title required."})),c().createElement("div",{className:"col-md-12"},c().createElement(_R,{ref:"thumbnailEditor",size:this.form.thumbnailSize,contentThumbnail:this.form.thumbCropData,content:this.form.supportContentData,label:"Project Cover Image"})),c().createElement("div",{className:"col-md-12"},c().createElement(DR,{ref:"description",label:"Description",placeholder:"Project description...",value:this.form.description,rows:10,required:!0,requiredErrorMessage:"Description required."})),c().createElement("div",{className:"col-md-12 project-info"},c().createElement(kO,{list:this.projectTagsAndProducts.tags,label:"Project Tags"}),c().createElement(kO,{list:this.projectTagsAndProducts.products.map((function(e){return e.text})),label:"Project Products"})));break;case 4:e=c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-12"},c().createElement(ug,{ref:"status",name:"status",label:"Project Status",options:this.form.completionStatusOptions.items,value:this.form.completionStatusOptions.selectedValue})),c().createElement("div",{className:"col-md-12"},c().createElement("fieldset",{className:"project-publish"},c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-6"},c().createElement("legend",null,"Publishing status")),c().createElement("div",{className:"col-md-6"},c().createElement("legend",null,"Project comments"))),c().createElement("div",{className:"row"},c().createElement("div",{className:"col-md-6"},c().createElement(ng,{ref:"publishToProfile",name:"publishToProfile",label:"Publish To Profile",value:this.form.publishedToProfileFL,onChange:this.onPublishToProfileChange})),c().createElement("div",{className:"col-md-6"},c().createElement(ug,{ref:"commentStatus",name:"commentStatus",options:this.form.commentsStatusOptions.items,value:this.form.commentsStatusOptions.selectedValue,disabled:!this.form.publishedToProfileFL}))))),c().createElement("div",{style:{textAlign:"center"}},c().createElement("button",{id:"btnSave",type:"button",value:"Save",name:"save",className:"btn-primary",onClick:this.onSubmit},"Save Project Changes")))}return c().createElement("div",null,c().createElement("section",{id:"heroBanner",className:"default"},c().createElement("div",{className:"hero-content"},c().createElement("h2",null,"Share Project Edit"))),c().createElement("div",{className:"container subsection",id:"projectEdit"},c().createElement(Cj,{stages:this.stages,currentStage:this.state.currentStage,onChange:this.changeStage,onCancel:this.editCancel}),e))}}])&&vD(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);SD.propTypes={form:p().object.isRequired};const OD=SD;function _D(e){return _D="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(e)}function kD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function CD(e,t){return CD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},CD(e,t)}function PD(e,t){if(t&&("object"===_D(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jD(e)}function jD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function TD(e){return TD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},TD(e)}var xD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CD(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=TD(r);if(o){var n=TD(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return PD(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).validate=t.validate.bind(jD(t)),t.onChange=t.onChange.bind(jD(t)),t.doQuery=t.doQuery.bind(jD(t)),t.startRename=t.startRename.bind(jD(t)),t.cancelRename=t.cancelRename.bind(jD(t)),t.getValue=t.getValue.bind(jD(t)),t.state={doRename:!1,value:t.props.value,status:null,helpMessage:t.props.helpMessage},t}return t=a,(n=[{key:"UNSAFE_componentWillMount",value:function(){this.doQuery=u()(this.doQuery,500)}},{key:"validate",value:function(e){return/^[\u00C0-\u1FFF\u2C00-\uD7FF\w\. -]{3,50}$/gi.exec(e)}},{key:"onChange",value:function(){var e=this.refs.name.value;e.trim()!=this.props.value?this.validate(e.trim())?this.doQuery(e):this.setState({value:e,status:"Error",helpMessage:"Profile name must be between 3 to 50 characters in length and only contain alphanumeric characters."}):this.setState({value:this.props.value,status:null,helpMessage:this.props.helpMessage})}},{key:"doQuery",value:function(e){var t=this,n="Error",r="Name Not Available";$.ajax({url:"/api/profile/checkrename",type:"POST",data:{name:e.trim()}}).done((function(e){!0===e.available&&(n="Success",r="Name Available.  Profile will be renamed to <strong>"+e.name+"</strong> after save.")})).fail((function(e){alerts.error(e.error)})).always((function(){t.setState({value:e,status:n,helpMessage:r})}))}},{key:"startRename",value:function(){this.setState({doRename:!0})}},{key:"cancelRename",value:function(){this.setState({doRename:!1,value:this.props.value,status:null,helpMessage:this.props.helpMessage})}},{key:"getValue",value:function(){return!0===this.state.doRename&&"Success"===this.state.status&&this.validate(this.state.value)&&this.state.value!=this.props.value?this.state.value:null}},{key:"render",value:function(){if(this.state.doRename){var e="profile-name-editor form-group";if(null!=this.state.status)switch(this.state.status){case"Success":e+=" has-success";break;case"Error":e+=" has-error"}return c().createElement("div",{className:e},c().createElement("label",{className:"static"},"Profile Name"),c().createElement("div",{className:"input-group"},c().createElement("input",{type:"text",ref:"name",className:"form-control",defaultValue:this.props.value,onChange:this.onChange,style:{width:"100%"}}),c().createElement("div",{className:"input-group-btn"},c().createElement("button",{type:"button",className:"btn btn-primary",onClick:this.cancelRename},"Cancel Rename"))),c().createElement("span",{className:"help-block",dangerouslySetInnerHTML:{__html:this.state.helpMessage}}))}return c().createElement("div",{className:"profile-name-editor form-group"},c().createElement("label",{className:"static"},"Profile Name"),c().createElement("div",{className:"static-input"},this.props.value," ",c().createElement("button",{type:"button",className:"btn-link icon icon-after icon-refresh",onClick:this.startRename},"Rename Profile")))}}])&&kD(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);xD.propTypes={helpMessage:p().string},xD.defaultProps={helpMessage:"Rename will only occur after save if the above input is valid."};const RD=xD;function DD(e){return DD="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},DD(e)}function ND(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function MD(e,t){return MD=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},MD(e,t)}function ID(e,t){if(t&&("object"===DD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return AD(e)}function AD(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LD(e){return LD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},LD(e)}var BD=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&MD(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=LD(r);if(o){var n=LD(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return ID(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).getValue=t.getValue.bind(AD(t)),t.open=t.open.bind(AD(t)),t.change=t.change.bind(AD(t)),t.state={hasAvatar:t.props.hasAvatar,avatarUrl:t.props.avatarUrl},t}return t=a,(n=[{key:"getValue",value:function(){}},{key:"open",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"change",value:function(e){var t=(e.dataTransfer?e.dataTransfer.files:e.target.files)[0],n=new FormData;n.append(t.name,t);var r=this;$.ajax({type:"POST",url:"/api/profile/"+this.props.profileRouteName+"/avatar",contentType:!1,processData:!1,data:n}).done((function(e,t,n){r.setState({hasAvatar:e.hasAvatar,avatarUrl:e.avatarUrl})})).fail((function(e,t,n){alerts.error(n.error)}))}},{key:"render",value:function(){var e=this,t=this.state.hasAvatar?"Replace Image":"Add Image",n={type:"file",style:{display:"none"},multiple:!1,ref:function(t){return e.fileInputEl=t},onChange:this.change};return c().createElement("div",{className:"profile-avatar-editor form-group"},c().createElement("label",{className:"static"},"Avatar"),c().createElement("img",{className:"circle",src:this.state.avatarUrl}),c().createElement("button",{type:"button",onClick:this.open,className:"btn-link icon icon-after icon-refresh"},t),c().createElement("input",n))}}])&&ND(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(c().Component);BD.propTypes={hasAvatar:p().bool.isRequired,avatarUrl:p().string};const FD=BD})(),i})()));
