(()=>{var e,t={8236:e=>{e.exports=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,s));var i=n[s];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i}},6245:(e,t,n)=>{const s=n(1609),i=n(5987),r=n(9375).dashboard,o=n(3852),a=n(8275),l=s.createElement;class u extends s.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(a(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:Dashboard",...this.props,target:this.container};delete t.uppy,e.use(i,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=o(this.props),l("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}u.propTypes=r,u.defaultProps={inline:!0},e.exports=u},9368:(e,t,n)=>{const s=n(1609),i=n(5556),r=n(5987),o=n(9375).dashboard,a=n(3852),l=n(8275),u=s.createElement;class c extends s.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(l(this,e)){const e={...this.props,onRequestCloseModal:this.props.onRequestClose};delete e.uppy,this.plugin.setOptions(e)}e.open&&!this.props.open?this.plugin.closeModal():!e.open&&this.props.open&&this.plugin.openModal()}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DashboardModal",...this.props,onRequestCloseModal:this.props.onRequestClose};t.target||(t.target=this.container),delete t.uppy,e.use(r,t),this.plugin=e.getPlugin(t.id),this.props.open&&this.plugin.openModal()}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=a(this.props),u("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}c.propTypes={target:"undefined"!=typeof window?i.instanceOf(window.HTMLElement):i.any,open:i.bool,onRequestClose:i.func,closeModalOnClickOutside:i.bool,disablePageScrollWhenModalOpen:i.bool,...o},e.exports=c},1362:(e,t,n)=>{const s=n(1609),i=n(6495),r=n(9375),o=n(3852),a=n(8275),l=s.createElement;class u extends s.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(a(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:DragDrop",...this.props,target:this.container};delete t.uppy,e.use(i,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=o(this.props),l("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}u.propTypes={uppy:r.uppy,locale:r.locale},u.defaultProps={},e.exports=u},6703:(e,t,n)=>{const s=n(5556),i=n(1609),r=n(1586),o=n(9375),a=i.createElement;class l extends i.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){e.uppy!==this.props.uppy&&(this.uninstallPlugin(e),this.installPlugin())}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:FileInput",...this.props,target:this.container};delete t.uppy,e.use(r,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return a("div",{className:"uppy-Container",ref:e=>{this.container=e}})}}l.propTypes={uppy:o.uppy,locale:o.locale,pretty:s.bool,inputName:s.string},l.defaultProps={},e.exports=l},1413:(e,t,n)=>{const s=n(1609),i=n(5556),r=n(98),o=n(9375).uppy,a=n(3852),l=n(8275),u=s.createElement;class c extends s.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(l(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:ProgressBar",...this.props,target:this.container};delete t.uppy,e.use(r,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=a(this.props),u("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}c.propTypes={uppy:o,fixed:i.bool,hideAfterFinish:i.bool},c.defaultProps={},e.exports=c},2578:(e,t,n)=>{const s=n(1609),i=n(5556),r=n(5711),o=n(9375).uppy,a=n(3852),l=n(8275),u=s.createElement;class c extends s.Component{componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(l(this,e)){const e={...this.props,target:this.container};delete e.uppy,this.plugin.setOptions(e)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){const{uppy:e}=this.props,t={id:"react:StatusBar",...this.props,target:this.container};delete t.uppy,e.use(r,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e){void 0===e&&(e=this.props);const{uppy:t}=e;t.removePlugin(this.plugin)}render(){return this.validProps=a(this.props),u("div",{className:"uppy-Container",ref:e=>{this.container=e},...this.validProps})}}c.propTypes={uppy:o,hideAfterFinish:i.bool,showProgressDetails:i.bool},c.defaultProps={},e.exports=c},3852:e=>{const t=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],n=/^(aria-|data-)/;e.exports=e=>Object.fromEntries(Object.entries(e).filter((e=>{let[s]=e;return n.test(s)||t.includes(s)})))},8275:e=>{"use strict";e.exports=function(e,t){return Object.keys(e.props).some((n=>!((e,t)=>Object.prototype.hasOwnProperty.call(e,t))(e.validProps,n)&&e.props[n]!==t[n]))}},9375:(e,t,n)=>{const s=n(5556),i=n(3522).Uppy,r=s.instanceOf(i).isRequired,o=s.arrayOf(s.string),a=s.shape({strings:s.object,pluralize:s.func}),l=s.shape({id:s.string.isRequired,name:s.string.isRequired,placeholder:s.string}),u=s.oneOfType([s.arrayOf(l),s.func]),c=s.oneOfType([s.string,s.number]),d={uppy:r,inline:s.bool,plugins:o,width:c,height:c,showProgressDetails:s.bool,hideUploadButton:s.bool,hideProgressAfterFinish:s.bool,note:s.string,metaFields:u,proudlyDisplayPoweredByUppy:s.bool,disableStatusBar:s.bool,disableInformer:s.bool,disableThumbnailGenerator:s.bool,thumbnailWidth:s.number,locale:a};e.exports={uppy:r,locale:a,dashboard:d}},5152:(e,t,n)=>{const{useEffect:s,useRef:i}=n(1609),r=n(3522).Uppy;e.exports=function(e){if("function"!=typeof e)throw new TypeError("useUppy: expected a function that returns a new Uppy instance");const t=i(void 0);if(void 0===t.current&&(t.current=e(),!(t.current instanceof r)))throw new TypeError("useUppy: factory function must return an Uppy instance, got "+typeof t.current);return s((()=>()=>{t.current.close({reason:"unmount"}),t.current=void 0}),[t]),t.current}},7e3:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});var s=n(1609),i=n(6427);function r(e){return e?(0,s.createElement)(i.Icon,{icon:(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 403.08 308.33"},(0,s.createElement)("path",{style:{fill:"#fff"},d:"M305.76,547.23a100.33,100.33,0,0,1-4.94-200.53c3.77-52,49.22-94.8,102.29-94.8a99.32,99.32,0,0,1,69.38,28.17c17.82,17.24,29.42,41.63,31.85,66.93a100.33,100.33,0,0,1,3.43,199.44l-.36,0-45.52.58-64.06-64.36c-7.46,11-16.74,23.67-27.24,34.32C350.56,537.35,329.35,547.23,305.76,547.23Zm-7.11-164.16a64.21,64.21,0,0,0,7.11,128.06c27.14,0,47.61-26.31,66.09-54.52ZM502.24,510.74a64.25,64.25,0,0,0-7.06-128.06c-14.71,0-28,6.56-41.84,20.66-9.58,9.75-18.28,22-25.75,33.21ZM401.52,410.63c8.78-12.82,19.92-27.55,33-39.23,10.88-9.7,22-16.42,33.8-20.43v-1.1A72.08,72.08,0,0,0,447.39,306a63.43,63.43,0,0,0-44.28-18c-17,0-34,7.15-46.6,19.62a65.81,65.81,0,0,0-19.43,39Z",transform:"translate(-198.93 -245.4)"}),(0,s.createElement)("path",{style:{fill:"#4bc2ec"},d:"M403.11,258.4A92.84,92.84,0,0,1,468,284.74c16.73,16.19,27.63,39.12,29.9,62.91v.11l.42,5.37A93.83,93.83,0,0,1,507,540l-42.4.55-67.73-68C387.31,487,377.26,501,366,512.47c-18.76,19-38.45,28.26-60.21,28.26a93.83,93.83,0,1,1,0-187.65h1.31c.35-51.39,44.19-94.68,96-94.68m-.59,162.39c10.62-16.05,22.4-32.1,36.34-44.54,11.48-10.23,23.35-17,35.92-20.46l0-1.62,0-4.61c-1.83-18.3-10.18-35.86-22.94-48.21a69.89,69.89,0,0,0-48.8-19.85c-18.69,0-37.34,7.84-51.17,21.5-12.83,12.68-20.44,28.94-21.61,46l72.19,71.75m97.28,96.69a70.74,70.74,0,0,0-4.62-141.3c-16.57,0-31.34,7.18-46.48,22.61-10.74,10.94-20.48,24.85-29.45,38.63l80.55,80.06m-194,.15c31.09,0,52.85-28.48,74.41-61.88l-79.05-79.42a70.72,70.72,0,0,0,4.64,141.3M403.11,245.4A106.24,106.24,0,0,0,361.18,254,111.75,111.75,0,0,0,303,311.36a105.14,105.14,0,0,0-8.14,29.26,106.82,106.82,0,0,0,10.87,213.11c25.42,0,48.14-10.51,69.46-32.14a231,231,0,0,0,23.52-28.75l56.6,56.87,3.89,3.9,5.5-.07,42.4-.55h.73l.72-.09A107,107,0,0,0,602,446.9a105.82,105.82,0,0,0-31.86-75.63,107.08,107.08,0,0,0-60-30.12C506.6,316.23,494.69,292.5,477,275.4a105.78,105.78,0,0,0-73.9-30ZM344,344.28a59.68,59.68,0,0,1,17.1-32c11.42-11.28,26.73-17.75,42-17.75a57,57,0,0,1,39.76,16.19,65.27,65.27,0,0,1,18.48,35.94c-10.82,4.39-21.09,11-31.14,19.92-11.44,10.2-21.36,22.54-29.59,34L344,344.28Zm92,91.44c6.59-9.68,14-19.69,22-27.83,12.7-12.94,24.18-18.71,37.2-18.71a57.73,57.73,0,0,1,9.37,114.69L436,435.72ZM305.76,504.63A57.73,57.73,0,0,1,296.33,390l67.18,67.49c-8.05,12-16.66,23.65-25.87,32.3-10.81,10.16-20.94,14.89-31.88,14.89Z",transform:"translate(-198.93 -245.4)"}),(0,s.createElement)("polygon",{style:{fill:"#26a9e0"},points:"285.03 289.5 208.78 213.25 202.51 222.85 269.16 289.5 285.03 289.5"}),(0,s.createElement)("path",{style:{fill:"#26a9e0"},d:"M495.18,534.79h-2.31l-87.4-86.86-1.84,2.92c-26.07,41.27-53,83.94-97.87,83.94a87.89,87.89,0,1,1,0-175.77h2.32l81.17,81.16-6.39,9.48-79.39-79.39a76.66,76.66,0,0,0,2.29,153.3c38.66,0,62.81-38.24,88.38-78.71l3.18-5L313,356v-2.34c0-48.43,41.26-89.35,90.1-89.35A87.41,87.41,0,0,1,463.84,289c16.24,15.71,26.06,37.71,28.12,59.21l.36,4.62a27.48,27.48,0,0,0-11.56,1.37l0-4.92C479,330.4,470.38,311,456,297.08a76.25,76.25,0,0,0-52.93-21.52c-20.24,0-40.41,8.46-55.34,23.21-14.61,14.43-22.9,33-23.5,52.62l79.23,78.76c24-37,50.31-71.13,91.68-71.13a87.89,87.89,0,1,1,0,175.77Zm-83.54-96.55,85.82,85.29a76.76,76.76,0,0,0,74.39-76.63,77.5,77.5,0,0,0-76.67-76.66c-18.27,0-34.39,7.75-50.72,24.39C432.65,406.66,421.92,422.25,411.64,438.24Z",transform:"translate(-198.93 -245.4)"}))}):(0,s.createElement)(i.Icon,{icon:(0,s.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 403.08 308.33"},(0,s.createElement)("path",{style:{fill:"#9fa3a8"},d:"M305.76,547.23a100.33,100.33,0,0,1-4.94-200.53c3.77-52,49.22-94.8,102.29-94.8a99.32,99.32,0,0,1,69.38,28.17c17.82,17.24,29.42,41.63,31.85,66.93a100.33,100.33,0,0,1,3.43,199.44l-.36,0-45.52.58-64.06-64.36c-7.46,11-16.74,23.67-27.24,34.32C350.56,537.35,329.35,547.23,305.76,547.23Zm-7.11-164.16a64.21,64.21,0,0,0,7.11,128.06c27.14,0,47.61-26.31,66.09-54.52ZM502.24,510.74a64.25,64.25,0,0,0-7.06-128.06c-14.71,0-28,6.56-41.84,20.66-9.58,9.75-18.28,22-25.75,33.21ZM401.52,410.63c8.78-12.82,19.92-27.55,33-39.23,10.88-9.7,22-16.42,33.8-20.43v-1.1A72.08,72.08,0,0,0,447.39,306a63.43,63.43,0,0,0-44.28-18c-17,0-34,7.15-46.6,19.62a65.81,65.81,0,0,0-19.43,39Z",transform:"translate(-198.93 -245.4)"}),(0,s.createElement)("path",{style:{fill:"#313131FF"},d:"M403.11,258.4A92.84,92.84,0,0,1,468,284.74c16.73,16.19,27.63,39.12,29.9,62.91v.11l.42,5.37A93.83,93.83,0,0,1,507,540l-42.4.55-67.73-68C387.31,487,377.26,501,366,512.47c-18.76,19-38.45,28.26-60.21,28.26a93.83,93.83,0,1,1,0-187.65h1.31c.35-51.39,44.19-94.68,96-94.68m-.59,162.39c10.62-16.05,22.4-32.1,36.34-44.54,11.48-10.23,23.35-17,35.92-20.46l0-1.62,0-4.61c-1.83-18.3-10.18-35.86-22.94-48.21a69.89,69.89,0,0,0-48.8-19.85c-18.69,0-37.34,7.84-51.17,21.5-12.83,12.68-20.44,28.94-21.61,46l72.19,71.75m97.28,96.69a70.74,70.74,0,0,0-4.62-141.3c-16.57,0-31.34,7.18-46.48,22.61-10.74,10.94-20.48,24.85-29.45,38.63l80.55,80.06m-194,.15c31.09,0,52.85-28.48,74.41-61.88l-79.05-79.42a70.72,70.72,0,0,0,4.64,141.3M403.11,245.4A106.24,106.24,0,0,0,361.18,254,111.75,111.75,0,0,0,303,311.36a105.14,105.14,0,0,0-8.14,29.26,106.82,106.82,0,0,0,10.87,213.11c25.42,0,48.14-10.51,69.46-32.14a231,231,0,0,0,23.52-28.75l56.6,56.87,3.89,3.9,5.5-.07,42.4-.55h.73l.72-.09A107,107,0,0,0,602,446.9a105.82,105.82,0,0,0-31.86-75.63,107.08,107.08,0,0,0-60-30.12C506.6,316.23,494.69,292.5,477,275.4a105.78,105.78,0,0,0-73.9-30ZM344,344.28a59.68,59.68,0,0,1,17.1-32c11.42-11.28,26.73-17.75,42-17.75a57,57,0,0,1,39.76,16.19,65.27,65.27,0,0,1,18.48,35.94c-10.82,4.39-21.09,11-31.14,19.92-11.44,10.2-21.36,22.54-29.59,34L344,344.28Zm92,91.44c6.59-9.68,14-19.69,22-27.83,12.7-12.94,24.18-18.71,37.2-18.71a57.73,57.73,0,0,1,9.37,114.69L436,435.72ZM305.76,504.63A57.73,57.73,0,0,1,296.33,390l67.18,67.49c-8.05,12-16.66,23.65-25.87,32.3-10.81,10.16-20.94,14.89-31.88,14.89Z",transform:"translate(-198.93 -245.4)"}),(0,s.createElement)("polygon",{style:{fill:"#313131FF"},points:"285.03 289.5 208.78 213.25 202.51 222.85 269.16 289.5 285.03 289.5"}),(0,s.createElement)("path",{style:{fill:"#313131FF"},d:"M495.18,534.79h-2.31l-87.4-86.86-1.84,2.92c-26.07,41.27-53,83.94-97.87,83.94a87.89,87.89,0,1,1,0-175.77h2.32l81.17,81.16-6.39,9.48-79.39-79.39a76.66,76.66,0,0,0,2.29,153.3c38.66,0,62.81-38.24,88.38-78.71l3.18-5L313,356v-2.34c0-48.43,41.26-89.35,90.1-89.35A87.41,87.41,0,0,1,463.84,289c16.24,15.71,26.06,37.71,28.12,59.21l.36,4.62a27.48,27.48,0,0,0-11.56,1.37l0-4.92C479,330.4,470.38,311,456,297.08a76.25,76.25,0,0,0-52.93-21.52c-20.24,0-40.41,8.46-55.34,23.21-14.61,14.43-22.9,33-23.5,52.62l79.23,78.76c24-37,50.31-71.13,91.68-71.13a87.89,87.89,0,1,1,0,175.77Zm-83.54-96.55,85.82,85.29a76.76,76.76,0,0,0,74.39-76.63,77.5,77.5,0,0,0-76.67-76.66c-18.27,0-34.39,7.75-50.72,24.39C432.65,406.66,421.92,422.25,411.64,438.24Z",transform:"translate(-198.93 -245.4)"}))})}n(6087),e=n.hmd(e)},9781:(e,t,n)=>{"use strict";const s=window.wp.blocks;var i=n(1609),r=n.n(i);const o=window.wp.data;var a=n(6427);const l=window.wp.blockEditor,u=window.wp.primitives,c=(0,i.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(u.Path,{d:"M16 10h4c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-4c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1zm-8 4H4c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h4c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm10-2.6L14.5 15l1.1 1.1 1.7-1.7c-.1 1.1-.3 2.3-.9 2.9-.3.3-.7.5-1.3.5h-4.5v1.5H15c.9 0 1.7-.3 2.3-.9 1-1 1.3-2.7 1.4-4l1.8 1.8 1.1-1.1-3.6-3.7zM6.8 9.7c.1-1.1.3-2.3.9-2.9.4-.4.8-.6 1.3-.6h4.5V4.8H9c-.9 0-1.7.3-2.3.9-1 1-1.3 2.7-1.4 4L3.5 8l-1 1L6 12.6 9.5 9l-1-1-1.7 1.7z"}));var d=n(7e3);const p=window.wp.i18n;var h=n(6087),f=n(3522),m=n.n(f),g=n(8395),y=n.n(g),v=(n(6245),n(9368),n(1362)),b=(n(1413),n(2578)),w=(n(6703),n(5152));class E extends f.UIPlugin{constructor(e,t){super(e,{...t}),this.id=this.opts.id||"CreateVid",this.type="modifier"}createVideo(e){return new Promise(((t,n)=>{const s=new FormData;s.append("title",e),s.append("nonce",IUP_VIDEO.nonce),fetch(`${ajaxurl}?action=infinite-uploads-video-create`,{method:"POST",headers:{Accept:"application/json"},body:s}).then((e=>e.json())).then((e=>{console.log(e),e.success?t(e.data):n(e.data)})).catch((e=>(console.log("Error:",e),n(e))))}))}prepareUpload=e=>{const t=e.map((e=>{const t=this.uppy.getFile(e),n=t.name.replace(/\.[^/.]+$/,"");return this.createVideo(n).then((t=>{console.log(`Video ${t.VideoId} created`),this.opts.uploadAuth.current={...this.opts.uploadAuth.current,[e]:t}})).catch((e=>{this.uppy.log(`Video could not be created ${t.id}:`,"warning"),this.uppy.log(e,"warning")}))}));return Promise.all(t).then((()=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)}))}))};install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}}const _=E,x=({setAttributes:e,attributes:t})=>{const{autoplay:n,loop:s,muted:r,preload:o}=t,l=(0,p.__)("Autoplay may cause usability issues for some users."),u=h.Platform.select({web:(0,h.useCallback)((e=>e?l:null),[]),native:l}),c=(0,h.useMemo)((()=>{const t=t=>n=>{e({[t]:n})};return{autoplay:t("autoplay"),loop:t("loop"),muted:t("muted"),preload:t("preload")}}),[]);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(a.ToggleControl,{label:(0,p.__)("Autoplay"),onChange:c.autoplay,checked:n,help:u}),(0,i.createElement)(a.ToggleControl,{label:(0,p.__)("Loop"),onChange:c.loop,checked:s}),(0,i.createElement)(a.ToggleControl,{label:(0,p.__)("Muted"),onChange:c.muted,checked:r}),(0,i.createElement)(a.ToggleControl,{label:(0,p.__)("Preload"),onChange:c.preload,checked:o}))};var P=n(6942),C=n.n(P),S=n(4848);const O=i.createContext({prefixes:{},breakpoints:["xxl","xl","lg","md","sm","xs"],minBreakpoint:"xs"}),{Consumer:k,Provider:F}=O;function N(e,t){const{prefixes:n}=(0,i.useContext)(O);return e||n[t]||t}function U(){const{breakpoints:e}=(0,i.useContext)(O);return e}function T(){const{minBreakpoint:e}=(0,i.useContext)(O);return e}const A=i.forwardRef((({className:e,bsPrefix:t,as:n="div",...s},i)=>(t=N(t,"card-body"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));A.displayName="CardBody";const R=A,D=i.forwardRef((({className:e,bsPrefix:t,as:n="div",...s},i)=>(t=N(t,"card-footer"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));D.displayName="CardFooter";const I=D,j=i.createContext(null);j.displayName="CardHeaderContext";const B=j,M=i.forwardRef((({bsPrefix:e,className:t,as:n="div",...s},r)=>{const o=N(e,"card-header"),a=(0,i.useMemo)((()=>({cardHeaderBsPrefix:o})),[o]);return(0,S.jsx)(B.Provider,{value:a,children:(0,S.jsx)(n,{ref:r,...s,className:C()(t,o)})})}));M.displayName="CardHeader";const L=M,$=i.forwardRef((({bsPrefix:e,className:t,variant:n,as:s="img",...i},r)=>{const o=N(e,"card-img");return(0,S.jsx)(s,{ref:r,className:C()(n?`${o}-${n}`:o,t),...i})}));$.displayName="CardImg";const z=$,H=i.forwardRef((({className:e,bsPrefix:t,as:n="div",...s},i)=>(t=N(t,"card-img-overlay"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));H.displayName="CardImgOverlay";const q=H,V=i.forwardRef((({className:e,bsPrefix:t,as:n="a",...s},i)=>(t=N(t,"card-link"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));V.displayName="CardLink";const W=V,K=e=>i.forwardRef(((t,n)=>(0,S.jsx)("div",{...t,ref:n,className:C()(t.className,e)}))),G=K("h6"),X=i.forwardRef((({className:e,bsPrefix:t,as:n=G,...s},i)=>(t=N(t,"card-subtitle"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));X.displayName="CardSubtitle";const Z=X,Y=i.forwardRef((({className:e,bsPrefix:t,as:n="p",...s},i)=>(t=N(t,"card-text"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));Y.displayName="CardText";const Q=Y,J=K("h5"),ee=i.forwardRef((({className:e,bsPrefix:t,as:n=J,...s},i)=>(t=N(t,"card-title"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));ee.displayName="CardTitle";const te=ee,ne=i.forwardRef((({bsPrefix:e,className:t,bg:n,text:s,border:i,body:r=!1,children:o,as:a="div",...l},u)=>{const c=N(e,"card");return(0,S.jsx)(a,{ref:u,...l,className:C()(t,c,n&&`bg-${n}`,s&&`text-${s}`,i&&`border-${i}`),children:r?(0,S.jsx)(R,{children:o}):o})}));ne.displayName="Card";const se=Object.assign(ne,{Img:z,Title:te,Subtitle:Z,Body:R,Link:W,Text:Q,Header:L,Footer:I,ImgOverlay:q}),ie=i.forwardRef((({bsPrefix:e,className:t,as:n="div",...s},i)=>{const r=N(e,"row"),o=U(),a=T(),l=`${r}-cols`,u=[];return o.forEach((e=>{const t=s[e];let n;delete s[e],null!=t&&"object"==typeof t?({cols:n}=t):n=t;const i=e!==a?`-${e}`:"";null!=n&&u.push(`${l}${i}-${n}`)})),(0,S.jsx)(n,{ref:i,...s,className:C()(t,r,...u)})}));ie.displayName="Row";const re=ie,oe=i.forwardRef(((e,t)=>{const[{className:n,...s},{as:i="div",bsPrefix:r,spans:o}]=function({as:e,bsPrefix:t,className:n,...s}){t=N(t,"col");const i=U(),r=T(),o=[],a=[];return i.forEach((e=>{const n=s[e];let i,l,u;delete s[e],"object"==typeof n&&null!=n?({span:i,offset:l,order:u}=n):i=n;const c=e!==r?`-${e}`:"";i&&o.push(!0===i?`${t}${c}`:`${t}${c}-${i}`),null!=u&&a.push(`order${c}-${u}`),null!=l&&a.push(`offset${c}-${l}`)})),[{...s,className:C()(n,...o,...a)},{as:e,bsPrefix:t,spans:o}]}(e);return(0,S.jsx)(i,{...s,ref:t,className:C()(n,!o.length&&r)})}));oe.displayName="Col";const ae=oe;function le({video:e}){return(0,i.createElement)("span",{className:"d-inline-flex text-nowrap",title:(0,p.__)("Storage Size","infinite-uploads")},(0,i.createElement)("span",{className:"dashicons dashicons-media-video me-1"}),function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(1)+" "+" KMGTP".charAt(t)+"B"}(e.storageSize))}function ue({video:e}){return(0,i.createElement)("span",{className:"d-inline-flex text-nowrap",title:(0,p.__)("Video Length","infinite-uploads")},(0,i.createElement)("span",{className:"dashicons dashicons-clock me-1"}),(t=e.length,((n=Math.floor(t/3600))>0?n+":":"")+((s=Math.floor(t%3600/60))>0?(n>0&&s<10?"0":"")+s+":":"0:")+((r=Math.floor(t%3600%60))<10?"0":"")+r));var t,n,s,r}function ce({video:e}){return(0,i.createElement)("span",{className:"d-inline-flex text-nowrap",title:(0,p.__)("View Count","infinite-uploads")},(0,i.createElement)("span",{className:"dashicons dashicons-welcome-view-site me-1"}),e.views)}function de({video:e}){return(0,i.createElement)("small",{className:"d-inline-flex text-nowrap",title:(0,p.__)("Upload Date","infinite-uploads")},(0,i.createElement)("span",{className:"dashicons dashicons-calendar me-1"}),(t=e.dateUploaded,new Date(t).toLocaleString()));var t}const pe=i.forwardRef((({bsPrefix:e,fluid:t=!1,as:n="div",className:s,...i},r)=>{const o=N(e,"container"),a="string"==typeof t?`-${t}`:"-fluid";return(0,S.jsx)(n,{ref:r,...i,className:C()(s,t?`${o}${a}`:o)})}));pe.displayName="Container";const he=pe,fe=!("undefined"==typeof window||!window.document||!window.document.createElement);var me=!1,ge=!1;try{var ye={get passive(){return me=!0},get once(){return ge=me=!0}};fe&&(window.addEventListener("test",ye,ye),window.removeEventListener("test",ye,!0))}catch(e){}const ve=function(e,t,n,s){if(s&&"boolean"!=typeof s&&!ge){var i=s.once,r=s.capture,o=n;!ge&&i&&(o=n.__once||function e(s){this.removeEventListener(t,e,r),n.call(this,s)},n.__once=o),e.addEventListener(t,o,me?s:r)}e.addEventListener(t,n,s)};function be(e){return e&&e.ownerDocument||document}const we=function(e,t,n,s){var i=s&&"boolean"!=typeof s?s.capture:s;e.removeEventListener(t,n,i),n.__once&&e.removeEventListener(t,n.__once,i)};var Ee;function _e(e){if((!Ee&&0!==Ee||e)&&fe){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),Ee=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ee}function xe(e){const t=function(e){const t=(0,i.useRef)(e);return(0,i.useEffect)((()=>{t.current=e}),[e]),t}(e);return(0,i.useCallback)((function(...e){return t.current&&t.current(...e)}),[t])}const Pe=e=>e&&"function"!=typeof e?t=>{e.current=t}:e,Ce=function(e,t){return(0,i.useMemo)((()=>function(e,t){const n=Pe(e),s=Pe(t);return e=>{n&&n(e),s&&s(e)}}(e,t)),[e,t])};var Se=/([A-Z])/g,Oe=/^ms-/;function ke(e){return function(e){return e.replace(Se,"-$1").toLowerCase()}(e).replace(Oe,"-ms-")}var Fe=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;const Ne=function(e,t){var n="",s="";if("string"==typeof t)return e.style.getPropertyValue(ke(t))||function(e,t){return function(e){var t=be(e);return t&&t.defaultView||window}(e).getComputedStyle(e,t)}(e).getPropertyValue(ke(t));Object.keys(t).forEach((function(i){var r=t[i];r||0===r?function(e){return!(!e||!Fe.test(e))}(i)?s+=i+"("+r+") ":n+=ke(i)+": "+r+";":e.style.removeProperty(ke(i))})),s&&(n+="transform: "+s+";"),e.style.cssText+=";"+n},Ue=function(e,t,n,s){return ve(e,t,n,s),function(){we(e,t,n,s)}};function Te(e,t,n,s){var i,r;null==n&&(r=-1===(i=Ne(e,"transitionDuration")||"").indexOf("ms")?1e3:1,n=parseFloat(i)*r||0);var o=function(e,t,n){void 0===n&&(n=5);var s=!1,i=setTimeout((function(){s||function(e,t,n,s){if(void 0===n&&(n=!1),void 0===s&&(s=!0),e){var i=document.createEvent("HTMLEvents");i.initEvent("transitionend",n,s),e.dispatchEvent(i)}}(e,0,!0)}),t+n),r=Ue(e,"transitionend",(function(){s=!0}),{once:!0});return function(){clearTimeout(i),r()}}(e,n,s),a=Ue(e,"transitionend",t);return function(){o(),a()}}function Ae(e){void 0===e&&(e=be());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(t){return e.body}}function Re(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}const De=window.ReactDOM;var Ie=n.n(De);function je(e){const t=function(e){const t=(0,i.useRef)(e);return(0,i.useEffect)((()=>{t.current=e}),[e]),t}(e);return(0,i.useCallback)((function(...e){return t.current&&t.current(...e)}),[t])}function Be(e){return`data-rr-ui-${e}`}const Me=Be("modal-open"),Le=class{constructor({ownerDocument:e,handleContainerOverflow:t=!0,isRTL:n=!1}={}){this.handleContainerOverflow=t,this.isRTL=n,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return function(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const t={overflow:"hidden"},n=this.isRTL?"paddingLeft":"paddingRight",s=this.getElement();e.style={overflow:s.style.overflow,[n]:s.style[n]},e.scrollBarWidth&&(t[n]=`${parseInt(Ne(s,n)||"0",10)+e.scrollBarWidth}px`),s.setAttribute(Me,""),Ne(s,t)}reset(){[...this.modals].forEach((e=>this.remove(e)))}removeContainerStyle(e){const t=this.getElement();t.removeAttribute(Me),Object.assign(t.style,e.style)}add(e){let t=this.modals.indexOf(e);return-1!==t||(t=this.modals.length,this.modals.push(e),this.setModalAttributes(e),0!==t||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state))),t}remove(e){const t=this.modals.indexOf(e);-1!==t&&(this.modals.splice(t,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}},$e=(0,i.createContext)(fe?window:void 0);function ze(){return(0,i.useContext)($e)}$e.Provider;const He=(e,t)=>fe?null==e?(t||be()).body:("function"==typeof e&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null,qe=e=>e&&"function"!=typeof e?t=>{e.current=t}:e,Ve=function(e,t){return(0,i.useMemo)((()=>function(e,t){const n=qe(e),s=qe(t);return e=>{n&&n(e),s&&s(e)}}(e,t)),[e,t])},We=void 0!==n.g&&n.g.navigator&&"ReactNative"===n.g.navigator.product,Ke="undefined"!=typeof document||We?i.useLayoutEffect:i.useEffect,Ge=function({children:e,in:t,onExited:n,mountOnEnter:s,unmountOnExit:r}){const o=(0,i.useRef)(null),a=(0,i.useRef)(t),l=je(n);(0,i.useEffect)((()=>{t?a.current=!0:l(o.current)}),[t,l]);const u=Ve(o,e.ref),c=(0,i.cloneElement)(e,{ref:u});return t?c:r||!a.current&&s?null:c};function Xe(e){if(!e||"function"==typeof e)return null;const{major:t}=function(){const e=i.version.split(".");return{major:+e[0],minor:+e[1],patch:+e[2]}}();return t>=19?e.props.ref:e.ref}const Ze=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"],Ye=["component"],Qe=i.forwardRef(((e,t)=>{let{component:n}=e;const s=function(e){let{onEnter:t,onEntering:n,onEntered:s,onExit:r,onExiting:o,onExited:a,addEndListener:l,children:u}=e,c=function(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}(e,Ze);const d=(0,i.useRef)(null),p=Ve(d,Xe(u)),h=e=>t=>{e&&d.current&&e(d.current,t)},f=(0,i.useCallback)(h(t),[t]),m=(0,i.useCallback)(h(n),[n]),g=(0,i.useCallback)(h(s),[s]),y=(0,i.useCallback)(h(r),[r]),v=(0,i.useCallback)(h(o),[o]),b=(0,i.useCallback)(h(a),[a]),w=(0,i.useCallback)(h(l),[l]);return Object.assign({},c,{nodeRef:d},t&&{onEnter:f},n&&{onEntering:m},s&&{onEntered:g},r&&{onExit:y},o&&{onExiting:v},a&&{onExited:b},l&&{addEndListener:w},{children:"function"==typeof u?(e,t)=>u(e,Object.assign({},t,{ref:p})):(0,i.cloneElement)(u,{ref:p})})}(function(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}(e,Ye));return(0,S.jsx)(n,Object.assign({ref:t},s))}));function Je({children:e,in:t,onExited:n,onEntered:s,transition:r}){const[o,a]=(0,i.useState)(!t);t&&o&&a(!1);const l=function({in:e,onTransition:t}){const n=(0,i.useRef)(null),s=(0,i.useRef)(!0),r=je(t);return Ke((()=>{if(!n.current)return;let t=!1;return r({in:e,element:n.current,initial:s.current,isStale:()=>t}),()=>{t=!0}}),[e,r]),Ke((()=>(s.current=!1,()=>{s.current=!0})),[]),n}({in:!!t,onTransition:e=>{Promise.resolve(r(e)).then((()=>{e.isStale()||(e.in?null==s||s(e.element,e.initial):(a(!0),null==n||n(e.element)))}),(t=>{throw e.in||a(!0),t}))}}),u=Ve(l,e.ref);return o&&!t?null:(0,i.cloneElement)(e,{ref:u})}function et(e,t,n){return e?(0,S.jsx)(Qe,Object.assign({},n,{component:e})):t?(0,S.jsx)(Je,Object.assign({},n,{transition:t})):(0,S.jsx)(Ge,Object.assign({},n))}const tt=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];let nt;const st=(0,i.forwardRef)(((e,t)=>{let{show:n=!1,role:s="dialog",className:r,style:o,children:a,backdrop:l=!0,keyboard:u=!0,onBackdropClick:c,onEscapeKeyDown:d,transition:p,runTransition:h,backdropTransition:f,runBackdropTransition:m,autoFocus:g=!0,enforceFocus:y=!0,restoreFocus:v=!0,restoreFocusOptions:b,renderDialog:w,renderBackdrop:E=e=>(0,S.jsx)("div",Object.assign({},e)),manager:_,container:x,onShow:P,onHide:C=()=>{},onExit:O,onExited:k,onExiting:F,onEnter:N,onEntering:U,onEntered:T}=e,A=function(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}(e,tt);const R=ze(),D=function(e,t){const n=ze(),[s,r]=(0,i.useState)((()=>He(e,null==n?void 0:n.document)));if(!s){const t=He(e);t&&r(t)}return(0,i.useEffect)((()=>{}),[t,s]),(0,i.useEffect)((()=>{const t=He(e);t!==s&&r(t)}),[e,s]),s}(x),I=function(e){const t=ze(),n=e||function(e){return nt||(nt=new Le({ownerDocument:null==e?void 0:e.document})),nt}(t),s=(0,i.useRef)({dialog:null,backdrop:null});return Object.assign(s.current,{add:()=>n.add(s.current),remove:()=>n.remove(s.current),isTopModal:()=>n.isTopModal(s.current),setDialogRef:(0,i.useCallback)((e=>{s.current.dialog=e}),[]),setBackdropRef:(0,i.useCallback)((e=>{s.current.backdrop=e}),[])})}(_),j=function(){const e=(0,i.useRef)(!0),t=(0,i.useRef)((()=>e.current));return(0,i.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),t.current}(),B=function(e){const t=(0,i.useRef)(null);return(0,i.useEffect)((()=>{t.current=e})),t.current}(n),[M,L]=(0,i.useState)(!n),$=(0,i.useRef)(null);(0,i.useImperativeHandle)(t,(()=>I),[I]),fe&&!B&&n&&($.current=Ae(null==R?void 0:R.document)),n&&M&&L(!1);const z=je((()=>{if(I.add(),G.current=Ue(document,"keydown",W),K.current=Ue(document,"focus",(()=>setTimeout(q)),!0),P&&P(),g){var e,t;const n=Ae(null!=(e=null==(t=I.dialog)?void 0:t.ownerDocument)?e:null==R?void 0:R.document);I.dialog&&n&&!Re(I.dialog,n)&&($.current=n,I.dialog.focus())}})),H=je((()=>{var e;I.remove(),null==G.current||G.current(),null==K.current||K.current(),v&&(null==(e=$.current)||null==e.focus||e.focus(b),$.current=null)}));(0,i.useEffect)((()=>{n&&D&&z()}),[n,D,z]),(0,i.useEffect)((()=>{M&&H()}),[M,H]),function(e){const t=function(e){const t=(0,i.useRef)(e);return t.current=e,t}(e);(0,i.useEffect)((()=>()=>t.current()),[])}((()=>{H()}));const q=je((()=>{if(!y||!j()||!I.isTopModal())return;const e=Ae(null==R?void 0:R.document);I.dialog&&e&&!Re(I.dialog,e)&&I.dialog.focus()})),V=je((e=>{e.target===e.currentTarget&&(null==c||c(e),!0===l&&C())})),W=je((e=>{u&&function(e){return"Escape"===e.code||27===e.keyCode}(e)&&I.isTopModal()&&(null==d||d(e),e.defaultPrevented||C())})),K=(0,i.useRef)(),G=(0,i.useRef)();if(!D)return null;const X=Object.assign({role:s,ref:I.setDialogRef,"aria-modal":"dialog"===s||void 0},A,{style:o,className:r,tabIndex:-1});let Z=w?w(X):(0,S.jsx)("div",Object.assign({},X,{children:i.cloneElement(a,{role:"document"})}));Z=et(p,h,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:O,onExiting:F,onExited:(...e)=>{L(!0),null==k||k(...e)},onEnter:N,onEntering:U,onEntered:T,children:Z});let Y=null;return l&&(Y=E({ref:I.setBackdropRef,onClick:V}),Y=et(f,m,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Y})),(0,S.jsx)(S.Fragment,{children:Ie().createPortal((0,S.jsxs)(S.Fragment,{children:[Y,Z]}),D)})}));st.displayName="Modal";const it=Object.assign(st,{Manager:Le});var rt=Function.prototype.bind.call(Function.prototype.call,[].slice);function ot(e,t){return rt(e.querySelectorAll(t))}function at(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const lt=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",ut=".sticky-top",ct=".navbar-toggler";class dt extends Le{adjustAndStore(e,t,n){const s=t.style[e];t.dataset[e]=s,Ne(t,{[e]:`${parseFloat(Ne(t,e))+n}px`})}restore(e,t){const n=t.dataset[e];void 0!==n&&(delete t.dataset[e],Ne(t,{[e]:n}))}setContainerStyle(e){super.setContainerStyle(e);const t=this.getElement();var n,s;if(s="modal-open",(n=t).classList?n.classList.add(s):function(e,t){return e.classList?e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,s)||("string"==typeof n.className?n.className=n.className+" "+s:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+s)),!e.scrollBarWidth)return;const i=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";ot(t,lt).forEach((t=>this.adjustAndStore(i,t,e.scrollBarWidth))),ot(t,ut).forEach((t=>this.adjustAndStore(r,t,-e.scrollBarWidth))),ot(t,ct).forEach((t=>this.adjustAndStore(r,t,e.scrollBarWidth)))}removeContainerStyle(e){super.removeContainerStyle(e);const t=this.getElement();var n,s;s="modal-open",(n=t).classList?n.classList.remove(s):"string"==typeof n.className?n.className=at(n.className,s):n.setAttribute("class",at(n.className&&n.className.baseVal||"",s));const i=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";ot(t,lt).forEach((e=>this.restore(i,e))),ot(t,ut).forEach((e=>this.restore(r,e))),ot(t,ct).forEach((e=>this.restore(r,e)))}}let pt;function ht(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.includes(s))continue;n[s]=e[s]}return n}function ft(e,t){return ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ft(e,t)}const mt=r().createContext(null);var gt="unmounted",yt="exited",vt="entering",bt="entered",wt="exiting",Et=function(e){var t,n;function s(t,n){var s;s=e.call(this,t,n)||this;var i,r=n&&!n.isMounting?t.enter:t.appear;return s.appearStatus=null,t.in?r?(i=yt,s.appearStatus=vt):i=bt:i=t.unmountOnExit||t.mountOnEnter?gt:yt,s.state={status:i},s.nextCallback=null,s}n=e,(t=s).prototype=Object.create(n.prototype),t.prototype.constructor=t,ft(t,n),s.getDerivedStateFromProps=function(e,t){return e.in&&t.status===gt?{status:yt}:null};var i=s.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==vt&&n!==bt&&(t=vt):n!==vt&&n!==bt||(t=wt)}this.updateStatus(!1,t)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var e,t,n,s=this.props.timeout;return e=t=n=s,null!=s&&"number"!=typeof s&&(e=s.exit,t=s.enter,n=void 0!==s.appear?s.appear:t),{exit:e,enter:t,appear:n}},i.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===vt){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Ie().findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===yt&&this.setState({status:gt})},i.performEnter=function(e){var t=this,n=this.props.enter,s=this.context?this.context.isMounting:e,i=this.props.nodeRef?[s]:[Ie().findDOMNode(this),s],r=i[0],o=i[1],a=this.getTimeouts(),l=s?a.appear:a.enter;e||n?(this.props.onEnter(r,o),this.safeSetState({status:vt},(function(){t.props.onEntering(r,o),t.onTransitionEnd(l,(function(){t.safeSetState({status:bt},(function(){t.props.onEntered(r,o)}))}))}))):this.safeSetState({status:bt},(function(){t.props.onEntered(r)}))},i.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),s=this.props.nodeRef?void 0:Ie().findDOMNode(this);t?(this.props.onExit(s),this.safeSetState({status:wt},(function(){e.props.onExiting(s),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:yt},(function(){e.props.onExited(s)}))}))}))):this.safeSetState({status:yt},(function(){e.props.onExited(s)}))},i.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},i.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(s){n&&(n=!1,t.nextCallback=null,e(s))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},i.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Ie().findDOMNode(this),s=null==e&&!this.props.addEndListener;if(n&&!s){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],r=i[0],o=i[1];this.props.addEndListener(r,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},i.render=function(){var e=this.state.status;if(e===gt)return null;var t=this.props,n=t.children,s=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,ht(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return r().createElement(mt.Provider,{value:null},"function"==typeof n?n(e,s):r().cloneElement(r().Children.only(n),s))},s}(r().Component);function _t(){}Et.contextType=mt,Et.propTypes={},Et.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:_t,onEntering:_t,onEntered:_t,onExit:_t,onExiting:_t,onExited:_t},Et.UNMOUNTED=gt,Et.EXITED=yt,Et.ENTERING=vt,Et.ENTERED=bt,Et.EXITING=wt;const xt=Et;function Pt(e,t){const n=Ne(e,t)||"",s=-1===n.indexOf("ms")?1e3:1;return parseFloat(n)*s}function Ct(e,t){const n=Pt(e,"transitionDuration"),s=Pt(e,"transitionDelay"),i=Te(e,(n=>{n.target===e&&(i(),t(n))}),n+s)}const St=r().forwardRef((({onEnter:e,onEntering:t,onEntered:n,onExit:s,onExiting:o,onExited:a,addEndListener:l,children:u,childRef:c,...d},p)=>{const h=(0,i.useRef)(null),f=Ce(h,c),m=e=>{var t;f((t=e)&&"setState"in t?Ie().findDOMNode(t):null!=t?t:null)},g=e=>t=>{e&&h.current&&e(h.current,t)},y=(0,i.useCallback)(g(e),[e]),v=(0,i.useCallback)(g(t),[t]),b=(0,i.useCallback)(g(n),[n]),w=(0,i.useCallback)(g(s),[s]),E=(0,i.useCallback)(g(o),[o]),_=(0,i.useCallback)(g(a),[a]),x=(0,i.useCallback)(g(l),[l]);return(0,S.jsx)(xt,{ref:p,...d,onEnter:y,onEntered:b,onEntering:v,onExit:w,onExited:_,onExiting:E,addEndListener:x,nodeRef:h,children:"function"==typeof u?(e,t)=>u(e,{...t,ref:m}):r().cloneElement(u,{ref:m})})})),Ot={[vt]:"show",[bt]:"show"},kt=i.forwardRef((({className:e,children:t,transitionClasses:n={},onEnter:s,...r},o)=>{const a={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...r},l=(0,i.useCallback)(((e,t)=>{!function(e){e.offsetHeight}(e),null==s||s(e,t)}),[s]);return(0,S.jsx)(St,{ref:o,addEndListener:Ct,...a,onEnter:l,childRef:Xe(t),children:(s,r)=>i.cloneElement(t,{...r,className:C()("fade",e,t.props.className,Ot[s],n[s])})})}));kt.displayName="Fade";const Ft=kt,Nt=i.forwardRef((({className:e,bsPrefix:t,as:n="div",...s},i)=>(t=N(t,"modal-body"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));Nt.displayName="ModalBody";const Ut=Nt,Tt=i.createContext({onHide(){}}),At=i.forwardRef((({bsPrefix:e,className:t,contentClassName:n,centered:s,size:i,fullscreen:r,children:o,scrollable:a,...l},u)=>{const c=`${e=N(e,"modal")}-dialog`,d="string"==typeof r?`${e}-fullscreen-${r}`:`${e}-fullscreen`;return(0,S.jsx)("div",{...l,ref:u,className:C()(c,t,i&&`${e}-${i}`,s&&`${c}-centered`,a&&`${c}-scrollable`,r&&d),children:(0,S.jsx)("div",{className:C()(`${e}-content`,n),children:o})})}));At.displayName="ModalDialog";const Rt=At,Dt=i.forwardRef((({className:e,bsPrefix:t,as:n="div",...s},i)=>(t=N(t,"modal-footer"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));Dt.displayName="ModalFooter";const It=Dt;var jt=n(5556),Bt=n.n(jt);const Mt={"aria-label":Bt().string,onClick:Bt().func,variant:Bt().oneOf(["white"])},Lt=i.forwardRef((({className:e,variant:t,"aria-label":n="Close",...s},i)=>(0,S.jsx)("button",{ref:i,type:"button",className:C()("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...s})));Lt.displayName="CloseButton",Lt.propTypes=Mt;const $t=Lt,zt=i.forwardRef((({closeLabel:e="Close",closeVariant:t,closeButton:n=!1,onHide:s,children:r,...o},a)=>{const l=(0,i.useContext)(Tt),u=xe((()=>{null==l||l.onHide(),null==s||s()}));return(0,S.jsxs)("div",{ref:a,...o,children:[r,n&&(0,S.jsx)($t,{"aria-label":e,variant:t,onClick:u})]})})),Ht=zt,qt=i.forwardRef((({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:s=!1,...i},r)=>(e=N(e,"modal-header"),(0,S.jsx)(Ht,{ref:r,...i,className:C()(t,e),closeLabel:n,closeButton:s}))));qt.displayName="ModalHeader";const Vt=qt,Wt=K("h4"),Kt=i.forwardRef((({className:e,bsPrefix:t,as:n=Wt,...s},i)=>(t=N(t,"modal-title"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));Kt.displayName="ModalTitle";const Gt=Kt;function Xt(e){return(0,S.jsx)(Ft,{...e,timeout:null})}function Zt(e){return(0,S.jsx)(Ft,{...e,timeout:null})}const Yt=i.forwardRef((({bsPrefix:e,className:t,style:n,dialogClassName:s,contentClassName:r,children:o,dialogAs:a=Rt,"data-bs-theme":l,"aria-labelledby":u,"aria-describedby":c,"aria-label":d,show:p=!1,animation:h=!0,backdrop:f=!0,keyboard:m=!0,onEscapeKeyDown:g,onShow:y,onHide:v,container:b,autoFocus:w=!0,enforceFocus:E=!0,restoreFocus:_=!0,restoreFocusOptions:x,onEntered:P,onExit:k,onExiting:F,onEnter:U,onEntering:T,onExited:A,backdropClassName:R,manager:D,...I},j)=>{const[B,M]=(0,i.useState)({}),[L,$]=(0,i.useState)(!1),z=(0,i.useRef)(!1),H=(0,i.useRef)(!1),q=(0,i.useRef)(null),[V,W]=(0,i.useState)(null),K=Ce(j,W),G=xe(v),X=function(){const{dir:e}=(0,i.useContext)(O);return"rtl"===e}();e=N(e,"modal");const Z=(0,i.useMemo)((()=>({onHide:G})),[G]);function Y(){return D||function(e){return pt||(pt=new dt(e)),pt}({isRTL:X})}function Q(e){if(!fe)return;const t=Y().getScrollbarWidth()>0,n=e.scrollHeight>be(e).documentElement.clientHeight;M({paddingRight:t&&!n?_e():void 0,paddingLeft:!t&&n?_e():void 0})}const J=xe((()=>{V&&Q(V.dialog)}));!function(e){const t=function(e){const t=(0,i.useRef)(e);return t.current=e,t}(e);(0,i.useEffect)((()=>()=>t.current()),[])}((()=>{we(window,"resize",J),null==q.current||q.current()}));const ee=()=>{z.current=!0},te=e=>{z.current&&V&&e.target===V.dialog&&(H.current=!0),z.current=!1},ne=()=>{$(!0),q.current=Te(V.dialog,(()=>{$(!1)}))},se=e=>{"static"!==f?H.current||e.target!==e.currentTarget?H.current=!1:null==v||v():(e=>{e.target===e.currentTarget&&ne()})(e)},ie=(0,i.useCallback)((t=>(0,S.jsx)("div",{...t,className:C()(`${e}-backdrop`,R,!h&&"show")})),[h,R,e]),re={...n,...B};return re.display="block",(0,S.jsx)(Tt.Provider,{value:Z,children:(0,S.jsx)(it,{show:p,ref:K,backdrop:f,container:b,keyboard:!0,autoFocus:w,enforceFocus:E,restoreFocus:_,restoreFocusOptions:x,onEscapeKeyDown:e=>{m?null==g||g(e):(e.preventDefault(),"static"===f&&ne())},onShow:y,onHide:v,onEnter:(e,t)=>{e&&Q(e),null==U||U(e,t)},onEntering:(e,t)=>{null==T||T(e,t),ve(window,"resize",J)},onEntered:P,onExit:e=>{null==q.current||q.current(),null==k||k(e)},onExiting:F,onExited:e=>{e&&(e.style.display=""),null==A||A(e),we(window,"resize",J)},manager:Y(),transition:h?Xt:void 0,backdropTransition:h?Zt:void 0,renderBackdrop:ie,renderDialog:n=>(0,S.jsx)("div",{role:"dialog",...n,style:re,className:C()(t,e,L&&`${e}-static`,!h&&"show"),onClick:f?se:void 0,onMouseUp:te,"data-bs-theme":l,"aria-label":d,"aria-labelledby":u,"aria-describedby":c,children:(0,S.jsx)(a,{...I,onMouseDown:ee,className:s,contentClassName:r,children:o})})})})}));Yt.displayName="Modal";const Qt=Object.assign(Yt,{Body:Ut,Header:Vt,Title:Gt,Footer:It,Dialog:Rt,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),Jt={type:Bt().string,tooltip:Bt().bool,as:Bt().elementType},en=i.forwardRef((({as:e="div",className:t,type:n="valid",tooltip:s=!1,...i},r)=>(0,S.jsx)(e,{...i,ref:r,className:C()(t,`${n}-${s?"tooltip":"feedback"}`)})));en.displayName="Feedback",en.propTypes=Jt;const tn=en,nn=i.createContext({}),sn=i.forwardRef((({id:e,bsPrefix:t,className:n,type:s="checkbox",isValid:r=!1,isInvalid:o=!1,as:a="input",...l},u)=>{const{controlId:c}=(0,i.useContext)(nn);return t=N(t,"form-check-input"),(0,S.jsx)(a,{...l,ref:u,type:s,id:e||c,className:C()(n,t,r&&"is-valid",o&&"is-invalid")})}));sn.displayName="FormCheckInput";const rn=sn,on=i.forwardRef((({bsPrefix:e,className:t,htmlFor:n,...s},r)=>{const{controlId:o}=(0,i.useContext)(nn);return e=N(e,"form-check-label"),(0,S.jsx)("label",{...s,ref:r,htmlFor:n||o,className:C()(t,e)})}));on.displayName="FormCheckLabel";const an=on;function ln(e,t){let n=0;return i.Children.map(e,(e=>i.isValidElement(e)?t(e,n++):e))}const un=i.forwardRef((({id:e,bsPrefix:t,bsSwitchPrefix:n,inline:s=!1,reverse:r=!1,disabled:o=!1,isValid:a=!1,isInvalid:l=!1,feedbackTooltip:u=!1,feedback:c,feedbackType:d,className:p,style:h,title:f="",type:m="checkbox",label:g,children:y,as:v="input",...b},w)=>{t=N(t,"form-check"),n=N(n,"form-switch");const{controlId:E}=(0,i.useContext)(nn),_=(0,i.useMemo)((()=>({controlId:e||E})),[E,e]),x=!y&&null!=g&&!1!==g||function(e,t){return i.Children.toArray(e).some((e=>i.isValidElement(e)&&e.type===t))}(y,an),P=(0,S.jsx)(rn,{...b,type:"switch"===m?"checkbox":m,ref:w,isValid:a,isInvalid:l,disabled:o,as:v});return(0,S.jsx)(nn.Provider,{value:_,children:(0,S.jsx)("div",{style:h,className:C()(p,x&&t,s&&`${t}-inline`,r&&`${t}-reverse`,"switch"===m&&n),children:y||(0,S.jsxs)(S.Fragment,{children:[P,x&&(0,S.jsx)(an,{title:f,children:g}),c&&(0,S.jsx)(tn,{type:d,tooltip:u,children:c})]})})})}));un.displayName="FormCheck";const cn=Object.assign(un,{Input:rn,Label:an});n(9771);const dn=i.forwardRef((({bsPrefix:e,type:t,size:n,htmlSize:s,id:r,className:o,isValid:a=!1,isInvalid:l=!1,plaintext:u,readOnly:c,as:d="input",...p},h)=>{const{controlId:f}=(0,i.useContext)(nn);return e=N(e,"form-control"),(0,S.jsx)(d,{...p,type:t,size:s,ref:h,readOnly:c,id:r||f,className:C()(o,u?`${e}-plaintext`:e,n&&`${e}-${n}`,"color"===t&&`${e}-color`,a&&"is-valid",l&&"is-invalid")})}));dn.displayName="FormControl";const pn=Object.assign(dn,{Feedback:tn}),hn=i.forwardRef((({className:e,bsPrefix:t,as:n="div",...s},i)=>(t=N(t,"form-floating"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));hn.displayName="FormFloating";const fn=hn,mn=i.forwardRef((({controlId:e,as:t="div",...n},s)=>{const r=(0,i.useMemo)((()=>({controlId:e})),[e]);return(0,S.jsx)(nn.Provider,{value:r,children:(0,S.jsx)(t,{...n,ref:s})})}));mn.displayName="FormGroup";const gn=mn,yn=i.forwardRef((({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:s=!1,className:r,htmlFor:o,...a},l)=>{const{controlId:u}=(0,i.useContext)(nn);t=N(t,"form-label");let c="col-form-label";"string"==typeof n&&(c=`${c} ${c}-${n}`);const d=C()(r,t,s&&"visually-hidden",n&&c);return o=o||u,n?(0,S.jsx)(ae,{ref:l,as:"label",className:d,htmlFor:o,...a}):(0,S.jsx)(e,{ref:l,className:d,htmlFor:o,...a})}));yn.displayName="FormLabel";const vn=yn,bn=i.forwardRef((({bsPrefix:e,className:t,id:n,...s},r)=>{const{controlId:o}=(0,i.useContext)(nn);return e=N(e,"form-range"),(0,S.jsx)("input",{...s,type:"range",ref:r,className:C()(t,e),id:n||o})}));bn.displayName="FormRange";const wn=bn,En=i.forwardRef((({bsPrefix:e,size:t,htmlSize:n,className:s,isValid:r=!1,isInvalid:o=!1,id:a,...l},u)=>{const{controlId:c}=(0,i.useContext)(nn);return e=N(e,"form-select"),(0,S.jsx)("select",{...l,size:n,ref:u,className:C()(s,e,t&&`${e}-${t}`,r&&"is-valid",o&&"is-invalid"),id:a||c})}));En.displayName="FormSelect";const xn=En,Pn=i.forwardRef((({bsPrefix:e,className:t,as:n="small",muted:s,...i},r)=>(e=N(e,"form-text"),(0,S.jsx)(n,{...i,ref:r,className:C()(t,e,s&&"text-muted")}))));Pn.displayName="FormText";const Cn=Pn,Sn=i.forwardRef(((e,t)=>(0,S.jsx)(cn,{...e,ref:t,type:"switch"})));Sn.displayName="Switch";const On=Object.assign(Sn,{Input:cn.Input,Label:cn.Label}),kn=i.forwardRef((({bsPrefix:e,className:t,children:n,controlId:s,label:i,...r},o)=>(e=N(e,"form-floating"),(0,S.jsxs)(gn,{ref:o,className:C()(t,e),controlId:s,...r,children:[n,(0,S.jsx)("label",{htmlFor:s,children:i})]}))));kn.displayName="FloatingLabel";const Fn=kn,Nn={_ref:Bt().any,validated:Bt().bool,as:Bt().elementType},Un=i.forwardRef((({className:e,validated:t,as:n="form",...s},i)=>(0,S.jsx)(n,{...s,ref:i,className:C()(e,t&&"was-validated")})));Un.displayName="Form",Un.propTypes=Nn;const Tn=Object.assign(Un,{Group:gn,Control:pn,Floating:fn,Check:cn,Switch:On,Label:vn,Text:Cn,Range:wn,Select:xn,FloatingLabel:Fn}),An=i.createContext(null);An.displayName="InputGroupContext";const Rn=An,Dn=i.forwardRef((({className:e,bsPrefix:t,as:n="span",...s},i)=>(t=N(t,"input-group-text"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));Dn.displayName="InputGroupText";const In=Dn,jn=i.forwardRef((({bsPrefix:e,size:t,hasValidation:n,className:s,as:r="div",...o},a)=>{e=N(e,"input-group");const l=(0,i.useMemo)((()=>({})),[]);return(0,S.jsx)(Rn.Provider,{value:l,children:(0,S.jsx)(r,{ref:a,...o,className:C()(s,e,t&&`${e}-${t}`,n&&"has-validation")})})}));jn.displayName="InputGroup";const Bn=Object.assign(jn,{Text:In,Radio:e=>(0,S.jsx)(In,{children:(0,S.jsx)(rn,{type:"radio",...e})}),Checkbox:e=>(0,S.jsx)(In,{children:(0,S.jsx)(rn,{type:"checkbox",...e})})}),Mn=["as","disabled"];function Ln({tagName:e,disabled:t,href:n,target:s,rel:i,role:r,onClick:o,tabIndex:a=0,type:l}){e||(e=null!=n||null!=s||null!=i?"a":"button");const u={tagName:e};if("button"===e)return[{type:l||"button",disabled:t},u];const c=s=>{(t||"a"===e&&function(e){return!e||"#"===e.trim()}(n))&&s.preventDefault(),t?s.stopPropagation():null==o||o(s)};return"a"===e&&(n||(n="#"),t&&(n=void 0)),[{role:null!=r?r:"button",disabled:void 0,tabIndex:t?void 0:a,href:n,target:"a"===e?s:void 0,"aria-disabled":t||void 0,rel:"a"===e?i:void 0,onClick:c,onKeyDown:e=>{" "===e.key&&(e.preventDefault(),c(e))}},u]}const $n=i.forwardRef(((e,t)=>{let{as:n,disabled:s}=e,i=function(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}(e,Mn);const[r,{tagName:o}]=Ln(Object.assign({tagName:n,disabled:s},i));return(0,S.jsx)(o,Object.assign({},i,r,{ref:t}))}));$n.displayName="Button";const zn=$n,Hn=i.forwardRef((({as:e,bsPrefix:t,variant:n="primary",size:s,active:i=!1,disabled:r=!1,className:o,...a},l)=>{const u=N(t,"btn"),[c,{tagName:d}]=Ln({tagName:e,disabled:r,...a}),p=d;return(0,S.jsx)(p,{...c,...a,ref:l,disabled:r,className:C()(o,u,i&&"active",n&&`${u}-${n}`,s&&`${u}-${s}`,a.href&&r&&"disabled")})}));Hn.displayName="Button";const qn=Hn;const Vn={prefix:String(Math.round(1e10*Math.random())),current:0},Wn=i.createContext(Vn),Kn=i.createContext(!1);let Gn=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement),Xn=new WeakMap;const Zn="function"==typeof i.useId?function(e){let t=i.useId(),[n]=(0,i.useState)("function"==typeof i.useSyncExternalStore?i.useSyncExternalStore(Jn,Yn,Qn):(0,i.useContext)(Kn));return e||`${n?"react-aria":`react-aria${Vn.prefix}`}-${t}`}:function(e){let t=(0,i.useContext)(Wn);t!==Vn||Gn||console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let n=function(e=!1){let t=(0,i.useContext)(Wn),n=(0,i.useRef)(null);if(null===n.current&&!e){var s,r;let e=null===(r=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||void 0===r||null===(s=r.ReactCurrentOwner)||void 0===s?void 0:s.current;if(e){let n=Xn.get(e);null==n?Xn.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,Xn.delete(e))}n.current=++t.current}return n.current}(!!e),s=`react-aria${t.prefix}`;return e||`${s}-${n}`};function Yn(){return!1}function Qn(){return!0}function Jn(e){return()=>{}}const es=i.createContext(null),ts=(e,t=null)=>null!=e?String(e):t||null,ns=i.createContext(null),ss=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],is=["activeKey","getControlledId","getControllerId"],rs=["as"];function os(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}function as(e){let{active:t,eventKey:n,mountOnEnter:s,transition:r,unmountOnExit:o,role:a="tabpanel",onEnter:l,onEntering:u,onEntered:c,onExit:d,onExiting:p,onExited:h}=e,f=os(e,ss);const m=(0,i.useContext)(es);if(!m)return[Object.assign({},f,{role:a}),{eventKey:n,isActive:t,mountOnEnter:s,transition:r,unmountOnExit:o,onEnter:l,onEntering:u,onEntered:c,onExit:d,onExiting:p,onExited:h}];const{activeKey:g,getControlledId:y,getControllerId:v}=m,b=os(m,is),w=ts(n);return[Object.assign({},f,{role:a,id:y(n),"aria-labelledby":v(n)}),{eventKey:n,isActive:null==t&&null!=w?ts(g)===w:t,transition:r||b.transition,mountOnEnter:null!=s?s:b.mountOnEnter,unmountOnExit:null!=o?o:b.unmountOnExit,onEnter:l,onEntering:u,onEntered:c,onExit:d,onExiting:p,onExited:h}]}const ls=i.forwardRef(((e,t)=>{let{as:n="div"}=e,s=os(e,rs);const[i,{isActive:r,onEnter:o,onEntering:a,onEntered:l,onExit:u,onExiting:c,onExited:d,mountOnEnter:p,unmountOnExit:h,transition:f=Ge}]=as(s);return(0,S.jsx)(es.Provider,{value:null,children:(0,S.jsx)(ns.Provider,{value:null,children:(0,S.jsx)(f,{in:r,onEnter:o,onEntering:a,onEntered:l,onExit:u,onExiting:c,onExited:d,mountOnEnter:p,unmountOnExit:h,children:(0,S.jsx)(n,Object.assign({},i,{ref:t,hidden:!r,"aria-hidden":!r}))})})})}));ls.displayName="TabPanel";const us=e=>{const{id:t,generateChildId:n,onSelect:s,activeKey:r,defaultActiveKey:o,transition:a,mountOnEnter:l,unmountOnExit:u,children:c}=e,[d,p]=function(e,t,n){const s=(0,i.useRef)(void 0!==e),[r,o]=(0,i.useState)(t),a=void 0!==e,l=s.current;return s.current=a,!a&&l&&r!==t&&o(t),[a?e:r,(0,i.useCallback)(((...e)=>{const[t,...s]=e;let i=null==n?void 0:n(t,...s);return o(t),i}),[n])]}(r,o,s),h=Zn(t),f=(0,i.useMemo)((()=>n||((e,t)=>h?`${h}-${t}-${e}`:null)),[h,n]),m=(0,i.useMemo)((()=>({onSelect:p,activeKey:d,transition:a,mountOnEnter:l||!1,unmountOnExit:u||!1,getControlledId:e=>f(e,"tabpane"),getControllerId:e=>f(e,"tab")})),[p,d,a,l,u,f]);return(0,S.jsx)(es.Provider,{value:m,children:(0,S.jsx)(ns.Provider,{value:p||null,children:c})})};us.Panel=ls;const cs=us;function ds(e){return"boolean"==typeof e?e?Ft:Ge:e}const ps=({transition:e,...t})=>(0,S.jsx)(cs,{...t,transition:ds(e)});ps.displayName="TabContainer";const hs=ps,fs=i.forwardRef((({className:e,bsPrefix:t,as:n="div",...s},i)=>(t=N(t,"tab-content"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));fs.displayName="TabContent";const ms=fs,gs=i.forwardRef((({bsPrefix:e,transition:t,...n},s)=>{const[{className:i,as:r="div",...o},{isActive:a,onEnter:l,onEntering:u,onEntered:c,onExit:d,onExiting:p,onExited:h,mountOnEnter:f,unmountOnExit:m,transition:g=Ft}]=as({...n,transition:ds(t)}),y=N(e,"tab-pane");return(0,S.jsx)(es.Provider,{value:null,children:(0,S.jsx)(ns.Provider,{value:null,children:(0,S.jsx)(g,{in:a,onEnter:l,onEntering:u,onEntered:c,onExit:d,onExiting:p,onExited:h,mountOnEnter:f,unmountOnExit:m,children:(0,S.jsx)(r,{...o,ref:s,className:C()(i,y,a&&"active")})})})})}));gs.displayName="TabPane";const ys=gs,vs={eventKey:Bt().oneOfType([Bt().string,Bt().number]),title:Bt().node.isRequired,disabled:Bt().bool,tabClassName:Bt().string,tabAttrs:Bt().object},bs=()=>{throw new Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly")};bs.propTypes=vs;const ws=Object.assign(bs,{Container:hs,Content:ms,Pane:ys});function Es(){return Es=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),i=1;i{o||(null==t||t(n),null!=e&&a&&!n.isPropagationStopped()&&a(e,n))})),[d,{isActive:c}]}const Fs=i.forwardRef(((e,t)=>{let{as:n=zn,active:s,eventKey:i}=e,r=function(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}(e,Os);const[o,a]=ks(Object.assign({key:ts(i,r.href),active:s},r));return o[Be("active")]=a.isActive,(0,S.jsx)(n,Object.assign({},r,o,{ref:t}))}));Fs.displayName="NavItem";const Ns=Fs,Us=["as","onSelect","activeKey","role","onKeyDown"],Ts=()=>{},As=Be("event-key"),Rs=i.forwardRef(((e,t)=>{let{as:n="div",onSelect:s,activeKey:r,role:o,onKeyDown:a}=e,l=function(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}(e,Us);const u=function(){const[,e]=(0,i.useReducer)((e=>e+1),0);return e}(),c=(0,i.useRef)(!1),d=(0,i.useContext)(ns),p=(0,i.useContext)(es);let h,f;p&&(o=o||"tablist",r=p.activeKey,h=p.getControlledId,f=p.getControllerId);const m=(0,i.useRef)(null),g=e=>{const t=m.current;if(!t)return null;const n=ot(t,`[${As}]:not([aria-disabled=true])`),s=t.querySelector("[aria-selected=true]");if(!s||s!==document.activeElement)return null;const i=n.indexOf(s);if(-1===i)return null;let r=i+e;return r>=n.length&&(r=0),r<0&&(r=n.length-1),n[r]},y=(e,t)=>{null!=e&&(null==s||s(e,t),null==d||d(e,t))};(0,i.useEffect)((()=>{if(m.current&&c.current){const e=m.current.querySelector(`[${As}][aria-selected=true]`);null==e||e.focus()}c.current=!1}));const v=Ve(t,m);return(0,S.jsx)(ns.Provider,{value:y,children:(0,S.jsx)(Ss.Provider,{value:{role:o,activeKey:ts(r),getControlledId:h||Ts,getControllerId:f||Ts},children:(0,S.jsx)(n,Object.assign({},l,{onKeyDown:e=>{if(null==a||a(e),!p)return;let t;switch(e.key){case"ArrowLeft":case"ArrowUp":t=g(-1);break;case"ArrowRight":case"ArrowDown":t=g(1);break;default:return}t&&(e.preventDefault(),y(t.dataset["rrUiEventKey"]||null,e),c.current=!0,u())},ref:v,role:o}))})})}));Rs.displayName="Nav";const Ds=Object.assign(Rs,{Item:Ns}),Is=i.createContext(null);Is.displayName="NavbarContext";const js=Is,Bs=i.forwardRef((({className:e,bsPrefix:t,as:n="div",...s},i)=>(t=N(t,"nav-item"),(0,S.jsx)(n,{ref:i,className:C()(e,t),...s}))));Bs.displayName="NavItem";const Ms=Bs;new WeakMap;const Ls=["onKeyDown"],$s=i.forwardRef(((e,t)=>{let{onKeyDown:n}=e,s=function(e,t){if(null==e)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;n[s]=e[s]}return n}(e,Ls);const[i]=Ln(Object.assign({tagName:"a"},s)),r=je((e=>{i.onKeyDown(e),null==n||n(e)}));return(o=s.href)&&"#"!==o.trim()&&"button"!==s.role?(0,S.jsx)("a",Object.assign({ref:t},s,{onKeyDown:n})):(0,S.jsx)("a",Object.assign({ref:t},s,i,{onKeyDown:r}));var o}));$s.displayName="Anchor";const zs=$s,Hs=i.forwardRef((({bsPrefix:e,className:t,as:n=zs,active:s,eventKey:i,disabled:r=!1,...o},a)=>{e=N(e,"nav-link");const[l,u]=ks({key:ts(i,o.href),active:s,disabled:r,...o});return(0,S.jsx)(n,{...o,...l,ref:a,disabled:r,className:C()(t,e,r&&"disabled",u.isActive&&"active")})}));Hs.displayName="NavLink";const qs=Hs,Vs=i.forwardRef(((e,t)=>{const{as:n="div",bsPrefix:s,variant:r,fill:o=!1,justify:a=!1,navbar:l,navbarScroll:u,className:c,activeKey:d,...p}=Ps(e,{activeKey:"onSelect"}),h=N(s,"nav");let f,m,g=!1;const y=(0,i.useContext)(js),v=(0,i.useContext)(B);return y?(f=y.bsPrefix,g=null==l||l):v&&({cardHeaderBsPrefix:m}=v),(0,S.jsx)(Ds,{as:n,ref:t,activeKey:d,className:C()(c,{[h]:!g,[`${f}-nav`]:g,[`${f}-nav-scroll`]:g&&u,[`${m}-${r}`]:!!m,[`${h}-${r}`]:!!r,[`${h}-fill`]:o,[`${h}-justified`]:a}),...p})}));Vs.displayName="Nav";const Ws=Object.assign(Vs,{Item:Ms,Link:qs});function Ks(e){let t;return function(e){i.Children.forEach(e,(e=>{i.isValidElement(e)&&(e=>{null==t&&(t=e.props.eventKey)})(e,0)}))}(e),t}function Gs(e){const{title:t,eventKey:n,disabled:s,tabClassName:i,tabAttrs:r,id:o}=e.props;return null==t?null:(0,S.jsx)(Ms,{as:"li",role:"presentation",children:(0,S.jsx)(qs,{as:"button",type:"button",eventKey:n,disabled:s,id:o,className:i,...r,children:t})})}const Xs=e=>{const{id:t,onSelect:n,transition:s,mountOnEnter:i=!1,unmountOnExit:r=!1,variant:o="tabs",children:a,activeKey:l=Ks(a),...u}=Ps(e,{activeKey:"onSelect"});return(0,S.jsxs)(cs,{id:t,activeKey:l,onSelect:n,transition:ds(s),mountOnEnter:i,unmountOnExit:r,children:[(0,S.jsx)(Ws,{id:t,...u,role:"tablist",as:"ul",variant:o,children:ln(a,Gs)}),(0,S.jsx)(ms,{children:ln(a,(e=>{const t={...e.props};return delete t.title,delete t.disabled,delete t.tabClassName,delete t.tabAttrs,(0,S.jsx)(ys,{...t})}))})]})};Xs.displayName="Tabs";const Zs=Xs;function Ys({video:e,setVideos:t}){const[n,s]=(0,h.useState)(!1),r=()=>s(!1);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(qn,{variant:"outline-danger",size:"sm",onClick:()=>s(!0),className:"rounded-4"},(0,p.__)("Delete Video","infinite-uploads")),(0,i.createElement)(Qt,{show:n,onHide:r},(0,i.createElement)(Qt.Header,{closeButton:!0},(0,i.createElement)(Qt.Title,null,(0,p.__)("Delete Video:","infinite-uploads")," ",e.title)),(0,i.createElement)(Qt.Body,null,(0,p.__)("Are you sure you would like to delete this video?","infinite-uploads")),(0,i.createElement)(Qt.Footer,null,(0,i.createElement)(qn,{variant:"secondary",onClick:r},(0,p.__)("Cancel","infinite-uploads")),(0,i.createElement)(qn,{variant:"danger",onClick:function(){const n=new FormData;n.append("video_id",e.guid),n.append("nonce",IUP_VIDEO.nonce),fetch(`${ajaxurl}?action=infinite-uploads-video-delete`,{method:"POST",headers:{Accept:"application/json"},body:n}).then((e=>e.json())).then((n=>{console.log(n),n.success?(t((t=>t.filter((t=>t.guid!==e.guid)))),r()):console.error(n.data)})).catch((e=>{console.log("Error:",e)}))}},(0,p.__)("Delete","infinite-uploads")))))}const Qs=i.forwardRef((({bsPrefix:e,variant:t,animation:n="border",size:s,as:i="div",className:r,...o},a)=>{const l=`${e=N(e,"spinner")}-${n}`;return(0,S.jsx)(i,{ref:a,...o,className:C()(r,l,s&&`${l}-${s}`,t&&`text-${t}`)})}));Qs.displayName="Spinner";const Js=Qs;function ei({video:e,setVideos:t,selectVideo:n,children:s}){const[r,o]=(0,h.useState)(!1),[a,l]=(0,h.useState)(e.title),[u,c]=(0,h.useState)(!1),[d,f]=(0,h.useState)(!1),[m,g]=(0,h.useState)(!1),[y,v]=(0,h.useState)(!0),[b,w]=(0,h.useState)(""),[E,_]=(0,h.useState)(!1),[x,P]=(0,h.useState)(!1),[C,S]=(0,h.useState)(null);(0,h.useEffect)((()=>{let e=[];u&&e.push('autoplay="true"'),d&&e.push('loop="true"'),m&&e.push('muted="true"'),y&&e.push('preload="true"'),w(e.join(" "))}),[u,d,m,y]),(0,h.useEffect)((()=>{const t=(0,i.createElement)("iframe",{src:`https://iframe.mediadelivery.net/embed/${e.videoLibraryId}/${e.guid}?autoplay=false&v=${Math.random()}`,loading:"lazy",allow:"accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;",allowFullScreen:!0});S(t)}),[e]);const O=t=>IUP_VIDEO.cdnUrl+"/"+e.guid+"/"+t;function k(n){P(!0);const s=new FormData;s.append("thumbnail",n),s.append("video_id",e.guid),s.append("nonce",IUP_VIDEO.nonce),fetch(`${ajaxurl}?action=infinite-uploads-video-update`,{method:"POST",headers:{Accept:"application/json"},body:s}).then((e=>e.json())).then((s=>{s.success?t((t=>t.map((t=>t.guid===e.guid?{...t,thumbnailFileName:n}:t)))):console.error(s.data),P(!1)})).catch((e=>{console.log("Error:",e),P(!1)}))}let F=[];for(let e=1;e<=5;e++)F.push((0,i.createElement)(ae,{key:e,className:"mb-2"},(0,i.createElement)(se,{className:"bg-dark text-white h-100 p-0",role:"button",disabled:x||E,onClick:()=>k("thumbnail_"+e+".jpg")},(0,i.createElement)("div",{className:"ratio ratio-16x9 overflow-hidden bg-black rounded"},(0,i.createElement)("div",{className:"iup-video-thumb rounded border-0",style:{backgroundImage:`url("${O("thumbnail_"+e+".jpg")}")`}})),(0,i.createElement)("div",{className:"card-img-overlay rounded border-0"},(0,i.createElement)("div",{className:"card-title align-middle text-center text-white"},(0,p.__)("Set","infinite-uploads"))))));return F.push((0,i.createElement)(ae,{key:"fileupload",className:"mb-2"},(0,i.createElement)(se,{className:"h-100 p-0 border-4 border-secondary",style:{borderStyle:"dashed"},disabled:x||E,role:"button",onClick:()=>document.getElementById("upload-thumbnail").click()},(0,i.createElement)("div",{className:"ratio ratio-16x9 overflow-hidden bg-light border-0 rounded"},(0,i.createElement)("div",null,E?(0,i.createElement)("div",{className:"h-100 w-100 d-flex align-items-center justify-content-center"},(0,i.createElement)(Js,{animation:"border",role:"status",className:"text-muted"})):(0,i.createElement)("span",{className:"dashicons dashicons-upload h-100 w-100 d-flex align-items-center justify-content-center text-muted h3"}))),(0,i.createElement)(Tn.Control,{type:"file",id:"upload-thumbnail",className:"d-none",accept:"image/png, image/jpeg",disabled:x||E,onChange:()=>function(n){_(!0);const s=new FormData;s.append("thumbnailFile",n),s.append("video_id",e.guid),s.append("nonce",IUP_VIDEO.nonce),fetch(`${ajaxurl}?action=infinite-uploads-video-update`,{method:"POST",headers:{Accept:"application/json"},body:s}).then((e=>e.json())).then((n=>{n.success?(function(){const n={method:"GET",headers:{Accept:"application/json",AccessKey:IUP_VIDEO.apiKey}};fetch(`https://video.bunnycdn.com/library/${IUP_VIDEO.libraryId}/videos/${e.guid}`,n).then((e=>e.json())).then((n=>{t((t=>t.map((t=>t.guid===e.guid?{...t,...n}:t))))})).catch((e=>{console.error(e)}))}(),_(!1)):(console.error(n.data),_(!1))})).catch((e=>{console.log("Error:",e),_(!1)}))}(document.getElementById("upload-thumbnail").files[0])})))),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("a",{className:"m-3 w-100 p-0 text-decoration-none",role:"button","aria-label":(0,p.__)("Open video modal","infinite-uploads"),onClick:()=>{n?n(e):o(!0)}},s),(0,i.createElement)(Qt,{show:r,onHide:()=>{o(!1)},size:"xl","aria-labelledby":"contained-modal-title-vcenter",centered:!0},(0,i.createElement)(Qt.Header,{closeButton:!0},(0,i.createElement)(Qt.Title,{id:"contained-modal-title-vcenter"},(0,p.__)("Edit Video:","infinite-uploads")," ",e.title)),(0,i.createElement)(Qt.Body,null,(0,i.createElement)(he,{fluid:!0,className:"pb-3"},(0,i.createElement)(re,{className:"justify-content-center mb-4 mt-3",xs:1,lg:2},(0,i.createElement)(ae,null,(0,i.createElement)(re,{className:"mb-2"},(0,i.createElement)(ae,null,(0,i.createElement)("div",{className:"ratio ratio-16x9"},C))),(0,i.createElement)(re,{className:"justify-content-between text-muted text-center"},(0,i.createElement)(ae,null,(0,i.createElement)(de,{video:e})),(0,i.createElement)(ae,null,(0,i.createElement)(ue,{video:e})),(0,i.createElement)(ae,null,(0,i.createElement)(ce,{video:e})),(0,i.createElement)(ae,null,(0,i.createElement)(le,{video:e})))),(0,i.createElement)(ae,null,(0,i.createElement)(re,{className:"mb-4"},(0,i.createElement)(ae,null,(0,i.createElement)("label",{htmlFor:"video-title"},(0,p.__)("Video Title","infinite-uploads")),(0,i.createElement)(Bn,null,(0,i.createElement)(Tn.Control,{id:"video-title",placeholder:(0,p.__)("Title","infinite-uploads"),"aria-label":(0,p.__)("Title","infinite-uploads"),value:a,onChange:e=>l(e.target.value),disabled:x||E}),(0,i.createElement)(qn,{variant:"primary",className:"text-white",disabled:x||E,onClick:function(){P(!0);const n=new FormData;n.append("title",a),n.append("video_id",e.guid),n.append("nonce",IUP_VIDEO.nonce),fetch(`${ajaxurl}?action=infinite-uploads-video-update`,{method:"POST",headers:{Accept:"application/json"},body:n}).then((e=>e.json())).then((n=>{n.success?t((t=>t.map((t=>t.guid===e.guid?{...t,title:a}:t)))):console.error(n.data),P(!1)})).catch((e=>{console.log("Error:",e),P(!1)}))}},(0,p.__)("Update","infinite-uploads"))))),(0,i.createElement)(re,{className:"mb-4"},(0,i.createElement)(ae,{className:"col-4"},(0,i.createElement)("h6",null,(0,p.__)("Current Thumbnail","infinite-uploads")),(0,i.createElement)(se,{className:"bg-dark text-white w-100 p-0 mb-2"},(0,i.createElement)("div",{className:"ratio ratio-16x9 overflow-hidden bg-black rounded border-0"},(0,i.createElement)("div",{className:"iup-video-thumb rounded border-0",style:{backgroundImage:`url("${O(e.thumbnailFileName)}")`}})))),(0,i.createElement)(ae,{className:"col-8"},(0,i.createElement)("p",null,(0,p.__)("Choose a new thumbnail to be displayed in the video player:","infinite-uploads")),(0,i.createElement)(re,{className:"justify-content-start d-flex row-cols-2 row-cols-md-3"},F))),(0,i.createElement)(re,{className:"justify-content-end mb-3"},(0,i.createElement)(ae,{className:"justify-content-end d-flex"},(0,i.createElement)(Ys,{video:e,setVideos:t}))))),(0,i.createElement)(Zs,{defaultActiveKey:"shortcode",className:"mb-4"},(0,i.createElement)(ws,{eventKey:"shortcode",title:(0,i.createElement)("div",{className:"d-inline-flex align-start"},(0,i.createElement)("span",{className:"dashicons dashicons-shortcode me-1"}),(0,p.__)("Embed Code","infinite-uploads"))},(0,i.createElement)(re,{className:"justify-content-center mt-2"},(0,i.createElement)(ae,null,(0,i.createElement)(re,null,(0,i.createElement)(ae,null,(0,i.createElement)("p",null,(0,p.__)("Copy and paste this code into your post, page, or widget to embed the video. If using Gutenberg editor use our block.","infinite-uploads")))),(0,i.createElement)(re,{className:"mb-1"},(0,i.createElement)(ae,null,(0,i.createElement)(Tn,null,(0,i.createElement)(Tn.Check,{inline:!0,label:(0,p.__)("Autoplay","infinite-uploads"),type:"checkbox",checked:u,onChange:e=>c(e.target.checked)}),(0,i.createElement)(Tn.Check,{inline:!0,label:(0,p.__)("Loop","infinite-uploads"),type:"checkbox",checked:d,onChange:e=>f(e.target.checked)}),(0,i.createElement)(Tn.Check,{inline:!0,label:(0,p.__)("Muted","infinite-uploads"),type:"checkbox",checked:m,onChange:e=>g(e.target.checked)}),(0,i.createElement)(Tn.Check,{inline:!0,label:(0,p.__)("Preload","infinite-uploads"),type:"checkbox",checked:y,onChange:e=>v(e.target.checked),style:{display:"none"}})))),(0,i.createElement)(re,null,(0,i.createElement)(ae,null,(0,i.createElement)(Tn.Control,{type:"text","aria-label":"Embed Code",readOnly:!0,value:`[infinite-uploads-vid id="${e.guid}" ${b}]`,onClick:e=>{e.target.select(),document.execCommand("copy")}})))))),(0,i.createElement)(ws,{eventKey:"stats",disabled:!0,title:(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"dashicons dashicons-chart-area me-1"}),(0,p.__)("Stats","infinite-uploads"))},(0,i.createElement)(re,{className:"justify-content-center"},(0,i.createElement)(ae,null,(0,i.createElement)(re,null,(0,i.createElement)(ae,null,(0,i.createElement)("h5",null,(0,p.__)("Statistics","infinite-uploads")),(0,i.createElement)("p",null,(0,p.__)("View the statistics for this video.","infinite-uploads")))),(0,i.createElement)(re,null,(0,i.createElement)(ae,null,"Chart here"))))),(0,i.createElement)(ws,{eventKey:"captions",disabled:!0,title:(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"dashicons dashicons-format-status me-1"}),(0,p.__)("Captions","infinite-uploads"))}),(0,i.createElement)(ws,{eventKey:"chapters",disabled:!0,title:(0,i.createElement)(i.Fragment,null,(0,i.createElement)("span",{className:"dashicons dashicons-text me-1"}),(0,p.__)("Chapters","infinite-uploads"))}))))))}function ti(e,t,n){const s=(e-t)/(n-t)*100;return Math.round(1e3*s)/1e3}function ni({min:e,now:t,max:n,label:s,visuallyHidden:i,striped:r,animated:o,className:a,style:l,variant:u,bsPrefix:c,...d},p){return(0,S.jsx)("div",{ref:p,...d,role:"progressbar",className:C()(a,`${c}-bar`,{[`bg-${u}`]:u,[`${c}-bar-animated`]:o,[`${c}-bar-striped`]:o||r}),style:{width:`${ti(t,e,n)}%`,...l},"aria-valuenow":t,"aria-valuemin":e,"aria-valuemax":n,children:i?(0,S.jsx)("span",{className:"visually-hidden",children:s}):s})}const si=i.forwardRef((({isChild:e=!1,...t},n)=>{const s={min:0,max:100,animated:!1,visuallyHidden:!1,striped:!1,...t};if(s.bsPrefix=N(s.bsPrefix,"progress"),e)return ni(s,n);const{min:r,now:o,max:a,label:l,visuallyHidden:u,striped:c,animated:d,bsPrefix:p,variant:h,className:f,children:m,...g}=s;return(0,S.jsx)("div",{ref:n,...g,className:C()(f,p),children:m?ln(m,(e=>(0,i.cloneElement)(e,{isChild:!0}))):ni({min:r,now:o,max:a,label:l,visuallyHidden:u,striped:c,animated:d,bsPrefix:p,variant:h},n)})}));si.displayName="ProgressBar";const ii=si,ri=function({video:e,videos:t,setVideos:n,selectVideo:s}){const r=t=>IUP_VIDEO.cdnUrl+"/"+e.guid+"/"+t,[o,a]=(0,h.useState)(r(e.thumbnailFileName)),l={0:(0,p.__)("Awaiting Upload","infinite-uploads"),1:(0,p.__)("Uploaded","infinite-uploads"),2:(0,p.__)("Processing","infinite-uploads"),3:(0,p.__)("Transcoding","infinite-uploads"),4:(0,p.__)("Finished","infinite-uploads"),5:(0,p.__)("Error","infinite-uploads"),6:(0,p.__)("Upload Failed","infinite-uploads")}[e.status];return[0,1,5,6].includes(e.status)?(0,i.createElement)("span",{className:"m-3 w-100 p-0"},(0,i.createElement)(se,{className:"m-0 shadow-sm"},(0,i.createElement)("div",{className:"ratio ratio-16x9 overflow-hidden bg-black text-white rounded-top"},(0,i.createElement)("div",null,(0,i.createElement)("div",{className:"d-flex justify-content-center align-items-center h-100 text-secondary font-weight-bold"},l))),(0,i.createElement)(se.Body,{className:"p-2"},(0,i.createElement)(se.Title,{className:"h6 card-title text-truncate"},e.title),(0,i.createElement)(re,{className:"justify-content-end text-muted align-items-center"},(0,i.createElement)(ae,{className:"justify-content-end d-flex"},!s&&(0,i.createElement)(Ys,{video:e,setVideos:n})))))):[2].includes(e.status)?(0,i.createElement)("span",{className:"m-3 w-100 p-0"},(0,i.createElement)(se,{className:"m-0 shadow-sm"},(0,i.createElement)("div",{className:"ratio ratio-16x9 overflow-hidden bg-black text-white rounded-top"},(0,i.createElement)("div",null,(0,i.createElement)("div",{className:"d-flex justify-content-center align-items-center h-100 text-secondary font-weight-bold"},l))),(0,i.createElement)(se.Body,{className:"p-2"},(0,i.createElement)(se.Title,{className:"h6 card-title text-truncate"},e.title),(0,i.createElement)("small",{className:"row justify-content-between text-muted align-items-center"},(0,i.createElement)(ae,{className:"col-auto"},(0,p.__)("Processing","infinite-uploads"),":"),(0,i.createElement)(ae,null,(0,i.createElement)(ii,{animated:!0,now:e.encodeProgress,label:`${e.encodeProgress}%`,className:"w-100"})))))):(0,i.createElement)(ei,{video:e,setVideos:n,selectVideo:s},(0,i.createElement)(se,{className:"m-0 shadow-sm"},(0,i.createElement)("div",{className:"ratio ratio-16x9 overflow-hidden bg-black rounded-top"},(0,i.createElement)("div",{className:"iup-video-thumb",style:{backgroundImage:`url("${o}")`},onMouseOver:()=>a(r("preview.webp")),onMouseOut:()=>a(r(e.thumbnailFileName))})),(0,i.createElement)(se.Body,{className:"p-2"},(0,i.createElement)(se.Title,{className:"h6 card-title text-truncate"},e.title),3===e.status?(0,i.createElement)("small",{className:"row justify-content-between text-muted align-items-center"},(0,i.createElement)(ae,{className:"col-auto"},(0,p.__)("Transcoding","infinite-uploads"),":"),(0,i.createElement)(ae,null,(0,i.createElement)(ii,{animated:!0,now:e.encodeProgress,label:`${e.encodeProgress}%`,className:"w-100"}))):(0,i.createElement)("small",{className:"row justify-content-between text-muted align-items-center"},(0,i.createElement)(ae,null,(0,i.createElement)(ue,{video:e})),(0,i.createElement)(ae,null),(0,i.createElement)(ae,null,(0,i.createElement)(le,{video:e}))))))};function oi({getVideos:e}){const[t,n]=(0,h.useState)(!1),s=(0,h.useRef)(null),r=(0,h.useRef)({}),o=w((()=>new(m())({debug:!0,restrictions:{maxNumberOfFiles:null,allowedFileTypes:["video/*"]},autoProceed:!0,allowMultipleUploadBatches:!0,onBeforeUpload:e=>{}}).use(y(),{endpoint:"https://video.bunnycdn.com/tusupload",retryDelays:[0,1e3,3e3,5e3,1e4],onBeforeRequest:(e,t)=>{if(!s.current[t.id])throw new Error("Error fetching auth.");e.setHeader("AuthorizationSignature",s.current[t.id].AuthorizationSignature),e.setHeader("AuthorizationExpire",s.current[t.id].AuthorizationExpire),e.setHeader("VideoId",s.current[t.id].VideoId),e.setHeader("LibraryId",IUP_VIDEO.libraryId)}}).use(_,{uploadAuth:s})));return o.on("error",(e=>{console.error(e.stack)})),o.on("upload-error",((e,t,n)=>{console.log("error with file:",e.id),console.log("error message:",t)})),o.on("upload-success",((t,n)=>{r.current[t.id]||(e(),r.current={...r.current,[t.id]:!0})})),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(qn,{variant:"primary",className:"text-nowrap text-white ms-4",onClick:()=>{n(!0)}},(0,i.createElement)("span",{className:"dashicons dashicons-video-alt3"}),(0,p.__)("Upload Videos","infinite-uploads")),(0,i.createElement)(Qt,{show:t,onHide:()=>{n(!1)},size:"lg","aria-labelledby":"contained-modal-title-vcenter",centered:!0},(0,i.createElement)(Qt.Header,{closeButton:!0},(0,i.createElement)(Qt.Title,{id:"contained-modal-title-vcenter"},(0,p.__)("Upload Videos","infinite-uploads"))),(0,i.createElement)(Qt.Body,null,(0,i.createElement)(he,{fluid:!0,className:"p-3"},(0,i.createElement)("div",{className:"uppy-wrapper"},(0,i.createElement)(v,{width:"100%",height:"100%",uppy:o,locale:{strings:{dropHereOr:(0,p.__)("Drop videos here or %{browse}.","infinite-uploads"),browse:(0,p.__)("browse files","infinite-uploads")}}}),(0,i.createElement)(b,{uppy:o,hideUploadButton:!0,hideAfterFinish:!0,showProgressDetails:!0}))))))}const ai=function({orderBy:e,setOrderBy:t,search:n,setSearch:s,selectVideo:r,getVideos:o}){const a=function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(1)+" "+" KMGTP".charAt(t)+"B"};return(0,i.createElement)(re,{className:"align-items-center"},(0,i.createElement)(ae,{sm:8,md:3,className:"mb-3 mb-lg-0"},(0,i.createElement)(Bn,null,(0,i.createElement)(Bn.Text,null,(0,i.createElement)("span",{className:"dashicons dashicons-search"})),(0,i.createElement)(Tn.Control,{placeholder:(0,p.__)("Search","infinite-uploads"),"aria-label":(0,p.__)("Search","infinite-uploads"),value:n,onChange:e=>s(e.target.value)}))),(0,i.createElement)(ae,{sm:4,md:2,className:"mb-3 mb-lg-0"},(0,i.createElement)(Bn,null,(0,i.createElement)(Bn.Text,null,(0,p.__)("Sort","infinite-uploads")),(0,i.createElement)(Tn.Select,{"aria-label":(0,p.__)("Sort by select","infinite-uploads"),value:e,onChange:e=>t(e.target.value)},">",(0,i.createElement)("option",{value:"title"},(0,p.__)("Title","infinite-uploads")),(0,i.createElement)("option",{value:"date"},(0,p.__)("Date","infinite-uploads"))))),(0,i.createElement)(ae,{className:"mb-3 mb-lg-0"},(0,i.createElement)(re,{className:"justify-content-center flex-nowrap"},(0,i.createElement)(ae,{className:"col-auto"},(0,i.createElement)("p",{className:"mb-0"},(0,p.__)("Video Count","infinite-uploads")),(0,i.createElement)("span",{className:"h4 text-nowrap"},IUP_VIDEO.settings.VideoCount)),(0,i.createElement)(ae,{className:"col-auto"},(0,i.createElement)("p",{className:"mb-0"},(0,p.__)("Library Storage","infinite-uploads")),(0,i.createElement)("span",{className:"h4 text-nowrap"},a(IUP_VIDEO.settings.StorageUsage))),(0,i.createElement)(ae,{className:"col-auto"},(0,i.createElement)("p",{className:"mb-0"},(0,p.__)("Video Bandwidth","infinite-uploads")),(0,i.createElement)("span",{className:"h4 text-nowrap"},a(IUP_VIDEO.settings.TrafficUsage))))),(0,i.createElement)(ae,{className:"d-flex justify-content-end mb-3 mb-lg-0"},(0,i.createElement)(qn,{variant:"outline-secondary",className:"rounded-pill text-nowrap",href:IUP_VIDEO.settingsUrl},(0,i.createElement)("span",{className:"dashicons dashicons-admin-generic"}),(0,p.__)("Settings","infinite-uploads")),!r&&(0,i.createElement)(oi,{getVideos:o})))},li=i.forwardRef((({active:e=!1,disabled:t=!1,className:n,style:s,activeLabel:i="(current)",children:r,linkStyle:o,linkClassName:a,as:l=zs,...u},c)=>{const d=e||t?"span":l;return(0,S.jsx)("li",{ref:c,style:s,className:C()(n,"page-item",{active:e,disabled:t}),children:(0,S.jsxs)(d,{className:C()("page-link",a),style:o,...u,children:[r,e&&i&&(0,S.jsx)("span",{className:"visually-hidden",children:i})]})})}));li.displayName="PageItem";const ui=li;function ci(e,t,n=e){const s=i.forwardRef((({children:e,...s},i)=>(0,S.jsxs)(li,{...s,ref:i,children:[(0,S.jsx)("span",{"aria-hidden":"true",children:e||t}),(0,S.jsx)("span",{className:"visually-hidden",children:n})]})));return s.displayName=e,s}const di=ci("First","«"),pi=ci("Prev","‹","Previous"),hi=ci("Ellipsis","…","More"),fi=ci("Next","›"),mi=ci("Last","»"),gi=i.forwardRef((({bsPrefix:e,className:t,size:n,...s},i)=>{const r=N(e,"pagination");return(0,S.jsx)("ul",{ref:i,...s,className:C()(t,r,n&&`${r}-${n}`)})}));gi.displayName="Pagination";const yi=Object.assign(gi,{First:di,Prev:pi,Ellipsis:hi,Item:ui,Next:fi,Last:mi}),vi=function({page:e,setPage:t,totalItems:n,itemsPerPage:s}){if(n<=s)return null;let r=e;const o=Math.ceil(n/s);let a=[];for(let e=1;e<=o;e++)a.push((0,i.createElement)(yi.Item,{key:e,active:e===r,onClick:()=>t(e)},e));return(0,i.createElement)(yi,{className:"justify-content-center mt-4"},(0,i.createElement)(yi.First,{onClick:()=>t(1),disabled:1===e}),a,(0,i.createElement)(yi.Last,{onClick:()=>t(o),disabled:e===o}))};function bi({selectVideo:e}){const[t,n]=(0,h.useState)([]),[s,r]=(0,h.useState)(!0),[o,a]=(0,h.useState)("date"),[l,u]=(0,h.useState)(""),[c,d]=(0,h.useState)(1),[f,m]=(0,h.useState)(0),[g,y]=(0,h.useState)(40),[v,b]=(0,h.useState)(6e4);function w(){const e={method:"GET",headers:{Accept:"application/json",AccessKey:IUP_VIDEO.apiKey}};fetch(`https://video.bunnycdn.com/library/${IUP_VIDEO.libraryId}/videos?page=${c}&itemsPerPage=${g}&orderBy=${o}&search=${l}`,e).then((e=>e.json())).then((e=>{console.log("Videos:",e),n(e.items),m(e.totalItems),y(e.itemsPerPage),r(!1)})).catch((e=>{console.error(e),r(!1)}))}return(0,h.useEffect)((()=>{s||(r(!0),w())}),[o,c]),(0,h.useEffect)((()=>{(l.length>2||0===l.length)&&(d(1),r(!0),w())}),[l]),(0,h.useEffect)((()=>{const e=t.find((e=>2===e.status||3===e.status));b(e?1e4:6e4)}),[t]),(0,h.useEffect)((()=>{const e=setInterval((()=>{w()}),v);return()=>clearInterval(e)}),[o,c,l,v]),(0,i.createElement)(i.Fragment,null,!e&&(0,i.createElement)("h1",{className:"text-muted mb-3"},(0,i.createElement)("img",{src:IUP_VIDEO.assetBase+"/img/iu-logo-gray.svg",alt:"Infinite Uploads Logo",height:"32",width:"32",className:"me-2"}),(0,p.__)("Cloud Video Library","infinite-uploads")),(0,i.createElement)(he,{fluid:!0},(0,i.createElement)(ai,{orderBy:o,setOrderBy:a,search:l,setSearch:u,selectVideo:e,getVideos:w}),s?(0,i.createElement)(he,{className:"d-flex justify-content-center align-middle my-5"},(0,i.createElement)(Js,{animation:"grow",role:"status",className:"my-5"},(0,i.createElement)("span",{className:"visually-hidden"},"Loading..."))):(0,i.createElement)(he,{fluid:!0},(0,i.createElement)(re,{xs:1,sm:1,md:2,lg:3,xl:4,xxl:5},t.length>0?t.map(((t,s)=>(0,i.createElement)(ae,{key:s+t.guid},(0,i.createElement)(ri,{video:t,setVideos:n,selectVideo:e})))):(0,i.createElement)(he,{className:"my-5 justify-content-center align-items-center"},(0,i.createElement)("p",{className:"text-muted text-center h5"},(0,p.__)("No videos found.","infinite-uploads")))),(0,i.createElement)(vi,{page:c,setPage:d,totalItems:f,itemsPerPage:g}))))}function wi({selectVideo:e,...t}){const[n,s]=(0,h.useState)(!1);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(a.Button,{variant:"primary",onClick:()=>s(!0)},(0,p.__)("Select from Library","infinite-uploads")),n&&(0,i.createElement)(a.Modal,{...t,isDismissible:!0,onRequestClose:()=>s(!1),icon:(0,d.E)(!1),style:{width:"98%"},title:(0,p.__)("Cloud Video Library","infinite-uploads"),className:"iup-block-library-model"},(0,i.createElement)("p",null,(0,p.__)("Select a video from your library to insert into the editor.","infinite-uploads")),(0,i.createElement)(bi,{selectVideo:e})))}const Ei=JSON.parse('{"UU":"infinite-uploads/video"}');(0,s.registerBlockType)(Ei.UU,{example:{attributes:{video_id:""}},edit:function({clientId:e,attributes:t,setAttributes:n}){const s=(0,l.useBlockProps)(),r=(0,o.useSelect)((t=>t("core/block-editor").isBlockSelected(e,!0))),[u,f]=(0,h.useState)(null),[g,E]=(0,h.useState)(!1),[P,C]=(0,h.useState)(!0),S=(0,h.useRef)(null);(0,h.useEffect)((()=>{r||C(!0)}),[r]),(0,h.useEffect)((()=>{t.video_id&&F()}),[]),(0,h.useEffect)((()=>{if(u&&(2===u.status||3===u.status)){const e=setInterval((()=>{F()}),5e3);return()=>clearInterval(e)}}),[u]);const O=w((()=>new(m())({debug:!0,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["video/*"]},autoProceed:!0,allowMultipleUploadBatches:!1,onBeforeUpload:e=>{}}).use(y(),{endpoint:"https://video.bunnycdn.com/tusupload",retryDelays:[0,1e3,3e3,5e3,1e4],onBeforeRequest:(e,s)=>{if(!S.current[s.id])throw new Error("Error fetching auth.");n({video_id:S.current[s.id].VideoId}),t.video_id=S.current[s.id].VideoId,e.setHeader("AuthorizationSignature",S.current[s.id].AuthorizationSignature),e.setHeader("AuthorizationExpire",S.current[s.id].AuthorizationExpire),e.setHeader("VideoId",S.current[s.id].VideoId),e.setHeader("LibraryId",IUP_VIDEO.libraryId)}}).use(_,{uploadAuth:S})));let k=(0,h.useRef)(!1);function F(){if(!t.video_id)return!1;const e={method:"GET",headers:{Accept:"application/json",AccessKey:IUP_VIDEO.apiKey}};fetch(`https://video.bunnycdn.com/library/${IUP_VIDEO.libraryId}/videos/${t.video_id}`,e).then((e=>e.json())).then((e=>{console.log("Video:",e),f(e)})).catch((e=>{console.error(e)}))}O.on("upload",(e=>{E(!0),k.current=!1})),O.on("cancel-all",(()=>{E(!1)})),O.on("error",(e=>{console.error(e.stack),E(!1)})),O.on("upload-error",((e,t,n)=>{console.log("error with file:",e.id),console.log("error message:",t),E(!1)})),O.on("upload-success",((e,t)=>{k.current||(k.current=!0,F()),E(!1)}));if(!g&&t.video_id&&u&&[1,2,3,4].includes(u.status)){if(4===u.status)return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{...s},(0,i.createElement)("figure",{className:"iup-video-embed-wrapper"},(0,i.createElement)("iframe",{src:`https://iframe.mediadelivery.net/embed/${IUP_VIDEO.libraryId}/${t.video_id}?autoplay=${t.autoplay}&preload=${t.preload}&loop=${t.loop}&muted=${t.muted}`,loading:"lazy",className:"iup-video-embed",sandbox:"allow-scripts allow-same-origin allow-presentation",allow:"accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;",allowFullScreen:!0})),P&&(0,i.createElement)("button",{className:"iup-video-overlay",onClick:()=>C(!1)})),(0,i.createElement)(l.BlockControls,{group:"other"},(0,i.createElement)(a.ToolbarButton,{onClick:()=>n({video_id:null}),icon:c,label:(0,p.__)("Replace Video","infinite-uploads")})),(0,i.createElement)(l.InspectorControls,null,(0,i.createElement)(a.PanelBody,{title:(0,p.__)("Settings")},(0,i.createElement)(x,{setAttributes:n,attributes:t}))));{let e="",r={};return 3===u.status?(e=(0,p.sprintf)((0,p.__)("Video %d%% encoded...","infinite-uploads"),u.encodeProgress),r={backgroundImage:`url("${IUP_VIDEO.cdnUrl}/${t.video_id}/${u.thumbnailFileName}")`}):e=u.status<=1?(0,p.__)("Awaiting Upload...","infinite-uploads"):u.status>4?(0,p.__)("Video Error. Upload again.","infinite-uploads"):(0,p.sprintf)((0,p.__)("Video %d%% processed...","infinite-uploads"),u.encodeProgress),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{...s},(0,i.createElement)("div",{className:"ratio-16-9-outer"},(0,i.createElement)("div",{className:"ratio-16-9-inner",style:r},(0,i.createElement)("div",{className:"ratio-16-9-content"},(0,i.createElement)(a.Spinner,{style:{height:"0.9em",width:"0.9em"}})," ",e)))),(0,i.createElement)(l.InspectorControls,null,(0,i.createElement)(a.PanelBody,{title:(0,p.__)("Settings")},(0,i.createElement)(x,{setAttributes:n,attributes:t}))))}}return(0,i.createElement)("div",{...s},(0,i.createElement)(a.Placeholder,{icon:d.E,instructions:(0,p.__)("Upload a new video direct to the cloud or select a video from your cloud library.","infinite-uploads"),label:(0,p.__)("Infinite Uploads Video","infinite-uploads")},(0,i.createElement)("div",{className:"placeholder-wrapper"},(0,i.createElement)("div",{className:"uppy-wrapper"},g?"":(0,i.createElement)(v,{width:"100%",height:"100%",uppy:O,locale:{strings:{dropHereOr:(0,p.__)("Drop video file here or %{browse}.","infinite-uploads"),browse:(0,p.__)("browse files","infinite-uploads")}}}),(0,i.createElement)(b,{uppy:O,hideUploadButton:!1,hideAfterFinish:!0,showProgressDetails:!0})),!g&&(0,i.createElement)(wi,{selectVideo:e=>{n({video_id:e.guid}),f(e),E(!1)}}))))},save:function({attributes:e}){const t=l.useBlockProps.save();return e.video_id?(0,i.createElement)("figure",{...t},(0,i.createElement)("div",{className:"iup-video-embed-wrapper"},(0,i.createElement)("iframe",{src:`https://iframe.mediadelivery.net/embed/${IUP_VIDEO.libraryId}/${e.video_id}?autoplay=${e.autoplay}&preload=${e.preload}&loop=${e.loop}&muted=${e.muted}`,loading:"lazy",className:"iup-video-embed",sandbox:"allow-scripts allow-same-origin allow-presentation",allow:"accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;",allowFullScreen:!0}))):(0,i.createElement)("div",{...t})},icon:(0,d.E)(!1)})},9797:function(e,t,n){!function(e){"use strict";function t(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 self?self:n.g;const i="undefined"!=typeof navigator,r=i&&"undefined"==typeof HTMLImageElement,o=!(void 0===n.g||"undefined"==typeof process||!process.versions||!process.versions.node),a=s.Buffer,l=!!a,u=e=>void 0!==e;function c(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(u).length)}function d(e){let t=new Error(e);throw delete t.stack,t}function p(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const h=e=>String.fromCharCode.apply(null,e),f="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class m{static from(e,t){return e instanceof this&&e.le===t?e:new m(e,void 0,void 0,t)}constructor(e,t=0,n,s){if("boolean"==typeof s&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===n&&(n=e.byteLength-t);let s=new DataView(e,t,n);this._swapDataView(s)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof m){void 0===n&&(n=e.byteLength-t),(t+=e.byteOffset)+n>e.byteOffset+e.byteLength&&d("Creating view outside of available memory in ArrayBuffer");let s=new DataView(e.buffer,t,n);this._swapDataView(s)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else d("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,n=m){return e instanceof DataView||e instanceof m?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||d("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new n(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new m(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return n=this.getUint8Array(e,t),f?f.decode(n):l?Buffer.from(n).toString("utf8"):decodeURIComponent(escape(h(n)));var n}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return h(n)}getUnicodeString(e=0,t=this.byteLength){const n=[];for(let s=0;s1e4?C(e,t,"base64"):o&&e.includes("://")?P(e,t,"url",S):o?C(e,t,"fs"):i?P(e,t,"url",S):void d(_);var n}async function P(e,t,n,s){return w.has(n)?C(e,t,n):s?async function(e,t){let n=await t(e);return new m(n)}(e,s):void d(`Parser ${n} is not loaded`)}async function C(e,t,n){let s=new(w.get(n))(e,t);return await s.read(),s}const S=e=>E(e).then((e=>e.arrayBuffer())),O=e=>new Promise(((t,n)=>{let s=new FileReader;s.onloadend=()=>t(s.result||new ArrayBuffer),s.onerror=n,s.readAsArrayBuffer(e)}));class k extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function F(e,t,n){let s=new k;for(let[e,t]of n)s.set(e,t);if(Array.isArray(t))for(let n of t)e.set(n,s);else e.set(t,s);return s}function N(e,t,n){let s,i=e.get(t);for(s of n)i.set(s[0],s[1])}const U=new Map,T=new Map,A=new Map,R=37500,D=37510,I=33723,j=34675,B=34665,M=34853,L=40965,$=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],z=["jfif","xmp","icc","iptc","ihdr"],H=["tiff",...z],q=["ifd0","ifd1","exif","gps","interop"],V=[...H,...q],W=["makerNote","userComment"],K=["translateKeys","translateValues","reviveValues","multiSegment"],G=[...K,"sanitize","mergeOutput","silentErrors"];class X{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class Z extends X{get needed(){return this.enabled||this.deps.size>0}constructor(e,n,s,i){if(super(),t(this,"enabled",!1),t(this,"skip",new Set),t(this,"pick",new Set),t(this,"deps",new Set),t(this,"translateKeys",!1),t(this,"translateValues",!1),t(this,"reviveValues",!1),this.key=e,this.enabled=n,this.parse=this.enabled,this.applyInheritables(i),this.canBeFiltered=q.includes(e),this.canBeFiltered&&(this.dict=U.get(e)),void 0!==s)if(Array.isArray(s))this.parse=this.enabled=!0,this.canBeFiltered&&s.length>0&&this.translateTagSet(s,this.pick);else if("object"==typeof s){if(this.enabled=!0,this.parse=!1!==s.parse,this.canBeFiltered){let{pick:e,skip:t}=s;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(s)}else!0===s||!1===s?this.parse=this.enabled=s:d(`Invalid options argument: ${s}`)}applyInheritables(e){let t,n;for(t of K)n=e[t],void 0!==n&&(this[t]=n)}translateTagSet(e,t){if(this.dict){let n,s,{tagKeys:i,tagValues:r}=this.dict;for(n of e)"string"==typeof n?(s=r.indexOf(n),-1===s&&(s=i.indexOf(Number(n))),-1!==s&&t.add(Number(i[s]))):t.add(n)}else for(let n of e)t.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,ne(this.pick,this.deps)):this.enabled&&this.pick.size>0&&ne(this.pick,this.deps)}}var Y={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},Q=new Map;class J extends X{static useCached(e){let t=Q.get(e);return void 0!==t||(t=new this(e),Q.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):d(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=i?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of $)this[e]=Y[e];for(e of G)this[e]=Y[e];for(e of W)this[e]=Y[e];for(e of V)this[e]=new Z(e,Y[e],void 0,this)}setupFromTrue(){let e;for(e of $)this[e]=Y[e];for(e of G)this[e]=Y[e];for(e of W)this[e]=!0;for(e of V)this[e]=new Z(e,!0,void 0,this)}setupFromArray(e){let t;for(t of $)this[t]=Y[t];for(t of G)this[t]=Y[t];for(t of W)this[t]=Y[t];for(t of V)this[t]=new Z(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,q)}setupFromObject(e){let t;for(t of(q.ifd0=q.ifd0||q.image,q.ifd1=q.ifd1||q.thumbnail,Object.assign(this,e),$))this[t]=te(e[t],Y[t]);for(t of G)this[t]=te(e[t],Y[t]);for(t of W)this[t]=te(e[t],Y[t]);for(t of H)this[t]=new Z(t,Y[t],e[t],this);for(t of q)this[t]=new Z(t,Y[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,q,V),!0===e.tiff?this.batchEnableWithBool(q,!0):!1===e.tiff?this.batchEnableWithUserValue(q,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,q):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,q)}batchEnableWithBool(e,t){for(let n of e)this[n].enabled=t}batchEnableWithUserValue(e,t){for(let n of e){let e=t[n];this[n].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,n,s=n){if(e&&e.length){for(let e of s)this[e].enabled=!1;let t=ee(e,n);for(let[e,n]of t)ne(this[e].pick,n),this[e].enabled=!0}else if(t&&t.length){let e=ee(t,n);for(let[t,n]of e)ne(this[t].skip,n)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:n,iptc:s,icc:i}=this;this.makerNote?t.deps.add(R):t.skip.add(R),this.userComment?t.deps.add(D):t.skip.add(D),n.enabled||e.skip.add(700),s.enabled||e.skip.add(I),i.enabled||e.skip.add(j)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:n,interop:s}=this;s.needed&&(t.deps.add(L),e.deps.add(L)),t.needed&&e.deps.add(B),n.needed&&e.deps.add(M),this.tiff.enabled=q.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let e of q)this[e].finalizeFilters()}get onlyTiff(){return!z.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of H)this[e].enabled&&!b.has(e)&&g("segment parser",e)}}function ee(e,t){let n,s,i,r,o=[];for(i of t){for(r of(n=U.get(i),s=[],n))(e.includes(r[0])||e.includes(r[1]))&&s.push(r[0]);s.length&&o.push([i,s])}return o}function te(e,t){return void 0!==e?e:void 0!==t?t:void 0}function ne(e,t){for(let n of t)e.add(n)}t(J,"default",Y);class se{constructor(e){t(this,"parsers",{}),t(this,"output",{}),t(this,"errors",[]),t(this,"pushToErrors",(e=>this.errors.push(e))),this.options=J.useCached(e)}async read(e){this.file=await function(e,t){return"string"==typeof e?x(e,t):i&&!r&&e instanceof HTMLImageElement?x(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new m(e):i&&e instanceof Blob?P(e,t,"blob",O):void d(_)}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[n,s]of v)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[n]=!0;this.file.close&&this.file.close(),d("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),c(n=e)?void 0:n;var n}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async t=>{let n=await t.parse();t.assignToOutput(e,n)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,n=b.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),void 0===s)return;let i=await this.fileParser.ensureSegmentChunk(s),r=this.parsers.tiff=new n(i,e,t),o=await r.extractThumbnail();return t.close&&t.close(),o}}async function ie(e,t){let n=new se(t);return await n.read(e),n.parse()}var re=Object.freeze({__proto__:null,parse:ie,Exifr:se,fileParsers:v,segmentParsers:b,fileReaders:w,tagKeys:U,tagValues:T,tagRevivers:A,createDictionary:F,extendDictionary:N,fetchUrlAsArrayBuffer:S,readBlobAsArrayBuffer:O,chunkedProps:$,otherSegments:z,segments:H,tiffBlocks:q,segmentsAndBlocks:V,tiffExtractables:W,inheritables:K,allFormatters:G,Options:J});class oe{static findPosition(e,t){let n=e.getUint16(t+2)+2,s="function"==typeof this.headerLength?this.headerLength(e,t,n):this.headerLength,i=t+s,r=n-s;return{offset:t,length:n,headerLength:s,start:i,size:r,end:i+r}}static parse(e,t={}){return new this(e,new J({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof m?e:new m(e)}constructor(e,n={},s){t(this,"errors",[]),t(this,"raw",new Map),t(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)})),this.chunk=this.normalizeInput(e),this.file=s,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let n=A.get(t),s=T.get(t),i=U.get(t),r=this.options[t],o=r.reviveValues&&!!n,a=r.translateValues&&!!s,l=r.translateKeys&&!!i,u={};for(let[t,r]of e)o&&n.has(t)?r=n.get(t)(r):a&&s.has(t)&&(r=this.translateValue(r,s.get(t))),l&&i.has(t)&&(t=i.get(t)||t),u[t]=r;return u}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[t]?Object.assign(e[t],n):e[t]=n}}function ae(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function le(e){return e>=224&&e<=239}function ue(e,t,n){for(let[s,i]of b)if(i.canHandle(e,t,n))return s}t(oe,"headerLength",4),t(oe,"type",void 0),t(oe,"multiSegment",!1),t(oe,"canHandle",(()=>!1));class ce extends class{constructor(e,n,s){t(this,"errors",[]),t(this,"ensureSegmentChunk",(async e=>{let t=e.start,n=e.size||65536;if(this.file.chunked)if(this.file.available(t,n))e.chunk=this.file.subarray(t,n);else try{e.chunk=await this.file.readChunk(t,n)}catch(t){d(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+n?e.chunk=this.file.subarray(t,n):void 0===e.size?e.chunk=this.file.subarray(t):d("Segment unreachable: "+JSON.stringify(e));return e.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=n,this.parsers=s}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let n=new(b.get(e))(t,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let t of e){let{type:e,chunk:n}=t,s=this.options[e];if(s&&s.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),t(this,"appSegments",[]),t(this,"jpegSegments",[]),t(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(b.keyList())):(e=void 0===e?b.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&b.has(e))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:n,findAll:s,wanted:i,remaining:r}=this;if(!s&&this.file.chunked&&(s=Array.from(i).some((e=>{let t=b.get(e),n=this.options[e];return t.multiSegment&&n.multiSegment})),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let t=!1;for(;r.size>0&&!t&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:s}=n,i=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>s&&!i?!await n.readNextChunk(e):!await n.readNextChunk(s),void 0===(e=this.findAppSegmentsInRange(e,n.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let n,s,i,r,o,a,{file:l,findAll:u,wanted:c,remaining:d,options:p}=this;for(;ee.multiSegment)))return;let e=function(e){let t,n,s,i=new Map;for(let r=0;r{let n=b.get(e,this.options);return n.handleMultiSegments?{type:e,chunk:n.handleMultiSegments(t)}:t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}t(ce,"type","jpeg"),v.set("jpeg",ce);const de=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class pe extends oe{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,n=new Map){let{pick:s,skip:i}=this.options[t];s=new Set(s);let r=s.size>0,o=0===i.size,a=this.chunk.getUint16(e);e+=2;for(let l=0;l13)&&d(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${i}, offset ${e}`),e>s.byteLength&&d(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${i}, offset ${e} is outside of chunk size ${s.byteLength}`),1===i)return s.getUint8Array(e,r);if(2===i)return""===(a=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(a=s.getString(e,r)).trim())?void 0:a;var a;if(7===i)return s.getUint8Array(e,r);if(1===r)return this.parseTagValue(i,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(i))(r),n=o;for(let s=0;se.byteLength&&d(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,p(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(B),this.interopOffset=t.get(L),this.gpsOffset=t.get(M),this.xmp=t.get(700),this.iptc=t.get(I),this.icc=t.get(j),this.options.sanitize&&(t.delete(B),t.delete(L),t.delete(M),t.delete(700),t.delete(I),t.delete(j)),t):void 0}async parseExifBlock(){if(this.exif)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,p(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(L)),this.makerNote=e.get(R),this.userComment=e.get(D),this.options.sanitize&&(e.delete(L),e.delete(R),e.delete(D)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let n=e.get(t);n&&1===n.length&&e.set(t,n[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",fe(...e.get(2),e.get(1))),e.set("longitude",fe(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,n,s={};for(t of q)if(e=this[t],!c(e))if(n=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(s,n)}else s[t]=n;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[n,s]of Object.entries(t))this.assignObjectToOutput(e,n,s)}}function fe(e,t,n,s){var i=e+t/60+n/3600;return"S"!==s&&"W"!==s||(i*=-1),i}t(he,"type","tiff"),t(he,"headerLength",10),b.set("tiff",he);var me=Object.freeze({__proto__:null,default:re,Exifr:se,fileParsers:v,segmentParsers:b,fileReaders:w,tagKeys:U,tagValues:T,tagRevivers:A,createDictionary:F,extendDictionary:N,fetchUrlAsArrayBuffer:S,readBlobAsArrayBuffer:O,chunkedProps:$,otherSegments:z,segments:H,tiffBlocks:q,segmentsAndBlocks:V,tiffExtractables:W,inheritables:K,allFormatters:G,Options:J,parse:ie});const ge={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},ye=Object.assign({},ge,{firstChunkSize:4e4,gps:[1,2,3,4]}),ve=Object.assign({},ge,{tiff:!1,ifd1:!0,mergeOutput:!1}),be=Object.assign({},ge,{firstChunkSize:4e4,ifd0:[274]});async function we(e){let t=new se(be);await t.read(e);let n=await t.parse();if(n&&n.ifd0)return n.ifd0[274]}const Ee=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});if(e.rotateCanvas=!0,e.rotateCss=!0,"object"==typeof navigator){let t=navigator.userAgent;if(t.includes("iPad")||t.includes("iPhone")){let n=t.match(/OS (\d+)_(\d+)/);if(n){let[,t,s]=n,i=Number(t)+.1*Number(s);e.rotateCanvas=i<13.4,e.rotateCss=!1}}else if(t.includes("OS X 10")){let[,n]=t.match(/OS X 10[_.](\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<15}if(t.includes("Chrome/")){let[,n]=t.match(/Chrome\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<81}else if(t.includes("Firefox/")){let[,n]=t.match(/Firefox\/(\d+)/);e.rotateCanvas=e.rotateCss=Number(n)<77}}class _e extends m{constructor(...e){super(...e),t(this,"ranges",new xe),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,n){if(0===e&&0===this.byteLength&&n){let e=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(e)}else{let n=e+t;if(n>this.byteLength){let{dataView:e}=this._extend(n);this._swapDataView(e)}}}_extend(e){let t;t=l?a.allocUnsafe(e):new Uint8Array(e);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}subarray(e,t,n=!1){return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,n=!1){n&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class xe{constructor(){t(this,"list",[])}get length(){return this.list.length}add(e,t,n=0){let s=e+t,i=this.list.filter((t=>Pe(e,t.offset,s)||Pe(e,t.end,s)));if(i.length>0){e=Math.min(e,...i.map((e=>e.offset))),s=Math.max(s,...i.map((e=>e.end))),t=s-e;let n=i.shift();n.offset=e,n.length=t,n.end=s,this.list=this.list.filter((e=>!i.includes(e)))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let n=e+t;return this.list.some((t=>t.offset<=e&&n<=t.end))}}function Pe(e,t,n){return e<=t&&t<=n}class Ce extends _e{constructor(e,n){super(0),t(this,"chunksRead",0),this.input=e,this.options=n}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,n=await this.readChunk(e,t);return!!n&&n.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead{"use strict";e.exports=function(e,t,n,s,i,r,o,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,s,i,r,o,a],c=0;(l=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},6993:e=>{e.exports=function(e,t){if(e===t)return!0;for(var n in e)if(!(n in t))return!1;for(var n in t)if(e[n]!==t[n])return!1;return!0}},8127:function(e,t,n){var s,i;i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:this,e.exports=function(n){"use strict";var i,r=(n=n||{}).Base64,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(e){for(var t={},n=0,s=e.length;n>>6)+l(128|63&t):l(224|t>>>12&15)+l(128|t>>>6&63)+l(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return l(240|t>>>18&7)+l(128|t>>>12&63)+l(128|t>>>6&63)+l(128|63&t)},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,d=function(e){return e.replace(c,u)},p=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[o.charAt(n>>>18),o.charAt(n>>>12&63),t>=2?"=":o.charAt(n>>>6&63),t>=1?"=":o.charAt(63&n)].join("")},h=n.btoa&&"function"==typeof n.btoa?function(e){return n.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,p)},f=function(e){return h(d(String(e)))},m=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},g=function(e,t){return t?m(f(e)):f(e)};n.Uint8Array&&(i=function(e,t){for(var n="",s=0,i=e.length;s>>18)+o.charAt(u>>>12&63)+(void 0!==a?o.charAt(u>>>6&63):"=")+(void 0!==l?o.charAt(63&u):"=")}return t?m(n):n});var y,v=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,b=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return l(55296+(t>>>10))+l(56320+(1023&t));case 3:return l((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return l((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},w=function(e){return e.replace(v,b)},E=function(e){var t=e.length,n=t%4,s=(t>0?a[e.charAt(0)]<<18:0)|(t>1?a[e.charAt(1)]<<12:0)|(t>2?a[e.charAt(2)]<<6:0)|(t>3?a[e.charAt(3)]:0),i=[l(s>>>16),l(s>>>8&255),l(255&s)];return i.length-=[0,0,2,1][n],i.join("")},_=n.atob&&"function"==typeof n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/\S{1,4}/g,E)},x=function(e){return _(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},P=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},C=function(e){return function(e){return w(_(e))}(P(e))};n.Uint8Array&&(y=function(e){return Uint8Array.from(x(P(e)),(function(e){return e.charCodeAt(0)}))});if(n.Base64={VERSION:"2.6.4",atob:x,btoa:h,fromBase64:C,toBase64:g,utob:d,encode:g,encodeURI:function(e){return g(e,!0)},btou:w,decode:C,noConflict:function(){var e=n.Base64;return n.Base64=r,e},fromUint8Array:i,toUint8Array:y},"function"==typeof Object.defineProperty){var S=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};n.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",S((function(){return C(this)}))),Object.defineProperty(String.prototype,"toBase64",S((function(e){return g(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",S((function(){return g(this,!0)})))}}return n.Meteor&&(Base64=n.Base64),e.exports?e.exports.Base64=n.Base64:void 0===(s=function(){return n.Base64}.apply(t,[]))||(e.exports=s),{Base64:n.Base64}}(i)},181:(e,t,n)=>{var s=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),d=Object.prototype.toString,p=Math.max,h=Math.min,f=function(){return c.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.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(s,"");var n=r.test(e);return n||o.test(e)?a(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var s,i,r,o,a,l,u=0,c=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=s,r=i;return s=i=void 0,u=t,o=e.apply(r,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=r}function w(){var e=f();if(b(e))return E(e);a=setTimeout(w,function(e){var n=t-(e-l);return d?h(n,r-(e-u)):n}(e))}function E(e){return a=void 0,y&&s?v(e):(s=i=void 0,o)}function _(){var e=f(),n=b(e);if(s=arguments,i=this,l=e,n){if(void 0===a)return function(e){return u=e,a=setTimeout(w,t),c?v(e):o}(l);if(d)return a=setTimeout(w,t),v(l)}return void 0===a&&(a=setTimeout(w,t)),o}return t=g(t)||0,m(n)&&(c=!!n.leading,r=(d="maxWait"in n)?p(g(n.maxWait)||0,t):r,y="trailing"in n?!!n.trailing:y),_.cancel=function(){void 0!==a&&clearTimeout(a),u=0,s=l=i=a=void 0},_.flush=function(){return void 0===a?o:E(f())},_}},5858:(e,t,n)=>{var s="Expected a function",i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,d=u||c||Function("return this")(),p=Object.prototype.toString,h=Math.max,f=Math.min,m=function(){return d.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(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(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=o.test(e);return n||a.test(e)?l(e.slice(2),n?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(s);return g(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),function(e,t,n){var i,r,o,a,l,u,c=0,d=!1,p=!1,v=!0;if("function"!=typeof e)throw new TypeError(s);function b(t){var n=i,s=r;return i=r=void 0,c=t,a=e.apply(s,n)}function w(e){var n=e-u;return void 0===u||n>=t||n<0||p&&e-c>=o}function E(){var e=m();if(w(e))return _(e);l=setTimeout(E,function(e){var n=t-(e-u);return p?f(n,o-(e-c)):n}(e))}function _(e){return l=void 0,v&&i?b(e):(i=r=void 0,a)}function x(){var e=m(),n=w(e);if(i=arguments,r=this,u=e,n){if(void 0===l)return function(e){return c=e,l=setTimeout(E,t),d?b(e):a}(u);if(p)return l=setTimeout(E,t),b(u)}return void 0===l&&(l=setTimeout(E,t)),a}return t=y(t)||0,g(n)&&(d=!!n.leading,o=(p="maxWait"in n)?h(y(n.maxWait)||0,t):o,v="trailing"in n?!!n.trailing:v),x.cancel=function(){void 0!==l&&clearTimeout(l),c=0,i=u=r=l=void 0},x.flush=function(){return void 0===l?a:_(m())},x}(e,t,{leading:i,maxWait:t,trailing:r})}},1811:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});var s=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function i(e,t){if(e.length!==t.length)return!1;for(var n=0;n{var s=n(7163),i=/[\/\+\.]/;e.exports=function(e,t){function n(t){var n=s(t,e,i);return n&&n.length>=2}return t?n(t.split(";")[0]):n}},3835:e=>{e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,n,s,i,r,o,a){var l=function(e){for(var n=t[e]?t[e]:[],s=e.indexOf(":"),i=-1===s?[e]:[e.substring(0,s),e.substring(s+1)],r=Object.keys(t),o=0,a=r.length;o{"use strict";n.r(t),n.d(t,{Component:()=>S,Fragment:()=>C,cloneElement:()=>K,createContext:()=>G,createElement:()=>_,createRef:()=>P,h:()=>_,hydrate:()=>W,isValidElement:()=>o,options:()=>i,render:()=>V,toChildArray:()=>R});var s,i,r,o,a,l,u,c,d,p,h,f,m,g={},y=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function E(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function _(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?s.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return x(e,a,i,r,null)}function x(e,t,n,s,o){var a={type:e,props:t,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++r:o,__i:-1,__u:0};return null==o&&null!=i.vnode&&i.vnode(a),a}function P(){return{current:null}}function C(e){return e.children}function S(e,t){this.props=e,this.context=t}function O(e,t){if(null==t)return e.__?O(e.__,e.__i+1):null;for(var n;tt&&a.sort(c));N.__r=0}function U(e,t,n,s,i,r,o,a,l,u,c){var d,p,h,f,m,v,b=s&&s.__k||y,w=t.length;for(l=T(n,t,b,l,w),d=0;d0?x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,a=null,-1!==(u=o.__i=D(o,n,l,d))&&(d--,(a=n[u])&&(a.__u|=2)),null==a||null===a.__v?(-1==u&&p--,"function"!=typeof o.type&&(o.__u|=4)):u!=l&&(u==l-1?p--:u==l+1?p++:(u>l?p--:p++,o.__u|=4))):e.__k[r]=null;if(d)for(r=0;r(null==l||2&l.__u?0:1))for(i=n-1,r=n+1;i>=0||r=0){if((l=t[i])&&!(2&l.__u)&&o==l.key&&a===l.type)return i;i--}if(r2&&(l.children=arguments.length>3?s.call(arguments,2):n),x(e.type,l,i||e.key,r||e.ref,null)}function G(e,t){var n={__c:t="__cC"+m++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,s;return this.getChildContext||(n=new Set,(s={})[t]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.forEach((function(e){e.__e=!0,F(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}s=y.slice,i={__e:function(e,t,n,s){for(var i,r,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,s||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},r=0,o=function(e){return null!=e&&null==e.constructor},S.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},n),this.props)),e&&w(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),F(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),F(this))},S.prototype.render=C,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,d=/(PointerCapture)$|Capture$/i,p=0,h=B(!1),f=B(!0),m=0},2694:(e,t,n)=>{"use strict";var s=n(6925);function i(){}function r(){}r.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,r,o){if(o!==s){var a=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 a.name="Invariant Violation",a}}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:r,resetWarningCache:i};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},3992:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function s(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function i(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var s,r,o=[];for(r in"string"!=typeof t&&(t="?"),e)if(n.call(e,r)){if((s=e[r])||null!=s&&!isNaN(s)||(s=""),r=i(r),s=i(s),null===r||null===s)continue;o.push(r+"="+s)}return o.length?t+o.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,i={};t=n.exec(e);){var r=s(t[1]),o=s(t[2]);null===r||null===o||r in i||(i[r]=o)}return i}},1020:(e,t,n)=>{"use strict";var s=n(1609),i=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var s,r={},u=null,c=null;for(s in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,s)&&!l.hasOwnProperty(s)&&(r[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===r[s]&&(r[s]=t[s]);return{$$typeof:i,type:e,key:u,ref:c,props:r,_owner:a.current}}t.Fragment=r,t.jsx=u,t.jsxs=u},4848:(e,t,n)=>{"use strict";e.exports=n(1020)},2063:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},6290:(e,t,n)=>{"use strict";n.r(t),n.d(t,{DetailedError:()=>p,HttpStack:()=>B,Upload:()=>se,canStoreURLs:()=>A,defaultOptions:()=>ne,enableDebugLog:()=>f,isSupported:()=>ae});var s=n(8127),i=n(1160),r=n.n(i);function o(e){return o="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(e)}function a(e){var t="function"==typeof Map?new Map:void 0;return a=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,s)}function s(){return l(e,arguments,d(this).constructor)}return s.prototype=Object.create(e.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),c(s,e)},a(e)}function l(e,t,n){return l=u()?Reflect.construct:function(e,t,n){var s=[null];s.push.apply(s,t);var i=new(Function.bind.apply(e,s));return n&&c(i,n.prototype),i},l.apply(null,arguments)}function u(){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 c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}const 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&&c(e,t)}(i,e);var t,n,s=(t=i,n=u(),function(){var e,s=d(t);if(n){var i=d(this).constructor;e=Reflect.construct(s,arguments,i)}else e=s.apply(this,arguments);return function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=s.call(this,e)).originalRequest=r,t.originalResponse=o,t.causingError=n,null!=n&&(e+=", caused by ".concat(n.toString())),null!=r){var a=r.getHeader("X-Request-ID")||"n/a",l=r.getMethod(),u=r.getURL(),c=o?o.getStatus():"n/a",d=o?o.getBody()||"":"n/a";e+=", originated from request (method: ".concat(l,", url: ").concat(u,", response code: ").concat(c,", response text: ").concat(d,", request id: ").concat(a,")")}return t.message=e,t}return i}(a(Error));var h=!1;function f(){h=!0}function m(e){h&&console.log(e)}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,s)}return n}function y(e){for(var t=1;t1&&["uploadUrl","uploadSize","uploadLengthDeferred"].forEach((function(t){e.options[t]&&e._emitError(new Error("tus: cannot use the ".concat(t," option when parallelUploads is enabled")))})),this.options.fingerprint(t,this.options).then((function(n){return m(null==n?"No fingerprint was calculated meaning that the upload cannot be stored in the URL storage.":"Calculated fingerprint: ".concat(n)),e._fingerprint=n,e._source?e._source:e.options.fileReader.openFile(t,e.options.chunkSize)})).then((function(t){e._source=t,e.options.parallelUploads>1||null!=e._parallelUploadUrls?e._startParallelUpload():e._startSingleUpload()})).catch((function(t){e._emitError(t)}))):this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var t=this,n=this._size=this._source.size,s=0;this._parallelUploads=[];var i=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,r=function(e,t,n){for(var s=Math.floor(e/t),i=[],r=0;r1&&"function"==typeof arguments[1])throw new Error("tus: the abort function does not accept a callback since v2 anymore; please use the returned Promise instead");return null!=this._parallelUploads&&this._parallelUploads.forEach((function(e){e.abort(t)})),null!==this._req&&(this._req.abort(),this._source.close()),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),t&&null!=this.url?e.terminate(this.url,this.options).then((function(){return n._removeFromUrlStorage()})):Promise.resolve()}},{key:"_emitHttpError",value:function(e,t,n,s){this._emitError(new p(n,s,e,t))}},{key:"_emitError",value:function(e){var t=this;if(!this._aborted){if(null!=this.options.retryDelays&&(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),C(e,this._retryAttempt,this.options))){var n=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout((function(){t.start()}),n))}if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}},{key:"_emitChunkComplete",value:function(e,t,n){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,n)}},{key:"_createUpload",value:function(){var e=this;if(this.options.endpoint){var t=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?t.setHeader("Upload-Defer-Length",1):t.setHeader("Upload-Length",this._size);var n,s=E(this.options.metadata);""!==s&&t.setHeader("Upload-Metadata",s),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,n=this._addChunkToRequest(t)):n=this._sendRequest(t,null),n.then((function(n){if(_(n.getStatus(),200)){var s=n.getHeader("Location");if(null!=s){if(e.url=S(e.options.endpoint,s),m("Created upload at ".concat(e.url)),"function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),0===e._size)return e._emitSuccess(),void e._source.close();e._saveUploadInUrlStorage(),e.options.uploadDataDuringCreation?e._handleUploadResponse(t,n):(e._offset=0,e._performUpload())}else e._emitHttpError(t,n,"tus: invalid or missing Location header")}else e._emitHttpError(t,n,"tus: unexpected response while creating upload")})).catch((function(n){e._emitHttpError(t,null,"tus: failed to create upload",n)}))}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var e=this,t=this._openRequest("HEAD",this.url);this._sendRequest(t,null).then((function(n){var s=n.getStatus();if(!_(s,200))return _(s,400)&&e._removeFromUrlStorage(),423===s?void e._emitHttpError(t,n,"tus: upload is currently locked; retry later"):e.options.endpoint?(e.url=null,void e._createUpload()):void e._emitHttpError(t,n,"tus: unable to resume upload (new upload cannot be created without an endpoint)");var i=parseInt(n.getHeader("Upload-Offset"),10);if(isNaN(i))e._emitHttpError(t,n,"tus: invalid or missing offset value");else{var r=parseInt(n.getHeader("Upload-Length"),10);if(!isNaN(r)||e.options.uploadLengthDeferred){if("function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),i===r)return e._emitProgress(r,r),void e._emitSuccess();e._offset=i,e._performUpload()}else e._emitHttpError(t,n,"tus: invalid or missing length value")}})).catch((function(n){e._emitHttpError(t,null,"tus: failed to resume upload",n)}))}},{key:"_performUpload",value:function(){var e,t=this;this._aborted||(this.options.overridePatchMethod?(e=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset",this._offset),this._addChunkToRequest(e).then((function(n){_(n.getStatus(),200)?t._handleUploadResponse(e,n):t._emitHttpError(e,n,"tus: unexpected response while uploading chunk")})).catch((function(n){t._aborted||t._emitHttpError(e,null,"tus: failed to upload chunk at offset ".concat(t._offset),n)})))}},{key:"_addChunkToRequest",value:function(e){var t=this,n=this._offset,s=this._offset+this.options.chunkSize;return e.setProgressHandler((function(e){t._emitProgress(n+e,t._size)})),e.setHeader("Content-Type","application/offset+octet-stream"),(s===1/0||s>this._size)&&!this.options.uploadLengthDeferred&&(s=this._size),this._source.slice(n,s).then((function(n){var s=n.value,i=n.done;return t.options.uploadLengthDeferred&&i&&(t._size=t._offset+(s&&s.size?s.size:0),e.setHeader("Upload-Length",t._size)),null===s?t._sendRequest(e):(t._emitProgress(t._offset,t._size),t._sendRequest(e,s))}))}},{key:"_handleUploadResponse",value:function(e,t){var n=parseInt(t.getHeader("Upload-Offset"),10);if(isNaN(n))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(n,this._size),this._emitChunkComplete(n-this._offset,n,this._size),this._offset=n,n==this._size)return this._emitSuccess(),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(e,t){var n=x(e,t,this.options);return this._req=n,n}},{key:"_removeFromUrlStorage",value:function(){var e=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch((function(t){e._emitError(t)})),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var e=this;if(this.options.storeFingerprintForResuming&&this._fingerprint){var t={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};this._parallelUploads?t.parallelUploadUrls=this._parallelUploadUrls:t.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,t).then((function(t){return e._urlStorageKey=t})).catch((function(t){e._emitError(t)}))}}},{key:"_sendRequest",value:function(e){return P(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,this.options)}}],s=[{key:"terminate",value:function(t,n){if(arguments.length>1&&"function"==typeof arguments[arguments.length-1])throw new Error("tus: the terminate function does not accept a callback since v2 anymore; please use the returned Promise instead");void 0===n&&(n={});var s=x("DELETE",t,n);return P(s,null,n).then((function(e){if(204!==e.getStatus())throw new p("tus: unexpected response while terminating upload",null,s,e)})).catch((function(i){if(i instanceof p||(i=new p("tus: failed to terminate upload",i,s,null)),!C(i,0,n))throw i;var r=n.retryDelays[0],o=n.retryDelays.slice(1),a=y(y({},n),{},{retryDelays:o});return new Promise((function(e){return setTimeout(e,r)})).then((function(){return e.terminate(t,a)}))}))}}],n&&b(t.prototype,n),s&&b(t,s),e}();function E(e){var t=[];for(var n in e)t.push("".concat(n," ").concat(s.Base64.encode(e[n])));return t.join(",")}function _(e,t){return e>=t&&e=n.retryDelays.length||null==e.originalRequest)return!1;if(n&&"function"==typeof n.onShouldRetry)return n.onShouldRetry(e,t,n);var s,i=e.originalResponse?e.originalResponse.getStatus():0;return(!_(i,400)||409===i||423===i)&&(s=!0,"undefined"!=typeof window&&"navigator"in window&&!1===window.navigator.onLine&&(s=!1),s)}function S(e,t){return new(r())(t,e).toString()}w.defaultOptions={endpoint:null,uploadUrl:null,metadata:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,_onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:null,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null};const O=w;function k(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((function(n,s){e._xhr.onload=function(){n(new L(e._xhr))},e._xhr.onerror=function(e){s(e)},e._xhr.send(t)}))}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),L=function(){function e(t){D(this,e),this._xhr=t}return j(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(e){return this._xhr.getResponseHeader(e)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}();const $=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};function z(e,t){for(var n=0;nthis._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var n=0===V(this._buffer);return this._done&&n?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])&&q(t.prototype,n),e}();function K(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=ee(ee({},ne),t),r.call(this,e,t)}return t=o,n=[{key:"terminate",value:function(e,t,n){return t=ee(ee({},ne),t),O.terminate(e,t,n)}}],null&&Z(t.prototype,null),n&&Z(t,n),o}(O),ie=window,re=ie.XMLHttpRequest,oe=ie.Blob,ae=re&&oe&&"function"==typeof oe.prototype.slice},1160:(e,t,n)=>{"use strict";var s=n(2063),i=n(3992),r=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,l=/:\d+$/,u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,c=/^[a-zA-Z]:/;function d(e){return(e||"").toString().replace(r,"")}var p=[["#","hash"],["?","query"],function(e,t){return m(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function f(e){var t,s=("undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).location||{},i={},r=typeof(e=e||s);if("blob:"===e.protocol)i=new y(unescape(e.pathname),{});else if("string"===r)for(t in i=new y(e,{}),h)delete i[t];else if("object"===r){for(t in e)t in h||(i[t]=e[t]);void 0===i.slashes&&(i.slashes=a.test(e.href))}return i}function m(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function g(e,t){e=(e=d(e)).replace(o,""),t=t||{};var n,s=u.exec(e),i=s[1]?s[1].toLowerCase():"",r=!!s[2],a=!!s[3],l=0;return r?a?(n=s[2]+s[3]+s[4],l=s[2].length+s[3].length):(n=s[2]+s[4],l=s[2].length):a?(n=s[3]+s[4],l=s[3].length):n=s[4],"file:"===i?l>=2&&(n=n.slice(2)):m(i)?n=s[4]:i?r&&(n=n.slice(2)):l>=2&&m(t.protocol)&&(n=s[4]),{protocol:i,slashes:r||m(i),slashesCount:l,rest:n}}function y(e,t,n){if(e=(e=d(e)).replace(o,""),!(this instanceof y))return new y(e,t,n);var r,a,l,u,h,v,b=p.slice(),w=typeof t,E=this,_=0;for("object"!==w&&"string"!==w&&(n=t,t=null),n&&"function"!=typeof n&&(n=i.parse),r=!(a=g(e||"",t=f(t))).protocol&&!a.slashes,E.slashes=a.slashes||r&&t.slashes,E.protocol=a.protocol||t.protocol||"",e=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||c.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(E.protocol)))&&(b[3]=[/(.*)/,"pathname"]);_{"use strict";e.exports=function(){}},7163:e=>{"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,n,s=!0,i=this.parts,r=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;s&&t{"use strict";e.exports=window.React},6427:e=>{"use strict";e.exports=window.wp.components},6087:e=>{"use strict";e.exports=window.wp.element},859:e=>{"use strict";class t extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}e.exports=t},3698:(e,t,n)=>{"use strict";var s=n(9061);const i=n(833);e.exports=class extends i{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then((e=>{let[t,n]=e;const s={};return n&&(s["uppy-auth-token"]=n),this.companionKeysParams&&(s["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...s}}))}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then((e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)]))).then((e=>{let[t]=e;return t}))}static initPlugin(e,t,n){if(e.type="acquirer",e.files=[],n&&(e.opts={...n,...t}),t.serverUrl||t.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(t.companionAllowedHosts){const n=t.companionAllowedHosts;if(!("string"==typeof n||Array.isArray(n)||n instanceof RegExp))throw new TypeError(`${e.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);e.opts.companionAllowedHosts=n}else/^(?!https?:\/\/).*$/i.test(t.companionUrl)?e.opts.companionAllowedHosts=`https://${t.companionUrl.replace(/^\/\//,"")}`:e.opts.companionAllowedHosts=new URL(t.companionUrl).origin;e.storage=e.opts.storage||s}}},833:(e,t,n)=>{"use strict";let s;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var r=0;function o(e){return"__private_"+r+++"_"+e}const a=n(9214),l=n(3461),u=n(859);async function c(e){if(401===e.status)throw new u;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var d=o("companionHeaders"),p=o("getPostResponseFunc"),h=o("getUrl"),f=o("errorHandler");s=Symbol.for("uppy test: getCompanionHeaders");class m{constructor(e,t){Object.defineProperty(this,f,{value:y}),Object.defineProperty(this,h,{value:g}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,i(this,d)[d]=null==t?void 0:t.companionHeaders}setCompanionHeaders(e){i(this,d)[d]=e}[s](){return i(this,d)[d]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...m.defaultHeaders,...i(this,d)[d]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:s}=e;return s.has("i-am")&&s.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:s.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(i(this,h)[h](e),{method:"OPTIONS"}).then((e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map((e=>e.trim().toLowerCase()))),this.preflightDone=!0,this.allowedHeaders.slice()))).catch((e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice())))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then((e=>{let[t,n]=e;return Object.keys(n).forEach((e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])})),n}))}get(e,t){return this.preflightAndHeaders(e).then((t=>a(i(this,h)[h](e),{method:"get",headers:t,credentials:this.opts.companionCookiesRule||"same-origin"}))).then(i(this,p)[p](t)).then(c).catch(i(this,f)[f]("get",e))}post(e,t,n){const s="post";return this.preflightAndHeaders(e).then((n=>a(i(this,h)[h](e),{method:s,headers:n,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(t)}))).then(i(this,p)[p](n)).then(c).catch(i(this,f)[f](s,e))}delete(e,t,n){const s="delete";return this.preflightAndHeaders(e).then((n=>a(`${this.hostname}/${e}`,{method:s,headers:n,credentials:this.opts.companionCookiesRule||"same-origin",body:t?JSON.stringify(t):null}))).then(i(this,p)[p](n)).then(c).catch(i(this,f)[f](s,e))}}function g(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function y(e,t){return n=>{var s;return null!=(s=n)&&s.isAuthError||(n=new l(`Could not ${e} ${i(this,h)[h](t)}`,{cause:n})),Promise.reject(n)}}m.VERSION="2.2.2",m.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${m.VERSION}`},e.exports=m},1878:(e,t,n)=>{"use strict";const s=n(833);e.exports=class extends s{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" "),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}}},8822:(e,t,n)=>{"use strict";let s,i;function r(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var o=0;function a(e){return"__private_"+o+++"_"+e}const l=n(3835);var u=a("queued"),c=a("emitter"),d=a("isOpen"),p=a("socket"),h=a("handleMessage");s=Symbol.for("uppy test: getSocket"),i=Symbol.for("uppy test: getQueued"),e.exports=class{constructor(e){Object.defineProperty(this,u,{writable:!0,value:[]}),Object.defineProperty(this,c,{writable:!0,value:l()}),Object.defineProperty(this,d,{writable:!0,value:!1}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return r(this,d)[d]}[s](){return r(this,p)[p]}[i](){return r(this,u)[u]}open(){r(this,p)[p]=new WebSocket(this.opts.target),r(this,p)[p].onopen=()=>{for(r(this,d)[d]=!0;r(this,u)[u].length>0&&r(this,d)[d];){const e=r(this,u)[u].shift();this.send(e.action,e.payload)}},r(this,p)[p].onclose=()=>{r(this,d)[d]=!1},r(this,p)[p].onmessage=r(this,h)[h]}close(){var e;null==(e=r(this,p)[p])||e.close()}send(e,t){r(this,d)[d]?r(this,p)[p].send(JSON.stringify({action:e,payload:t})):r(this,u)[u].push({action:e,payload:t})}on(e,t){r(this,c)[c].on(e,t)}emit(e,t){r(this,c)[c].emit(e,t)}once(e,t){r(this,c)[c].once(e,t)}}},8327:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=t.SearchProvider=t.RequestClient=t.Provider=void 0;const s=n(833);t.RequestClient=s;const i=n(3698);t.Provider=i;const r=n(1878);t.SearchProvider=r;const o=n(8822);t.Socket=o},9061:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},t.removeItem=function(e){return new Promise((t=>{localStorage.removeItem(e),t()}))},t.setItem=function(e,t){return new Promise((n=>{localStorage.setItem(e,t),n()}))}},2522:(e,t,n)=>{"use strict";const s=n(6458);e.exports=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const e=new s([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}},7839:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultOptions=t.RestrictionError=t.Restricter=void 0;const s=n(8236),i=n(7057);t.defaultOptions={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class r extends Error{constructor(){super(...arguments),this.isRestriction=!0}}t.RestrictionError=r,"undefined"==typeof AggregateError&&(globalThis.AggregateError=class extends Error{constructor(e,t){super(t),this.errors=e}}),t.Restricter=class{constructor(e,t){this.i18n=t,this.getOpts=()=>{const t=e();if(null!=t.restrictions.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validate(e,t){const{maxFileSize:n,minFileSize:o,maxTotalFileSize:a,maxNumberOfFiles:l,allowedFileTypes:u}=this.getOpts().restrictions;if(l&&t.filter((e=>!e.isGhost)).length+1>l)throw new r(`${this.i18n("youCanOnlyUploadX",{smart_count:l})}`);if(u&&!u.some((t=>t.includes("/")?!!e.type&&i(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase()))){const e=u.join(", ");throw new r(this.i18n("youCanOnlyUploadFileTypes",{types:e}))}if(a&&null!=e.size&&t.reduce(((e,t)=>e+t.size),e.size)>a)throw new r(this.i18n("exceedsSize",{size:s(a),file:e.name}));if(n&&null!=e.size&&e.size>n)throw new r(this.i18n("exceedsSize",{size:s(n),file:e.name}));if(o&&null!=e.size&&e.size{"use strict";var s=n(172);function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var r=0;function o(e){return"__private_"+r+++"_"+e}const a=n(515),l=n(8200),u=n(2522);var c=o("updateUI");class d extends u{constructor(){super(...arguments),Object.defineProperty(this,c,{writable:!0,value:void 0})}mount(e,t){const n=t.id,r=a(e);if(r){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),i(this,c)[c]=function(e){let t=null,n=null;return function(){for(var s=arguments.length,i=new Array(s),r=0;r(t=null,e(...n))))),t}}((e=>{this.uppy.getPlugin(this.id)&&((0,s.render)(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),(0,s.render)(this.render(this.uppy.getState()),t),this.el=t,r.appendChild(t),t.dir=this.opts.direction||l(t)||"ltr",this.onMount(),this.el}let o;if("object"==typeof e&&e instanceof d)o=e;else if("function"==typeof e){const t=e;this.uppy.iteratePlugins((e=>{e instanceof t&&(o=e)}))}if(o)return this.uppy.log(`Installing ${n} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let u=`Invalid target option given to ${n}.`;throw u+="function"==typeof e?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the