cortex-react-ui 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -15,5 +15,5 @@
15
15
  /*!**************************************************************************************!*\
16
16
  !*** external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} ***!
17
17
  \**************************************************************************************/
18
- /*! no static exports found */function(t,r){t.exports=e}}).default};var Mt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}({exports:{}}.exports=Et(o.default)),Dt={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},It=o.default.createContext&&o.default.createContext(Dt),Ft=["attr","size","title"];function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kt.apply(this,arguments)}function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){Rt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Rt(e,t,r){var n;return(t="symbol"==typeof(n=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gt(e){return e&&e.map(((e,t)=>o.default.createElement(e.tag,Nt({key:t},e.attr),Gt(e.child))))}function jt(e){return t=>o.default.createElement(Yt,kt({attr:Nt({},e.attr)},t),Gt(e.child))}function Yt(e){var t=t=>{var r,{attr:n,size:i,title:a}=e,s=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Ft),c=i||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),o.default.createElement("svg",kt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,s,{className:r,style:Nt(Nt({color:e.color||t.color},t.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),a&&o.default.createElement("title",null,a),e.children)};return void 0!==It?o.default.createElement(It.Consumer,null,(e=>t(e))):t(Dt)}function Vt(e){return jt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 144v288c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48h88l12.3-32.9c7-18.7 24.9-31.1 44.9-31.1h125.5c20 0 37.9 12.4 44.9 31.1L376 96h88c26.5 0 48 21.5 48 48zM376 288c0-66.2-53.8-120-120-120s-120 53.8-120 120 53.8 120 120 120 120-53.8 120-120zm-32 0c0 48.5-39.5 88-88 88s-88-39.5-88-88 39.5-88 88-88 88 39.5 88 88z"},child:[]}]})(e)}function St(e){return jt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"},child:[]}]})(e)}function Ot(e){return jt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function Pt(e){return jt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function Qt(e){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M16 7h-1l-1-1h-4L9 7H8c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm-4 7c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"},child:[]},{tag:"path",attr:{d:"m8.57.51 4.48 4.48V2.04c4.72.47 8.48 4.23 8.95 8.95h2C23.34 3.02 15.49-1.59 8.57.51zM10.95 21.96c-4.72-.47-8.48-4.23-8.95-8.95H0c.66 7.97 8.51 12.58 15.43 10.48l-4.48-4.48v2.95z"},child:[]}]})(e)}function Lt(e){return jt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10"},child:[]}]})(e)}var Ut,Wt=function(){function e(){this.dbName="cortex-react-media",this.storeName="capturedFiles",this.db=null}return e.prototype.openDatabase=function(){return u(this,void 0,void 0,(function(){var e=this;return d(this,(function(t){return[2,new Promise((function(t,r){var n=indexedDB.open(e.dbName,1);n.onupgradeneeded=function(t){n.result.createObjectStore(e.storeName,{keyPath:"id",autoIncrement:!0})},n.onsuccess=function(){e.db=n.result,t(e.db)},n.onerror=function(){return r(n.error)}}))]}))}))},e.prototype.storeFile=function(e){return u(this,void 0,void 0,(function(){var t=this;return d(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:[4,this.openDatabase()];case 1:r.sent(),r.label=2;case 2:return[2,new Promise((function(r,n){var o=t.db.transaction(t.storeName,"readwrite").objectStore(t.storeName).add({file:e,timestamp:Date.now(),name:e.name});o.onsuccess=function(){return r(o.result)},o.onerror=function(){return n(o.error)}}))]}}))}))},e.prototype.retrieveFile=function(e){return u(this,void 0,void 0,(function(){var t=this;return d(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:[4,this.openDatabase()];case 1:r.sent(),r.label=2;case 2:return[2,new Promise((function(r,n){var o=t.db.transaction([t.storeName],"readonly").objectStore(t.storeName).get(e);o.onsuccess=function(){var e=o.result;r(e?e.file:null)},o.onerror=function(){return n(o.error)}}))]}}))}))},e}();!function(e){e[e.Enter=0]="Enter",e[e.Entering=1]="Entering",e[e.Entered=2]="Entered",e[e.Exit=3]="Exit",e[e.Exiting=4]="Exiting",e[e.Exited=5]="Exited"}(Ut||(Ut={}));var Kt=o.default.forwardRef((function(e,t){var r=e.trigger,n=e.mode,i=void 0===n?"appear":n,a=e.children,s=e.enterTimeout,l=e.exitTimeout,u=e.className,d=e.onEnter,f=e.onEntering,h=e.onEntered,g=e.onExit,m=e.onExiting,v=e.onExited,w=o.default.useRef(null),y=o.default.useRef(),A=o.default.useState((function(){return"appear"===i?Ut.Exited:Ut.Entered}));A[0],A[1],o.default.useEffect((function(){return function(){y.current&&window.clearTimeout(y.current)}}),[y]),o.default.useEffect((function(){r?(y.current&&window.clearTimeout(y.current),w.current.classList.remove("".concat(u,"-exit")),w.current.classList.remove("".concat(u,"-exiting")),w.current.classList.remove("".concat(u,"-exited")),d&&d(),w.current.classList.add("".concat(u,"-enter")),y.current=window.setTimeout((function(){f&&f(),w.current&&w.current.classList.add("".concat(u,"-entering")),y.current=window.setTimeout((function(){h&&h(),w.current&&w.current.classList.add("".concat(u,"-entered"))}),s||1e3)}),10)):(y.current&&window.clearTimeout(y.current),w.current.classList.remove("".concat(u,"-enter")),w.current.classList.remove("".concat(u,"-entering")),w.current.classList.remove("".concat(u,"-entered")),g&&g(),w.current.classList.add("".concat(u,"-exit")),y.current=window.setTimeout((function(){m&&m(),w.current&&w.current.classList.add("".concat(u,"-exiting")),y.current=window.setTimeout((function(){v&&v(),w.current&&w.current.classList.add("".concat(u,"-exited"))}),l||1e3)})))}),[r]);var C=o.default.useMemo((function(){if(a){var e=c(c({},a.props),{className:B(u,a.props.className),ref:w});return o.default.cloneElement(a,e)}}),[a,w]);return p.exports.jsx(p.exports.Fragment,{children:C})}));Kt.propTypes={},Kt.defaultProps={};var Jt=o.default.forwardRef((function(e,t){var r=e.trigger,n=e.children,o=e.onEnter,i=e.onEntering,a=e.onEntered,s=e.onExit,l=e.onExiting,u=e.onExited;return p.exports.jsx(Kt,c({ref:t,trigger:r,mode:"appear",className:"ui-fade",enterTimeout:160,exitTimeout:160,onEnter:o,onExit:s,onEntering:i,onEntered:a,onExiting:l,onExited:u},{children:n}))}));function Zt(e,t){var r=i.useCallback((function(r){var n=r.target,o=t.reduce((function(e,t){if(!t)return e;var r=function(e){var t;if(!e)return document.body;if("[object String]"===Object.prototype.toString.call(e)){var r=document.getElementById(e);return null!=r?r:document.body}var n=e;return n&&void 0!==n.current?null!==(t=n.current)&&void 0!==t?t:void 0:e}(t);return!1!==e&&r&&null!==r?!r.contains(n):e}),!0);e&&o&&e()}),[e]);i.useEffect((function(){return document.addEventListener("mousedown",r),function(){document.removeEventListener("mousedown",r)}}),[t,r])}Jt.propTypes={},Jt.defaultProps={};var Ht=function(e){var t=e.tag;e.className;var r=e.onDelete;return p.exports.jsxs("span",c({className:"ui-taginputItem"},{children:[p.exports.jsx("span",c({className:"ui-taginputItemLabel"},{children:t.label})),p.exports.jsx("button",c({type:"button",className:"ui-taginputItemRemove",onClick:r},{children:"x"}))]}))},zt=o.default.forwardRef((function(e,t){var r=e.className,n=e.value,i=e.onClick,a=e.onChange,s=o.default.useRef(null),c=o.default.useCallback((function(e){a&&a(e.target.value)}),[a]);return o.default.useEffect((function(){if(t&&s)return x(t,s.current),function(){x(t,null)}}),[t,s]),p.exports.jsx(p.exports.Fragment,{children:p.exports.jsx("input",{ref:s,value:n,className:B("ui-taginputFilter",r),autoComplete:"off",spellCheck:"false","data-form-type":"other",onChange:c,onClick:i})})})),Xt=function(e){var t=e.suggestion,r=e.onClick,n=o.default.useCallback((function(e){r&&r(t,e)}),[r]);return p.exports.jsx("div",c({role:"button",className:"ui-taginputSelectItem",tabIndex:0,onClick:n},{children:t.label}))},_t=function(e){var t=e.group,r=e.onClick,n=Array.isArray(t.suggestions)?t.suggestions.map((function(e,t){return!0===e.group?p.exports.jsx(_t,{group:e,onClick:r},t):p.exports.jsx(Xt,{suggestion:e,onClick:r},t)})):null;return p.exports.jsxs("div",c({className:"ui-taginputSelectGroup"},{children:[p.exports.jsx("span",c({className:"ui-taginputSelectGroupLabel"},{children:t.label})),p.exports.jsx("div",c({className:"ui-taginputSelectGroupItems"},{children:n}))]}))},$t=o.default.forwardRef((function(e,t){var r=e.open,n=e.tags,i=e.disableFilter,a=e.suggestions,s=e.anchorEl,l=e.filter,u=e.onSuggestionClick,d=o.default.useMemo((function(){if(!Array.isArray(a))return[];if(i)return a;var e=Array.isArray(n)&&n.length>0,t=l&&l.length>0,r=[];return a.forEach((function(o){if(!0!==o.group)e&&n.some((function(e){return e.id===o.id}))||t&&o.label.toUpperCase().indexOf(l.toUpperCase())<0||r.push(c({},o));else if(Array.isArray(o.suggestions)){var i=c(c({},o),{suggestions:[]});o.suggestions.forEach((function(r){e&&n.some((function(e){return e.id===r.id}))||t&&r.label.toUpperCase().indexOf(l.toUpperCase())<0||i.suggestions.push(c({},r))})),i.suggestions.length>0&&r.push(i)}})),r}),[a,l,n]),f=o.default.useCallback((function(e){u&&u(e)}),[u]),h=r&&d.length>0,g=d.map((function(e,t){return!0===e.group?p.exports.jsx(_t,{group:e,onClick:f},t):p.exports.jsx(Xt,{suggestion:e,onClick:f},t)}));return p.exports.jsx(O,c({ref:t,open:h,anchorEl:s,placement:F},{children:p.exports.jsx("div",c({className:"ui-taginputSelect"},{children:g}))}))})),er=function(e){var t=e.containerRef;e.className;var r=e.children,n=e.onClick;e.onClose;var i=o.default.useRef(null);return o.default.useEffect((function(){if(i&&t&&i.current&&t.current){var e=t.current.getBoundingClientRect(),r=i.current.getBoundingClientRect(),n=e.width,o="0px",a="unset";e.right+r.width>=window.innerWidth&&(n=-r.width),r.bottom>=window.innerHeight&&(a="".concat(-(window.innerHeight-e.bottom-15).toFixed(),"px"),o="unset"),i.current.setAttribute("style","opacity: 1; left: ".concat(n.toFixed(),"px; bottom: ").concat(a,"; top: ").concat(o,";"))}}),[i]),p.exports.jsx("div",c({ref:i,className:"ui-menu"},{children:p.exports.jsx("ul",c({className:"ui-menuList",onClick:n,onContextMenu:n},{children:r}))}))};function tr(e){var t=i.useState(),r=t[0],n=t[1];return i.useEffect((function(){n(function(e){var t;if(e){if("[object String]"===Object.prototype.toString.call(e)){var r=document.getElementById(e);return null!=r?r:void 0}var n=e;return n&&void 0!==n.current?null!==(t=n.current)&&void 0!==t?t:void 0:e}}(e))}),[e]),r}er.propTypes={className:s.default.string},er.defaultProps={className:void 0};var rr=function(e){var t=e.className,r=e.children,n=e.placement,i=e.open,a=e.container,s=e.onOpen,l=e.onClose,u=o.default.useRef(null),d=tr(a),f=o.default.useState(null),h=f[0],g=f[1];Zt((function(){i&&l&&l()}),[u]);var m=o.default.useCallback((function(e){e.preventDefault(),e.ctrlKey||(g({mouseX:e.pageX-2,mouseY:e.pageY-4}),s&&s())}),[s]),v=function(e){e.preventDefault()};return o.default.useEffect((function(){var e=null!=d?d:document;return e.addEventListener("contextmenu",m),e!==document&&document.addEventListener("contextmenu",v),function(){e.removeEventListener("contextmenu",m),document.removeEventListener("contextmenu",v)}}),[d,m]),p.exports.jsx(O,c({ref:u,anchorPosition:null!==h?{top:h.mouseY,left:h.mouseX}:void 0,placement:n,open:i,overflow:!1},{children:p.exports.jsx(er,c({className:t,onClose:l,onClick:function(e){e&&2===e.button&&(e.preventDefault(),e.stopPropagation())},containerRef:u},{children:r}))}))};rr.propTypes={className:s.default.string},rr.defaultProps={className:void 0};var nr=function(e){return e.className,p.exports.jsx("hr",{})};nr.propTypes={className:s.default.string},nr.defaultProps={className:void 0};var or=function(e){var t=e.className;return p.exports.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 7",fill:"none",className:B("ui-icon",t),transform:"rotate(90 0 0)",preserveAspectRatio:"xMidYMid meet"},{children:p.exports.jsx("path",{d:"M5.3,0.3c0.4-0.4,1-0.4,1.4,0l5,5c0.4,0.4,0.4,1,0,1.4c-0.4,0.4-1,0.4-1.4,0L6,2.4L1.7,6.7c-0.4,0.4-1,0.4-1.4,0c-0.4-0.4-0.4-1,0-1.4L5.3,0.3z"})}))},ir=function(e){var t=e.className;return p.exports.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:B("ui-icon",t)},{children:p.exports.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))},ar=function(e){var t=e.label,r=e.icon,n=e.className,i=e.style;e.active;var a=e.disable,s=e.children,l=e.itemTemplate,u=e.onClick,d=o.default.useState(!1),f=d[0],h=d[1],g=o.default.useRef(null),m=o.default.useCallback((function(e){u&&!0!==a&&u(e)}),[u]),v=null!=s;return p.exports.jsxs("li",c({className:B("ui-menuItem",!0===a?"ui-menuItem-disable":null,n),style:i,onMouseEnter:function(){h(!0)},onMouseLeave:function(){h(!1)},ref:g},{children:[p.exports.jsxs("button",c({type:"button",className:"ui-menuItem-btn",onClick:m},{children:[r&&p.exports.jsx("div",c({className:"ui-menuItem-icon"},{children:r})),p.exports.jsx("span",{children:null!=l?l:t}),v&&p.exports.jsx("div",c({className:"ui-menuItem-menuIconContainer"},{children:p.exports.jsx(or,{className:"ui-menuItem-menuIcon"})}))]})),v&&f&&p.exports.jsx(er,c({containerRef:g},{children:s}))]}))};ar.propTypes={className:s.default.string},ar.defaultProps={className:void 0};var sr=function(e){var t=e.className,r=e.children,n=e.placement,i=e.open,a=e.anchorPosition,s=e.anchorEl,l=e.onClose,u=o.default.useRef(null);return Zt((function(){i&&l&&l()}),[u]),i&&(a||s)?p.exports.jsx(O,c({ref:u,anchorPosition:a,anchorEl:s,placement:n,open:i,overflow:!1,className:"ui-menu-popper"},{children:p.exports.jsx(er,c({className:t,onClose:l,onClick:function(e){e&&2===e.button&&(e.preventDefault(),e.stopPropagation())},containerRef:u},{children:r}))})):null};sr.propTypes={className:s.default.string},sr.defaultProps={className:void 0};var cr=function(e){var t=e.title,r=e.className,n=e.children;return p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsx("li",c({className:B("ui-group-title",r)},{children:t})),n]})};cr.propTypes={className:s.default.string},cr.defaultProps={className:void 0};var lr=function(e){var t=e.url,r=e.queryParams,n=e.token,o=e.label,i=e.onStart,a=e.onCompleted,s=e.onError;return p.exports.jsx(p.exports.Fragment,{children:p.exports.jsx(ar,{label:o,onClick:function(e){return u(void 0,void 0,void 0,(function(){var o,c,l,u,f,p,h,g;return d(this,(function(d){switch(d.label){case 0:i&&i(e),d.label=1;case 1:if(d.trys.push([1,4,,5]),!n)throw new Error("INVALID_TOKEN");if(!t)throw new Error("INVALID_URL");return(o={}).ContentType="application/json",o.Authorization="Bearer ".concat(n),c={method:"get",headers:o},l=new URL(t),r&&Object.keys(r).forEach((function(e){return l.searchParams.append(e,r[e])})),[4,fetch(l,c)];case 2:if(!(u=d.sent())||200!==u.status)throw new Error("An error occured while generating file");return[4,u.blob()];case 3:return(f=d.sent())&&(p=window.URL.createObjectURL(f),(h=document.createElement("a")).href=p,h.download=function(e){var t=e.get("Content-Disposition");if(!t)return null;var r=t.split(";"),n="filename=",o=r.find((function(e){return e.indexOf(n)>-1}));if(o){var i=o.search(n);if(i<0)return null;var a=o.substring(i+9).trim();if(0===a.length)return null;var s=a.substring(0,1);return'"'!==s&&"'"!==s?a:a.length<2||a[a.length-1]!==s?null:a.substring(1,a.length-1)}return null}(u.headers)||"file",h.click(),URL.revokeObjectURL(p),h.remove()),[3,5];case 4:throw g=d.sent(),s&&s(g),g;case 5:return a&&a(),[2]}}))}))}})})};lr.propTypes={label:s.default.string};var ur=function(e){e.open;var t=e.width,r=e.fullWidth,n=e.fullHeight,i=e.className,a=e.children,s=e.onClose,l=o.default.useRef(),u=o.default.useRef(null),d=o.default.useRef(null);o.default.useEffect((function(){return l.current=document.body.style.overflow,document.body.style.overflow="hidden",function(){var e;document.body.style.overflow=null!==(e=l.current)&&void 0!==e?e:"initial"}}),[]);var f=o.default.useCallback((function(){s&&s()}),[s]);return p.exports.jsx(b,c({ref:u},{children:p.exports.jsxs("div",c({ref:function(e){d.current=e},style:{position:"fixed",margin:"0"},role:"dialog",className:B("ui-dialog",i)},{children:[p.exports.jsx("div",{role:"presentation",className:"ui-dialog-overlay",onClick:f}),p.exports.jsx("div",c({className:B("ui-dialog-container",t?"ui-dialog-size-".concat(t):null,!0===r?"ui-dialog-size-fullwidth":null,!0===n?"ui-dialog-size-fullheight":null)},{children:a}))]}))}))};ur.propTypes={className:s.default.string},ur.defaultProps={className:void 0};var dr=function(e){var t=e.className,r=e.children;return p.exports.jsx("div",c({className:B("ui-dialog-content",t)},{children:r}))};dr.propTypes={className:s.default.string},dr.defaultProps={className:void 0};var fr=function(e){var t=e.className,r=e.children;return p.exports.jsx("footer",c({className:B("ui-dialog-footer",t)},{children:r}))};fr.propTypes={className:s.default.string},fr.defaultProps={className:void 0};var pr=function(e){var t=e.className,r=e.children;return p.exports.jsx("header",c({className:B("ui-dialog-header",t)},{children:r}))};pr.propTypes={className:s.default.string},pr.defaultProps={className:void 0};var hr=function(e){var t=e.className,r=e.children,n=e.closeDisable,i=e.onClose,a=o.default.useCallback((function(){i&&!0!==n&&i()}),[i,n]),s=void 0!==i;return p.exports.jsxs("h3",c({className:B("ui-dialog-title",t)},{children:[r,s&&p.exports.jsx("button",c({type:"button",className:B("ui-dialog-close",n?"ui-dialog-close-disable":null),tabIndex:0,onClick:a},{children:p.exports.jsx(ir,{})}))]}))};hr.propTypes={className:s.default.string,children:s.default.node,closeDisable:s.default.bool},hr.defaultProps={className:void 0,children:void 0};var gr=function(e){var t=e.className,r=e.children;return p.exports.jsx("div",c({className:B("ui-dialog-actions",t)},{children:r}))};gr.propTypes={className:s.default.string,children:s.default.node},gr.defaultProps={className:void 0,children:void 0};var mr=function(e){var t=e.title,r=e.ok,n=e.cancel,i=e.children,a=e.className,s=e.onClose,l=o.default.useCallback((function(){s&&s(!1)}),[s]),u=o.default.useCallback((function(){s&&s(!0)}),[s]),d=null!=r?r:"oui",f=null!=n?n:"Annuler";return p.exports.jsxs(ur,c({open:!0,className:B("ui-dialog-box","ui-dialog-confirm",a)},{children:[p.exports.jsx(pr,{children:p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("svg",c({className:"ui-dialog-icon",xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 438.5 438.5"},{children:[p.exports.jsx("path",{d:"M409.1,109.2c-19.6-33.6-46.2-60.2-79.8-79.8C295.7,9.8,259.1,0,219.3,0c-39.8,0-76.5,9.8-110.1,29.4\r\n C75.6,49,49,75.6,29.4,109.2C9.8,142.8,0,179.5,0,219.3c0,39.8,9.8,76.5,29.4,110.1c19.6,33.6,46.2,60.2,79.8,79.8\r\n c33.6,19.6,70.3,29.4,110.1,29.4s76.5-9.8,110.1-29.4c33.6-19.6,60.2-46.2,79.8-79.8c19.6-33.6,29.4-70.3,29.4-110.1\r\n C438.5,179.5,428.7,142.8,409.1,109.2z M387.4,290.2c-9.7,22.6-22.7,42-39,58.2c-16.3,16.3-35.7,29.3-58.2,39\r\n c-22.6,9.7-46.2,14.6-70.9,14.6s-48.4-4.9-70.9-14.6c-22.6-9.7-42-22.7-58.2-39c-16.3-16.3-29.3-35.7-39-58.2\r\n c-9.7-22.6-14.6-46.2-14.6-70.9c0-24.7,4.9-48.4,14.6-70.9c9.7-22.6,22.7-42,39-58.2c16.3-16.3,35.7-29.3,58.2-39\r\n c22.6-9.7,46.2-14.6,70.9-14.6c24.7,0,48.4,4.9,70.9,14.6c22.6,9.7,42,22.7,58.2,39c16.3,16.3,29.3,35.7,39,58.2\r\n c9.7,22.6,14.6,46.2,14.6,70.9C402,244,397.1,267.7,387.4,290.2z"}),p.exports.jsx("path",{d:"M217,294c-14.6,0-26.5,12.2-26.5,26.8c0,14.3,11.5,26.8,26.5,26.8s26.8-12.5,26.8-26.8C243.8,306.2,231.6,294,217,294z"}),p.exports.jsx("path",{d:"M221.5,90.8c-47.1,0-68.7,27.9-68.7,46.7c0,13.6,11.5,19.9,20.9,19.9c18.8,0,11.2-26.8,46.7-26.8c17.4,0,31.4,7.7,31.4,23.7\r\n c0,18.8-19.5,29.6-31,39.4c-10.1,8.7-23.4,23-23.4,53c0,18.1,4.9,23.4,19.2,23.4c17.1,0,20.6-7.7,20.6-14.3\r\n c0-18.1,0.4-28.6,19.5-43.6c9.4-7.3,39-31,39-63.8S266.1,90.8,221.5,90.8z"})]})),p.exports.jsx("h1",c({className:"ui-dialog-title"},{children:t}))]})}),p.exports.jsx(dr,{children:i}),p.exports.jsxs(fr,{children:[p.exports.jsx(Q,c({className:"dialog-action-ok dialog-action",onClick:u},{children:d})),p.exports.jsx(Q,c({className:"dialog-action-close dialog-action",onClick:l},{children:f}))]})]}))};mr.propTypes={className:s.default.string},mr.defaultProps={className:void 0};var vr=function(e){var t=e.title,r=e.ok,n=e.children,i=e.className,a=e.onClose,s=o.default.useCallback((function(){a&&a(!0)}),[a]),l=null!=r?r:"fermer";return p.exports.jsxs(ur,c({open:!0,className:B("ui-dialog-box","ui-dialog-error",i)},{children:[p.exports.jsx(pr,{children:p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("svg",c({className:"ui-dialog-icon",xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 438.533 438.533"},{children:[p.exports.jsx("path",{d:"M409.133,109.203c-19.608-33.592-46.205-60.189-79.798-79.796C295.736,9.801,259.058,0,219.273,0 c-39.781,0-76.47,9.801-110.063,29.407c-33.595,19.604-60.192,46.201-79.8,79.796C9.801,142.8,0,179.489,0,219.267 c0,39.78,9.804,76.463,29.407,110.062c19.607,33.592,46.204,60.189,79.799,79.798c33.597,19.605,70.283,29.407,110.063,29.407 s76.47-9.802,110.065-29.407c33.593-19.602,60.189-46.206,79.795-79.798c19.603-33.596,29.403-70.284,29.403-110.062 C438.533,179.485,428.732,142.795,409.133,109.203z M387.434,290.213c-9.709,22.556-22.696,41.97-38.969,58.245 c-16.271,16.269-35.689,29.26-58.245,38.965c-22.555,9.712-46.202,14.564-70.946,14.564c-24.744,0-48.391-4.853-70.948-14.564 c-22.554-9.705-41.971-22.696-58.245-38.965c-16.269-16.275-29.259-35.687-38.97-58.245 c-9.707-22.552-14.562-46.206-14.562-70.946c0-24.744,4.854-48.391,14.562-70.948c9.707-22.554,22.697-41.968,38.97-58.245 c16.274-16.269,35.691-29.26,58.245-38.97c22.554-9.704,46.205-14.558,70.948-14.558c24.74,0,48.395,4.851,70.946,14.558 c22.556,9.707,41.97,22.698,58.245,38.97c16.272,16.274,29.26,35.688,38.969,58.245c9.709,22.554,14.564,46.201,14.564,70.948 C402.002,244.011,397.143,267.664,387.434,290.213z"}),p.exports.jsx("path",{d:"M284.368,258.668c-19.219-14.086-40.926-21.129-65.095-21.129c-24.172,0-45.871,7.039-65.096,21.129 c-19.224,14.085-32.358,32.641-39.397,55.671c-1.521,4.757-1.143,9.381,1.141,13.847c2.286,4.469,5.898,7.467,10.85,8.993 c4.758,1.526,9.373,1.143,13.846-1.144c4.471-2.285,7.467-5.899,8.991-10.848c4.759-15.235,13.562-27.556,26.409-36.979 c12.847-9.418,27.263-14.127,43.252-14.127c15.987,0,30.412,4.712,43.251,14.127c12.854,9.424,21.655,21.744,26.412,36.979 c1.52,4.948,4.564,8.562,9.134,10.848c4.568,2.286,9.236,2.67,13.989,1.144c4.761-1.526,8.278-4.524,10.564-8.993 c2.286-4.466,2.669-9.09,1.14-13.847C316.729,291.312,303.591,272.75,284.368,258.668z"}),p.exports.jsx("path",{d:"M146.181,182.725c10.085,0,18.699-3.576,25.837-10.709c7.139-7.135,10.708-15.749,10.708-25.837 c0-10.089-3.569-18.699-10.708-25.837s-15.752-10.709-25.837-10.709c-10.088,0-18.702,3.571-25.84,10.709 c-7.135,7.139-10.707,15.749-10.707,25.837c0,10.088,3.568,18.702,10.707,25.837C127.482,179.152,136.093,182.725,146.181,182.725 z"}),p.exports.jsx("path",{d:"M292.359,109.631c-10.089,0-18.706,3.571-25.845,10.709c-7.132,7.139-10.708,15.749-10.708,25.837 c0,10.088,3.576,18.702,10.708,25.837c7.139,7.137,15.756,10.709,25.845,10.709c10.081,0,18.698-3.576,25.837-10.709 c7.139-7.135,10.708-15.749,10.708-25.837c0-10.089-3.569-18.699-10.708-25.837S302.44,109.631,292.359,109.631z"})]})),p.exports.jsx("h1",c({className:"ui-dialog-title"},{children:t}))]})}),p.exports.jsx(dr,{children:n}),p.exports.jsx(fr,{children:p.exports.jsx(Q,c({className:"dialog-action-ok dialog-action",onClick:s},{children:l}))})]}))};vr.propTypes={className:s.default.string},vr.defaultProps={className:void 0};var wr=function(e){var t=e.title,r=e.ok,n=e.children,i=e.className,a=e.onClose,s=o.default.useCallback((function(){a&&a(!0)}),[a]),l=null!=r?r:"fermer";return p.exports.jsxs(ur,c({open:!0,className:B("ui-dialog-box","ui-dialog-warning",i)},{children:[p.exports.jsx(pr,{children:p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("svg",c({className:"ui-dialog-icon",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 512 512"},{children:[p.exports.jsx("polygon",{fill:"#FFA418",points:"0,477.703 256,477.703 289.391,256 256,34.297"}),p.exports.jsx("polygon",{fill:"#FF8A1E",points:"256,34.297 256,477.703 512,477.703"}),p.exports.jsx("circle",{fill:"#324860",cx:"256",cy:"405.359",r:"16.696"}),p.exports.jsx("rect",{x:"239.304",y:"177.185",fill:"#324860",width:"33.391",height:"178.087"})]})),p.exports.jsx("h1",c({className:"ui-dialog-title"},{children:t}))]})}),p.exports.jsx(dr,{children:n}),p.exports.jsx(fr,{children:p.exports.jsx(Q,c({className:"dialog-action-ok dialog-action",onClick:s},{children:l}))})]}))};wr.propTypes={className:s.default.string},wr.defaultProps={className:void 0},exports.AuthDownloadLink=lr,exports.BarLoader=function(e){var t=e.title,r=e.color,n=e.className,o=e.isComplete;return p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsx("div",c({className:B("loader",null!=r?"loader-color-".concat(r):"loader-color-blue",!0===o?"completed":"",n)},{children:p.exports.jsx("div",{className:B("loaderBar",null!=r?"loaderBar-color-".concat(r):"loaderBar-color-blue")})})),p.exports.jsx("div",c({className:B("loaderBar-title")},{children:p.exports.jsx("span",{children:t})}))]})},exports.Button=Q,exports.Camera=function(t){var r=t.onCapture,n=t.isOffline,o=void 0!==n&&n,i=t.mode,a=void 0===i?"photo":i,s=t.validateText,f=void 0===s?"Valider":s,h=t.resetText,g=void 0===h?"Annuler":h,m=t.isShowOffline,v=void 0!==m&&m;t.isShowVideoButton;var w=l(t,["onCapture","isOffline","mode","validateText","resetText","isShowOffline","isShowVideoButton"]),y=e.useRef(null),A=e.useRef(null),C=e.useRef(new Wt),E=e.useState(a),b=E[0],x=E[1],B=e.useState(!1),T=B[0],M=B[1],D=e.useState(!1),I=D[0],F=D[1],k=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)||navigator.maxTouchPoints>0||"ontouchstart"in document.documentElement,q=function(){var t=e.useRef(null),r=e.useState(0),n=r[0],o=r[1],i=function(e){var t=Math.floor(e/86400),r=Math.floor(e%86400/3600),n=Math.floor(e%3600/60),o=e%60;return"".concat(t>0?t.toString().padStart(2,"0").concat(":"):"").concat(r>0?r.toString().padStart(2,"0").concat(":"):"").concat(n.toString().padStart(2,"0"),":").concat(o.toString().padStart(2,"0"))},a=e.useMemo((function(){return i(n)}),[n]),s=e.useCallback((function(){o(0),t.current=setInterval((function(){o((function(e){return e+1}))}),1e3)}),[]),c=e.useCallback((function(){t.current&&(clearInterval(t.current),t.current=null)}),[]);return{formatTime:i,startTimer:s,stopTimer:c,formatedTime:a}}(),N=q.formatedTime,R=q.startTimer,G=q.stopTimer,j=e.useState({imageUrl:null,videoUrl:null,isRecording:!1,storedFileId:null,file:null}),Y=j[0],V=j[1],S=e.useState({facingMode:"environment",width:{min:200},height:{min:300}});S[0];var O=S[1];e.useEffect((function(){return O({facingMode:k?"environment":"user",width:{min:200},height:{min:300}}),function(){U(),G(),W()}}),[]),e.useEffect((function(){"video"===b&&M(!1)}),[Y]);var P=e.useCallback((function(){return u(void 0,void 0,void 0,(function(){var e,t,r,n,o,i,a,s,l,u;return d(this,(function(d){if(e=null===(u=y.current)||void 0===u?void 0:u.getScreenshot()){for(t=atob(e.split(",")[1]),r=new Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);o=new Uint8Array(r),i=new Blob([o],{type:"image/jpeg"}),a="captured_image_".concat(Date.now().toString().slice(-7),".jpg"),s=new File([i],a,{type:"image/jpeg"}),l=URL.createObjectURL(s),V((function(e){return c(c({},e),{imageUrl:l,file:s})}))}return[2]}))}))}),[y,o,r]),L=e.useCallback((function(){if(y.current&&y.current.stream){var e="webm",t="video/".concat(e);MediaRecorder.isTypeSupported("video/mp4")&&(e="mp4",t="video/mp4");var r=new MediaRecorder(y.current.stream,{mimeType:t}),n=[];r.ondataavailable=function(e){e.data.size>0&&n.push(e.data)},r.onstop=function(){return u(void 0,void 0,void 0,(function(){var r,o,i,a;return d(this,(function(s){return r=new Blob(n,{type:t}),o="captured_video_".concat(Date.now(),".").concat(e),i=new File([r],o,{type:t}),a=URL.createObjectURL(i),V((function(e){return c(c({},e),{videoUrl:a,isRecording:!1,file:i})})),G(),[2]}))}))},r.start(),A.current=r,R(),V((function(e){return c(c({},e),{isRecording:!0})}))}}),[y,o,R,G,r]),U=function(){V({imageUrl:null,videoUrl:null,isRecording:!1,storedFileId:null,file:null})};return p.exports.jsx("div",c({className:"camera-container"},{children:Y.imageUrl||Y.videoUrl?p.exports.jsxs("div",c({className:"camera-preview camera-screen-animation"},{children:[Y.imageUrl&&p.exports.jsx("img",{src:Y.imageUrl,alt:"Capturé",style:{height:"90%",objectFit:"contain",overflowClipMargin:"content-box",overflow:"clip",aspectRatio:"16/9",display:"flex",justifySelf:"center"}}),Y.videoUrl&&p.exports.jsxs("video",c({width:"100%",height:"90%",id:"video",style:{height:"90%",objectFit:"contain",overflowClipMargin:"content-box",overflow:"clip",aspectRatio:"16/9",display:"flex",justifySelf:"center"},onEnded:function(){return M(!1)}},{children:[p.exports.jsx("source",{src:Y.videoUrl,type:"video/mp4"}),p.exports.jsx("source",{src:Y.videoUrl,type:"video/webm"}),p.exports.jsx("track",{kind:"captions",src:"",lang:"en",label:"English",default:!0}),"Your browser does not support the video."]})),Y.videoUrl&&p.exports.jsx(Q,c({variant:"contained",className:"video-play-btn",onClick:function(){var e=document.getElementById("video");try{e.paused?e.play():e.pause(),M(!T)}catch(e){}}},{children:T?p.exports.jsx(St,{}):p.exports.jsx(Ot,{})})),p.exports.jsxs("div",c({className:"camera-controls"},{children:[p.exports.jsx(Q,c({variant:"contained",onClick:function(){return u(void 0,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return o?[4,C.current.storeFile(Y.file)]:[3,2];case 1:e=t.sent(),r({fileRowId:e,fileStoreName:"capturedFiles"}),t.label=2;case 2:return o||"photo"!==b||r({file:Y.file,imageSrc:Y.imageUrl}),o||"video"!==b||r({file:Y.file,videoSrc:Y.videoUrl}),U(),[2]}}))}))},className:"camera-button camera-button--download"},{children:f})),p.exports.jsx(Q,c({variant:"outlined",onClick:U,className:"camera-button camera-button--reset"},{children:g}))]}))]})):p.exports.jsxs("div",c({className:"camera-preview"},{children:[Y.isRecording&&p.exports.jsxs("div",c({className:"camera-recording-timer",style:{display:"video"===b?"flex":"none"}},{children:[p.exports.jsx("span",{className:"camera-recording-dot"}),p.exports.jsx("span",{children:N})]})),!Y.isRecording&&p.exports.jsx("button",c({type:"button",onClick:function(){return x("photo"===b?"video":"photo"),void U()},className:"camera-button camera-mode"},{children:p.exports.jsx("span",{children:"photo"===b?"Video":"Photo"})})),k&&!Y.isRecording&&p.exports.jsx("button",c({type:"button",onClick:function(){F(!I),O({facingMode:I?"environment":"user",width:{min:200},height:{min:300}})},className:"camera-button camera-switch"},{children:p.exports.jsx(Qt,{size:18})})),o&&v&&p.exports.jsx("div",c({className:"camera-offline-mode"},{children:"Offline mode"})),p.exports.jsx(Mt,c({ref:y,videoConstraints:{facingMode:"environment",width:{min:200},height:{min:300}}},w,{style:{height:"90% !important",objectFit:"contain",overflowClipMargin:"content-box",overflow:"clip",aspectRatio:"16/9",display:"flex",justifySelf:"center",margin:"0 auto"},screenshotFormat:"image/jpeg",allowFullScreen:!0})),p.exports.jsxs("div",c({className:"camera-controls"},{children:["photo"===b&&p.exports.jsx(Q,c({variant:"contained",className:"camera-button camera-button--capture",onClick:P},{children:p.exports.jsx(Vt,{size:28})})),"video"===b&&!Y.isRecording&&p.exports.jsx(Q,c({variant:"contained",onClick:L,className:"camera-button camera-button--record"},{children:p.exports.jsx(Lt,{size:30})})),"video"===b&&Y.isRecording&&p.exports.jsx(Q,c({variant:"contained",onClick:W,className:"camera-button camera-button--record"},{children:p.exports.jsx(Pt,{size:28})}))]}))]}))}));function W(){A.current&&A.current.stop()}},exports.ChevronDownIcon=function(e){var t=e.className;return p.exports.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className:B("ui-icon",t),transform:"rotate(180 0 0)"},{children:p.exports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 8.29289C11.6834 7.90237 12.3166 7.90237 12.7071 8.29289L17.7071 13.2929C18.0976 13.6834 18.0976 14.3166 17.7071 14.7071C17.3166 15.0976 16.6834 15.0976 16.2929 14.7071L12 10.4142L7.70711 14.7071C7.31658 15.0976 6.68342 15.0976 6.29289 14.7071C5.90237 14.3166 5.90237 13.6834 6.29289 13.2929L11.2929 8.29289Z"})}))},exports.ChevronLeftIcon=function(e){var t=e.className;return p.exports.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 7",fill:"none",className:B("ui-icon",t),transform:"rotate(270 0 0)",preserveAspectRatio:"xMidYMid meet"},{children:p.exports.jsx("path",{d:"M5.3,0.3c0.4-0.4,1-0.4,1.4,0l5,5c0.4,0.4,0.4,1,0,1.4c-0.4,0.4-1,0.4-1.4,0L6,2.4L1.7,6.7c-0.4,0.4-1,0.4-1.4,0c-0.4-0.4-0.4-1,0-1.4L5.3,0.3z"})}))},exports.ChevronRightIcon=or,exports.ConfirmDialog=mr,exports.ContextMenu=rr,exports.CrossIcon=ir,exports.Dialog=ur,exports.DialogActions=gr,exports.DialogContent=dr,exports.DialogFooter=fr,exports.DialogHeader=pr,exports.DialogTitle=hr,exports.Divider=nr,exports.DomContainer=b,exports.ErrorDialog=vr,exports.Menu=er,exports.MenuGroup=cr,exports.MenuItem=ar,exports.Popper=O,exports.PopupMenu=sr,exports.Scanner=function(t){var r=t.scanConfirmation,n=void 0===r||r,o=t.scanTrackerType,i=void 0===o?"centerText":o,a=l(t,["scanConfirmation","scanTrackerType"]),s=e.useState(!1),u=s[0],d=s[1],f=e.useState(!1),h=f[0],g=f[1],m=e.useState([]),v=m[0],w=m[1],y=function(){d(!1),g(!1)},A=e.useMemo((function(){switch(i){case"outline":return dt;case"boundingBox":return ft;case"centerText":return pt;default:return}}),[i]),C=e.useCallback((function(){y(),a.onScan(v)}),[a,v]),E=e.useCallback((function(e){n&&(d(!0),g(!0),w(e))}),[a]);return p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsx("div",c({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",gap:"15px",margin:"20px"}},{children:p.exports.jsx(Ct,c({formats:["qr_code","micro_qr_code","rm_qr_code","maxi_code","pdf417","aztec","data_matrix","matrix_codes","dx_film_edge","databar","databar_expanded","codabar","code_39","code_93","code_128","ean_8","ean_13","itf","linear_codes","upc_a","upc_e"],components:{audio:!0,onOff:!0,torch:!0,tracker:A,finder:!1},scanDelay:2e3,allowMultiple:!1},a,{onScan:E,paused:h}))})),p.exports.jsx(Tt,c({open:u,onClose:y,onConfirm:C},null==a?void 0:a.scanConfirmDialog))]})},exports.Selected=function(e){var t=e.title,r=e.data,n=e.onClick;return p.exports.jsx(p.exports.Fragment,{children:p.exports.jsxs("div",c({className:B("ui-selected-params")},{children:[p.exports.jsx("div",c({className:B("ui-selected-title")},{children:t})),p.exports.jsx("div",c({className:B("ui-selected-content")},{children:p.exports.jsx(p.exports.Fragment,{children:Array.isArray(r)&&r.map((function(e,t){return p.exports.jsx(p.exports.Fragment,{children:p.exports.jsx("div",c({className:B("ui-selected-button")},{children:p.exports.jsx("button",c({type:"button",onClick:function(){n(e)},className:1===e.selected?"ui-selected-btn":0===e.selected?"ui-not-selected":"ui-new-selected"},{children:e.name}))}),t)})}))})}))]}))})},exports.Spinner=P,exports.TagInput=function(e){var t=e.tags;e.className;var r=e.suggestions,n=e.disableFilter,i=e.onTextChange,a=e.onChange,s=o.default.useRef(null),l=o.default.useRef(null),u=o.default.useRef(null),d=o.default.useState(""),h=d[0],g=d[1],m=o.default.useState(!1),v=m[0],w=m[1];Zt((function(){w(!1)}),[s,l]);var y=o.default.useCallback((function(e){if(a&&Array.isArray(t)){var r=t.findIndex((function(t){return t.id===e.id}));if(!(r<0)){var n=f([],t,!0);n.splice(r,1),a(n)}}}),[t,a]),A=o.default.useCallback((function(e){if(e){var r={id:e.id,label:e.label,value:e.value},n=Array.isArray(t)?f(f([],t,!0),[r],!1):[r];w(!1),a&&a(n),g(""),i&&i("")}}),[t,a,i]),C=o.default.useCallback((function(e){g(e),i&&i(e)}),[i]),E=Array.isArray(t)?t.map((function(e,t){return p.exports.jsx(Ht,{tag:e,onDelete:function(){return y(e)}},t)})):[];return p.exports.jsxs("div",c({ref:u,className:"ui-taginput"},{children:[E,p.exports.jsx(zt,{ref:s,value:h,onChange:C,onClick:function(){w(!0)}}),p.exports.jsx($t,{ref:l,open:v,anchorEl:s,filter:h,tags:t,suggestions:r,disableFilter:n,onSuggestionClick:A})]}))},exports.ToggleButton=function(e){var t=e.selected,r=e.value,n=e.size,i=e.children,a=e.className,s=e.onChange,l=o.default.useCallback((function(){s&&s(r)}),[s,r]);return p.exports.jsx("button",c({type:"button",className:B("ui-toggleBtn",void 0!==n?"ui-toggleBtn-size-".concat(n):"ui-toggleBtn-size-md",!0===t?"ui-toggleBtn-selected":null,a),onClick:l},{children:i}))},exports.Tooltip=function(e){var t=e.children,r=e.title;e.anchorEl;var n=e.enterDelay,i=void 0===n?0:n,a=e.leaveDelay,s=void 0===a?0:a,l=e.className,u=e.disabled,d=o.default.useState(void 0),f=d[0],h=d[1],g=o.default.useState(!1),m=g[0],v=g[1],w=o.default.useState(!0),y=w[0],A=w[1],C=o.default.useState(!1),E=C[0],b=C[1],x=o.default.useRef(),T=o.default.useRef();o.default.useEffect((function(){!0===u&&v(!1)}),[u]);var M,D=function(){v(!0)},I=function(){v(!1)},F=function(e){E||(clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),T.current=setTimeout((function(){I()}),s))},k=function(e){E||(clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),!0!==u&&(x.current=setTimeout((function(){D()}),i)))},q=function(e){b(!0),clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),!0!==u&&(x.current=setTimeout((function(){D()}),2e3))},N=function(e){clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),T.current=setTimeout((function(){I()}),3e3)};if(t){var R=c(c({},t.props),{onFocus:function(e){f||h(e.currentTarget),x.current=setTimeout((function(){D()}),i)},onMouseEnter:function(e){E||(clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),!0!==u&&(x.current=setTimeout((function(){D()}),i)))},onMouseLeave:F,onMouseOver:k,onTouchStart:q,onTouchEnd:N});M=o.default.cloneElement(t,R)}var G=m||!y;return p.exports.jsxs(p.exports.Fragment,{children:[M,p.exports.jsx(O,c({role:"tooltip",anchorEl:f,open:G,className:B("ui-tooltip",l),onMouseOver:E?void 0:k,onMouseLeave:E?void 0:F,onTouchStart:q,onTouchEnd:N},{children:p.exports.jsx(Jt,c({trigger:m,onEnter:function(){A(!1)},onExited:function(){A(!0)}},{children:p.exports.jsx("div",c({className:"ui-tooltip-content"},{children:r}))}))}))]})},exports.WarningDialog=wr;
18
+ /*! no static exports found */function(t,r){t.exports=e}}).default};var Mt=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}({exports:{}}.exports=Et(o.default)),Dt={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},It=o.default.createContext&&o.default.createContext(Dt),Ft=["attr","size","title"];function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kt.apply(this,arguments)}function qt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qt(Object(r),!0).forEach((function(t){Rt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Rt(e,t,r){var n;return(t="symbol"==typeof(n=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?n:n+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gt(e){return e&&e.map(((e,t)=>o.default.createElement(e.tag,Nt({key:t},e.attr),Gt(e.child))))}function jt(e){return t=>o.default.createElement(Yt,kt({attr:Nt({},e.attr)},t),Gt(e.child))}function Yt(e){var t=t=>{var r,{attr:n,size:i,title:a}=e,s=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Ft),c=i||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),o.default.createElement("svg",kt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,s,{className:r,style:Nt(Nt({color:e.color||t.color},t.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),a&&o.default.createElement("title",null,a),e.children)};return void 0!==It?o.default.createElement(It.Consumer,null,(e=>t(e))):t(Dt)}function Vt(e){return jt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 144v288c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48h88l12.3-32.9c7-18.7 24.9-31.1 44.9-31.1h125.5c20 0 37.9 12.4 44.9 31.1L376 96h88c26.5 0 48 21.5 48 48zM376 288c0-66.2-53.8-120-120-120s-120 53.8-120 120 53.8 120 120 120 120-53.8 120-120zm-32 0c0 48.5-39.5 88-88 88s-88-39.5-88-88 39.5-88 88-88 88 39.5 88 88z"},child:[]}]})(e)}function St(e){return jt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"},child:[]}]})(e)}function Ot(e){return jt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"},child:[]}]})(e)}function Pt(e){return jt({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"},child:[]}]})(e)}function Qt(e){return jt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M16 7h-1l-1-1h-4L9 7H8c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2zm-4 7c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"},child:[]},{tag:"path",attr:{d:"m8.57.51 4.48 4.48V2.04c4.72.47 8.48 4.23 8.95 8.95h2C23.34 3.02 15.49-1.59 8.57.51zM10.95 21.96c-4.72-.47-8.48-4.23-8.95-8.95H0c.66 7.97 8.51 12.58 15.43 10.48l-4.48-4.48v2.95z"},child:[]}]})(e)}function Lt(e){return jt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M8 13A5 5 0 1 0 8 3a5 5 0 0 0 0 10"},child:[]}]})(e)}var Ut,Wt=function(){function e(){this.dbName="cortex-react-media",this.storeName="capturedFiles",this.db=null}return e.prototype.openDatabase=function(){return u(this,void 0,void 0,(function(){var e=this;return d(this,(function(t){return[2,new Promise((function(t,r){var n=indexedDB.open(e.dbName,1);n.onupgradeneeded=function(t){n.result.createObjectStore(e.storeName,{keyPath:"id",autoIncrement:!0})},n.onsuccess=function(){e.db=n.result,t(e.db)},n.onerror=function(){return r(n.error)}}))]}))}))},e.prototype.storeFile=function(e){return u(this,void 0,void 0,(function(){var t=this;return d(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:[4,this.openDatabase()];case 1:r.sent(),r.label=2;case 2:return[2,new Promise((function(r,n){var o=t.db.transaction(t.storeName,"readwrite").objectStore(t.storeName).add({file:e,timestamp:Date.now(),name:e.name});o.onsuccess=function(){return r(o.result)},o.onerror=function(){return n(o.error)}}))]}}))}))},e.prototype.retrieveFile=function(e){return u(this,void 0,void 0,(function(){var t=this;return d(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:[4,this.openDatabase()];case 1:r.sent(),r.label=2;case 2:return[2,new Promise((function(r,n){var o=t.db.transaction([t.storeName],"readonly").objectStore(t.storeName).get(e);o.onsuccess=function(){var e=o.result;r(e?e.file:null)},o.onerror=function(){return n(o.error)}}))]}}))}))},e}();!function(e){e[e.Enter=0]="Enter",e[e.Entering=1]="Entering",e[e.Entered=2]="Entered",e[e.Exit=3]="Exit",e[e.Exiting=4]="Exiting",e[e.Exited=5]="Exited"}(Ut||(Ut={}));var Kt=o.default.forwardRef((function(e,t){var r=e.trigger,n=e.mode,i=void 0===n?"appear":n,a=e.children,s=e.enterTimeout,l=e.exitTimeout,u=e.className,d=e.onEnter,f=e.onEntering,h=e.onEntered,g=e.onExit,m=e.onExiting,v=e.onExited,w=o.default.useRef(null),y=o.default.useRef(),A=o.default.useState((function(){return"appear"===i?Ut.Exited:Ut.Entered}));A[0],A[1],o.default.useEffect((function(){return function(){y.current&&window.clearTimeout(y.current)}}),[y]),o.default.useEffect((function(){r?(y.current&&window.clearTimeout(y.current),w.current.classList.remove("".concat(u,"-exit")),w.current.classList.remove("".concat(u,"-exiting")),w.current.classList.remove("".concat(u,"-exited")),d&&d(),w.current.classList.add("".concat(u,"-enter")),y.current=window.setTimeout((function(){f&&f(),w.current&&w.current.classList.add("".concat(u,"-entering")),y.current=window.setTimeout((function(){h&&h(),w.current&&w.current.classList.add("".concat(u,"-entered"))}),s||1e3)}),10)):(y.current&&window.clearTimeout(y.current),w.current.classList.remove("".concat(u,"-enter")),w.current.classList.remove("".concat(u,"-entering")),w.current.classList.remove("".concat(u,"-entered")),g&&g(),w.current.classList.add("".concat(u,"-exit")),y.current=window.setTimeout((function(){m&&m(),w.current&&w.current.classList.add("".concat(u,"-exiting")),y.current=window.setTimeout((function(){v&&v(),w.current&&w.current.classList.add("".concat(u,"-exited"))}),l||1e3)})))}),[r]);var C=o.default.useMemo((function(){if(a){var e=c(c({},a.props),{className:B(u,a.props.className),ref:w});return o.default.cloneElement(a,e)}}),[a,w]);return p.exports.jsx(p.exports.Fragment,{children:C})}));Kt.propTypes={},Kt.defaultProps={};var Jt=o.default.forwardRef((function(e,t){var r=e.trigger,n=e.children,o=e.onEnter,i=e.onEntering,a=e.onEntered,s=e.onExit,l=e.onExiting,u=e.onExited;return p.exports.jsx(Kt,c({ref:t,trigger:r,mode:"appear",className:"ui-fade",enterTimeout:160,exitTimeout:160,onEnter:o,onExit:s,onEntering:i,onEntered:a,onExiting:l,onExited:u},{children:n}))}));function Zt(e,t){var r=i.useCallback((function(r){var n=r.target,o=t.reduce((function(e,t){if(!t)return e;var r=function(e){var t;if(!e)return document.body;if("[object String]"===Object.prototype.toString.call(e)){var r=document.getElementById(e);return null!=r?r:document.body}var n=e;return n&&void 0!==n.current?null!==(t=n.current)&&void 0!==t?t:void 0:e}(t);return!1!==e&&r&&null!==r?!r.contains(n):e}),!0);e&&o&&e()}),[e]);i.useEffect((function(){return document.addEventListener("mousedown",r),function(){document.removeEventListener("mousedown",r)}}),[t,r])}Jt.propTypes={},Jt.defaultProps={};var Ht=function(e){var t=e.tag;e.className;var r=e.onDelete;return p.exports.jsxs("span",c({className:"ui-taginputItem"},{children:[p.exports.jsx("span",c({className:"ui-taginputItemLabel"},{children:t.label})),p.exports.jsx("button",c({type:"button",className:"ui-taginputItemRemove",onClick:r},{children:"x"}))]}))},zt=o.default.forwardRef((function(e,t){var r=e.className,n=e.value,i=e.onClick,a=e.onChange,s=o.default.useRef(null),c=o.default.useCallback((function(e){a&&a(e.target.value)}),[a]);return o.default.useEffect((function(){if(t&&s)return x(t,s.current),function(){x(t,null)}}),[t,s]),p.exports.jsx(p.exports.Fragment,{children:p.exports.jsx("input",{ref:s,value:n,className:B("ui-taginputFilter",r),autoComplete:"off",spellCheck:"false","data-form-type":"other",onChange:c,onClick:i})})})),Xt=function(e){var t=e.suggestion,r=e.onClick,n=o.default.useCallback((function(e){r&&r(t,e)}),[r]);return p.exports.jsx("div",c({role:"button",className:"ui-taginputSelectItem",tabIndex:0,onClick:n},{children:t.label}))},_t=function(e){var t=e.group,r=e.onClick,n=Array.isArray(t.suggestions)?t.suggestions.map((function(e,t){return!0===e.group?p.exports.jsx(_t,{group:e,onClick:r},t):p.exports.jsx(Xt,{suggestion:e,onClick:r},t)})):null;return p.exports.jsxs("div",c({className:"ui-taginputSelectGroup"},{children:[p.exports.jsx("span",c({className:"ui-taginputSelectGroupLabel"},{children:t.label})),p.exports.jsx("div",c({className:"ui-taginputSelectGroupItems"},{children:n}))]}))},$t=o.default.forwardRef((function(e,t){var r=e.open,n=e.tags,i=e.disableFilter,a=e.suggestions,s=e.anchorEl,l=e.filter,u=e.onSuggestionClick,d=o.default.useMemo((function(){if(!Array.isArray(a))return[];if(i)return a;var e=Array.isArray(n)&&n.length>0,t=l&&l.length>0,r=[];return a.forEach((function(o){if(!0!==o.group)e&&n.some((function(e){return e.id===o.id}))||t&&o.label.toUpperCase().indexOf(l.toUpperCase())<0||r.push(c({},o));else if(Array.isArray(o.suggestions)){var i=c(c({},o),{suggestions:[]});o.suggestions.forEach((function(r){e&&n.some((function(e){return e.id===r.id}))||t&&r.label.toUpperCase().indexOf(l.toUpperCase())<0||i.suggestions.push(c({},r))})),i.suggestions.length>0&&r.push(i)}})),r}),[a,l,n]),f=o.default.useCallback((function(e){u&&u(e)}),[u]),h=r&&d.length>0,g=d.map((function(e,t){return!0===e.group?p.exports.jsx(_t,{group:e,onClick:f},t):p.exports.jsx(Xt,{suggestion:e,onClick:f},t)}));return p.exports.jsx(O,c({ref:t,open:h,anchorEl:s,placement:F},{children:p.exports.jsx("div",c({className:"ui-taginputSelect"},{children:g}))}))})),er=function(e){var t=e.containerRef;e.className;var r=e.children,n=e.onClick;e.onClose;var i=o.default.useRef(null);return o.default.useEffect((function(){if(i&&t&&i.current&&t.current){var e=t.current.getBoundingClientRect(),r=i.current.getBoundingClientRect(),n=e.width,o="0px",a="unset";e.right+r.width>=window.innerWidth&&(n=-r.width),r.bottom>=window.innerHeight&&(a="".concat(-(window.innerHeight-e.bottom-15).toFixed(),"px"),o="unset"),i.current.setAttribute("style","opacity: 1; left: ".concat(n.toFixed(),"px; bottom: ").concat(a,"; top: ").concat(o,";"))}}),[i]),p.exports.jsx("div",c({ref:i,className:"ui-menu"},{children:p.exports.jsx("ul",c({className:"ui-menuList",onClick:n,onContextMenu:n},{children:r}))}))};function tr(e){var t=i.useState(),r=t[0],n=t[1];return i.useEffect((function(){n(function(e){var t;if(e){if("[object String]"===Object.prototype.toString.call(e)){var r=document.getElementById(e);return null!=r?r:void 0}var n=e;return n&&void 0!==n.current?null!==(t=n.current)&&void 0!==t?t:void 0:e}}(e))}),[e]),r}er.propTypes={className:s.default.string},er.defaultProps={className:void 0};var rr=function(e){var t=e.className,r=e.children,n=e.placement,i=e.open,a=e.container,s=e.onOpen,l=e.onClose,u=o.default.useRef(null),d=tr(a),f=o.default.useState(null),h=f[0],g=f[1];Zt((function(){i&&l&&l()}),[u]);var m=o.default.useCallback((function(e){e.preventDefault(),e.ctrlKey||(g({mouseX:e.pageX-2,mouseY:e.pageY-4}),s&&s())}),[s]),v=function(e){e.preventDefault()};return o.default.useEffect((function(){var e=null!=d?d:document;return e.addEventListener("contextmenu",m),e!==document&&document.addEventListener("contextmenu",v),function(){e.removeEventListener("contextmenu",m),document.removeEventListener("contextmenu",v)}}),[d,m]),p.exports.jsx(O,c({ref:u,anchorPosition:null!==h?{top:h.mouseY,left:h.mouseX}:void 0,placement:n,open:i,overflow:!1},{children:p.exports.jsx(er,c({className:t,onClose:l,onClick:function(e){e&&2===e.button&&(e.preventDefault(),e.stopPropagation())},containerRef:u},{children:r}))}))};rr.propTypes={className:s.default.string},rr.defaultProps={className:void 0};var nr=function(e){return e.className,p.exports.jsx("hr",{})};nr.propTypes={className:s.default.string},nr.defaultProps={className:void 0};var or=function(e){var t=e.className;return p.exports.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 7",fill:"none",className:B("ui-icon",t),transform:"rotate(90 0 0)",preserveAspectRatio:"xMidYMid meet"},{children:p.exports.jsx("path",{d:"M5.3,0.3c0.4-0.4,1-0.4,1.4,0l5,5c0.4,0.4,0.4,1,0,1.4c-0.4,0.4-1,0.4-1.4,0L6,2.4L1.7,6.7c-0.4,0.4-1,0.4-1.4,0c-0.4-0.4-0.4-1,0-1.4L5.3,0.3z"})}))},ir=function(e){var t=e.className;return p.exports.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:B("ui-icon",t)},{children:p.exports.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}))},ar=function(e){var t=e.label,r=e.icon,n=e.className,i=e.style;e.active;var a=e.disable,s=e.children,l=e.itemTemplate,u=e.onClick,d=o.default.useState(!1),f=d[0],h=d[1],g=o.default.useRef(null),m=o.default.useCallback((function(e){u&&!0!==a&&u(e)}),[u]),v=null!=s;return p.exports.jsxs("li",c({className:B("ui-menuItem",!0===a?"ui-menuItem-disable":null,n),style:i,onMouseEnter:function(){h(!0)},onMouseLeave:function(){h(!1)},ref:g},{children:[p.exports.jsxs("button",c({type:"button",className:"ui-menuItem-btn",onClick:m},{children:[r&&p.exports.jsx("div",c({className:"ui-menuItem-icon"},{children:r})),p.exports.jsx("span",{children:null!=l?l:t}),v&&p.exports.jsx("div",c({className:"ui-menuItem-menuIconContainer"},{children:p.exports.jsx(or,{className:"ui-menuItem-menuIcon"})}))]})),v&&f&&p.exports.jsx(er,c({containerRef:g},{children:s}))]}))};ar.propTypes={className:s.default.string},ar.defaultProps={className:void 0};var sr=function(e){var t=e.className,r=e.children,n=e.placement,i=e.open,a=e.anchorPosition,s=e.anchorEl,l=e.onClose,u=o.default.useRef(null);return Zt((function(){i&&l&&l()}),[u]),i&&(a||s)?p.exports.jsx(O,c({ref:u,anchorPosition:a,anchorEl:s,placement:n,open:i,overflow:!1,className:"ui-menu-popper"},{children:p.exports.jsx(er,c({className:t,onClose:l,onClick:function(e){e&&2===e.button&&(e.preventDefault(),e.stopPropagation())},containerRef:u},{children:r}))})):null};sr.propTypes={className:s.default.string},sr.defaultProps={className:void 0};var cr=function(e){var t=e.title,r=e.className,n=e.children;return p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsx("li",c({className:B("ui-group-title",r)},{children:t})),n]})};cr.propTypes={className:s.default.string},cr.defaultProps={className:void 0};var lr=function(e){var t=e.url,r=e.queryParams,n=e.token,o=e.label,i=e.onStart,a=e.onCompleted,s=e.onError;return p.exports.jsx(p.exports.Fragment,{children:p.exports.jsx(ar,{label:o,onClick:function(e){return u(void 0,void 0,void 0,(function(){var o,c,l,u,f,p,h,g;return d(this,(function(d){switch(d.label){case 0:i&&i(e),d.label=1;case 1:if(d.trys.push([1,4,,5]),!n)throw new Error("INVALID_TOKEN");if(!t)throw new Error("INVALID_URL");return(o={}).ContentType="application/json",o.Authorization="Bearer ".concat(n),c={method:"get",headers:o},l=new URL(t),r&&Object.keys(r).forEach((function(e){return l.searchParams.append(e,r[e])})),[4,fetch(l,c)];case 2:if(!(u=d.sent())||200!==u.status)throw new Error("An error occured while generating file");return[4,u.blob()];case 3:return(f=d.sent())&&(p=window.URL.createObjectURL(f),(h=document.createElement("a")).href=p,h.download=function(e){var t=e.get("Content-Disposition");if(!t)return null;var r=t.split(";"),n="filename=",o=r.find((function(e){return e.indexOf(n)>-1}));if(o){var i=o.search(n);if(i<0)return null;var a=o.substring(i+9).trim();if(0===a.length)return null;var s=a.substring(0,1);return'"'!==s&&"'"!==s?a:a.length<2||a[a.length-1]!==s?null:a.substring(1,a.length-1)}return null}(u.headers)||"file",h.click(),URL.revokeObjectURL(p),h.remove()),[3,5];case 4:throw g=d.sent(),s&&s(g),g;case 5:return a&&a(),[2]}}))}))}})})};lr.propTypes={label:s.default.string};var ur=function(e){e.open;var t=e.width,r=e.fullWidth,n=e.fullHeight,i=e.className,a=e.children,s=e.onClose,l=o.default.useRef(),u=o.default.useRef(null),d=o.default.useRef(null);o.default.useEffect((function(){return l.current=document.body.style.overflow,document.body.style.overflow="hidden",function(){var e;document.body.style.overflow=null!==(e=l.current)&&void 0!==e?e:"initial"}}),[]);var f=o.default.useCallback((function(){s&&s()}),[s]);return p.exports.jsx(b,c({ref:u},{children:p.exports.jsxs("div",c({ref:function(e){d.current=e},style:{position:"fixed",margin:"0"},role:"dialog",className:B("ui-dialog",i)},{children:[p.exports.jsx("div",{role:"presentation",className:"ui-dialog-overlay",onClick:f}),p.exports.jsx("div",c({className:B("ui-dialog-container",t?"ui-dialog-size-".concat(t):null,!0===r?"ui-dialog-size-fullwidth":null,!0===n?"ui-dialog-size-fullheight":null)},{children:a}))]}))}))};ur.propTypes={className:s.default.string},ur.defaultProps={className:void 0};var dr=function(e){var t=e.className,r=e.children;return p.exports.jsx("div",c({className:B("ui-dialog-content",t)},{children:r}))};dr.propTypes={className:s.default.string},dr.defaultProps={className:void 0};var fr=function(e){var t=e.className,r=e.children;return p.exports.jsx("footer",c({className:B("ui-dialog-footer",t)},{children:r}))};fr.propTypes={className:s.default.string},fr.defaultProps={className:void 0};var pr=function(e){var t=e.className,r=e.children;return p.exports.jsx("header",c({className:B("ui-dialog-header",t)},{children:r}))};pr.propTypes={className:s.default.string},pr.defaultProps={className:void 0};var hr=function(e){var t=e.className,r=e.children,n=e.closeDisable,i=e.onClose,a=o.default.useCallback((function(){i&&!0!==n&&i()}),[i,n]),s=void 0!==i;return p.exports.jsxs("h3",c({className:B("ui-dialog-title",t)},{children:[r,s&&p.exports.jsx("button",c({type:"button",className:B("ui-dialog-close",n?"ui-dialog-close-disable":null),tabIndex:0,onClick:a},{children:p.exports.jsx(ir,{})}))]}))};hr.propTypes={className:s.default.string,children:s.default.node,closeDisable:s.default.bool},hr.defaultProps={className:void 0,children:void 0};var gr=function(e){var t=e.className,r=e.children;return p.exports.jsx("div",c({className:B("ui-dialog-actions",t)},{children:r}))};gr.propTypes={className:s.default.string,children:s.default.node},gr.defaultProps={className:void 0,children:void 0};var mr=function(e){var t=e.title,r=e.ok,n=e.cancel,i=e.children,a=e.className,s=e.onClose,l=o.default.useCallback((function(){s&&s(!1)}),[s]),u=o.default.useCallback((function(){s&&s(!0)}),[s]),d=null!=r?r:"oui",f=null!=n?n:"Annuler";return p.exports.jsxs(ur,c({open:!0,className:B("ui-dialog-box","ui-dialog-confirm",a)},{children:[p.exports.jsx(pr,{children:p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("svg",c({className:"ui-dialog-icon",xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 438.5 438.5"},{children:[p.exports.jsx("path",{d:"M409.1,109.2c-19.6-33.6-46.2-60.2-79.8-79.8C295.7,9.8,259.1,0,219.3,0c-39.8,0-76.5,9.8-110.1,29.4\r\n C75.6,49,49,75.6,29.4,109.2C9.8,142.8,0,179.5,0,219.3c0,39.8,9.8,76.5,29.4,110.1c19.6,33.6,46.2,60.2,79.8,79.8\r\n c33.6,19.6,70.3,29.4,110.1,29.4s76.5-9.8,110.1-29.4c33.6-19.6,60.2-46.2,79.8-79.8c19.6-33.6,29.4-70.3,29.4-110.1\r\n C438.5,179.5,428.7,142.8,409.1,109.2z M387.4,290.2c-9.7,22.6-22.7,42-39,58.2c-16.3,16.3-35.7,29.3-58.2,39\r\n c-22.6,9.7-46.2,14.6-70.9,14.6s-48.4-4.9-70.9-14.6c-22.6-9.7-42-22.7-58.2-39c-16.3-16.3-29.3-35.7-39-58.2\r\n c-9.7-22.6-14.6-46.2-14.6-70.9c0-24.7,4.9-48.4,14.6-70.9c9.7-22.6,22.7-42,39-58.2c16.3-16.3,35.7-29.3,58.2-39\r\n c22.6-9.7,46.2-14.6,70.9-14.6c24.7,0,48.4,4.9,70.9,14.6c22.6,9.7,42,22.7,58.2,39c16.3,16.3,29.3,35.7,39,58.2\r\n c9.7,22.6,14.6,46.2,14.6,70.9C402,244,397.1,267.7,387.4,290.2z"}),p.exports.jsx("path",{d:"M217,294c-14.6,0-26.5,12.2-26.5,26.8c0,14.3,11.5,26.8,26.5,26.8s26.8-12.5,26.8-26.8C243.8,306.2,231.6,294,217,294z"}),p.exports.jsx("path",{d:"M221.5,90.8c-47.1,0-68.7,27.9-68.7,46.7c0,13.6,11.5,19.9,20.9,19.9c18.8,0,11.2-26.8,46.7-26.8c17.4,0,31.4,7.7,31.4,23.7\r\n c0,18.8-19.5,29.6-31,39.4c-10.1,8.7-23.4,23-23.4,53c0,18.1,4.9,23.4,19.2,23.4c17.1,0,20.6-7.7,20.6-14.3\r\n c0-18.1,0.4-28.6,19.5-43.6c9.4-7.3,39-31,39-63.8S266.1,90.8,221.5,90.8z"})]})),p.exports.jsx("h1",c({className:"ui-dialog-title"},{children:t}))]})}),p.exports.jsx(dr,{children:i}),p.exports.jsxs(fr,{children:[p.exports.jsx(Q,c({className:"dialog-action-ok dialog-action",onClick:u},{children:d})),p.exports.jsx(Q,c({className:"dialog-action-close dialog-action",onClick:l},{children:f}))]})]}))};mr.propTypes={className:s.default.string},mr.defaultProps={className:void 0};var vr=function(e){var t=e.title,r=e.ok,n=e.children,i=e.className,a=e.onClose,s=o.default.useCallback((function(){a&&a(!0)}),[a]),l=null!=r?r:"fermer";return p.exports.jsxs(ur,c({open:!0,className:B("ui-dialog-box","ui-dialog-error",i)},{children:[p.exports.jsx(pr,{children:p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("svg",c({className:"ui-dialog-icon",xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 438.533 438.533"},{children:[p.exports.jsx("path",{d:"M409.133,109.203c-19.608-33.592-46.205-60.189-79.798-79.796C295.736,9.801,259.058,0,219.273,0 c-39.781,0-76.47,9.801-110.063,29.407c-33.595,19.604-60.192,46.201-79.8,79.796C9.801,142.8,0,179.489,0,219.267 c0,39.78,9.804,76.463,29.407,110.062c19.607,33.592,46.204,60.189,79.799,79.798c33.597,19.605,70.283,29.407,110.063,29.407 s76.47-9.802,110.065-29.407c33.593-19.602,60.189-46.206,79.795-79.798c19.603-33.596,29.403-70.284,29.403-110.062 C438.533,179.485,428.732,142.795,409.133,109.203z M387.434,290.213c-9.709,22.556-22.696,41.97-38.969,58.245 c-16.271,16.269-35.689,29.26-58.245,38.965c-22.555,9.712-46.202,14.564-70.946,14.564c-24.744,0-48.391-4.853-70.948-14.564 c-22.554-9.705-41.971-22.696-58.245-38.965c-16.269-16.275-29.259-35.687-38.97-58.245 c-9.707-22.552-14.562-46.206-14.562-70.946c0-24.744,4.854-48.391,14.562-70.948c9.707-22.554,22.697-41.968,38.97-58.245 c16.274-16.269,35.691-29.26,58.245-38.97c22.554-9.704,46.205-14.558,70.948-14.558c24.74,0,48.395,4.851,70.946,14.558 c22.556,9.707,41.97,22.698,58.245,38.97c16.272,16.274,29.26,35.688,38.969,58.245c9.709,22.554,14.564,46.201,14.564,70.948 C402.002,244.011,397.143,267.664,387.434,290.213z"}),p.exports.jsx("path",{d:"M284.368,258.668c-19.219-14.086-40.926-21.129-65.095-21.129c-24.172,0-45.871,7.039-65.096,21.129 c-19.224,14.085-32.358,32.641-39.397,55.671c-1.521,4.757-1.143,9.381,1.141,13.847c2.286,4.469,5.898,7.467,10.85,8.993 c4.758,1.526,9.373,1.143,13.846-1.144c4.471-2.285,7.467-5.899,8.991-10.848c4.759-15.235,13.562-27.556,26.409-36.979 c12.847-9.418,27.263-14.127,43.252-14.127c15.987,0,30.412,4.712,43.251,14.127c12.854,9.424,21.655,21.744,26.412,36.979 c1.52,4.948,4.564,8.562,9.134,10.848c4.568,2.286,9.236,2.67,13.989,1.144c4.761-1.526,8.278-4.524,10.564-8.993 c2.286-4.466,2.669-9.09,1.14-13.847C316.729,291.312,303.591,272.75,284.368,258.668z"}),p.exports.jsx("path",{d:"M146.181,182.725c10.085,0,18.699-3.576,25.837-10.709c7.139-7.135,10.708-15.749,10.708-25.837 c0-10.089-3.569-18.699-10.708-25.837s-15.752-10.709-25.837-10.709c-10.088,0-18.702,3.571-25.84,10.709 c-7.135,7.139-10.707,15.749-10.707,25.837c0,10.088,3.568,18.702,10.707,25.837C127.482,179.152,136.093,182.725,146.181,182.725 z"}),p.exports.jsx("path",{d:"M292.359,109.631c-10.089,0-18.706,3.571-25.845,10.709c-7.132,7.139-10.708,15.749-10.708,25.837 c0,10.088,3.576,18.702,10.708,25.837c7.139,7.137,15.756,10.709,25.845,10.709c10.081,0,18.698-3.576,25.837-10.709 c7.139-7.135,10.708-15.749,10.708-25.837c0-10.089-3.569-18.699-10.708-25.837S302.44,109.631,292.359,109.631z"})]})),p.exports.jsx("h1",c({className:"ui-dialog-title"},{children:t}))]})}),p.exports.jsx(dr,{children:n}),p.exports.jsx(fr,{children:p.exports.jsx(Q,c({className:"dialog-action-ok dialog-action",onClick:s},{children:l}))})]}))};vr.propTypes={className:s.default.string},vr.defaultProps={className:void 0};var wr=function(e){var t=e.title,r=e.ok,n=e.children,i=e.className,a=e.onClose,s=o.default.useCallback((function(){a&&a(!0)}),[a]),l=null!=r?r:"fermer";return p.exports.jsxs(ur,c({open:!0,className:B("ui-dialog-box","ui-dialog-warning",i)},{children:[p.exports.jsx(pr,{children:p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("svg",c({className:"ui-dialog-icon",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",x:"0px",y:"0px",viewBox:"0 0 512 512"},{children:[p.exports.jsx("polygon",{fill:"#FFA418",points:"0,477.703 256,477.703 289.391,256 256,34.297"}),p.exports.jsx("polygon",{fill:"#FF8A1E",points:"256,34.297 256,477.703 512,477.703"}),p.exports.jsx("circle",{fill:"#324860",cx:"256",cy:"405.359",r:"16.696"}),p.exports.jsx("rect",{x:"239.304",y:"177.185",fill:"#324860",width:"33.391",height:"178.087"})]})),p.exports.jsx("h1",c({className:"ui-dialog-title"},{children:t}))]})}),p.exports.jsx(dr,{children:n}),p.exports.jsx(fr,{children:p.exports.jsx(Q,c({className:"dialog-action-ok dialog-action",onClick:s},{children:l}))})]}))};wr.propTypes={className:s.default.string},wr.defaultProps={className:void 0},exports.AuthDownloadLink=lr,exports.BarLoader=function(e){var t=e.title,r=e.color,n=e.className,o=e.isComplete;return p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsx("div",c({className:B("loader",null!=r?"loader-color-".concat(r):"loader-color-blue",!0===o?"completed":"",n)},{children:p.exports.jsx("div",{className:B("loaderBar",null!=r?"loaderBar-color-".concat(r):"loaderBar-color-blue")})})),p.exports.jsx("div",c({className:B("loaderBar-title")},{children:p.exports.jsx("span",{children:t})}))]})},exports.Button=Q,exports.Camera=function(t){var r=t.onCapture,n=t.isOffline,o=void 0!==n&&n,i=t.mode,a=void 0===i?"photo":i,s=t.validateText,f=void 0===s?"Valider":s,h=t.resetText,g=void 0===h?"Annuler":h,m=t.isShowOffline,v=void 0!==m&&m,w=t.isShowVideoButton,y=void 0!==w&&w,A=l(t,["onCapture","isOffline","mode","validateText","resetText","isShowOffline","isShowVideoButton"]),C=e.useRef(null),E=e.useRef(null),b=e.useRef(new Wt),x=e.useState(a),B=x[0],T=x[1],M=e.useState(!1),D=M[0],I=M[1],F=e.useState(!1),k=F[0],q=F[1],N=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)||navigator.maxTouchPoints>0||"ontouchstart"in document.documentElement,R=function(){var t=e.useRef(null),r=e.useState(0),n=r[0],o=r[1],i=function(e){var t=Math.floor(e/86400),r=Math.floor(e%86400/3600),n=Math.floor(e%3600/60),o=e%60;return"".concat(t>0?t.toString().padStart(2,"0").concat(":"):"").concat(r>0?r.toString().padStart(2,"0").concat(":"):"").concat(n.toString().padStart(2,"0"),":").concat(o.toString().padStart(2,"0"))},a=e.useMemo((function(){return i(n)}),[n]),s=e.useCallback((function(){o(0),t.current=setInterval((function(){o((function(e){return e+1}))}),1e3)}),[]),c=e.useCallback((function(){t.current&&(clearInterval(t.current),t.current=null)}),[]);return{formatTime:i,startTimer:s,stopTimer:c,formatedTime:a}}(),G=R.formatedTime,j=R.startTimer,Y=R.stopTimer,V=e.useState({imageUrl:null,videoUrl:null,isRecording:!1,storedFileId:null,file:null}),S=V[0],O=V[1],P=e.useState({facingMode:"environment",width:{min:200},height:{min:300}});P[0];var L=P[1];e.useEffect((function(){return L({facingMode:N?"environment":"user",width:{min:200},height:{min:300}}),function(){K(),Y(),J()}}),[]),e.useEffect((function(){"video"===B&&I(!1)}),[S]);var U=e.useCallback((function(){return u(void 0,void 0,void 0,(function(){var e,t,r,n,o,i,a,s,l,u;return d(this,(function(d){if(e=null===(u=C.current)||void 0===u?void 0:u.getScreenshot()){for(t=atob(e.split(",")[1]),r=new Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);o=new Uint8Array(r),i=new Blob([o],{type:"image/jpeg"}),a="captured_image_".concat(Date.now().toString().slice(-7),".jpg"),s=new File([i],a,{type:"image/jpeg"}),l=URL.createObjectURL(s),O((function(e){return c(c({},e),{imageUrl:l,file:s})}))}return[2]}))}))}),[C,o,r]),W=e.useCallback((function(){if(C.current&&C.current.stream){var e="webm",t="video/".concat(e);MediaRecorder.isTypeSupported("video/mp4")&&(e="mp4",t="video/mp4");var r=new MediaRecorder(C.current.stream,{mimeType:t}),n=[];r.ondataavailable=function(e){e.data.size>0&&n.push(e.data)},r.onstop=function(){return u(void 0,void 0,void 0,(function(){var r,o,i,a;return d(this,(function(s){return r=new Blob(n,{type:t}),o="captured_video_".concat(Date.now(),".").concat(e),i=new File([r],o,{type:t}),a=URL.createObjectURL(i),O((function(e){return c(c({},e),{videoUrl:a,isRecording:!1,file:i})})),Y(),[2]}))}))},r.start(),E.current=r,j(),O((function(e){return c(c({},e),{isRecording:!0})}))}}),[C,o,j,Y,r]),K=function(){O({imageUrl:null,videoUrl:null,isRecording:!1,storedFileId:null,file:null})};return p.exports.jsx("div",c({className:"camera-container"},{children:S.imageUrl||S.videoUrl?p.exports.jsxs("div",c({className:"camera-preview camera-screen-animation"},{children:[S.imageUrl&&p.exports.jsx("img",{src:S.imageUrl,alt:"Capturé",style:{height:"90%",objectFit:"contain",overflowClipMargin:"content-box",overflow:"clip",aspectRatio:"16/9",display:"flex",justifySelf:"center"}}),S.videoUrl&&p.exports.jsxs("video",c({width:"100%",height:"90%",id:"video",style:{height:"90%",objectFit:"contain",overflowClipMargin:"content-box",overflow:"clip",aspectRatio:"16/9",display:"flex",justifySelf:"center"},onEnded:function(){return I(!1)}},{children:[p.exports.jsx("source",{src:S.videoUrl,type:"video/mp4"}),p.exports.jsx("source",{src:S.videoUrl,type:"video/webm"}),p.exports.jsx("track",{kind:"captions",src:"",lang:"en",label:"English",default:!0}),"Your browser does not support the video."]})),S.videoUrl&&p.exports.jsx(Q,c({variant:"contained",className:"video-play-btn",onClick:function(){var e=document.getElementById("video");try{e.paused?e.play():e.pause(),I(!D)}catch(e){}}},{children:D?p.exports.jsx(St,{}):p.exports.jsx(Ot,{})})),p.exports.jsxs("div",c({className:"camera-controls"},{children:[p.exports.jsx(Q,c({variant:"contained",onClick:function(){return u(void 0,void 0,void 0,(function(){var e;return d(this,(function(t){switch(t.label){case 0:return o?[4,b.current.storeFile(S.file)]:[3,2];case 1:e=t.sent(),r({fileRowId:e,fileStoreName:"capturedFiles"}),t.label=2;case 2:return o||"photo"!==B||r({file:S.file,imageSrc:S.imageUrl}),o||"video"!==B||r({file:S.file,videoSrc:S.videoUrl}),K(),[2]}}))}))},className:"camera-button camera-button--download"},{children:f})),p.exports.jsx(Q,c({variant:"outlined",onClick:K,className:"camera-button camera-button--reset"},{children:g}))]}))]})):p.exports.jsxs("div",c({className:"camera-preview"},{children:[S.isRecording&&p.exports.jsxs("div",c({className:"camera-recording-timer",style:{display:"video"===B?"flex":"none"}},{children:[p.exports.jsx("span",{className:"camera-recording-dot"}),p.exports.jsx("span",{children:G})]})),!S.isRecording&&y&&p.exports.jsx("button",c({type:"button",onClick:function(){return T("photo"===B?"video":"photo"),void K()},className:"camera-button camera-mode"},{children:p.exports.jsx("span",{children:"photo"===B?"Video":"Photo"})})),o&&v&&p.exports.jsx("div",c({className:"camera-offline-mode"},{children:"Offline mode"})),p.exports.jsx(Mt,c({ref:C,videoConstraints:{facingMode:"environment",width:{min:200},height:{min:300}}},A,{style:{height:"90% !important",objectFit:"contain",overflowClipMargin:"content-box",overflow:"clip",aspectRatio:"16/9",display:"flex",justifySelf:"center",margin:"0 auto"},screenshotFormat:"image/jpeg",allowFullScreen:!0})),p.exports.jsxs("div",c({className:"camera-controls"},{children:["photo"===B&&p.exports.jsx(Q,c({variant:"contained",className:"camera-button camera-button--capture",onClick:U},{children:p.exports.jsx(Vt,{size:28})})),"video"===B&&!S.isRecording&&p.exports.jsx(Q,c({variant:"contained",onClick:W,className:"camera-button camera-button--record"},{children:p.exports.jsx(Lt,{size:30})})),"video"===B&&S.isRecording&&p.exports.jsx(Q,c({variant:"contained",onClick:J,className:"camera-button camera-button--record"},{children:p.exports.jsx(Pt,{size:28})})),N&&!S.isRecording&&p.exports.jsx("button",c({type:"button",onClick:function(){q(!k),L({facingMode:k?"environment":"user",width:{min:200},height:{min:300}})},className:"camera-button camera-switch"},{children:p.exports.jsx(Qt,{size:18})}))]}))]}))}));function J(){E.current&&E.current.stop()}},exports.ChevronDownIcon=function(e){var t=e.className;return p.exports.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className:B("ui-icon",t),transform:"rotate(180 0 0)"},{children:p.exports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 8.29289C11.6834 7.90237 12.3166 7.90237 12.7071 8.29289L17.7071 13.2929C18.0976 13.6834 18.0976 14.3166 17.7071 14.7071C17.3166 15.0976 16.6834 15.0976 16.2929 14.7071L12 10.4142L7.70711 14.7071C7.31658 15.0976 6.68342 15.0976 6.29289 14.7071C5.90237 14.3166 5.90237 13.6834 6.29289 13.2929L11.2929 8.29289Z"})}))},exports.ChevronLeftIcon=function(e){var t=e.className;return p.exports.jsx("svg",c({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 7",fill:"none",className:B("ui-icon",t),transform:"rotate(270 0 0)",preserveAspectRatio:"xMidYMid meet"},{children:p.exports.jsx("path",{d:"M5.3,0.3c0.4-0.4,1-0.4,1.4,0l5,5c0.4,0.4,0.4,1,0,1.4c-0.4,0.4-1,0.4-1.4,0L6,2.4L1.7,6.7c-0.4,0.4-1,0.4-1.4,0c-0.4-0.4-0.4-1,0-1.4L5.3,0.3z"})}))},exports.ChevronRightIcon=or,exports.ConfirmDialog=mr,exports.ContextMenu=rr,exports.CrossIcon=ir,exports.Dialog=ur,exports.DialogActions=gr,exports.DialogContent=dr,exports.DialogFooter=fr,exports.DialogHeader=pr,exports.DialogTitle=hr,exports.Divider=nr,exports.DomContainer=b,exports.ErrorDialog=vr,exports.Menu=er,exports.MenuGroup=cr,exports.MenuItem=ar,exports.Popper=O,exports.PopupMenu=sr,exports.Scanner=function(t){var r=t.scanConfirmation,n=void 0===r||r,o=t.scanTrackerType,i=void 0===o?"centerText":o,a=l(t,["scanConfirmation","scanTrackerType"]),s=e.useState(!1),u=s[0],d=s[1],f=e.useState(!1),h=f[0],g=f[1],m=e.useState([]),v=m[0],w=m[1],y=function(){d(!1),g(!1)},A=e.useMemo((function(){switch(i){case"outline":return dt;case"boundingBox":return ft;case"centerText":return pt;default:return}}),[i]),C=e.useCallback((function(){y(),a.onScan(v)}),[a,v]),E=e.useCallback((function(e){n&&(d(!0),g(!0),w(e))}),[a]);return p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsx("div",c({style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",gap:"15px",margin:"20px"}},{children:p.exports.jsx(Ct,c({formats:["qr_code","micro_qr_code","rm_qr_code","maxi_code","pdf417","aztec","data_matrix","matrix_codes","dx_film_edge","databar","databar_expanded","codabar","code_39","code_93","code_128","ean_8","ean_13","itf","linear_codes","upc_a","upc_e"],components:{audio:!0,onOff:!0,torch:!0,tracker:A,finder:!1},scanDelay:2e3,allowMultiple:!1},a,{onScan:E,paused:h}))})),p.exports.jsx(Tt,c({open:u,onClose:y,onConfirm:C},null==a?void 0:a.scanConfirmDialog))]})},exports.Selected=function(e){var t=e.title,r=e.data,n=e.onClick;return p.exports.jsx(p.exports.Fragment,{children:p.exports.jsxs("div",c({className:B("ui-selected-params")},{children:[p.exports.jsx("div",c({className:B("ui-selected-title")},{children:t})),p.exports.jsx("div",c({className:B("ui-selected-content")},{children:p.exports.jsx(p.exports.Fragment,{children:Array.isArray(r)&&r.map((function(e,t){return p.exports.jsx(p.exports.Fragment,{children:p.exports.jsx("div",c({className:B("ui-selected-button")},{children:p.exports.jsx("button",c({type:"button",onClick:function(){n(e)},className:1===e.selected?"ui-selected-btn":0===e.selected?"ui-not-selected":"ui-new-selected"},{children:e.name}))}),t)})}))})}))]}))})},exports.Spinner=P,exports.TagInput=function(e){var t=e.tags;e.className;var r=e.suggestions,n=e.disableFilter,i=e.onTextChange,a=e.onChange,s=o.default.useRef(null),l=o.default.useRef(null),u=o.default.useRef(null),d=o.default.useState(""),h=d[0],g=d[1],m=o.default.useState(!1),v=m[0],w=m[1];Zt((function(){w(!1)}),[s,l]);var y=o.default.useCallback((function(e){if(a&&Array.isArray(t)){var r=t.findIndex((function(t){return t.id===e.id}));if(!(r<0)){var n=f([],t,!0);n.splice(r,1),a(n)}}}),[t,a]),A=o.default.useCallback((function(e){if(e){var r={id:e.id,label:e.label,value:e.value},n=Array.isArray(t)?f(f([],t,!0),[r],!1):[r];w(!1),a&&a(n),g(""),i&&i("")}}),[t,a,i]),C=o.default.useCallback((function(e){g(e),i&&i(e)}),[i]),E=Array.isArray(t)?t.map((function(e,t){return p.exports.jsx(Ht,{tag:e,onDelete:function(){return y(e)}},t)})):[];return p.exports.jsxs("div",c({ref:u,className:"ui-taginput"},{children:[E,p.exports.jsx(zt,{ref:s,value:h,onChange:C,onClick:function(){w(!0)}}),p.exports.jsx($t,{ref:l,open:v,anchorEl:s,filter:h,tags:t,suggestions:r,disableFilter:n,onSuggestionClick:A})]}))},exports.ToggleButton=function(e){var t=e.selected,r=e.value,n=e.size,i=e.children,a=e.className,s=e.onChange,l=o.default.useCallback((function(){s&&s(r)}),[s,r]);return p.exports.jsx("button",c({type:"button",className:B("ui-toggleBtn",void 0!==n?"ui-toggleBtn-size-".concat(n):"ui-toggleBtn-size-md",!0===t?"ui-toggleBtn-selected":null,a),onClick:l},{children:i}))},exports.Tooltip=function(e){var t=e.children,r=e.title;e.anchorEl;var n=e.enterDelay,i=void 0===n?0:n,a=e.leaveDelay,s=void 0===a?0:a,l=e.className,u=e.disabled,d=o.default.useState(void 0),f=d[0],h=d[1],g=o.default.useState(!1),m=g[0],v=g[1],w=o.default.useState(!0),y=w[0],A=w[1],C=o.default.useState(!1),E=C[0],b=C[1],x=o.default.useRef(),T=o.default.useRef();o.default.useEffect((function(){!0===u&&v(!1)}),[u]);var M,D=function(){v(!0)},I=function(){v(!1)},F=function(e){E||(clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),T.current=setTimeout((function(){I()}),s))},k=function(e){E||(clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),!0!==u&&(x.current=setTimeout((function(){D()}),i)))},q=function(e){b(!0),clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),!0!==u&&(x.current=setTimeout((function(){D()}),2e3))},N=function(e){clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),T.current=setTimeout((function(){I()}),3e3)};if(t){var R=c(c({},t.props),{onFocus:function(e){f||h(e.currentTarget),x.current=setTimeout((function(){D()}),i)},onMouseEnter:function(e){E||(clearTimeout(x.current),clearTimeout(T.current),f||h(e.currentTarget),!0!==u&&(x.current=setTimeout((function(){D()}),i)))},onMouseLeave:F,onMouseOver:k,onTouchStart:q,onTouchEnd:N});M=o.default.cloneElement(t,R)}var G=m||!y;return p.exports.jsxs(p.exports.Fragment,{children:[M,p.exports.jsx(O,c({role:"tooltip",anchorEl:f,open:G,className:B("ui-tooltip",l),onMouseOver:E?void 0:k,onMouseLeave:E?void 0:F,onTouchStart:q,onTouchEnd:N},{children:p.exports.jsx(Jt,c({trigger:m,onEnter:function(){A(!1)},onExited:function(){A(!0)}},{children:p.exports.jsx("div",c({className:"ui-tooltip-content"},{children:r}))}))}))]})},exports.WarningDialog=wr;
19
19
  //# sourceMappingURL=index.js.map