diff --git a/asset-manifest.json b/asset-manifest.json index d4f52b3a..ebe95ab2 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,16 +1,16 @@ { "files": { "main.css": "/metadata-entry-form/static/css/main.27bb419d.css", - "main.js": "/metadata-entry-form/static/js/main.7b2d96a3.js", + "main.js": "/metadata-entry-form/static/js/main.4634a5ac.js", "static/media/emlTemplate.j2": "/metadata-entry-form/static/media/emlTemplate.c7cac6e90d63ddf2962e.j2", "static/media/spritesheet.svg": "/metadata-entry-form/static/media/spritesheet.a4e0eb7ad904a4858361.svg", "static/media/emlCoverage.j2": "/metadata-entry-form/static/media/emlCoverage.ba6b51994dacf1f20971.j2", "index.html": "/metadata-entry-form/index.html", "main.27bb419d.css.map": "/metadata-entry-form/static/css/main.27bb419d.css.map", - "main.7b2d96a3.js.map": "/metadata-entry-form/static/js/main.7b2d96a3.js.map" + "main.4634a5ac.js.map": "/metadata-entry-form/static/js/main.4634a5ac.js.map" }, "entrypoints": [ "static/css/main.27bb419d.css", - "static/js/main.7b2d96a3.js" + "static/js/main.4634a5ac.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 64224375..70efabe4 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -
{"use strict";n.d(t,{c:()=>r});const r=(0,n(78).c)()},4880:(e,t,n)=>{"use strict";n.d(t,{cp:()=>s,rV:()=>o});var r=n(2540),i={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(e){return"".concat(Math.round(e),"ms")}const s={easing:i,duration:o,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,l=t.easing,c=void 0===l?i.easeInOut:l,u=t.delay,d=void 0===u?0:u;(0,r.c)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof s?s:a(s)," ").concat(c," ").concat("string"===typeof d?d:a(d))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},1512:(e,t,n)=>{"use strict";n.d(t,{c:()=>h});var r=n(5984),i=n(2540),o=n(1468),a=n(9996),s=n.n(a),l=n(3236),c=n(4328),u=n(2200);const d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var a=t.defaultTheme,d=t.withTheme,p=void 0!==d&&d,h=t.name,f=(0,i.c)(t,["defaultTheme","withTheme","name"]);var m=h,g=(0,l.c)(e,(0,r.c)({defaultTheme:a,Component:n,name:h||n.displayName,classNamePrefix:m},f)),v=o.forwardRef((function(e,t){e.classes;var s,l=e.innerRef,d=(0,i.c)(e,["classes","innerRef"]),f=g((0,r.c)({},n.defaultProps,e)),m=d;return("string"===typeof h||p)&&(s=(0,u.c)()||a,h&&(m=(0,c.c)({theme:s,name:h,props:d})),p&&!m.theme&&(m.theme=s)),o.createElement(n,(0,r.c)({ref:l||t,classes:f},m))}));return s()(v,n),v}};var p=n(3376);const h=function(e,t){return d(e,(0,r.c)({defaultTheme:p.c},t))}},8848:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},3620:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(1856);function i(e){if("string"!==typeof e)throw new Error((0,r.c)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},2656:(e,t,n)=>{"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;nr})},5696:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var r=n(5984),i=n(1468),o=n(4484);function a(e,t){var n=function(t,n){return i.createElement(o.c,(0,r.c)({ref:n},t),e)};return n.muiName=o.c.muiName,i.memo(i.forwardRef(n))}},664:(e,t,n)=>{"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o r})},8148:(e,t,n)=>{"use strict";n.r(t),n.d(t,{capitalize:()=>r.c,createChainedFunction:()=>i.c,createSvgIcon:()=>o.c,debounce:()=>a.c,deprecatedPropType:()=>s,isMuiElement:()=>l.c,ownerDocument:()=>c.c,ownerWindow:()=>u.c,requirePropFactory:()=>d,setRef:()=>p.c,unstable_useId:()=>v.c,unsupportedProp:()=>h,useControlled:()=>f.c,useEventCallback:()=>m.c,useForkRef:()=>g.c,useIsFocusVisible:()=>b.c});var r=n(3620),i=n(2656),o=n(5696),a=n(664);function s(e,t){return function(){return null}}var l=n(168),c=n(7376),u=n(6804);function d(e){return function(){return null}}var p=n(9184);function h(e,t,n,r,i){return null}var f=n(6960),m=n(9568),g=n(576),v=n(5064),b=n(2880)},168:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(1468);function i(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},7376:(e,t,n)=>{"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{c:()=>r})},6804:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(7376);function i(e){return(0,r.c)(e).defaultView||window}},9184:(e,t,n)=>{"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,{c:()=>r})},5064:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(1468);function i(e){var t=r.useState(e),n=t[0],i=t[1],o=e||n;return r.useEffect((function(){null==n&&i("mui-".concat(Math.round(1e5*Math.random())))}),[n]),o}},6960:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(1468);function i(e){var t=e.controlled,n=e.default,i=(e.name,e.state,r.useRef(void 0!==t).current),o=r.useState(n),a=o[0],s=o[1];return[i?t:a,r.useCallback((function(e){i||s(e)}),[])]}},9568:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(1468),i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function o(e){var t=r.useRef(e);return i((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},576:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(1468),i=n(9184);function o(e,t){return r.useMemo((function(){return null==e&&null==t?null:function(n){(0,i.c)(e,n),(0,i.c)(t,n)}}),[e,t])}},2880:(e,t,n)=>{"use strict";n.d(t,{c:()=>f});var r=n(1468),i=n(4840),o=!0,a=!1,s=null,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function c(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function u(){o=!1}function d(){"hidden"===this.visibilityState&&a&&(o=!0)}function p(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function h(){a=!0,window.clearTimeout(s),s=window.setTimeout((function(){a=!1}),100)}function f(){return{isFocusVisible:p,onBlurVisible:h,ref:r.useCallback((function(e){var t,n=i.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",d,!0))}),[])}}},3564:(e,t,n)=>{"use strict";var r=n(5272),i=n(6536);t.c=void 0;var o=i(n(1468)),a=(0,r(n(1204)).default)(o.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");t.c=a},5140:(e,t,n)=>{"use strict";var r=n(5272),i=n(6536);t.c=void 0;var o=i(n(1468)),a=(0,r(n(1204)).default)(o.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");t.c=a},6212:(e,t,n)=>{"use strict";var r=n(5272),i=n(6536);t.c=void 0;var o=i(n(1468)),a=(0,r(n(1204)).default)(o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");t.c=a},6968:(e,t,n)=>{"use strict";var r=n(5272),i=n(6536);t.c=void 0;var o=i(n(1468)),a=(0,r(n(1204)).default)(o.createElement("path",{d:"M20 9H4v2h16V9zM4 15h16v-2H4v2z"}),"DragHandle");t.c=a},3651:(e,t,n)=>{"use strict";var r=n(5272),i=n(6536);t.c=void 0;var o=i(n(1468)),a=(0,r(n(1204)).default)(o.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.c=a},4968:(e,t,n)=>{"use strict";var r=n(5272),i=n(6536);t.c=void 0;var o=i(n(1468)),a=(0,r(n(1204)).default)(o.createElement("path",{d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}),"Translate");t.c=a},1204:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(8148)},9928:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__"},4328:(e,t,n)=>{"use strict";function r(e){var t=e.theme,n=e.name,r=e.props;if(!t||!t.props||!t.props[n])return r;var i,o=t.props[n];for(i in o)void 0===r[i]&&(r[i]=o[i]);return r}n.d(t,{c:()=>r})},3236:(e,t,n)=>{"use strict";n.d(t,{c:()=>cn});var r=n(2540),i=n(5984),o=n(1468),a="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};const s="object"===("undefined"===typeof window?"undefined":a(window))&&"object"===("undefined"===typeof document?"undefined":a(document))&&9===document.nodeType;var l=n(4816),c=n(5776),u=n(4316),d=n(1632),p={}.constructor;function h(e){if(null==e||"object"!==typeof e)return e;if(Array.isArray(e))return e.map(h);if(e.constructor!==p)return e;var t={};for(var n in e)t[n]=h(e[n]);return t}function f(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=h(t),o=r.plugins.onCreateRule(e,i,n);return o||(e[0],null)}var m=function(e,t){for(var n="",r=0;r <+~=|^:(),"'`\s])/g,x="undefined"!==typeof CSS&&CSS.escape,w=function(e){return x?x(e):e.replace(_,"\\$1")},E=function(){function e(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},e}(),T=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var o=r.selector,a=r.scoped,s=r.sheet,l=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=l((0,u.c)((0,u.c)(i)),s),i.selectorText="."+w(i.id)),i}(0,c.c)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==typeof n?e[t]=n:Array.isArray(n)&&(e[t]=g(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?(0,i.c)({},e,{allowEmpty:!0}):e;return y(this.selectorText,this.style,n)},(0,l.c)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(E),C={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new T(e,t,n)}},k={indent:1,children:!0},S=/@([\w-]+)/,O=function(){function e(e,t,n){this.type="conditional",this.isProcessed=!1,this.key=e;var r=e.match(S);for(var o in this.at=r?r[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new J((0,i.c)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.replaceRule=function(e,t,n){var r=this.rules.replace(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.toString=function(e){void 0===e&&(e=k);var t=v(e).linebreak;if(null==e.indent&&(e.indent=k.indent),null==e.children&&(e.children=k.children),!1===e.children)return this.query+" {}";var n=this.rules.toString(e);return n?this.query+" {"+t+n+t+"}":""},e}(),A=/@container|@media|@supports\s+/,j={onCreateRule:function(e,t,n){return A.test(e)?new O(e,t,n):null}},P={indent:1,children:!0},I=/@keyframes\s+([\w-]+)/,L=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r=e.match(I);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var l in this.id=!1===o?this.name:w(s(this,a)),this.rules=new J((0,i.c)({},n,{parent:this})),t)this.rules.add(l,t[l],(0,i.c)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=P);var t=v(e).linebreak;if(null==e.indent&&(e.indent=P.indent),null==e.children&&(e.children=P.children),!1===e.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(e);return n&&(n=""+t+n+t),this.at+" "+this.id+" {"+n+"}"},e}(),R=/@keyframes\s+/,N=/\$([\w-]+)/g,D=function(e,t){return"string"===typeof e?e.replace(N,(function(e,n){return n in t?t[n]:e})):e},M=function(e,t,n){var r=e[t],i=D(r,n);i!==r&&(e[t]=i)},B={onCreateRule:function(e,t,n){return"string"===typeof e&&R.test(e)?new L(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&M(e,"animation-name",n.keyframes),"animation"in e&&M(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return D(e,r.keyframes);default:return e}}},Q=function(e){function t(){return e.apply(this,arguments)||this}return(0,c.c)(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?(0,i.c)({},e,{allowEmpty:!0}):e;return y(this.key,this.style,n)},t}(E),U={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new Q(e,t,n):null}},F=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){var t=v(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r =this.index)t.push(e);else for(var r=0;r n)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=(0,d.c)(t,["attached"]),i=v(r).linebreak,o="",a=0;a -1?r.substr(0,i-1):r;e.style.setProperty(t,o,i>-1?"important":"")}}catch(a){return!1}return!0},ue=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(n){}},de=function(e,t){return e.selectorText=t,e.selectorText===t},pe=se((function(){return document.querySelector("head")}));function he(e){var t=ne.registry;if(t.length>0){var n=function(e,t){for(var n=0;n t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"===typeof r){var i=function(e){for(var t=pe(),n=0;n n?n:t},ve=function(){function e(e){this.getPropertyValue=le,this.setProperty=ce,this.removeProperty=ue,this.setSelector=de,this.hasInsertedRules=!1,this.cssRules=[],e&&ne.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,i=t.element;this.element=i||function(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var o=fe();o&&this.element.setAttribute("nonce",o)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=he(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"===typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else pe().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n -1){var i=Nt[e];if(!Array.isArray(i))return ht.js+yt(i)in t&&ht.css+i;if(!r)return!1;for(var o=0;o t?1:-1:e.length-t.length};return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r={},i=Object.keys(t).sort(e),o=0;o 0&&void 0!==arguments[0]?arguments[0]:{},t=e.disableGlobal,n=void 0!==t&&t,r=e.productionPrefix,i=void 0===r?"jss":r,o=e.seed,a=void 0===o?"":o,s=""===a?"":"".concat(a,"-"),l=0,c=function(){return l+=1};return function(e,t){var r=t.options.name;if(r&&0===r.indexOf("Mui")&&!t.options.link&&!n){if(-1!==Oe.indexOf(e.key))return"Mui-".concat(e.key);var o="".concat(s).concat(r,"-").concat(e.key);return t.options.theme[Se.c]&&""===a?"".concat(o,"-").concat(c()):o}return"".concat(s).concat(i).concat(c())}}(),nn={disableGeneration:!1,generateClassName:tn,jss:en,sheetsCache:null,sheetsManager:new Map,sheetsRegistry:null},rn=o.createContext(nn);var on=-1e9;var an=n(8384);const sn={};function ln(e,t){var n=e.state,r=e.theme,o=e.stylesOptions,a=e.stylesCreator,s=e.name;if(!o.disableGeneration){var l=Ce.get(o.sheetsManager,a,r);l||(l={refs:0,staticSheet:null,dynamicStyles:null},Ce.set(o.sheetsManager,a,r,l));var c=(0,i.c)({},a.options,o,{theme:r,flip:"boolean"===typeof o.flip?o.flip:"rtl"===r.direction});c.generateId=c.serverGenerateClassName||c.generateClassName;var u=o.sheetsRegistry;if(0===l.refs){var d;o.sheetsCache&&(d=Ce.get(o.sheetsCache,a,r));var p=a.create(r,s);d||((d=o.jss.createStyleSheet(p,(0,i.c)({link:!1},c))).attach(),o.sheetsCache&&Ce.set(o.sheetsCache,a,r,d)),u&&u.add(d),l.staticSheet=d,l.dynamicStyles=we(p)}if(l.dynamicStyles){var h=o.jss.createStyleSheet(l.dynamicStyles,(0,i.c)({link:!0},c));h.update(t),h.attach(),n.dynamicSheet=h,n.classes=(0,Ee.c)({baseClasses:l.staticSheet.classes,newClasses:h.classes}),u&&u.add(h)}else n.classes=l.staticSheet.classes;l.refs+=1}}function cn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.name,a=t.classNamePrefix,s=t.Component,l=t.defaultTheme,c=void 0===l?sn:l,u=(0,r.c)(t,["name","classNamePrefix","Component","defaultTheme"]),d=function(e){var t="function"===typeof e;return{create:function(n,r){var o;try{o=t?e(n):e}catch(l){throw l}if(!r||!n.overrides||!n.overrides[r])return o;var a=n.overrides[r],s=(0,i.c)({},o);return Object.keys(a).forEach((function(e){s[e]=(0,an.c)(s[e],a[e])})),s},options:{}}}(e),p=n||a||"makeStyles";d.options={index:on+=1,name:n,meta:p,classNamePrefix:p};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,ke.c)()||c,r=(0,i.c)({},o.useContext(rn),u),a=o.useRef(),l=o.useRef();!function(e,t){var n,r=o.useRef([]),i=o.useMemo((function(){return{}}),t);r.current!==i&&(r.current=i,n=e()),o.useEffect((function(){return function(){n&&n()}}),[i])}((function(){var i={name:n,state:{},stylesCreator:d,stylesOptions:r,theme:t};return ln(i,e),l.current=!1,a.current=i,function(){!function(e){var t=e.state,n=e.theme,r=e.stylesOptions,i=e.stylesCreator;if(!r.disableGeneration){var o=Ce.get(r.sheetsManager,i,n);o.refs-=1;var a=r.sheetsRegistry;0===o.refs&&(Ce.delete(r.sheetsManager,i,n),r.jss.removeStyleSheet(o.staticSheet),a&&a.remove(o.staticSheet)),t.dynamicSheet&&(r.jss.removeStyleSheet(t.dynamicSheet),a&&a.remove(t.dynamicSheet))}}(i)}}),[t,d]),o.useEffect((function(){l.current&&function(e,t){var n=e.state;n.dynamicSheet&&n.dynamicSheet.update(t)}(a.current,e),l.current=!0}));var p=function(e,t,n){var r=e.state;if(e.stylesOptions.disableGeneration)return t||{};r.cacheClasses||(r.cacheClasses={value:null,lastProp:null,lastJSS:{}});var i=!1;return r.classes!==r.cacheClasses.lastJSS&&(r.cacheClasses.lastJSS=r.classes,i=!0),t!==r.cacheClasses.lastProp&&(r.cacheClasses.lastProp=t,i=!0),i&&(r.cacheClasses.value=(0,Ee.c)({baseClasses:r.cacheClasses.lastJSS,newClasses:t,Component:n})),r.cacheClasses.value}(a.current,e.classes,s);return p}}},4928:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(5984);function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.baseClasses,n=e.newClasses;e.Component;if(!n)return t;var i=(0,r.c)({},t);return Object.keys(n).forEach((function(e){n[e]&&(i[e]="".concat(t[e]," ").concat(n[e]))})),i}},7792:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});const r=n(1468).createContext(null)},2200:(e,t,n)=>{"use strict";n.d(t,{c:()=>o});var r=n(1468),i=n(7792);function o(){return r.useContext(i.c)}},1880:(e,t,n)=>{"use strict";n.d(t,{l:()=>a});var r=n(2784),i={xs:0,sm:600,md:960,lg:1280,xl:1920},o={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(i[e],"px)")}};function a(e,t,n){if(Array.isArray(t)){var i=e.theme.breakpoints||o;return t.reduce((function(e,r,o){return e[i.up(i.keys[o])]=n(t[o]),e}),{})}if("object"===(0,r.c)(t)){var a=e.theme.breakpoints||o;return Object.keys(t).reduce((function(e,r){return e[a.up(r)]=n(t[r]),e}),{})}return n(t)}},208:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(8384);const i=function(e,t){return t?(0,r.c)(e,t,{clone:!1}):e}},6304:(e,t,n)=>{"use strict";n.d(t,{I:()=>d,c:()=>f});var r=n(5376),i=n(1880),o=n(208);var a={m:"margin",p:"padding"},s={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},l={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},c=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){if(e.length>2){if(!l[e])return[e];e=l[e]}var t=e.split(""),n=(0,r.c)(t,2),i=n[0],o=n[1],c=a[i],u=s[o]||"";return Array.isArray(u)?u.map((function(e){return c+e})):[c+u]})),u=["m","mt","mr","mb","ml","mx","my","p","pt","pr","pb","pl","px","py","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY"];function d(e){var t=e.spacing||8;return"number"===typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"===typeof t?t:function(){}}function p(e,t){return function(n){return e.reduce((function(e,r){return e[r]=function(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}(t,n),e}),{})}}function h(e){var t=d(e.theme);return Object.keys(e).map((function(n){if(-1===u.indexOf(n))return null;var r=p(c(n),t),o=e[n];return(0,i.l)(e,o,r)})).reduce(o.c,{})}h.propTypes={},h.filterProps=u;const f=h},8384:(e,t,n)=>{"use strict";n.d(t,{c:()=>a});var r=n(5984),i=n(2784);function o(e){return e&&"object"===(0,i.c)(e)&&e.constructor===Object}function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},i=n.clone?(0,r.c)({},e):e;return o(e)&&o(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(o(t[r])&&r in e?i[r]=a(e[r],t[r],n):i[r]=t[r])})),i}},1856:(e,t,n)=>{"use strict";function r(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n r})},9112:(e,t,n)=>{"use strict";n.d(t,{wp:()=>h,ud:()=>v,WS:()=>g,m2:()=>f});var r=n(8992),i=n(4156),o=n(4184),a=n(1276),s=n(5016),l=n(3104),c=n(4756),u=n(5980),d=function(){function e(e){this.errors=0,this.sid=(0,i.OW)(),this.timestamp=Date.now(),this.started=Date.now(),this.duration=0,this.status=c.G.Ok,e&&this.update(e)}return e.prototype.update=function(e){void 0===e&&(e={}),e.user&&(e.user.ip_address&&(this.ipAddress=e.user.ip_address),e.did||(this.did=e.user.id||e.user.email||e.user.username)),this.timestamp=e.timestamp||Date.now(),e.sid&&(this.sid=32===e.sid.length?e.sid:(0,i.OW)()),e.did&&(this.did=""+e.did),"number"===typeof e.started&&(this.started=e.started),"number"===typeof e.duration?this.duration=e.duration:this.duration=this.timestamp-this.started,e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),e.ipAddress&&(this.ipAddress=e.ipAddress),e.userAgent&&(this.userAgent=e.userAgent),"number"===typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):this.status===c.G.Ok?this.update({status:c.G.Exited}):this.update()},e.prototype.toJSON=function(){return(0,u.Sy)({sid:""+this.sid,init:!0,started:new Date(this.started).toISOString(),timestamp:new Date(this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"===typeof this.did||"string"===typeof this.did?""+this.did:void 0,duration:this.duration,attrs:(0,u.Sy)({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},e}(),p=3,h=function(){function e(e,t,n){void 0===t&&(t=new l.k),void 0===n&&(n=p),this._version=n,this._stack=[{}],this.getStackTop().scope=t,this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version {"use strict";n.d(t,{e:()=>u,k:()=>l});var r=n(8992),i=n(5336),o=n(4184),a=n(5044),s=n(4156),l=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=(0,r.KQ)(t._breadcrumbs),n._tags=(0,r.C3)({},t._tags),n._extra=(0,r.C3)({},t._extra),n._contexts=(0,r.C3)({},t._contexts),n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=(0,r.KQ)(t._eventProcessors)),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.setTags=function(e){return this._tags=(0,r.C3)((0,r.C3)({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=(0,r.C3)((0,r.C3)({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){return this._extra=(0,r.C3)((0,r.C3)({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=(0,r.C3)((0,r.C3)({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=(0,r.C3)((0,r.C3)({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e,t,n,r,i=this.getSpan();return(null===(e=i)||void 0===e?void 0:e.transaction)?null===(t=i)||void 0===t?void 0:t.transaction:(null===(r=null===(n=i)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?i.spanRecorder.spans[0]:void 0},e.prototype.setSession=function(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"===typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=(0,r.C3)((0,r.C3)({},this._tags),t._tags),this._extra=(0,r.C3)((0,r.C3)({},this._extra),t._extra),this._contexts=(0,r.C3)((0,r.C3)({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint)):(0,i.oF)(t)&&(this._tags=(0,r.C3)((0,r.C3)({},this._tags),t.tags),this._extra=(0,r.C3)((0,r.C3)({},this._extra),t.extra),this._contexts=(0,r.C3)((0,r.C3)({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n=(0,r.C3)({timestamp:(0,o.CG)()},e);return this._breadcrumbs=void 0!==t&&t>=0?(0,r.KQ)(this._breadcrumbs,[n]).slice(-t):(0,r.KQ)(this._breadcrumbs,[n]),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){var n;if(this._extra&&Object.keys(this._extra).length&&(e.extra=(0,r.C3)((0,r.C3)({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=(0,r.C3)((0,r.C3)({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=(0,r.C3)((0,r.C3)({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=(0,r.C3)((0,r.C3)({},this._contexts),e.contexts)),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=(0,r.C3)({trace:this._span.getTraceContext()},e.contexts);var i=null===(n=this._span.transaction)||void 0===n?void 0:n.name;i&&(e.tags=(0,r.C3)({transaction:i},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=(0,r.KQ)(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,this._notifyEventProcessors((0,r.KQ)(c(),this._eventProcessors),e,t)},e.prototype._notifyEventProcessors=function(e,t,n,o){var s=this;return void 0===o&&(o=0),new a.G((function(a,l){var c=e[o];if(null===t||"function"!==typeof c)a(t);else{var u=c((0,r.C3)({},t),n);(0,i.Oe)(u)?u.then((function(t){return s._notifyEventProcessors(e,t,n,o+1).then(a)})).then(null,l):s._notifyEventProcessors(e,u,n,o+1).then(a).then(null,l)}}))},e.prototype._notifyScopeListeners=function(){var e=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function c(){var e=(0,s.mm)();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function u(e){c().push(e)}},7090:(e,t,n)=>{"use strict";n.d(t,{Mh:()=>x,Iz:()=>_});var r,i=n(8992),o=n(9112);!function(e){e.Explicit="explicitly_set",e.Sampler="client_sampler",e.Rate="client_rate",e.Inheritance="inheritance"}(r||(r={}));var a=n(1276),s=n(5016),l=n(5336),c=n(4156),u=n(3456),d=n(8888),p=n(6360);function h(){var e=(0,p.gB)();e&&(a.Q.log("[Tracing] Transaction: "+d.D.InternalError+" -> Global error occured"),e.setStatus(d.D.InternalError))}var f=n(9916),m=n(8300);function g(){var e=this.getScope();if(e){var t=e.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}}function v(e,t,n){var o,s,l=e.getClient(),c=l&&l.getOptions()||{};return l&&(0,p.KQ)(c)?void 0!==t.sampled?(t.tags=(0,i.C3)((0,i.C3)({},t.tags),{__sentry_samplingMethod:r.Explicit}),t):("function"===typeof c.tracesSampler?(s=c.tracesSampler(n),t.tags=(0,i.C3)((0,i.C3)({},t.tags),{__sentry_samplingMethod:r.Sampler,__sentry_sampleRate:String(Number(s))})):void 0!==n.parentSampled?(s=n.parentSampled,t.tags=(0,i.C3)((0,i.C3)({},t.tags),{__sentry_samplingMethod:r.Inheritance})):(s=c.tracesSampleRate,t.tags=(0,i.C3)((0,i.C3)({},t.tags),{__sentry_samplingMethod:r.Rate,__sentry_sampleRate:String(Number(s))})),function(e){if(isNaN(e)||"number"!==typeof e&&"boolean"!==typeof e)return a.Q.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(e)+" of type "+JSON.stringify(typeof e)+"."),!1;if(e<0||e>1)return a.Q.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+e+"."),!1;return!0}(s)?s?(t.sampled=Math.random() {"use strict";n.d(t,{Y1:()=>c,if:()=>d});var r=n(8992),i=n(4184),o=n(1276),a=n(2696),s=n(8888),l=n(8300),c=1e3,u=function(e){function t(t,n,r,i){void 0===r&&(r="");var o=e.call(this,i)||this;return o._pushActivity=t,o._popActivity=n,o.transactionSpanId=r,o}return(0,r.ct)(t,e),t.prototype.add=function(t){var n=this;t.spanId!==this.transactionSpanId&&(t.finish=function(e){t.endTimestamp="number"===typeof e?e:(0,i.gb)(),n._popActivity(t.spanId)},void 0===t.endTimestamp&&this._pushActivity(t.spanId)),e.prototype.add.call(this,t)},t}(a.U),d=function(e){function t(t,n,r,i){void 0===r&&(r=c),void 0===i&&(i=!1);var a=e.call(this,t,n)||this;return a._idleHub=n,a._idleTimeout=r,a._onScope=i,a.activities={},a._heartbeatTimer=0,a._heartbeatCounter=0,a._finished=!1,a._beforeFinishCallbacks=[],n&&i&&(p(n),o.Q.log("Setting idle transaction on scope. Span ID: "+a.spanId),n.configureScope((function(e){return e.setSpan(a)}))),a}return(0,r.ct)(t,e),t.prototype.finish=function(t){var n,a,l=this;if(void 0===t&&(t=(0,i.gb)()),this._finished=!0,this.activities={},this.spanRecorder){o.Q.log("[Tracing] finishing IdleTransaction",new Date(1e3*t).toISOString(),this.op);try{for(var c=(0,r.gR)(this._beforeFinishCallbacks),u=c.next();!u.done;u=c.next()){(0,u.value)(this,t)}}catch(d){n={error:d}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(n)throw n.error}}this.spanRecorder.spans=this.spanRecorder.spans.filter((function(e){if(e.spanId===l.spanId)return!0;e.endTimestamp||(e.endTimestamp=t,e.setStatus(s.D.Cancelled),o.Q.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(e,void 0,2)));var n=e.startTimestamp=3?(o.Q.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus(s.D.DeadlineExceeded),this.setTag("heartbeat","failed"),this.finish()):this._pingHeartbeat()}},t.prototype._pingHeartbeat=function(){var e=this;o.Q.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),this._heartbeatTimer=setTimeout((function(){e._beat()}),5e3)},t}(l.I);function p(e){if(e){var t=e.getScope();if(t)t.getTransaction()&&t.setSpan(void 0)}}},7416:(e,t,n)=>{"use strict";n.d(t,{g:()=>c});var r=n(8992),i=n(5016),o=n(1276),a=n(5980);e=n.hmd(e);var s=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],l={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]},c=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._operations=Array.isArray(e.operations)?e.operations:s,this._describeOperations=!("describeOperations"in e)||e.describeOperations}return t.prototype.setupOnce=function(t,n){var r;try{r=(0,i.iq)(e,"mongodb").Collection}catch(a){return void o.Q.error("Mongo Integration was unable to require `mongodb` package.")}this._instrumentOperations(r,this._operations,n)},t.prototype._instrumentOperations=function(e,t,n){var r=this;t.forEach((function(t){return r._patchOperation(e,t,n)}))},t.prototype._patchOperation=function(e,t,n){if(t in e.prototype){var i=this._getSpanContextFromOperationArguments.bind(this);(0,a.ym)(e.prototype,t,(function(e){return function(){for(var o,a,s,l=[],c=0;c ",i[a[1]]="string"===typeof d?d:d.name||" "}else for(var p=0;p {"use strict";n.d(t,{W:()=>a});var r=n(5016),i=n(1276),o=n(5980);e=n.hmd(e);var a=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(t,n){var a;try{a=(0,r.iq)(e,"mysql/lib/Connection.js")}catch(s){return void i.Q.error("Mysql Integration was unable to require `mysql` package.")}(0,o.ym)(a.prototype,"query",(function(e){return function(t,r,i){var o,a,s=null===(a=null===(o=n().getScope())||void 0===o?void 0:o.getSpan())||void 0===a?void 0:a.startChild({description:"string"===typeof t?t:t.sql,op:"db"});return"function"===typeof i?e.call(this,t,r,(function(e,t,n){var r;null===(r=s)||void 0===r||r.finish(),i(e,t,n)})):"function"===typeof r?e.call(this,t,(function(e,t,n){var i;null===(i=s)||void 0===i||i.finish(),r(e,t,n)})):e.call(this,t,r,i)}}))},t.id="Mysql",t}()},3160:(e,t,n)=>{"use strict";n.d(t,{a:()=>a});var r=n(5016),i=n(1276),o=n(5980);e=n.hmd(e);var a=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(t,n){var a;try{a=(0,r.iq)(e,"pg").Client}catch(s){return void i.Q.error("Postgres Integration was unable to require `pg` package.")}(0,o.ym)(a.prototype,"query",(function(e){return function(t,r,i){var o,a,s=null===(a=null===(o=n().getScope())||void 0===o?void 0:o.getSpan())||void 0===a?void 0:a.startChild({description:"string"===typeof t?t:t.text,op:"db"});return"function"===typeof i?e.call(this,t,r,(function(e,t){var n;null===(n=s)||void 0===n||n.finish(),i(e,t)})):"function"===typeof r?e.call(this,t,(function(e,t){var n;null===(n=s)||void 0===n||n.finish(),r(e,t)})):e.call(this,t,r).then((function(e){var t;return null===(t=s)||void 0===t||t.finish(),e}))}}))},t.id="Postgres",t}()},2696:(e,t,n)=>{"use strict";n.d(t,{C:()=>c,U:()=>l});var r=n(8992),i=n(4156),o=n(4184),a=n(5980),s=n(8888),l=function(){function e(e){void 0===e&&(e=1e3),this.spans=[],this._maxlen=e}return e.prototype.add=function(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)},e}(),c=function(){function e(e){if(this.traceId=(0,i.OW)(),this.spanId=(0,i.OW)().substring(16),this.startTimestamp=(0,o.gb)(),this.tags={},this.data={},!e)return this;e.traceId&&(this.traceId=e.traceId),e.spanId&&(this.spanId=e.spanId),e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.data&&(this.data=e.data),e.tags&&(this.tags=e.tags),e.status&&(this.status=e.status),e.startTimestamp&&(this.startTimestamp=e.startTimestamp),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}return e.prototype.child=function(e){return this.startChild(e)},e.prototype.startChild=function(t){var n=new e((0,r.C3)((0,r.C3)({},t),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}));return n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,n},e.prototype.setTag=function(e,t){var n;return this.tags=(0,r.C3)((0,r.C3)({},this.tags),((n={})[e]=t,n)),this},e.prototype.setData=function(e,t){var n;return this.data=(0,r.C3)((0,r.C3)({},this.data),((n={})[e]=t,n)),this},e.prototype.setStatus=function(e){return this.status=e,this},e.prototype.setHttpStatus=function(e){this.setTag("http.status_code",String(e));var t=s.D.fromHttpCode(e);return t!==s.D.UnknownError&&this.setStatus(t),this},e.prototype.isSuccess=function(){return this.status===s.D.Ok},e.prototype.finish=function(e){this.endTimestamp="number"===typeof e?e:(0,o.gb)()},e.prototype.toTraceparent=function(){var e="";return void 0!==this.sampled&&(e=this.sampled?"-1":"-0"),this.traceId+"-"+this.spanId+e},e.prototype.getTraceContext=function(){return(0,a.Sy)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},e.prototype.toJSON=function(){return(0,a.Sy)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},e}()},8888:(e,t,n)=>{"use strict";var r;n.d(t,{D:()=>r}),function(e){e.Ok="ok",e.DeadlineExceeded="deadline_exceeded",e.Unauthenticated="unauthenticated",e.PermissionDenied="permission_denied",e.NotFound="not_found",e.ResourceExhausted="resource_exhausted",e.InvalidArgument="invalid_argument",e.Unimplemented="unimplemented",e.Unavailable="unavailable",e.InternalError="internal_error",e.UnknownError="unknown_error",e.Cancelled="cancelled",e.AlreadyExists="already_exists",e.FailedPrecondition="failed_precondition",e.Aborted="aborted",e.OutOfRange="out_of_range",e.DataLoss="data_loss"}(r||(r={})),function(e){e.fromHttpCode=function(t){if(t<400)return e.Ok;if(t>=400&&t<500)switch(t){case 401:return e.Unauthenticated;case 403:return e.PermissionDenied;case 404:return e.NotFound;case 409:return e.AlreadyExists;case 413:return e.FailedPrecondition;case 429:return e.ResourceExhausted;default:return e.InvalidArgument}if(t>=500&&t<600)switch(t){case 501:return e.Unimplemented;case 503:return e.Unavailable;case 504:return e.DeadlineExceeded;default:return e.InternalError}return e.UnknownError}}(r||(r={}))},8300:(e,t,n)=>{"use strict";n.d(t,{I:()=>l});var r=n(8992),i=n(9112),o=n(5336),a=n(1276),s=n(2696),l=function(e){function t(t,n){var r=e.call(this,t)||this;return r._measurements={},r._hub=(0,i.WS)(),(0,o.aG)(n,i.wp)&&(r._hub=n),r.name=t.name?t.name:"",r._trimEnd=t.trimEnd,r.transaction=r,r}return(0,r.ct)(t,e),t.prototype.setName=function(e){this.name=e},t.prototype.initSpanRecorder=function(e){void 0===e&&(e=1e3),this.spanRecorder||(this.spanRecorder=new s.U(e)),this.spanRecorder.add(this)},t.prototype.setMeasurements=function(e){this._measurements=(0,r.C3)({},e)},t.prototype.finish=function(t){var n=this;if(void 0===this.endTimestamp){if(this.name||(a.Q.warn("Transaction has no name, falling back to ` `."),this.name=" "),e.prototype.finish.call(this,t),!0===this.sampled){var r=this.spanRecorder?this.spanRecorder.spans.filter((function(e){return e!==n&&e.endTimestamp})):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((function(e,t){return e.endTimestamp&&t.endTimestamp?e.endTimestamp>t.endTimestamp?e:t:e})).endTimestamp);var i={contexts:{trace:this.getTraceContext()},spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction"};return Object.keys(this._measurements).length>0&&(a.Q.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),this._hub.captureEvent(i)}a.Q.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.")}},t}(s.C)},6360:(e,t,n)=>{"use strict";n.d(t,{Cg:()=>a,GW:()=>c,KQ:()=>o,gB:()=>s,kV:()=>l});var r=n(9112),i=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function o(e){return"tracesSampleRate"in e||"tracesSampler"in e}function a(e){var t=e.match(i);if(t){var n=void 0;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}}function s(e){var t,n;return void 0===e&&(e=(0,r.WS)()),null===(n=null===(t=e)||void 0===t?void 0:t.getScope())||void 0===n?void 0:n.getTransaction()}function l(e){return e/1e3}function c(e){return 1e3*e}},4756:(e,t,n)=>{"use strict";var r;n.d(t,{G:()=>r}),function(e){e.Ok="ok",e.Exited="exited",e.Crashed="crashed",e.Abnormal="abnormal"}(r||(r={}))},8972:(e,t,n)=>{"use strict";n.d(t,{I:()=>i});var r=n(5336);function i(e){try{for(var t=e,n=[],r=0,i=0,a=void 0;t&&r++<5&&!("html"===(a=o(t))||r>1&&i+3*n.length+a.length>=80);)n.push(a),i+=a.length,t=t.parentNode;return n.reverse().join(" > ")}catch(s){return" "}}function o(e){var t,n,i,o,a,s=e,l=[];if(!s||!s.tagName)return"";if(l.push(s.tagName.toLowerCase()),s.id&&l.push("#"+s.id),(t=s.className)&&(0,r.ct)(t))for(n=t.split(/\s+/),a=0;a {"use strict";n.d(t,{c:()=>m});var r,i=n(8992),o=n(5336),a=n(1276),s=n(4156),l=n(5980),c=n(1496),u=n(648),d=(0,s.mm)(),p={},h={};function f(e){if(!h[e])switch(h[e]=!0,e){case"console":!function(){if(!("console"in d))return;["debug","info","warn","error","log","assert"].forEach((function(e){e in d.console&&(0,l.ym)(d.console,e,(function(t){return function(){for(var n=[],r=0;r 2?t[2]:void 0;if(i){var o=r,a=String(i);r=a,g("history",{from:o,to:a})}return e.apply(this,t)}}d.onpopstate=function(){for(var t=[],n=0;n {"use strict";function r(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return m(e,Error)}}function i(e){return"[object ErrorEvent]"===Object.prototype.toString.call(e)}function o(e){return"[object DOMError]"===Object.prototype.toString.call(e)}function a(e){return"[object DOMException]"===Object.prototype.toString.call(e)}function s(e){return"[object String]"===Object.prototype.toString.call(e)}function l(e){return null===e||"object"!==typeof e&&"function"!==typeof e}function c(e){return"[object Object]"===Object.prototype.toString.call(e)}function u(e){return"undefined"!==typeof Event&&m(e,Event)}function d(e){return"undefined"!==typeof Element&&m(e,Element)}function p(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function h(e){return Boolean(e&&e.then&&"function"===typeof e.then)}function f(e){return c(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function m(e,t){try{return e instanceof t}catch(n){return!1}}n.d(t,{K7:()=>f,KI:()=>d,Oe:()=>h,QX:()=>p,Qn:()=>a,SO:()=>u,Sc:()=>o,aG:()=>m,ct:()=>s,cz:()=>i,eU:()=>r,oF:()=>c,od:()=>l})},1276:(e,t,n)=>{"use strict";n.d(t,{Q:()=>s});var r=n(4156),i=(0,r.mm)(),o="Sentry Logger ",a=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t {"use strict";n.d(t,{Mt:()=>f,NP:()=>u,OW:()=>a,QD:()=>c,UX:()=>s,mm:()=>o,qW:()=>d,s5:()=>p,y_:()=>l});var r=n(5016),i={};function o(){return(0,r.ao)()?n.g:"undefined"!==typeof window?window:"undefined"!==typeof self?self:i}function a(){var e=o(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function s(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function l(e){if(e.message)return e.message;if(e.exception&&e.exception.values&&e.exception.values[0]){var t=e.exception.values[0];return t.type&&t.value?t.type+": "+t.value:t.type||t.value||e.event_id||" "}return e.event_id||" "}function c(e){var t=o();if(!("console"in t))return e();var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var i=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),i}function u(e,t,n){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].value=e.exception.values[0].value||t||"",e.exception.values[0].type=e.exception.values[0].type||n||"Error"}function d(e,t){void 0===t&&(t={});try{e.exception.values[0].mechanism=e.exception.values[0].mechanism||{},Object.keys(t).forEach((function(n){e.exception.values[0].mechanism[n]=t[n]}))}catch(n){}}function p(){try{return document.location.href}catch(e){return""}}var h=6e4;function f(e,t){if(!t)return h;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?h:r-e}},5016:(e,t,n)=>{"use strict";n.d(t,{Kw:()=>l,ao:()=>o,iq:()=>a});var r=n(5336),i=n(5980);function o(){return"[object process]"===Object.prototype.toString.call("undefined"!==typeof process?process:0)}function a(e,t){return e.require(t)}e=n.hmd(e);var s=["cookies","data","headers","method","query_string","url"];function l(t,n){if(void 0===n&&(n=s),!o())throw new Error("Can't get node request data outside of a node environment");var l={},c=t.headers||t.header||{},u=t.method,d=t.hostname||t.host||c.host||" ",p="https"===t.protocol||t.secure||(t.socket||{}).encrypted?"https":"http",h=t.originalUrl||t.url||"",f=p+"://"+d+h;return n.forEach((function(n){switch(n){case"headers":l.headers=c;break;case"method":l.method=u;break;case"url":l.url=f;break;case"cookies":l.cookies=t.cookies||a(e,"cookie").parse(c.cookie||"");break;case"query_string":l.query_string=a(e,"url").parse(h||"",!1).query;break;case"data":if("GET"===u||"HEAD"===u)break;void 0!==t.body&&(l.data=(0,r.ct)(t.body)?t.body:JSON.stringify((0,i.Cs)(t.body)));break;default:({}).hasOwnProperty.call(t,n)&&(l[n]=t[n])}})),l}},5980:(e,t,n)=>{"use strict";n.d(t,{Sy:()=>b,yq:()=>v,ym:()=>c,Cs:()=>g,yY:()=>h,OW:()=>u});var r=n(8992),i=n(8972),o=n(5336),a=function(){function e(){this._hasWeakSet="function"===typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return e.prototype.memoize=function(e){if(this._hasWeakSet)return!!this._inner.has(e)||(this._inner.add(e),!1);for(var t=0;t "}try{s.currentTarget=(0,o.KI)(a.currentTarget)?(0,i.I)(a.currentTarget):Object.prototype.toString.call(a.currentTarget)}catch(l){s.currentTarget=" "}for(var r in"undefined"!==typeof CustomEvent&&(0,o.aG)(e,CustomEvent)&&(s.detail=a.detail),a)Object.prototype.hasOwnProperty.call(a,r)&&(s[r]=a);return s}return e}function p(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function h(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=g(e,t);return p(r)>n?h(e,t-1,n):r}function f(e,t){return"domain"===t&&e&&"object"===typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!==typeof n.g&&e===n.g?"[Global]":"undefined"!==typeof window&&e===window?"[Window]":"undefined"!==typeof document&&e===document?"[Document]":(0,o.K7)(e)?"[SyntheticEvent]":"number"===typeof e&&e!==e?"[NaN]":void 0===e?"[undefined]":"function"===typeof e?"[Function: "+(0,s.k)(e)+"]":"symbol"===typeof e?"["+String(e)+"]":"bigint"===typeof e?"[BigInt: "+String(e)+"]":e}function m(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new a),0===n)return function(e){var t=Object.prototype.toString.call(e);if("string"===typeof e)return e;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=f(e);return(0,o.od)(n)?n:t}(t);if(null!==t&&void 0!==t&&"function"===typeof t.toJSON)return t.toJSON();var i=f(t,e);if((0,o.od)(i))return i;var s=d(t),l=Array.isArray(t)?[]:{};if(r.memoize(t))return"[Circular ~]";for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(l[c]=m(c,s[c],n-1,r));return r.unmemoize(t),l}function g(e,t){try{return JSON.parse(JSON.stringify(e,(function(e,n){return m(e,n,t)})))}catch(n){return"**non-serializable**"}}function v(e,t){void 0===t&&(t=40);var n=Object.keys(d(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return(0,l.E3)(n[0],t);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length?i:(0,l.E3)(i,t)}return""}function b(e){var t,n;if((0,o.oF)(e)){var i=e,a={};try{for(var s=(0,r.gR)(Object.keys(i)),l=s.next();!l.done;l=s.next()){var c=l.value;"undefined"!==typeof i[c]&&(a[c]=b(i[c]))}}catch(u){t={error:u}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a}return Array.isArray(e)?e.map(b):e}},1496:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=" ";function i(e){try{return e&&"function"===typeof e&&e.name||r}catch(t){return r}}},8776:(e,t,n)=>{"use strict";n.d(t,{AU:()=>a,E3:()=>i,Y9:()=>o});var r=n(5336);function i(e,t){return void 0===t&&(t=0),"string"!==typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function o(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r {"use strict";n.d(t,{Gk:()=>o,Ix:()=>c,K4:()=>l,T0:()=>s});var r=n(1276),i=n(4156);function o(){if(!("fetch"in(0,i.mm)()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function a(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function s(){if(!o())return!1;var e=(0,i.mm)();if(a(e.fetch))return!0;var t=!1,n=e.document;if(n&&"function"===typeof n.createElement)try{var s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s),s.contentWindow&&s.contentWindow.fetch&&(t=a(s.contentWindow.fetch)),n.head.removeChild(s)}catch(l){r.Q.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",l)}return t}function l(){if(!o())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}function c(){var e=(0,i.mm)(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}},5044:(e,t,n)=>{"use strict";n.d(t,{G:()=>o});var r,i=n(5336);!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"}(r||(r={}));var o=function(){function e(e){var t=this;this._state=r.PENDING,this._handlers=[],this._resolve=function(e){t._setResult(r.RESOLVED,e)},this._reject=function(e){t._setResult(r.REJECTED,e)},this._setResult=function(e,n){t._state===r.PENDING&&((0,i.Oe)(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._attachHandler=function(e){t._handlers=t._handlers.concat(e),t._executeHandlers()},this._executeHandlers=function(){if(t._state!==r.PENDING){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e.done||(t._state===r.RESOLVED&&e.onfulfilled&&e.onfulfilled(t._value),t._state===r.REJECTED&&e.onrejected&&e.onrejected(t._value),e.done=!0)}))}};try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}return e.resolve=function(t){return new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.all=function(t){return new e((function(n,r){if(Array.isArray(t))if(0!==t.length){var i=t.length,o=[];t.forEach((function(t,a){e.resolve(t).then((function(e){o[a]=e,0===(i-=1)&&n(o)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},e.prototype.then=function(t,n){var r=this;return new e((function(e,i){r._attachHandler({done:!1,onfulfilled:function(n){if(t)try{return void e(t(n))}catch(r){return void i(r)}else e(n)},onrejected:function(t){if(n)try{return void e(n(t))}catch(r){return void i(r)}else i(t)}})}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var i,o;return n.then((function(e){o=!1,i=e,t&&t()}),(function(e){o=!0,i=e,t&&t()})).then((function(){o?r(i):e(i)}))}))},e.prototype.toString=function(){return"[object SyncPromise]"},e}()},4184:(e,t,n)=>{"use strict";n.d(t,{CG:()=>l,W2:()=>u,gb:()=>c});var r=n(4156),i=n(5016);e=n.hmd(e);var o={nowSeconds:function(){return Date.now()/1e3}};var a=(0,i.ao)()?function(){try{return(0,i.iq)(e,"perf_hooks").performance}catch(t){return}}():function(){var e=(0,r.mm)().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),s=void 0===a?o:{nowSeconds:function(){return(a.timeOrigin+a.now())/1e3}},l=o.nowSeconds.bind(o),c=s.nowSeconds.bind(s),u=function(){var e=(0,r.mm)().performance;if(e)return e.timeOrigin?e.timeOrigin:e.timing&&e.timing.navigationStart||Date.now()}()},6248:e=>{"use strict";const t=(e,t,n)=>{const r=t<0?e.length+t:t;if(r>=0&&r (e=[...e],t(e,n,r),e),e.exports.mutate=t},8364:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=s(e),a=o[0],l=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,l)),u=0,d=l>0?a-4:a;for(n=0;n >16&255,c[u++]=t>>8&255,c[u++]=255&t;2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,c=r-i;s c?c:s+a));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,o,a=[],s=t;s >18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},3344:(e,t,n)=>{"use strict";const r=n(8364),i=n(924),o="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Sn=l,t.ZK=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"===typeof e)return function(e,t){"string"===typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|m(e,t);let r=s(n);const i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!==typeof SharedArrayBuffer&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|f(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!==typeof e.length||Y(e.length)?s(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),s(e<0?0:0|f(e))}function p(e){const t=e.length<0?0:0|f(e.length),n=s(t);for(let r=0;r =a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(i)return r?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){let o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let r=-1;for(o=n;o s&&(n=s-l),o=n;o>=0;o--){let n=!0;for(let r=0;ri&&(r=i):r=i;const o=t.length;let a;for(r>o/2&&(r=o/2),a=0;a >8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i 239?4:t>223?3:t>191?2:1;if(i+a<=n){let n,r,s,l;switch(a){case 1:t<128&&(o=t);break;case 2:n=e[i+1],128===(192&n)&&(l=(31&t)<<6|63&n,l>127&&(o=l));break;case 3:n=e[i+1],r=e[i+2],128===(192&n)&&128===(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],128===(192&n)&&128===(192&r)&&128===(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&s,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let n="",r=0;for(;r r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=m,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t n&&(e+=" ... ")," "},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(K(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(r,i),u=e.slice(t,n);for(let l=0;l >>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":case"latin1":case"binary":return w(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function O(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;ir)&&(n=r);let i="";for(let o=t;o n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t e.length)throw new RangeError("Index out of range")}function R(e,t,n,r,i){z(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,n}function N(e,t,n,r,i){z(t,r,i,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=a,a>>=8,e[n+2]=a,a>>=8,e[n+1]=a,a>>=8,e[n]=a,n+8}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return t=+t,n>>>=0,o||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,o){return t=+t,n>>>=0,o||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t >>=0,t>>>=0,n||I(e,t,this.length);let r=this[e],i=1,o=0;for(;++o >>=0,t>>>=0,n||I(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=J((function(e){q(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)< >>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)< >>=0,t>>>=0,n||I(e,t,this.length);let r=this[e],i=1,o=0;for(;++o =i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||I(e,t,this.length);let r=t,i=1,o=this[e+--r];for(;r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=J((function(e){q(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)< >>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)< >>=0,t||I(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[t]=255&e;++o >>=0,n>>>=0,!r){L(this,e,t,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=J((function(e){return R(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,e,t,n,r-1,-r)}let i=0,o=1,a=0;for(this[t]=255&e;++i >0)-a&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);L(this,e,t,n,r-1,-r)}let i=n-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=J((function(e){return R(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=J((function(e){return N(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r =this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t >>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(i=t;i =r+4;n-=3)t="_".concat(e.slice(n-3,n)).concat(t);return"".concat(e.slice(0,n)).concat(t)}function z(e,t,n,r,i,o){if(e>n||e 3?0===t||t===BigInt(0)?">= 0".concat(r," and < 2").concat(r," ** ").concat(8*(o+1)).concat(r):">= -(2".concat(r," ** ").concat(8*(o+1)-1).concat(r,") and < 2 ** ")+"".concat(8*(o+1)-1).concat(r):">= ".concat(t).concat(r," and <= ").concat(n).concat(r),new Q.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,i,o)}function q(e,t){if("number"!==typeof e)throw new Q.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,n){if(Math.floor(e)!==e)throw q(e,n),new Q.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new Q.ERR_BUFFER_OUT_OF_BOUNDS;throw new Q.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(t),e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(typeof t)}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,t,n){let r='The value of "'.concat(e,'" is out of range.'),i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=F(String(n)):"bigint"===typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),r+=" It must be ".concat(t,". Received ").concat(i),r}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function G(e,t){let n;t=t||1/0;const r=e.length;let i=null;const o=[];for(let a=0;a 55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function $(e,t,n,r){let i;for(i=0;i =t.length||i>=e.length);++i)t[i+n]=e[i];return i}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!==e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function J(e){return"undefined"===typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},3616:(e,t,n)=>{const r=n(8660);n(5408),n(3304),n(572),n(3092),n(8616),n(9156);const i=n(3024),o=n(6112),a=n(6576);const s={getAttributedEntry:(e,t,n)=>e.replace(/^\s*<[a-z]+/i,"$& data-".concat(t,'="').concat(n,'"')),getPrefixedEntry:(e,t)=>s.getAttributedEntry(e,"csl-entry-id",t),getWrappedEntry(e,t,n){const r=(e,t)=>"function"===typeof t?t(e):null==t?t:"";if(null==n.prepend&&null==n.append)return e;const i=r(t,n.prepend),o=r(t,n.append);let a="",s="";const l=e.match(/^([^>]+>)([\s\S]+)(<[^<]+)$/i);return l&&(a=l[1],e=l[2],s=l[3]),a+i+e+o+s}};function l(e,t){if(!(this instanceof l))return new l(e,t);const n=new r.Cite(e,t);this._options=n._options,this.log=n.log,this.data=n.data}l.prototype=Object.create(r.Cite.prototype),l.async=r.Cite.async,l.validateOptions=r.Cite.validateOptions,l.validateOutputOptions=r.Cite.validateOutputOptions,l.input=r.plugins.input.chain,l.inputAsync=r.plugins.input.chainAsync,l.util=Object.assign({attr:s},r.util),l.version={cite:r.version,citeproc:i.PROCESSOR_VERSION};const c=r.plugins.config.get("@csl");var u,d,p,h,f,m;l.CSL={engine:n(376).ig,item:e=>t=>e.find((e=>e.id===t)),locale:e=>c.styles.get(c.styles.has(e)?e:"en-US"),style:e=>c.templates.get(c.templates.has(e)?e:"apa"),register:{addTemplate:c.templates.add.bind(c.templates),getTemplate:c.templates.get.bind(c.templates),hasTemplate:c.templates.has.bind(c.templates),addLocale:c.locales.add.bind(c.locales),getLocale:c.locales.get.bind(c.locales),hasLocale:c.locales.has.bind(c.locales)}},l.plugins=function e(t){const n={};for(const r in t)n[r]="object"===typeof t[r]?e(t[r]):t[r];return n}(r.plugins),delete l.plugins.input.util.clean,l.parse=Object.assign({input:{chain:r.plugins.input.chain,chainAsync:r.plugins.input.chainAsync,chainLink:r.plugins.input.chainLink,chainLinkAsync:r.plugins.input.chainLinkAsync,data:r.plugins.input.data,dataAsync:r.plugins.input.dataAsync,type:r.plugins.input.type,async:{chain:r.plugins.input.chainAsync,chainLink:r.plugins.input.chainLinkAsync,data:r.plugins.input.dataAsync}},name:o.parse,date:a.parse,csl:r.plugins.input.util.clean,bibjson:n(5408).parsers.json.record,bibtex:(h=n(940).qy,f=n(2892),m=n(9776).target,{json:e=>e.parse([].concat(e)),prop(e,t){const n=f.parse([{type:"book",properties:{[e]:t}}])[0],r=Object.keys(n).find((e=>{let[t]=e;return"type"!==t}));return[r,n[r]]},text:e=>h["@biblatex/text"].parse(e),type:e=>m[e]||"book"}),bibtxt:(p=n(2652),{text:p.parse,textEntry:p.textEntry}),doi:(d=n(3092),{api:d.parsers.api.parse,id:d.parsers.id.parse,async:{api:d.parsers.api.parseAsync}}),json:n(7767).a8.json.parse,wikidata:(u=n(9156),{json:u.parsers.entity.parse,list:u.parsers.id.parse,prop:u.parsers.prop.parse,type:u.parsers.prop.parseType,async:{json:u.parsers.entity.parseAsync,prop(){for(var e=arguments.length,t=new Array(e),n=0;n ({json:e=>t.formatBibtex([e])[0],label(e){let{id:t,"citation-label":r,author:i,issued:o,"year-suffix":a,title:s}=e;return n.LABEL.toSource(t,r,i,o,a,s)},text:(t,n)=>e.bibtex(t,{format:n?"html":"text"}),type:e=>r[e]||"misc"}))(n(3384).c,n(5480),n(448).Converters,n(9776).target),bibtxt:n(2683).format,json:n(6532).c.data,label:n(6532).c.label},l.plugins.output),e.exports=l},6576:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"format",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return r.default}});var r=o(n(1920)),i=o(n(7600));function o(e){return e&&e.__esModule?e:{default:e}}},1920:(e,t)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(l){s=!0,i=l}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n +e<0)))return null;r=+n[0]<0||+n[0]>+n[1]&&+n[1]>0?n.pop():n.shift()}return[n.pop(),r]}return null}(e)||function(e){if("string"!==typeof e)return null;const t=e.match(/^(\d+) ?(a\.?d\.?|b\.?c\.?)$/i);if(t){const e=n(t.slice(1),2);return[e[0]*("a"===e[1].toLowerCase()[0]?1:-1)]}return/^-?\d+$/.test(e)?[e]:null}(e);return t&&t.map((e=>parseInt(e)))}var d=function(e,t){const n=[],r="string"===typeof e&&function(e){return a.test(e)?e.match(a).slice(1,3):e.split(o)}(e);t?n.push(e,t):r&&2===r.length?n.push(...r):n.push(e);const i=n.map(u);return i.filter(Boolean).length===n.length?{"date-parts":i}:{raw:t?n.join("/"):e}};t.default=d},7600:(e,t)=>{"use strict";function n(e,t,n){if(e.length>=t)return e;for(;e.length 1&&void 0!==arguments[1]?arguments[1]:"-";if(!e["date-parts"])return e.raw;const r=e["date-parts"][0].map((e=>e.toString()));switch(r.length){case 3:r[2]=n(r[2],2,"0");case 2:r[1]=n(r[1],2,"0");case 1:r[0]=n(r[0],4,"0")}return r.join(t)};t.default=r},3024:e=>{"use strict";var t={PROCESSOR_VERSION:"1.4.61",error:function(e){throw"undefined"===typeof Error?new Error("citeproc-js error: "+e):"citeproc-js error: "+e},debug:function(e){"undefined"===typeof console?dump("CSL: "+e+"\n"):console.log("citeproc-js warning: "+e)},toLocaleUpperCase(e){var t=this.tmp.lang_array;try{e=e.toLocaleUpperCase(t)}catch(n){e=e.toUpperCase()}return e},toLocaleLowerCase(e){var t=this.tmp.lang_array;try{e=e.toLocaleLowerCase(t)}catch(n){e=e.toLowerCase()}return e},LOCATOR_LABELS_REGEXP:new RegExp("^((vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\\.)\\s+(.*)"),STATUTE_SUBDIV_PLAIN_REGEX:/(?:(?:^| )(?:vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\. *)/,STATUTE_SUBDIV_PLAIN_REGEX_FRONT:/(?:^\s*[.,;]*\s*(?:vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\. *)/,STATUTE_SUBDIV_STRINGS:{"vrs.":"verse","sv.":"sub-verbo","subpara.":"subparagraph","op.":"opus","subch.":"subchapter","add.":"addendum","amend.":"amendment","annot.":"annotation","app.":"appendix","art.":"article","bibliog.":"bibliography","bk.":"book","ch.":"chapter","cl.":"clause","col.":"column","cmt.":"comment","dec.":"decision","dept.":"department","ex.":"example","fig.":"figure","fld.":"field","fol.":"folio","n.":"note","hypo.":"hypothetical","illus.":"illustration","intro.":"introduction","l.":"line","no.":"issue","p.":"page","pp.":"page","para.":"paragraph","pt.":"part","pmbl.":"preamble","princ.":"principle","pub.":"publication","r.":"rule","rn.":"randnummer","sched.":"schedule","sec.":"section","ser.":"series,","subdiv.":"subdivision","subsec.":"subsection","supp.":"supplement","tbl.":"table","tit.":"title","vol.":"volume"},STATUTE_SUBDIV_STRINGS_REVERSE:{verse:"vrs.","sub-verbo":"sv.","sub verbo":"sv.",subparagraph:"subpara.",opus:"op.",subchapter:"subch.",addendum:"add.",amendment:"amend.",annotation:"annot.",appendix:"app.",article:"art.",bibliography:"bibliog.",book:"bk.",chapter:"ch.",clause:"cl.",column:"col.",comment:"cmt.",decision:"dec.",department:"dept.",example:"ex.",figure:"fig.",field:"fld.",folio:"fol.",note:"n.",hypothetical:"hypo.",illustration:"illus.",introduction:"intro.",line:"l.",issue:"no.",page:"p.",paragraph:"para.",part:"pt.",preamble:"pmbl.",principle:"princ.",publication:"pub.",rule:"r.",randnummer:"rn.",schedule:"sched.",section:"sec.","series,":"ser.",subdivision:"subdiv.",subsection:"subsec.",supplement:"supp.",table:"tbl.",title:"tit.",volume:"vol."},LOCATOR_LABELS_MAP:{vrs:"verse",sv:"sub-verbo",subpara:"subparagraph",op:"opus",subch:"subchapter",add:"addendum",amend:"amendment",annot:"annotation",app:"appendix",art:"article",bibliog:"bibliography",bk:"book",ch:"chapter",cl:"clause",col:"column",cmt:"comment",dec:"decision",dept:"department",ex:"example",fig:"figure",fld:"field",fol:"folio",n:"note",hypo:"hypothetical",illus:"illustration",intro:"introduction",l:"line",no:"issue",p:"page",pp:"page",para:"paragraph",pt:"part",pmbl:"preamble",princ:"principle",pub:"publication",r:"rule",rn:"randnummer",sched:"schedule",sec:"section",ser:"series,",subdiv:"subdivision",subsec:"subsection",supp:"supplement",tbl:"table",tit:"title",vol:"volume"},MODULE_MACROS:{"juris-pretitle":!0,"juris-title":!0,"juris-pretitle-short":!0,"juris-title-short":!0,"juris-main":!0,"juris-main-short":!0,"juris-tail":!0,"juris-tail-short":!0,"juris-locator":!0},MODULE_TYPES:{legal_case:!0,legislation:!0,bill:!0,hearing:!0,gazette:!0,report:!0,regulation:!0,standard:!0,patent:!0,locator:!0},checkNestedBrace:function(e){"note"===e.opt.xclass?(this.depth=0,this.update=function(e){for(var t=(e=e||"").split(/([\(\)])/),n=1,r=t.length;n -1;a--)if(e.opt.availableAbbrevDomains[t].indexOf(o[a])>-1){r=o[a];break}if(!r&&i)for(a=i.length-1;a>-1;a--)if(e.opt.availableAbbrevDomains[t].indexOf(i[a])>-1){r=i[a];break}}return r},FIELD_CATEGORY_REMAP:{title:"title","container-title":"container-title","collection-title":"collection-title",country:"place",number:"number",place:"place",archive:"container-title","title-short":"title",genre:"title",event:"title",medium:"title","archive-place":"place","publisher-place":"place","event-place":"place",jurisdiction:"place","language-name":"place","language-name-original":"place","call-number":"number","chapter-number":"number","collection-number":"number",edition:"number",page:"number",issue:"number",locator:"number","locator-extra":"number","number-of-pages":"number","number-of-volumes":"number",volume:"number","citation-number":"number",publisher:"institution-part"},parseLocator:function(e){if(this.opt.development_extensions.locator_date_and_revision&&e.locator){e.locator=""+e.locator;var t=e.locator.indexOf("|");if(t>-1){var n=e.locator;e.locator=n.slice(0,t);var r=(n=n.slice(t+1)).match(/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*/);r&&(e["locator-date"]=this.fun.dateparser.parseDateToObject(r[1]),n=n.slice(r[1].length)),e["locator-extra"]=n.replace(/^\s+/,"").replace(/\s+$/,"")}}return e.locator&&(e.locator=(""+e.locator).replace(/\s+$/,"")),e},normalizeLocaleStr:function(e){if(e){var t=e.split("-");return t[0]=t[0].toLowerCase(),t[1]&&(t[1]=t[1].toUpperCase()),t.join("-")}},parseNoteFieldHacks:function(e,n,r){if("string"===typeof e.note){for(var i=[],o=e.note.split("\n"),a=0,s=o.length;a 0||u>1)||i[u-1].match(t.NOTE_FIELD_REGEXP));u+=2)i[u]="\n"+i[u].slice(2,-1).trim()+"\n";o[a]=i.join("")}}var p=0,h={};for(a=0,s=(o=o.join("\n").split("\n")).length;a-1)e[g]&&!r||(e[g]=t.DateParser.parseDateToArray(v),(!n||n[g]&&this.isDateString(v))&&(o[a]=""));else if(!e[g]){if(t.NAME_VARIABLES.indexOf(g.replace(/^alt-/,""))>-1){h[g]||(h[g]=[]);var b=v.split(/\s*\|\|\s*/);if(1===b.length)h[g].push({literal:b[0]});else if(2===b.length){var y={family:b[0],given:b[1]};t.parseParticles(y),h[g].push(y)}}else e[g]=v;n&&!n[g]||(o[a]="")}}}for(var g in h)e[g]=h[g];if(n){o[p].trim()&&(o[p]="\n"+o[p]);for(a=p-1;a>-1;a--)o[a].trim()||(o=o.slice(0,a).concat(o.slice(a+1)))}e.note=o.join("\n").trim()}},checkPrefixSpaceAppend:function(e,n){n||(n="");var r="",i=n.replace(/<[^>]+>/g,"").replace(/["'\u201d\u2019\u00bb\u202f\u00a0 ]+$/g,""),o=i.slice(-1);return(i.match(t.ENDSWITH_ROMANESQUE_REGEXP)||t.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(o)>-1||o.match(/[\)\],0-9]/))&&(r=" "),n=(n+r).replace(/\s+/g," ")},checkIgnorePredecessor:function(e,n){var r=n.replace(/<[^>]+>/g,"").replace(/["'\u201d\u2019\u00bb\u202f\u00a0 ]+$/g,"").slice(-1);return t.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(r)>-1&&n.trim().indexOf(" ")>-1&&(e.tmp.term_predecessor=!1,!0)},checkSuffixSpacePrepend:function(e,n){return n?((n.match(t.STARTSWITH_ROMANESQUE_REGEXP)||["[","("].indexOf(n.slice(0,1))>-1)&&(n=" "+n),n):""},GENDERS:["masculine","feminine"],ERROR_NO_RENDERED_FORM:1,PREVIEW:"Just for laughs.",ASSUME_ALL_ITEMS_REGISTERED:2,START:0,END:1,SINGLETON:2,SEEN:6,SUCCESSOR:3,SUCCESSOR_OF_SUCCESSOR:4,SUPPRESS:5,SINGULAR:0,PLURAL:1,LITERAL:!0,BEFORE:1,AFTER:2,DESCENDING:1,ASCENDING:2,PRIMARY:1,SECONDARY:2,POSITION_FIRST:0,POSITION_SUBSEQUENT:1,POSITION_IBID:2,POSITION_IBID_WITH_LOCATOR:3,POSITION_CONTAINER_SUBSEQUENT:4,POSITION_MAP:{0:0,4:1,1:2,2:3,3:4},POSITION_TEST_VARS:["position","first-reference-note-number","near-note"],AREAS:["citation","citation_sort","bibliography","bibliography_sort","intext"],CITE_FIELDS:["first-reference-note-number","first-container-reference-note-number","locator","locator-extra"],SWAPPING_PUNCTUATION:[".","!","?",":",","],TERMINAL_PUNCTUATION:[":",".",";","!","?"," "],NONE:0,NUMERIC:1,POSITION:2,TRIGRAPH:3,DATE_PARTS:["year","month","day"],DATE_PARTS_ALL:["year","month","day","season"],DATE_PARTS_INTERNAL:["year","month","day","year_end","month_end","day_end"],NAME_PARTS:["non-dropping-particle","family","given","dropping-particle","suffix","literal"],DISAMBIGUATE_OPTIONS:["disambiguate-add-names","disambiguate-add-givenname","disambiguate-add-year-suffix"],GIVENNAME_DISAMBIGUATION_RULES:["all-names","all-names-with-initials","primary-name","primary-name-with-initials","by-cite"],NAME_ATTRIBUTES:["and","delimiter-precedes-last","delimiter-precedes-et-al","initialize-with","initialize","name-as-sort-order","sort-separator","et-al-min","et-al-use-first","et-al-subsequent-min","et-al-subsequent-use-first","form","prefix","suffix","delimiter"],LOOSE:0,STRICT:1,TOLERANT:2,PREFIX_PUNCTUATION:/[.;:]\s*$/,SUFFIX_PUNCTUATION:/^\s*[.;:,\(\)]/,NUMBER_REGEXP:/(?:^\d+|\d+$)/,NAME_INITIAL_REGEXP:/^([A-Z\u0e01-\u0e5b\u00c0-\u017f\u0400-\u042f\u0590-\u05d4\u05d6-\u05ff\u0600-\u06ff\u0370\u0372\u0376\u0386\u0388-\u03ab\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03fd-\u03ff])([a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0400-\u052f\u0600-\u06ff\u0370-\u03ff\u1f00-\u1fff]*|)(\.)*/,ROMANESQUE_REGEXP:/[-0-9a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/,ROMANESQUE_NOT_REGEXP:/[^a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/g,STARTSWITH_ROMANESQUE_REGEXP:/^[&a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/,ENDSWITH_ROMANESQUE_REGEXP:/[.;:&a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]$/,ALL_ROMANESQUE_REGEXP:/^[a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]+$/,VIETNAMESE_SPECIALS:/[\u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]/,VIETNAMESE_NAMES:/^(?:(?:[.AaBbCcDdEeGgHhIiKkLlMmNnOoPpQqRrSsTtUuVvXxYy \u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]{2,6})(\s+|$))+$/,NOTE_FIELDS_REGEXP:/\{:(?:[\-_a-z]+|[A-Z]+):[^\}]+\}/g,NOTE_FIELD_REGEXP:/^([\-_a-z]+|[A-Z]+):\s*([^\}]+)$/,PARTICLE_GIVEN_REGEXP:/^([^ ]+(?:\u02bb |\u2019 | |\' ) *)(.+)$/,PARTICLE_FAMILY_REGEXP:/^([^ ]+(?:\-|\u02bb|\u2019| |\') *)(.+)$/,DISPLAY_CLASSES:["block","left-margin","right-inline","indent"],NAME_VARIABLES:["author","chair","collection-editor","compiler","composer","container-author","contributor","curator","director","editor","editor-translator","editorial-director","executive-producer","guest","host","illustrator","interviewer","narrator","organizer","original-author","performer","producer","recipient","reviewed-author","script-writer","series-creator","translator","commenter"],CREATORS:["author","chair","collection-editor","compiler","composer","container-author","contributor","curator","director","editor","editor-translator","editorial-director","executive-producer","guest","host","illustrator","interviewer","narrator","organizer","original-author","performer","producer","recipient","reviewed-author","script-writer","series-creator","translator","commenter"],NUMERIC_VARIABLES:["call-number","chapter-number","collection-number","division","edition","page","issue","locator","locator-extra","number","number-of-pages","number-of-volumes","part-number","printing-number","section","supplement-number","version","volume","supplement","citation-number"],DATE_VARIABLES:["locator-date","issued","event-date","accessed","original-date","publication-date","available-date","submitted","alt-issued","alt-event"],VARIABLES_WITH_SHORT_FORM:["title","container-title"],TITLE_FIELD_SPLITS:function(e){for(var t=["title","short","main","sub","subjoin"],n={},r=0,i=t.length;r-1&&r.indexOf(t[o].toLowerCase())>-1;o+=-1)i.push(t.pop());t.reverse();var a=t.join(" "),s=i.join(" ");"drop"!==n&&s?"demote"===n&&(t=[a,s].join(", ")):t=a}return t},extractTitleAndSubtitle:function(e,n){var r=n?"\u202f":"",i=[""];this.opt.development_extensions.split_container_title&&i.push("container-");for(var o=0,a=i.length;o-1&&(h[l.subjoin]=r+": "),(h[l.subjoin].indexOf("-")>-1||h[l.subjoin].indexOf("\u2014")>-1)&&(h[l.subjoin]="\u2014")),u)for(var _ in h)e.multi._keys[_]||(e.multi._keys[_]={}),e.multi._keys[_][u]=h[_];else for(var _ in h)e[_]=h[_]}}},titlecaseSentenceOrNormal:function(e,n,r,i,o){var a=t.TITLE_FIELD_SPLITS(r),s={};if(i&&n.multi?(n.multi._keys[a.title]&&(s[a.title]=n.multi._keys[a.title][i]),n.multi._keys[a.main]&&(s[a.main]=n.multi._keys[a.main][i]),n.multi._keys[a.sub]&&(s[a.sub]=n.multi._keys[a.sub][i]),n.multi._keys[a.subjoin]&&(s[a.subjoin]=n.multi._keys[a.subjoin][i])):(s[a.title]=n[a.title],s[a.main]=n[a.main],s[a.sub]=n[a.sub],s[a.subjoin]=n[a.subjoin]),s[a.main]&&s[a.sub]){var l=s[a.main],c=s[a.subjoin],u=s[a.sub];return o?(l=t.Output.Formatters.sentence(e,l),u=t.Output.Formatters.sentence(e,u)):e.opt.development_extensions.uppercase_subtitles&&(u=t.Output.Formatters["capitalize-first"](e,u)),[l,c,u].join("")}if(s[a.title]){if(o)return t.Output.Formatters.sentence(e,s[a.title]);if(e.opt.development_extensions.uppercase_subtitles){for(var d=t.TITLE_SPLIT(s[a.title]),p=0,h=d.length;p-1||d[p].indexOf("\u2014")>-1)&&(d[p]="\u2014")}return s[a.title]=d.join(""),s[a.title]}return s[a.title]}return""},getSafeEscape:function(e){if(["bibliography","citation"].indexOf(e.tmp.area)>-1){var n=[];return e.opt.development_extensions.thin_non_breaking_space_html_hack&&"html"===e.opt.mode&&n.push((function(e){return e.replace(/\u202f/g,' ')})),n.length?function(r){for(var i=0,o=n.length;i "@vertical-align"===e[0])).length>0||r&&r.strings.suffix?e.tmp.just_did_number=!1:t&&(t.match(/[0-9]$/)?e.tmp.just_did_number=!0:e.tmp.just_did_number=!1)}},EVALUATE_GROUP_CONDITION:function(e,n){if(e.opt.use_context_condition){var r,i="comma-safe-numbers-only"===n.condition.test;if("empty-label"===n.condition.test)r=!n.condition.termtxt;else if("empty-label-no-decor"===n.condition.test)r=!n.condition.termtxt||n.condition.termtxt.indexOf("%s")>-1;else if(["comma-safe","comma-safe-numbers-only"].indexOf(n.condition.test)>-1){var o=n.condition.termtxt,a=!1;n.condition.termtxt&&(a=n.condition.termtxt.slice(0,1).match(t.ALL_ROMANESQUE_REGEXP)),r=e.tmp.just_did_number?n.condition.valueTerm?!i:!o||(a?!i:["always","after-number"].indexOf(e.opt.require_comma_on_symbol)>-1):!n.condition.valueTerm&&(!!o&&(a?!i:"always"===e.opt.require_comma_on_symbol))}if(r)var s=!1;else s=!0;return n.condition.not&&(s=!s),s}},SYS_OPTIONS:["prioritize_disambiguate_condition","csl_reverse_lookup_support","main_title_from_short_title","uppercase_subtitles","force_short_title_casing_alignment","implicit_short_title","split_container_title"],TITLE_SPLIT_REGEXP:function(){var e=["\\.\\s+","\\!\\s+","\\?\\s+","\\s*::*\\s+","\\s*\u2014\\s*","\\s+\\-\\s+","\\s*\\-\\-\\-*\\s*"];return{match:new RegExp("("+e.join("|")+")","g"),matchfirst:new RegExp("^("+e.join("|")+")"),split:new RegExp("(?:"+e.join("|")+")")}}(),TITLE_SPLIT:function(e){if(!e)return e;for(var n=e.match(t.TITLE_SPLIT_REGEXP.match),r=e.split(t.TITLE_SPLIT_REGEXP.split),i=r.length-2;i>-1;i--)r[i]=r[i].trim(),r[i]&&r[i].slice(-1).toLowerCase()!==r[i].slice(-1)?(r[i]=r[i]+n[i]+r[i+1],r=r.slice(0,i+1).concat(r.slice(i+2))):r=r.slice(0,i+1).concat([n[i]]).concat(r.slice(i+1));return r},GET_COURT_CLASS:function(e,t,n){var r="",i=null,o=t.jurisdiction?t.jurisdiction.split(":")[0]:null,a="court_condition_classes";return n&&(a="court_key_classes"),o&&t.authority&&("string"===typeof t.authority?i=t.authority:t.authority[0]&&t.authority[0].literal&&(i=t.authority[0].literal)),i&&(this.lang&&e.locale[this.lang].opts[a]&&e.locale[this.lang].opts[a][o]&&e.locale[this.lang].opts[a][o][i]?r=e.locale[this.lang].opts[a][o][i]:e.locale[e.opt["default-locale"][0]].opts[a]&&e.locale[e.opt["default-locale"][0]].opts[a][o]&&e.locale[e.opt["default-locale"][0]].opts[a][o][i]&&(r=e.locale[e.opt["default-locale"][0]].opts[a][o][i])),r},SET_COURT_CLASSES:function(e,t,n,r){for(var i=n.getNodesByName(r,"court-class"),o=0,a=n.numberofnodes(i);o-1)||e.children[r].attrs.prefix||e.children[r].attrs.suffix){t=!1;break}n=n.slice(0,o).concat(n.slice(o+1))}t&&!n.length&&(e.attrs["has-publisher-and-publisher-place"]=!0)}for(r=0,i=e.children.length;r0){var t=e.slice();return"substitute"===t.pop()||this.isChildOfSubstitute(t)}return!1},t.XmlJSON.prototype.addMissingNameNodes=function(e,t){if(t||(t=[]),"names"===e.name&&!this.isChildOfSubstitute(t)){for(var n=!0,r=0,i=e.children.length;r-1){var c=this.nodeCopy(this.institution);for(i=0,o=t.INSTITUTION_KEYS.length;i /,"")).replace(//g,"")).replace(/^\s+/g,"")).replace(/\s+$/g,""):e},t.parseXml=function(e){var t={children:[]},n=[t.children];function r(e){return e.split("&").join("&").split(""").join('"').split(">").join(">").split("<").join("<").replace(/([0-9]{1,6});/gi,(function(e,t){var n=parseInt(t,10);return String.fromCharCode(n)})).replace(/([a-f0-9]{1,6});/gi,(function(e,t){var n=parseInt(t,16);return String.fromCharCode(n)}))}function i(e,t){var n=RegExp("^.*[\t ]+"+t+"=(\"(?:[^\"]*)\"|'(?:[^']*)').*$"),r=e.match(n);return r?r[1].slice(1,-1):null}function o(e){var t=RegExp("^<([^\t />]+)"),n=e.match(t);return n?n[1]:null}function a(e){var t={};t.name=o(e),t.attrs={};var n=function(e){var t=e.match(/([^\'\"=\x09 ]+)=(?:\"[^\"]*\"|\'[^\']*\')/g);if(t)for(var n=0,r=t.length;n ([^<]*)<.*$/)[1])}function l(e){n.slice(-1)[0].push(e)}function c(e){var t;e.slice(1).indexOf("<")>-1?((t=a(e.slice(0,e.indexOf(">")+1))).children=[s(e)],l(t)):"/>"===e.slice(-2)?(t=a(e),"term"===o(e)&&t.children.push(""),l(t)):""===e.slice(0,2)?n.pop():(l(t=a(e)),function(e){n.push(e.children)}(t))}for(var u=function(e){for(var t=(e=e.split(/(?:\r\n|\n|\r)/).join(" ").replace(/>[\x09 ]+<").replace(/<\!--.*?-->/g,"")).split("><"),n=null,r=0,i=t.length;r0&&(t[r]="<"+t[r]),r "),"number"!=typeof n&&("","vancouver":"","harvard1":""}')}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.p="/metadata-entry-form/",(()=>{"use strict";var e={};n.r(e),n.d(e,{Express:()=>Ze,Mongo:()=>tt.g,Mysql:()=>et.W,Postgres:()=>Xe.a});var t={};n.r(t),n.d(t,{hasBrowserEnv:()=>lM,hasStandardBrowserEnv:()=>cM,hasStandardBrowserWebWorkerEnv:()=>dM});var r,i=n(1468),o=n(4840),a=n(8992),s=n(3104),l=n(9112),c=n(1276),u=n(4156),d=n(8776),p=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],h=function(){function e(t){void 0===t&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){(0,s.e)((function(t){var n=(0,l.WS)();if(!n)return t;var r=n.getIntegration(e);if(r){var i=n.getClient(),o=i?i.getOptions():{},a=r._mergeOptions(o);if(r._shouldDropEvent(t,a))return null}return t}))},e.prototype._shouldDropEvent=function(e,t){return this._isSentryError(e,t)?(c.Q.warn("Event dropped due to being internal Sentry Error.\nEvent: "+(0,u.y_)(e)),!0):this._isIgnoredError(e,t)?(c.Q.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+(0,u.y_)(e)),!0):this._isDeniedUrl(e,t)?(c.Q.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+(0,u.y_)(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0):!this._isAllowedUrl(e,t)&&(c.Q.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+(0,u.y_)(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0)},e.prototype._isSentryError=function(e,t){if(!t.ignoreInternal)return!1;try{return e&&e.exception&&e.exception.values&&e.exception.values[0]&&"SentryError"===e.exception.values[0].type||!1}catch(n){return!1}},e.prototype._isIgnoredError=function(e,t){return!(!t.ignoreErrors||!t.ignoreErrors.length)&&this._getPossibleEventMessages(e).some((function(e){return t.ignoreErrors.some((function(t){return(0,d.AU)(e,t)}))}))},e.prototype._isDeniedUrl=function(e,t){if(!t.denyUrls||!t.denyUrls.length)return!1;var n=this._getEventFilterUrl(e);return!!n&&t.denyUrls.some((function(e){return(0,d.AU)(n,e)}))},e.prototype._isAllowedUrl=function(e,t){if(!t.allowUrls||!t.allowUrls.length)return!0;var n=this._getEventFilterUrl(e);return!n||t.allowUrls.some((function(e){return(0,d.AU)(n,e)}))},e.prototype._mergeOptions=function(e){return void 0===e&&(e={}),{allowUrls:(0,a.KQ)(this._options.whitelistUrls||[],this._options.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:(0,a.KQ)(this._options.blacklistUrls||[],this._options.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:(0,a.KQ)(this._options.ignoreErrors||[],e.ignoreErrors||[],p),ignoreInternal:"undefined"===typeof this._options.ignoreInternal||this._options.ignoreInternal}},e.prototype._getPossibleEventMessages=function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,i=t.value,o=void 0===i?"":i;return[""+o,r+": "+o]}catch(a){return c.Q.error("Cannot extract message for event "+(0,u.y_)(e)),[]}return[]},e.prototype._getEventFilterUrl=function(e){try{if(e.stacktrace){var t=e.stacktrace.frames;return t&&t[t.length-1].filename||null}if(e.exception){var n=e.exception.values&&e.exception.values[0].stacktrace&&e.exception.values[0].stacktrace.frames;return n&&n[n.length-1].filename||null}return null}catch(r){return c.Q.error("Cannot extract url for event "+(0,u.y_)(e)),null}},e.id="InboundFilters",e}(),f=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){r=Function.prototype.toString,Function.prototype.toString=function(){for(var e=[],t=0;t 1&&(d=h.slice(0,-1).join("/"),p=h.pop()),p){var f=p.match(/^\d+/);f&&(p=f[0])}this._fromComponents({host:l,pass:s,path:d,projectId:p,port:u,protocol:r,user:i})},e.prototype._fromComponents=function(e){this.protocol=e.protocol,this.user=e.user,this.pass=e.pass||"",this.host=e.host,this.port=e.port||"",this.path=e.path||"",this.projectId=e.projectId},e.prototype._validate=function(){var e=this;if(["protocol","user","host","projectId"].forEach((function(t){if(!e[t])throw new v(y+": "+t+" missing")})),!this.projectId.match(/^\d+$/))throw new v(y+": Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new v(y+": Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new v(y+": Invalid port "+this.port)},e}(),x=n(5336),w=n(5044),E=n(4184),T=n(5980),C=[];function k(e){var t={};return function(e){var t=e.defaultIntegrations&&(0,a.KQ)(e.defaultIntegrations)||[],n=e.integrations,r=[];if(Array.isArray(n)){var i=n.map((function(e){return e.name})),o=[];t.forEach((function(e){-1===i.indexOf(e.name)&&-1===o.indexOf(e.name)&&(r.push(e),o.push(e.name))})),n.forEach((function(e){-1===o.indexOf(e.name)&&(r.push(e),o.push(e.name))}))}else"function"===typeof n?(r=n(t),r=Array.isArray(r)?r:[r]):r=(0,a.KQ)(t);var s=r.map((function(e){return e.name})),l="Debug";return-1!==s.indexOf(l)&&r.push.apply(r,(0,a.KQ)(r.splice(s.indexOf(l),1))),r}(e).forEach((function(e){t[e.name]=e,function(e){-1===C.indexOf(e.name)&&(e.setupOnce(s.e,l.WS),C.push(e.name),c.Q.log("Integration installed: "+e.name))}(e)})),t}var S,O=function(){function e(e,t){this._integrations={},this._processing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=new _(t.dsn))}return e.prototype.captureException=function(e,t,n){var r=this,i=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){i=e}))),i},e.prototype.captureMessage=function(e,t,n,r){var i=this,o=n&&n.event_id,a=(0,x.od)(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(a.then((function(e){return i._captureEvent(e,n,r)})).then((function(e){o=e}))),o},e.prototype.captureEvent=function(e,t,n){var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r},e.prototype.captureSession=function(e){e.release?this._sendSession(e):c.Q.warn("Discarded session because of missing release")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.flush=function(e){var t=this;return this._isClientProcessing(e).then((function(n){return t._getBackend().getTransport().close(e).then((function(e){return n&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&(this._integrations=k(this._options))},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){return c.Q.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var n,r,i,o=!1,s=!1,l=t.exception&&t.exception.values;if(l){s=!0;try{for(var c=(0,a.gR)(l),u=c.next();!u.done;u=c.next()){var d=u.value.mechanism;if(d&&!1===d.handled){o=!0;break}}}catch(g){n={error:g}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}var p=t.user;if(!e.userAgent){var h=t.request?t.request.headers:{};for(var f in h)if("user-agent"===f.toLowerCase()){i=h[f];break}}e.update((0,a.C3)((0,a.C3)({},o&&{status:m.G.Crashed}),{user:p,userAgent:i,errors:e.errors+Number(s||o)}))},e.prototype._sendSession=function(e){this._getBackend().sendSession(e)},e.prototype._isClientProcessing=function(e){var t=this;return new w.G((function(n){var r=0,i=setInterval((function(){0==t._processing?(clearInterval(i),n(!0)):(r+=1,e&&r>=e&&(clearInterval(i),n(!1)))}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},e.prototype._prepareEvent=function(e,t,n){var r=this,i=this.getOptions().normalizeDepth,o=void 0===i?3:i,l=(0,a.C3)((0,a.C3)({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:(0,u.OW)()),timestamp:e.timestamp||(0,E.CG)()});this._applyClientOptions(l),this._applyIntegrationsMetadata(l);var c=t;n&&n.captureContext&&(c=s.k.clone(c).update(n.captureContext));var d=w.G.resolve(l);return c&&(d=c.applyToEvent(l,n)),d.then((function(e){return"number"===typeof o&&o>0?r._normalizeEvent(e,o):e}))},e.prototype._normalizeEvent=function(e,t){if(!e)return null;var n=(0,a.C3)((0,a.C3)((0,a.C3)((0,a.C3)((0,a.C3)({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return(0,a.C3)((0,a.C3)({},e),e.data&&{data:(0,T.Cs)(e.data,t)})}))}),e.user&&{user:(0,T.Cs)(e.user,t)}),e.contexts&&{contexts:(0,T.Cs)(e.contexts,t)}),e.extra&&{extra:(0,T.Cs)(e.extra,t)});return e.contexts&&e.contexts.trace&&(n.contexts.trace=e.contexts.trace),n},e.prototype._applyClientOptions=function(e){var t=this.getOptions(),n=t.environment,r=t.release,i=t.dist,o=t.maxValueLength,a=void 0===o?250:o;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=(0,d.E3)(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=(0,d.E3)(s.value,a));var l=e.request;l&&l.url&&(l.url=(0,d.E3)(l.url,a))},e.prototype._applyIntegrationsMetadata=function(e){var t=e.sdk,n=Object.keys(this._integrations);t&&n.length>0&&(t.integrations=n)},e.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},e.prototype._captureEvent=function(e,t,n){return this._processEvent(e,t,n).then((function(e){return e.event_id}),(function(e){c.Q.error(e)}))},e.prototype._processEvent=function(e,t,n){var r=this,i=this.getOptions(),o=i.beforeSend,a=i.sampleRate;if(!this._isEnabled())return w.G.reject(new v("SDK not enabled, will not send event."));var s="transaction"===e.type;return!s&&"number"===typeof a&&Math.random()>a?w.G.reject(new v("Discarding event because it's not included in the random sample (sampling rate = "+a+")")):this._prepareEvent(e,n,t).then((function(e){if(null===e)throw new v("An event processor returned null, will not send event.");if(t&&t.data&&!0===t.data.__sentry__||s||!o)return e;var n=o(e,t);if("undefined"===typeof n)throw new v("`beforeSend` method has to return `null` or a valid event.");return(0,x.Oe)(n)?n.then((function(e){return e}),(function(e){throw new v("beforeSend rejected with "+e)})):n})).then((function(e){if(null===e)throw new v("`beforeSend` returned `null`, will not send event.");var t=n&&n.getSession&&n.getSession();return!s&&t&&r._updateSessionFromEvent(t,e),r._sendEvent(e),e})).then(null,(function(e){if(e instanceof v)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new v("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._processing+=1,e.then((function(e){return t._processing-=1,e}),(function(e){return t._processing-=1,e}))},e}();!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.Invalid="invalid",e.Failed="failed"}(S||(S={})),function(e){e.fromHttpCode=function(t){return t>=200&&t<300?e.Success:429===t?e.RateLimit:t>=400&&t<500?e.Invalid:t>=500?e.Failed:e.Unknown}}(S||(S={}));var A,j=function(){function e(){}return e.prototype.sendEvent=function(e){return w.G.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:S.Skipped})},e.prototype.close=function(e){return w.G.resolve(!0)},e}(),P=function(){function e(e){this._options=e,this._options.dsn||c.Q.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(e,t){throw new v("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){throw new v("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){this._transport.sendEvent(e).then(null,(function(e){c.Q.error("Error while sending event: "+e)}))},e.prototype.sendSession=function(e){this._transport.sendSession?this._transport.sendSession(e).then(null,(function(e){c.Q.error("Error while sending session: "+e)})):c.Q.warn("Dropping session because custom transport doesn't implement sendSession")},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new j},e}();!function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(A||(A={})),function(e){e.fromString=function(t){switch(t){case"debug":return e.Debug;case"info":return e.Info;case"warn":case"warning":return e.Warning;case"error":return e.Error;case"fatal":return e.Fatal;case"critical":return e.Critical;default:return e.Log}}}(A||(A={}));var I=n(648),L="?",R=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack| |[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,N=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,D=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,M=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,B=/\((\S*)(?::(\d+))(?::(\d+))\)/,Q=/Minified React error #\d+;/i;function U(e){var t=null,n=0;e&&("number"===typeof e.framesToPop?n=e.framesToPop:Q.test(e.message)&&(n=1));try{if(t=function(e){if(!e||!e.stacktrace)return null;for(var t,n=e.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?: ]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,o=n.split("\n"),a=[],s=0;s eval")>-1&&(t=M.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=t[1],n[4]=t[2],n[5]=""):0!==a||n[5]||void 0===e.columnNumber||(i[0].column=e.columnNumber+1),r={url:n[3],func:n[1]||L,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=L),i.push(r)}if(!i.length)return null;return{message:z(e),name:e.name,stack:i}}(e),t)return F(t,n)}catch(r){}return{message:z(e),name:e&&e.name,stack:[],failed:!0}}function F(e,t){try{return(0,a.C3)((0,a.C3)({},e),{stack:e.stack.slice(t)})}catch(n){return e}}function z(e){var t=e&&e.message;return t?t.error&&"string"===typeof t.error.message?t.error.message:t:"No error message"}var q=50;function H(e){var t=G(e.stack),n={type:e.name,value:e.message};return t&&t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function W(e){return{exception:{values:[H(e)]}}}function G(e){if(!e||!e.length)return[];var t=e,n=t[0].func||"",r=t[t.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,q).map((function(e){return{colno:null===e.column?void 0:e.column,filename:e.url||t[0].url,function:e.func||"?",in_app:!0,lineno:null===e.line?void 0:e.line}})).reverse()}function V(e,t,n){var r;if(void 0===n&&(n={}),(0,x.cz)(e)&&e.error)return r=W(U(e=e.error));if((0,x.Sc)(e)||(0,x.Qn)(e)){var i=e,o=i.name||((0,x.Sc)(i)?"DOMError":"DOMException"),s=i.message?o+": "+i.message:o;return r=$(s,t,n),(0,u.NP)(r,s),"code"in i&&(r.tags=(0,a.C3)((0,a.C3)({},r.tags),{"DOMException.code":""+i.code})),r}return(0,x.eU)(e)?r=W(U(e)):(0,x.oF)(e)||(0,x.SO)(e)?(r=function(e,t,n){var r={exception:{values:[{type:(0,x.SO)(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+(0,T.yq)(e)}]},extra:{__serialized__:(0,T.yY)(e)}};if(t){var i=G(U(t).stack);r.stacktrace={frames:i}}return r}(e,t,n.rejection),(0,u.qW)(r,{synthetic:!0}),r):(r=$(e,t,n),(0,u.NP)(r,""+e,void 0),(0,u.qW)(r,{synthetic:!0}),r)}function $(e,t,n){void 0===n&&(n={});var r={message:e};if(n.attachStacktrace&&t){var i=G(U(t).stack);r.stacktrace={frames:i}}return r}function K(e,t){return{body:JSON.stringify({sent_at:(new Date).toISOString()})+"\n"+JSON.stringify({type:"session"})+"\n"+JSON.stringify(e),type:"session",url:t.getEnvelopeEndpointWithUrlEncodedAuth()}}function Y(e,t){var n=e.tags||{},r=n.__sentry_samplingMethod,i=n.__sentry_sampleRate,o=(0,a.sX)(n,["__sentry_samplingMethod","__sentry_sampleRate"]);e.tags=o;var s="transaction"===e.type,l={body:JSON.stringify(e),type:e.type||"event",url:s?t.getEnvelopeEndpointWithUrlEncodedAuth():t.getStoreEndpointWithUrlEncodedAuth()};if(s){var c=JSON.stringify({event_id:e.event_id,sent_at:(new Date).toISOString()})+"\n"+JSON.stringify({type:e.type,sample_rates:[{id:r,rate:i}]})+"\n"+l.body;l.body=c}return l}var Z=function(){function e(e){this.dsn=e,this._dsnObject=new _(e)}return e.prototype.getDsn=function(){return this._dsnObject},e.prototype.getBaseApiEndpoint=function(){var e=this._dsnObject,t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return t+"//"+e.host+n+(e.path?"/"+e.path:"")+"/api/"},e.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},e.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},e.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},e.prototype.getStoreEndpointPath=function(){var e=this._dsnObject;return(e.path?"/"+e.path:"")+"/api/"+e.projectId+"/store/"},e.prototype.getRequestHeaders=function(e,t){var n=this._dsnObject,r=["Sentry sentry_version=7"];return r.push("sentry_client="+e+"/"+t),r.push("sentry_key="+n.user),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},e.prototype.getReportDialogEndpoint=function(e){void 0===e&&(e={});var t=this._dsnObject,n=this.getBaseApiEndpoint()+"embed/error-page/",r=[];for(var i in r.push("dsn="+t.toString()),e)if("dsn"!==i)if("user"===i){if(!e.user)continue;e.user.name&&r.push("name="+encodeURIComponent(e.user.name)),e.user.email&&r.push("email="+encodeURIComponent(e.user.email))}else r.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r.length?n+"?"+r.join("&"):n},e.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},e.prototype._getIngestEndpoint=function(e){return""+this.getBaseApiEndpoint()+this._dsnObject.projectId+"/"+e+"/"},e.prototype._encodedAuth=function(){var e={sentry_key:this._dsnObject.user,sentry_version:"7"};return(0,T.OW)(e)},e}(),J=function(){function e(e){this._limit=e,this._buffer=[]}return e.prototype.isReady=function(){return void 0===this._limit||this.length() 0&&n(!1)}),e);w.G.all(t._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},e}(),X=function(){function e(e){this.options=e,this._buffer=new J(30),this._rateLimits={},this._api=new Z(this.options.dsn),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return e.prototype.sendEvent=function(e){throw new v("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype._handleResponse=function(e){var t=e.requestType,n=e.response,r=e.headers,i=e.resolve,o=e.reject,a=S.fromHttpCode(n.status);this._handleRateLimit(r)&&c.Q.warn("Too many requests, backing off until: "+this._disabledUntil(t)),a!==S.Success?o(n):i({status:a})},e.prototype._disabledUntil=function(e){return this._rateLimits[e]||this._rateLimits.all},e.prototype._isRateLimited=function(e){return this._disabledUntil(e)>new Date(Date.now())},e.prototype._handleRateLimit=function(e){var t,n,r,i,o=Date.now(),s=e["x-sentry-rate-limits"],l=e["retry-after"];if(s){try{for(var c=(0,a.gR)(s.trim().split(",")),d=c.next();!d.done;d=c.next()){var p=d.value.split(":",2),h=parseInt(p[0],10),f=1e3*(isNaN(h)?60:h);try{for(var m=(r=void 0,(0,a.gR)(p[1].split(";"))),g=m.next();!g.done;g=m.next()){var v=g.value;this._rateLimits[v||"all"]=new Date(o+f)}}catch(b){r={error:b}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}}catch(y){t={error:y}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return!0}return!!l&&(this._rateLimits.all=new Date(o+(0,u.Mt)(o,l)),!0)},e}(),ee=(0,u.mm)(),te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,a.ct)(t,e),t.prototype.sendEvent=function(e){return this._sendRequest(Y(e,this._api),e)},t.prototype.sendSession=function(e){return this._sendRequest(K(e,this._api),e)},t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return Promise.reject({event:t,type:e.type,reason:"Transport locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:(0,I.K4)()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add(new w.G((function(t,i){ee.fetch(e.url,r).then((function(r){var o={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:o,resolve:t,reject:i})})).catch(i)})))},t}(X),ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,a.ct)(t,e),t.prototype.sendEvent=function(e){return this._sendRequest(Y(e,this._api),e)},t.prototype.sendSession=function(e){return this._sendRequest(K(e,this._api),e)},t.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?Promise.reject({event:t,type:e.type,reason:"Transport locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429}):this._buffer.add(new w.G((function(t,r){var i=new XMLHttpRequest;for(var o in i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};n._handleResponse({requestType:e.type,response:i,headers:o,resolve:t,reject:r})}},i.open("POST",e.url),n.options.headers)n.options.headers.hasOwnProperty(o)&&i.setRequestHeader(o,n.options.headers[o]);i.send(e.body)})))},t}(X),re=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,a.ct)(t,e),t.prototype.eventFromException=function(e,t){return function(e,t,n){var r=V(t,n&&n.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return(0,u.qW)(r,{handled:!0,type:"generic"}),r.level=A.Error,n&&n.event_id&&(r.event_id=n.event_id),w.G.resolve(r)}(this._options,e,t)},t.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=A.Info),function(e,t,n,r){void 0===n&&(n=A.Info);var i=$(t,r&&r.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),w.G.resolve(i)}(this._options,e,t,n)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=(0,a.C3)((0,a.C3)({},this._options.transportOptions),{dsn:this._options.dsn});return this._options.transport?new this._options.transport(t):(0,I.Gk)()?new te(t):new ne(t)},t}(P);function ie(e){for(var t=[],n=1;n 0}function le(e,t,n){if(void 0===t&&(t={}),"function"!==typeof e)return e;try{if(e.__sentry__)return e;if(e.__sentry_wrapped__)return e.__sentry_wrapped__}catch(o){return e}var r=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"===typeof n&&n.apply(this,arguments);var i=r.map((function(e){return le(e,t)}));return e.handleEvent?e.handleEvent.apply(this,i):e.apply(this,i)}catch(o){throw ae+=1,setTimeout((function(){ae-=1})),ie("withScope",(function(e){e.addEventProcessor((function(e){var n=(0,a.C3)({},e);return t.mechanism&&((0,u.NP)(n,void 0,void 0),(0,u.qW)(n,t.mechanism)),n.extra=(0,a.C3)((0,a.C3)({},n.extra),{arguments:r}),n})),oe(o)})),o}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}catch(s){}e.prototype=e.prototype||{},r.prototype=e.prototype,Object.defineProperty(e,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:e}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return e.name}})}catch(s){}return r}function ce(e){if(void 0===e&&(e={}),e.eventId)if(e.dsn){var t=document.createElement("script");t.async=!0,t.src=new Z(e.dsn).getReportDialogEndpoint(e),e.onLoad&&(t.onload=e.onLoad),(document.head||document.body).appendChild(t)}else c.Q.error("Missing dsn option in showReportDialog call");else c.Q.error("Missing eventId option in showReportDialog call")}var ue=n(3456),de=n(8972),pe=function(){function e(t){this.name=e.id,this._options=(0,a.C3)({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&(0,l.WS)().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:(0,u.y_)(e)},{event:e})},e.prototype.setupOnce=function(){var e=this;this._options.console&&(0,ue.c)({callback:function(){for(var t=[],n=0;n "}0!==t.length&&(0,l.WS)().addBreadcrumb({category:"ui."+e.name,message:t},{event:e.event,name:e.name})},e.prototype._xhrBreadcrumb=function(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,i=t.status_code,o=t.body;(0,l.WS)().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:i},type:"http"},{xhr:e.xhr,input:o})}else;},e.prototype._fetchBreadcrumb=function(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?(0,l.WS)().addBreadcrumb({category:"fetch",data:e.fetchData,level:A.Error,type:"http"},{data:e.error,input:e.args}):(0,l.WS)().addBreadcrumb({category:"fetch",data:(0,a.C3)((0,a.C3)({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))},e.prototype._historyBreadcrumb=function(e){var t=(0,u.mm)(),n=e.from,r=e.to,i=(0,u.UX)(t.location.href),o=(0,u.UX)(n),a=(0,u.UX)(r);o.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),(0,l.WS)().addBreadcrumb({category:"navigation",data:{from:n,to:r}})},e.id="Breadcrumbs",e}(),he="5.30.0",fe=function(e){function t(t){return void 0===t&&(t={}),e.call(this,re,t)||this}return(0,a.ct)(t,e),t.prototype.showReportDialog=function(e){void 0===e&&(e={}),(0,u.mm)().document&&(this._isEnabled()?ce((0,a.C3)((0,a.C3)({},e),{dsn:e.dsn||this.getDsn()})):c.Q.error("Trying to call showReportDialog with Sentry Client disabled"))},t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",t.sdk=(0,a.C3)((0,a.C3)({},t.sdk),{name:"sentry.javascript.browser",packages:(0,a.KQ)(t.sdk&&t.sdk.packages||[],[{name:"npm:@sentry/browser",version:he}]),version:he}),e.prototype._prepareEvent.call(this,t,n,r)},t.prototype._sendEvent=function(t){var n=this.getIntegration(pe);n&&n.addSentryBreadcrumb(t),e.prototype._sendEvent.call(this,t)},t}(O),me=n(1496),ge=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],ve=function(){function e(t){this.name=e.id,this._options=(0,a.C3)({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=(0,u.mm)();(this._options.setTimeout&&(0,T.ym)(e,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&(0,T.ym)(e,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&(0,T.ym)(e,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&(0,T.ym)(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget)&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:ge).forEach(this._wrapEventTarget.bind(this))},e.prototype._wrapTimeFunction=function(e){return function(){for(var t=[],n=0;n 0?t:(0,u.s5)();return 0===e.exception.values[0].stacktrace.frames.length&&e.exception.values[0].stacktrace.frames.push({colno:i,filename:a,function:"?",in_app:!0,lineno:o}),e},e.id="GlobalHandlers",e}(),ye=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||"cause",this._limit=t.limit||5}return e.prototype.setupOnce=function(){(0,s.e)((function(t,n){var r=(0,l.WS)().getIntegration(e);return r?r._handler(t,n):t}))},e.prototype._handler=function(e,t){if(!e.exception||!e.exception.values||!t||!(0,x.aG)(t.originalException,Error))return e;var n=this._walkErrorTree(t.originalException,this._key);return e.exception.values=(0,a.KQ)(n,e.exception.values),e},e.prototype._walkErrorTree=function(e,t,n){if(void 0===n&&(n=[]),!(0,x.aG)(e[t],Error)||n.length+1>=this._limit)return n;var r=H(U(e[t]));return this._walkErrorTree(e[t],t,(0,a.KQ)([r],n))},e.id="LinkedErrors",e}(),_e=(0,u.mm)(),xe=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){(0,s.e)((function(t){var n,r,i;if((0,l.WS)().getIntegration(e)){if(!_e.navigator&&!_e.location&&!_e.document)return t;var o=(null===(n=t.request)||void 0===n?void 0:n.url)||(null===(r=_e.location)||void 0===r?void 0:r.href),s=(_e.document||{}).referrer,c=(_e.navigator||{}).userAgent,u=(0,a.C3)((0,a.C3)((0,a.C3)({},null===(i=t.request)||void 0===i?void 0:i.headers),s&&{Referer:s}),c&&{"User-Agent":c}),d=(0,a.C3)((0,a.C3)({},o&&{url:o}),{headers:u});return(0,a.C3)((0,a.C3)({},t),{request:d})}return t}))},e.id="UserAgent",e}(),we=[new h,new f,new ve,new pe,new be,new ye,new xe];var Ee=n(7090),Te=n(9916),Ce=n(8888),ke=n(6360),Se=(0,u.mm)();var Oe,Ae,je=function(e,t,n,r){var i;return function(){n&&t.isFinal&&n.disconnect(),t.value>=0&&(r||t.isFinal||"hidden"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||t.isFinal||void 0===i)&&(e(t),i=t.value))}},Pe=function(e,t){return void 0===t&&(t=-1),{name:e,value:t,delta:0,entries:[],id:Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),isFinal:!1}},Ie=function(e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){return e.getEntries().map(t)}));return n.observe({type:e,buffered:!0}),n}}catch(r){}},Le=!1,Re=!1,Ne=function(e){Le=!e.persisted},De=function(e,t){void 0===t&&(t=!1),Re||(addEventListener("pagehide",Ne),addEventListener("beforeunload",(function(){})),Re=!0),addEventListener("visibilitychange",(function(t){var n=t.timeStamp;"hidden"===document.visibilityState&&e({timeStamp:n,isUnloading:Le})}),{capture:!0,once:t})},Me=function(){return void 0===Oe&&(Oe="hidden"===document.visibilityState?0:1/0,De((function(e){var t=e.timeStamp;return Oe=t}),!0)),{get timeStamp(){return Oe}}},Be=function(e,t){void 0===t&&(t=!1);var n,r=Pe("LCP"),i=Me(),o=function(e){var t=e.startTime;t -1&&(r=f)}})),void 0!==r&&void 0!==i&&He(e,{description:"evaluation",endTimestamp:i,op:"script",startTimestamp:r}),this._performanceCursor=Math.max(performance.getEntries().length-1,0),this._trackNavigator(e),"pageload"===e.op){var s=(0,ke.kV)(E.W2);["fcp","fp","lcp","ttfb"].forEach((function(n){if(t._measurements[n]&&!(s>=e.startTimestamp)){var r=t._measurements[n].value,i=s+(0,ke.kV)(r),o=Math.abs(1e3*(i-e.startTimestamp)),a=o-r;c.Q.log("[Measurements] Normalized "+n+" from "+r+" to "+o+" ("+a+")"),t._measurements[n].value=o}})),this._measurements["mark.fid"]&&this._measurements.fid&&He(e,{description:"first input delay",endTimestamp:this._measurements["mark.fid"].value+(0,ke.kV)(this._measurements.fid.value),op:"web.vitals",startTimestamp:this._measurements["mark.fid"].value}),e.setMeasurements(this._measurements)}}},e.prototype._trackCLS=function(){var e=this;!function(e,t){void 0===t&&(t=!1);var n,r=Pe("CLS",0),i=function(e){e.hadRecentInput||(r.value+=e.value,r.entries.push(e),n())},o=Ie("layout-shift",i);o&&(n=je(e,r,o,t),De((function(e){var t=e.isUnloading;o.takeRecords().map(i),t&&(r.isFinal=!0),n()})))}((function(t){t.entries.pop()&&(c.Q.log("[Measurements] Adding CLS"),e._measurements.cls={value:t.value})}))},e.prototype._trackNavigator=function(e){var t=Fe.navigator;if(t){var n=t.connection;n&&(n.effectiveType&&e.setTag("effectiveConnectionType",n.effectiveType),n.type&&e.setTag("connectionType",n.type),We(n.rtt)&&(this._measurements["connection.rtt"]={value:n.rtt}),We(n.downlink)&&(this._measurements["connection.downlink"]={value:n.downlink})),We(t.deviceMemory)&&e.setTag("deviceMemory",String(t.deviceMemory)),We(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}},e.prototype._trackLCP=function(){var e=this;Be((function(t){var n=t.entries.pop();if(n){var r=(0,ke.kV)(performance.timeOrigin),i=(0,ke.kV)(n.startTime);c.Q.log("[Measurements] Adding LCP"),e._measurements.lcp={value:t.value},e._measurements["mark.lcp"]={value:r+i}}}))},e.prototype._trackFID=function(){var e=this;!function(e){var t=Pe("FID"),n=Me(),r=function(e){e.startTime n&&(e.startTimestamp=n),e.startChild((0,a.C3)({startTimestamp:n},r))}function We(e){return"number"===typeof e&&isFinite(e)}var Ge={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]};function Ve(e){var t=(0,a.C3)((0,a.C3)({},Ge),e),n=t.traceFetch,r=t.traceXHR,i=t.tracingOrigins,o=t.shouldCreateSpanForRequest,s={},c=function(e){if(s[e])return s[e];var t=i;return s[e]=t.some((function(t){return(0,d.AU)(e,t)}))&&!(0,d.AU)(e,"sentry_key"),s[e]},u=c;"function"===typeof o&&(u=function(e){return c(e)&&o(e)});var p={};n&&(0,ue.c)({callback:function(e){!function(e,t,n){var r,i=null===(r=(0,l.WS)().getClient())||void 0===r?void 0:r.getOptions();if(!i||!(0,ke.KQ)(i)||!e.fetchData||!t(e.fetchData.url))return;if(e.endTimestamp&&e.fetchData.__span){if(c=n[e.fetchData.__span]){var o=e.response;o&&c.setHttpStatus(o.status),c.finish(),delete n[e.fetchData.__span]}return}var s=(0,ke.gB)();if(s){var c=s.startChild({data:(0,a.C3)((0,a.C3)({},e.fetchData),{type:"fetch"}),description:e.fetchData.method+" "+e.fetchData.url,op:"http"});e.fetchData.__span=c.spanId,n[c.spanId]=c;var u=e.args[0]=e.args[0],d=e.args[1]=e.args[1]||{},p=d.headers;(0,x.aG)(u,Request)&&(p=u.headers),p?"function"===typeof p.append?p.append("sentry-trace",c.toTraceparent()):p=Array.isArray(p)?(0,a.KQ)(p,[["sentry-trace",c.toTraceparent()]]):(0,a.C3)((0,a.C3)({},p),{"sentry-trace":c.toTraceparent()}):p={"sentry-trace":c.toTraceparent()},d.headers=p}}(e,u,p)},type:"fetch"}),r&&(0,ue.c)({callback:function(e){!function(e,t,n){var r,i=null===(r=(0,l.WS)().getClient())||void 0===r?void 0:r.getOptions();if(!i||!(0,ke.KQ)(i)||!(e.xhr&&e.xhr.__sentry_xhr__&&t(e.xhr.__sentry_xhr__.url))||e.xhr.__sentry_own_request__)return;var o=e.xhr.__sentry_xhr__;if(e.endTimestamp&&e.xhr.__sentry_xhr_span_id__){return void((c=n[e.xhr.__sentry_xhr_span_id__])&&(c.setHttpStatus(o.status_code),c.finish(),delete n[e.xhr.__sentry_xhr_span_id__]))}var s=(0,ke.gB)();if(s){var c=s.startChild({data:(0,a.C3)((0,a.C3)({},o.data),{type:"xhr",method:o.method,url:o.url}),description:o.method+" "+o.url,op:"http"});if(e.xhr.__sentry_xhr_span_id__=c.spanId,n[e.xhr.__sentry_xhr_span_id__]=c,e.xhr.setRequestHeader)try{e.xhr.setRequestHeader("sentry-trace",c.toTraceparent())}catch(u){}}}(e,u,p)},type:"xhr"})}var $e=(0,u.mm)();var Ke=(0,a.C3)({idleTimeout:Te.Y1,markBackgroundTransactions:!0,maxTransactionDuration:600,routingInstrumentation:function(e,t,n){if(void 0===t&&(t=!0),void 0===n&&(n=!0),$e&&$e.location){var r,i=$e.location.href;t&&(r=e({name:$e.location.pathname,op:"pageload"})),n&&(0,ue.c)({callback:function(t){var n=t.to,o=t.from;void 0===o&&i&&-1!==i.indexOf(n)?i=void 0:o!==n&&(i=void 0,r&&(c.Q.log("[Tracing] Finishing current transaction with op: "+r.op),r.finish()),r=e({name:$e.location.pathname,op:"navigation"}))},type:"history"})}else c.Q.warn("Could not initialize routing instrumentation due to invalid location")},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0},Ge),Ye=function(){function e(t){this.name=e.id,this._metrics=new ze,this._emitOptionsWarning=!1;var n=Ge.tracingOrigins;t&&t.tracingOrigins&&Array.isArray(t.tracingOrigins)&&0!==t.tracingOrigins.length?n=t.tracingOrigins:this._emitOptionsWarning=!0,this.options=(0,a.C3)((0,a.C3)((0,a.C3)({},Ke),t),{tracingOrigins:n})}return e.prototype.setupOnce=function(e,t){var n=this;this._getCurrentHub=t,this._emitOptionsWarning&&(c.Q.warn("[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),c.Q.warn("[Tracing] We added a reasonable default for you: "+Ge.tracingOrigins));var r=this.options,i=r.routingInstrumentation,o=r.startTransactionOnLocationChange,a=r.startTransactionOnPageLoad,s=r.markBackgroundTransactions,l=r.traceFetch,u=r.traceXHR,d=r.tracingOrigins,p=r.shouldCreateSpanForRequest;i((function(e){return n._createRouteTransaction(e)}),a,o),s&&(Se&&Se.document?Se.document.addEventListener("visibilitychange",(function(){var e=(0,ke.gB)();Se.document.hidden&&e&&(c.Q.log("[Tracing] Transaction: "+Ce.D.Cancelled+" -> since tab moved to the background, op: "+e.op),e.status||e.setStatus(Ce.D.Cancelled),e.setTag("visibilitychange","document.hidden"),e.finish())})):c.Q.warn("[Tracing] Could not set up background tab detection due to lack of global document")),Ve({traceFetch:l,traceXHR:u,tracingOrigins:d,shouldCreateSpanForRequest:p})},e.prototype._createRouteTransaction=function(e){var t=this;if(this._getCurrentHub){var n=this.options,r=n.beforeNavigate,i=n.idleTimeout,o=n.maxTransactionDuration,s="pageload"===e.op?function(){var e=function(e){var t=document.querySelector("meta[name="+e+"]");return t?t.getAttribute("content"):null}("sentry-trace");if(e)return(0,ke.Cg)(e);return}():void 0,l=(0,a.C3)((0,a.C3)((0,a.C3)({},e),s),{trimEnd:!0}),u="function"===typeof r?r(l):l,d=void 0===u?(0,a.C3)((0,a.C3)({},l),{sampled:!1}):u;!1===d.sampled&&c.Q.log("[Tracing] Will not send "+d.op+" transaction because of beforeNavigate.");var p=this._getCurrentHub(),h=(0,Ee.Iz)(p,d,i,!0);return c.Q.log("[Tracing] Starting "+d.op+" transaction on scope"),h.registerBeforeFinishCallback((function(e,n){t._metrics.addPerformanceEntries(e),function(e,t,n){var r=n-t.startTimestamp,i=n&&(r>e||r<0);i&&(t.setStatus(Ce.D.DeadlineExceeded),t.setTag("maxTransactionDurationExceeded","true"))}((0,ke.GW)(o),e,n)})),h}c.Q.warn("[Tracing] Did not create "+e.op+" transaction because _getCurrentHub is invalid.")},e.id="BrowserTracing",e}();var Ze=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._router=t.router||t.app,this._methods=(Array.isArray(t.methods)?t.methods:[]).concat("use")}return e.prototype.setupOnce=function(){this._router?function(e,t){void 0===t&&(t=[]);t.forEach((function(t){return function(e,t){var n=e[t];return e[t]=function(){for(var e=[],r=0;r =0;u--){var d=i[u];"."===d?lt(i,u):".."===d?(lt(i,u),c++):c&&(lt(i,u),c--)}if(!s)for(;c--;c)i.unshift("..");!s||""===i[0]||i[0]&&st(i[0])||i.unshift("");var p=i.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};function ut(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}const dt=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"===typeof t||"object"===typeof n){var r=ut(t),i=ut(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var pt=!0,ht="Invariant failed";function ft(e,t){if(!e){if(pt)throw new Error(ht);var n="function"===typeof t?t():t,r=n?"".concat(ht,": ").concat(n):ht;throw new Error(r)}}function mt(e){return"/"===e.charAt(0)?e:"/"+e}function gt(e){return"/"===e.charAt(0)?e.substr(1):e}function vt(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function bt(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function yt(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function _t(e,t,n,r){var i;"string"===typeof e?(i=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),i.state=t):(void 0===(i=(0,at.c)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(o){throw o instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):o}return n&&(i.key=n),r?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=ct(i.pathname,r.pathname)):i.pathname=r.pathname:i.pathname||(i.pathname="/"),i}function xt(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"===typeof e?e(t,n):e;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r 1&&void 0!==arguments[1]?arguments[1]:{};return(0,Sn.c)(e,(0,at.c)({defaultTheme:On.c},t))};var jn=n(2200);function Pn(){return(0,jn.c)()||On.c}var In=n(5696);const Ln=(0,In.c)(i.createElement("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu"),Rn=(0,In.c)(i.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),Nn=(0,In.c)(i.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),Dn=(0,In.c)(i.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"}),"AccountCircle"),Mn=(0,In.c)(i.createElement("path",{d:"M19 5v14H5V5h14m1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9zM11 7h6v2h-6V7zm0 4h6v2h-6v-2zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),Bn=(0,In.c)(i.createElement("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-2 14l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z"}),"AssignmentTurnedIn"),Qn=(0,In.c)(i.createElement("path",{d:"M20 0H4v2h16V0zM4 24h16v-2H4v2zM20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 2.75c1.24 0 2.25 1.01 2.25 2.25s-1.01 2.25-2.25 2.25S9.75 10.24 9.75 9 10.76 6.75 12 6.75zM17 17H7v-1.5c0-1.67 3.33-2.5 5-2.5s5 .83 5 2.5V17z"}),"Contacts"),Un=(0,In.c)(i.createElement("path",{d:"M23 6H1v12h22V6zm-2 10H3V8h2v4h2V8h2v4h2V8h2v4h2V8h2v4h2V8h2v8z"}),"StraightenSharp"),Fn=(0,In.c)(i.createElement("path",{d:"M20 21c-1.39 0-2.78-.47-4-1.32-2.44 1.71-5.56 1.71-8 0C6.78 20.53 5.39 21 4 21H2v2h2c1.38 0 2.74-.35 4-.99 2.52 1.29 5.48 1.29 8 0 1.26.65 2.62.99 4 .99h2v-2h-2zM3.95 19H4c1.6 0 3.02-.88 4-2 .98 1.12 2.4 2 4 2s3.02-.88 4-2c.98 1.12 2.4 2 4 2h.05l2.18-7.65-2.23-.73V4h-5V1H9v3H4v6.62l-2.23.73L3.95 19zM6 6h12v3.97L12 8 6 9.97V6z"}),"DirectionsBoatSharp"),zn=(0,In.c)(i.createElement("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-5 3c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm4 8h-8v-1c0-1.33 2.67-2 4-2s4 .67 4 2v1z"}),"FolderShared"),qn=(0,In.c)(i.createElement("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 14v-2.47l6.88-6.88c.2-.2.51-.2.71 0l1.77 1.77c.2.2.2.51 0 .71L8.47 14H6zm12 0h-7.5l2-2H18v2z"}),"RateReview"),Hn=(0,In.c)(i.createElement("path",{d:"M16.5 12c1.38 0 2.49-1.12 2.49-2.5S17.88 7 16.5 7C15.12 7 14 8.12 14 9.5s1.12 2.5 2.5 2.5zM9 11c1.66 0 2.99-1.34 2.99-3S10.66 5 9 5C7.34 5 6 6.34 6 8s1.34 3 3 3zm7.5 3c-1.83 0-5.5.92-5.5 2.75V19h11v-2.25c0-1.83-3.67-2.75-5.5-2.75zM9 13c-2.33 0-7 1.17-7 3.5V19h7v-2.25c0-.85.33-2.34 2.37-3.47C10.5 13.1 9.66 13 9 13z"}),"SupervisorAccount"),Wn=(0,In.c)(i.createElement("path",{d:"M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"ExitToApp");var Gn=n(1512),Vn={WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box"},$n=function(e){return(0,at.c)({color:e.palette.text.primary},e.typography.body2,{backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}})};const Kn=(0,Gn.c)((function(e){return{"@global":{html:Vn,"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:(0,at.c)({margin:0},$n(e),{"&::backdrop":{backgroundColor:e.palette.background.default}})}}}),{name:"MuiCssBaseline"})((function(e){var t=e.children,n=void 0===t?null:t;return e.classes,i.createElement(i.Fragment,null,n)}));var Yn=n(2540),Zn=n(3620),Jn=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.component,a=void 0===o?"div":o,s=e.square,l=void 0!==s&&s,c=e.elevation,u=void 0===c?1:c,d=e.variant,p=void 0===d?"elevation":d,h=(0,Yn.c)(e,["classes","className","component","square","elevation","variant"]);return i.createElement(a,(0,at.c)({className:(0,kn.c)(n.root,r,"outlined"===p?n.outlined:n["elevation".concat(u)],!l&&n.rounded),ref:t},h))}));const Xn=(0,Gn.c)((function(e){var t={};return e.shadows.forEach((function(e,n){t["elevation".concat(n)]={boxShadow:e}})),(0,at.c)({root:{backgroundColor:e.palette.background.paper,color:e.palette.text.primary,transition:e.transitions.create("box-shadow")},rounded:{borderRadius:e.shape.borderRadius},outlined:{border:"1px solid ".concat(e.palette.divider)}},t)}),{name:"MuiPaper"})(Jn);var er=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.color,a=void 0===o?"primary":o,s=e.position,l=void 0===s?"fixed":s,c=(0,Yn.c)(e,["classes","className","color","position"]);return i.createElement(Xn,(0,at.c)({square:!0,component:"header",elevation:4,className:(0,kn.c)(n.root,n["position".concat((0,Zn.c)(l))],n["color".concat((0,Zn.c)(a))],r,"fixed"===l&&"mui-fixed"),ref:t},c))}));const tr=(0,Gn.c)((function(e){var t="light"===e.palette.type?e.palette.grey[100]:e.palette.grey[900];return{root:{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",zIndex:e.zIndex.appBar,flexShrink:0},positionFixed:{position:"fixed",top:0,left:"auto",right:0,"@media print":{position:"absolute"}},positionAbsolute:{position:"absolute",top:0,left:"auto",right:0},positionSticky:{position:"sticky",top:0,left:"auto",right:0},positionStatic:{position:"static"},positionRelative:{position:"relative"},colorDefault:{backgroundColor:t,color:e.palette.getContrastText(t)},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},colorInherit:{color:"inherit"},colorTransparent:{backgroundColor:"transparent",color:"inherit"}}}),{name:"MuiAppBar"})(er);var nr=n(2312),rr=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.component,a=void 0===o?"div":o,s=e.disableGutters,l=void 0!==s&&s,c=e.variant,u=void 0===c?"regular":c,d=(0,Yn.c)(e,["classes","className","component","disableGutters","variant"]);return i.createElement(a,(0,at.c)({className:(0,kn.c)(n.root,n[u],r,!l&&n.gutters),ref:t},d))}));const ir=(0,Gn.c)((function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:(0,nr.c)({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}}),{name:"MuiToolbar"})(rr);var or=n(9816),ar=n(576),sr=n(9568),lr=n(2880),cr=n(3188),ur=n(4316);const dr=i.createContext(null);function pr(e,t){var n=Object.create(null);return e&&i.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&(0,i.isValidElement)(e)?t(e):e}(e)})),n}function hr(e,t,n){return null!=n[t]?n[t]:e.props[t]}function fr(e,t,n){var r=pr(e.children),o=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var l in t){if(i[l])for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=t.pulsate,o=void 0!==i&&i,a=t.center,s=void 0===a?r||t.pulsate:a,l=t.fakeElement,c=void 0!==l&&l;if("mousedown"===e.type&&h.current)h.current=!1;else{"touchstart"===e.type&&(h.current=!0);var u,d,p,b=c?null:g.current,y=b?b.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(y.width/2),d=Math.round(y.height/2);else{var _=e.touches?e.touches[0]:e,x=_.clientX,w=_.clientY;u=Math.round(x-y.left),d=Math.round(w-y.top)}if(s)(p=Math.sqrt((2*Math.pow(y.width,2)+Math.pow(y.height,2))/3))%2===0&&(p+=1);else{var E=2*Math.max(Math.abs((b?b.clientWidth:0)-u),u)+2,T=2*Math.max(Math.abs((b?b.clientHeight:0)-d),d)+2;p=Math.sqrt(Math.pow(E,2)+Math.pow(T,2))}e.touches?null===m.current&&(m.current=function(){v({pulsate:o,rippleX:u,rippleY:d,rippleSize:p,cb:n})},f.current=setTimeout((function(){m.current&&(m.current(),m.current=null)}),80)):v({pulsate:o,rippleX:u,rippleY:d,rippleSize:p,cb:n})}}),[r,v]),y=i.useCallback((function(){b({},{pulsate:!0})}),[b]),_=i.useCallback((function(e,t){if(clearTimeout(f.current),"touchend"===e.type&&m.current)return e.persist(),m.current(),m.current=null,void(f.current=setTimeout((function(){_(e,t)})));m.current=null,u((function(e){return e.length>0?e.slice(1):e})),p.current=t}),[]);return i.useImperativeHandle(t,(function(){return{pulsate:y,start:b,stop:_}}),[y,b,_]),i.createElement("span",(0,at.c)({className:(0,kn.c)(o.root,a),ref:g},s),i.createElement(vr,{component:null,exit:!0},c))}));const xr=(0,Gn.c)((function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(i.memo(_r));var wr=i.forwardRef((function(e,t){var n=e.action,r=e.buttonRef,a=e.centerRipple,s=void 0!==a&&a,l=e.children,c=e.classes,u=e.className,d=e.component,p=void 0===d?"button":d,h=e.disabled,f=void 0!==h&&h,m=e.disableRipple,g=void 0!==m&&m,v=e.disableTouchRipple,b=void 0!==v&&v,y=e.focusRipple,_=void 0!==y&&y,x=e.focusVisibleClassName,w=e.onBlur,E=e.onClick,T=e.onFocus,C=e.onFocusVisible,k=e.onKeyDown,S=e.onKeyUp,O=e.onMouseDown,A=e.onMouseLeave,j=e.onMouseUp,P=e.onTouchEnd,I=e.onTouchMove,L=e.onTouchStart,R=e.onDragLeave,N=e.tabIndex,D=void 0===N?0:N,M=e.TouchRippleProps,B=e.type,Q=void 0===B?"button":B,U=(0,Yn.c)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),F=i.useRef(null);var z=i.useRef(null),q=i.useState(!1),H=q[0],W=q[1];f&&H&&W(!1);var G=(0,lr.c)(),V=G.isFocusVisible,$=G.onBlurVisible,K=G.ref;function Y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b;return(0,sr.c)((function(r){return t&&t(r),!n&&z.current&&z.current[e](r),!0}))}i.useImperativeHandle(n,(function(){return{focusVisible:function(){W(!0),F.current.focus()}}}),[]),i.useEffect((function(){H&&_&&!g&&z.current.pulsate()}),[g,_,H]);var Z=Y("start",O),J=Y("stop",R),X=Y("stop",j),ee=Y("stop",(function(e){H&&e.preventDefault(),A&&A(e)})),te=Y("start",L),ne=Y("stop",P),re=Y("stop",I),ie=Y("stop",(function(e){H&&($(e),W(!1)),w&&w(e)}),!1),oe=(0,sr.c)((function(e){F.current||(F.current=e.currentTarget),V(e)&&(W(!0),C&&C(e)),T&&T(e)})),ae=function(){var e=o.findDOMNode(F.current);return p&&"button"!==p&&!("A"===e.tagName&&e.href)},se=i.useRef(!1),le=(0,sr.c)((function(e){_&&!se.current&&H&&z.current&&" "===e.key&&(se.current=!0,e.persist(),z.current.stop(e,(function(){z.current.start(e)}))),e.target===e.currentTarget&&ae()&&" "===e.key&&e.preventDefault(),k&&k(e),e.target===e.currentTarget&&ae()&&"Enter"===e.key&&!f&&(e.preventDefault(),E&&E(e))})),ce=(0,sr.c)((function(e){_&&" "===e.key&&z.current&&H&&!e.defaultPrevented&&(se.current=!1,e.persist(),z.current.stop(e,(function(){z.current.pulsate(e)}))),S&&S(e),E&&e.target===e.currentTarget&&ae()&&" "===e.key&&!e.defaultPrevented&&E(e)})),ue=p;"button"===ue&&U.href&&(ue="a");var de={};"button"===ue?(de.type=Q,de.disabled=f):("a"===ue&&U.href||(de.role="button"),de["aria-disabled"]=f);var pe=(0,ar.c)(r,t),he=(0,ar.c)(K,F),fe=(0,ar.c)(pe,he),me=i.useState(!1),ge=me[0],ve=me[1];i.useEffect((function(){ve(!0)}),[]);var be=ge&&!g&&!f;return i.createElement(ue,(0,at.c)({className:(0,kn.c)(c.root,u,H&&[c.focusVisible,x],f&&c.disabled),onBlur:ie,onClick:E,onFocus:oe,onKeyDown:le,onKeyUp:ce,onMouseDown:Z,onMouseLeave:ee,onMouseUp:X,onDragLeave:J,onTouchEnd:ne,onTouchMove:re,onTouchStart:te,ref:fe,tabIndex:f?-1:D},de,U),l,be?i.createElement(xr,(0,at.c)({ref:z,center:s},M)):null)}));const Er=(0,Gn.c)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(wr);var Tr=i.forwardRef((function(e,t){var n=e.edge,r=void 0!==n&&n,o=e.children,a=e.classes,s=e.className,l=e.color,c=void 0===l?"default":l,u=e.disabled,d=void 0!==u&&u,p=e.disableFocusRipple,h=void 0!==p&&p,f=e.size,m=void 0===f?"medium":f,g=(0,Yn.c)(e,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return i.createElement(Er,(0,at.c)({className:(0,kn.c)(a.root,s,"default"!==c&&a["color".concat((0,Zn.c)(c))],d&&a.disabled,"small"===m&&a["size".concat((0,Zn.c)(m))],{start:a.edgeStart,end:a.edgeEnd}[r]),centerRipple:!0,focusRipple:!h,disabled:d,ref:t},g),i.createElement("span",{className:a.label},o))}));const Cr=(0,Gn.c)((function(e){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:e.palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:(0,or.W4)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:e.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,or.W4)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,or.W4)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:e.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}}),{name:"MuiIconButton"})(Tr);var kr={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p"},Sr=i.forwardRef((function(e,t){var n=e.align,r=void 0===n?"inherit":n,o=e.classes,a=e.className,s=e.color,l=void 0===s?"initial":s,c=e.component,u=e.display,d=void 0===u?"initial":u,p=e.gutterBottom,h=void 0!==p&&p,f=e.noWrap,m=void 0!==f&&f,g=e.paragraph,v=void 0!==g&&g,b=e.variant,y=void 0===b?"body1":b,_=e.variantMapping,x=void 0===_?kr:_,w=(0,Yn.c)(e,["align","classes","className","color","component","display","gutterBottom","noWrap","paragraph","variant","variantMapping"]),E=c||(v?"p":x[y]||kr[y])||"span";return i.createElement(E,(0,at.c)({className:(0,kn.c)(o.root,a,"inherit"!==y&&o[y],"initial"!==l&&o["color".concat((0,Zn.c)(l))],m&&o.noWrap,h&&o.gutterBottom,v&&o.paragraph,"inherit"!==r&&o["align".concat((0,Zn.c)(r))],"initial"!==d&&o["display".concat((0,Zn.c)(d))]),ref:t},w))}));const Or=(0,Gn.c)((function(e){return{root:{margin:0},body2:e.typography.body2,body1:e.typography.body1,caption:e.typography.caption,button:e.typography.button,h1:e.typography.h1,h2:e.typography.h2,h3:e.typography.h3,h4:e.typography.h4,h5:e.typography.h5,h6:e.typography.h6,subtitle1:e.typography.subtitle1,subtitle2:e.typography.subtitle2,overline:e.typography.overline,srOnly:{position:"absolute",height:1,width:1,overflow:"hidden"},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right"},alignJustify:{textAlign:"justify"},noWrap:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},gutterBottom:{marginBottom:"0.35em"},paragraph:{marginBottom:16},colorInherit:{color:"inherit"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorTextPrimary:{color:e.palette.text.primary},colorTextSecondary:{color:e.palette.text.secondary},colorError:{color:e.palette.error.main},displayInline:{display:"inline"},displayBlock:{display:"block"}}}),{name:"MuiTypography"})(Sr);var Ar=n(4928),jr=n(5376),Pr=n(2784),Ir=n(1856),Lr=(n(52),n(7376)),Rr=n(664),Nr=n(6804),Dr=n(2656),Mr=n(4328),Br=n(9184);var Qr="undefined"!==typeof window?i.useLayoutEffect:i.useEffect;const Ur=i.forwardRef((function(e,t){var n=e.children,r=e.container,a=e.disablePortal,s=void 0!==a&&a,l=e.onRendered,c=i.useState(null),u=c[0],d=c[1],p=(0,ar.c)(i.isValidElement(n)?n.ref:null,t);return Qr((function(){s||d(function(e){return e="function"===typeof e?e():e,o.findDOMNode(e)}(r)||document.body)}),[r,s]),Qr((function(){if(u&&!s)return(0,Br.c)(t,u),function(){(0,Br.c)(t,null)}}),[t,u,s]),Qr((function(){l&&(u||s)&&l()}),[l,u,s]),s?i.isValidElement(n)?i.cloneElement(n,{ref:p}):n:u?o.createPortal(n,u):u}));var Fr=n(8848);function zr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var qr=n(4816);function Hr(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}function Wr(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Gr(e){return parseInt(window.getComputedStyle(e)["padding-right"],10)||0}function Vr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0,o=[t,n].concat((0,cr.c)(r)),a=["TEMPLATE","SCRIPT","STYLE"];[].forEach.call(e.children,(function(e){1===e.nodeType&&-1===o.indexOf(e)&&-1===a.indexOf(e.tagName)&&Wr(e,i)}))}function $r(e,t){var n=-1;return e.some((function(e,r){return!!t(e)&&(n=r,!0)})),n}function Kr(e,t){var n,r=[],i=[],o=e.container;if(!t.disableScrollLock){if(function(e){var t=(0,Lr.c)(e);return t.body===e?(0,Nr.c)(t).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(o)){var a=Hr();r.push({value:o.style.paddingRight,key:"padding-right",el:o}),o.style["padding-right"]="".concat(Gr(o)+a,"px"),n=(0,Lr.c)(o).querySelectorAll(".mui-fixed"),[].forEach.call(n,(function(e){i.push(e.style.paddingRight),e.style.paddingRight="".concat(Gr(e)+a,"px")}))}var s=o.parentElement,l="HTML"===s.nodeName&&"scroll"===window.getComputedStyle(s)["overflow-y"]?s:o;r.push({value:l.style.overflow,key:"overflow",el:l}),l.style.overflow="hidden"}return function(){n&&[].forEach.call(n,(function(e,t){i[t]?e.style.paddingRight=i[t]:e.style.removeProperty("padding-right")})),r.forEach((function(e){var t=e.value,n=e.el,r=e.key;t?n.style.setProperty(r,t):n.style.removeProperty(r)}))}}var Yr=function(){function e(){zr(this,e),this.modals=[],this.containers=[]}return(0,qr.c)(e,[{key:"add",value:function(e,t){var n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&Wr(e.modalRef,!1);var r=function(e){var t=[];return[].forEach.call(e.children,(function(e){e.getAttribute&&"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);Vr(t,e.mountNode,e.modalRef,r,!0);var i=$r(this.containers,(function(e){return e.container===t}));return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblingNodes:r}),n)}},{key:"mount",value:function(e,t){var n=$r(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];r.restore||(r.restore=Kr(r,t))}},{key:"remove",value:function(e){var t=this.modals.indexOf(e);if(-1===t)return t;var n=$r(this.containers,(function(t){return-1!==t.modals.indexOf(e)})),r=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.restore&&r.restore(),e.modalRef&&Wr(e.modalRef,!0),Vr(r.container,e.mountNode,e.modalRef,r.hiddenSiblingNodes,!1),this.containers.splice(n,1);else{var i=r.modals[r.modals.length-1];i.modalRef&&Wr(i.modalRef,!1)}return t}},{key:"isTopModal",value:function(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}]),e}();const Zr=function(e){var t=e.children,n=e.disableAutoFocus,r=void 0!==n&&n,a=e.disableEnforceFocus,s=void 0!==a&&a,l=e.disableRestoreFocus,c=void 0!==l&&l,u=e.getDoc,d=e.isEnabled,p=e.open,h=i.useRef(),f=i.useRef(null),m=i.useRef(null),g=i.useRef(),v=i.useRef(null),b=i.useCallback((function(e){v.current=o.findDOMNode(e)}),[]),y=(0,ar.c)(t.ref,b),_=i.useRef();return i.useEffect((function(){_.current=p}),[p]),!_.current&&p&&"undefined"!==typeof window&&(g.current=u().activeElement),i.useEffect((function(){if(p){var e=(0,Lr.c)(v.current);r||!v.current||v.current.contains(e.activeElement)||(v.current.hasAttribute("tabIndex")||v.current.setAttribute("tabIndex",-1),v.current.focus());var t=function(){null!==v.current&&(e.hasFocus()&&!s&&d()&&!h.current?v.current&&!v.current.contains(e.activeElement)&&v.current.focus():h.current=!1)},n=function(t){!s&&d()&&9===t.keyCode&&e.activeElement===v.current&&(h.current=!0,t.shiftKey?m.current.focus():f.current.focus())};e.addEventListener("focus",t,!0),e.addEventListener("keydown",n,!0);var i=setInterval((function(){t()}),50);return function(){clearInterval(i),e.removeEventListener("focus",t,!0),e.removeEventListener("keydown",n,!0),c||(g.current&&g.current.focus&&g.current.focus(),g.current=null)}}}),[r,s,c,d,p]),i.createElement(i.Fragment,null,i.createElement("div",{tabIndex:0,ref:f,"data-test":"sentinelStart"}),i.cloneElement(t,{ref:y}),i.createElement("div",{tabIndex:0,ref:m,"data-test":"sentinelEnd"}))};var Jr={root:{zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}};const Xr=i.forwardRef((function(e,t){var n=e.invisible,r=void 0!==n&&n,o=e.open,a=(0,Yn.c)(e,["invisible","open"]);return o?i.createElement("div",(0,at.c)({"aria-hidden":!0,ref:t},a,{style:(0,at.c)({},Jr.root,r?Jr.invisible:{},a.style)})):null}));var ei=new Yr;const ti=i.forwardRef((function(e,t){var n=(0,jn.c)(),r=(0,Mr.c)({name:"MuiModal",props:(0,at.c)({},e),theme:n}),a=r.BackdropComponent,s=void 0===a?Xr:a,l=r.BackdropProps,c=r.children,u=r.closeAfterTransition,d=void 0!==u&&u,p=r.container,h=r.disableAutoFocus,f=void 0!==h&&h,m=r.disableBackdropClick,g=void 0!==m&&m,v=r.disableEnforceFocus,b=void 0!==v&&v,y=r.disableEscapeKeyDown,_=void 0!==y&&y,x=r.disablePortal,w=void 0!==x&&x,E=r.disableRestoreFocus,T=void 0!==E&&E,C=r.disableScrollLock,k=void 0!==C&&C,S=r.hideBackdrop,O=void 0!==S&&S,A=r.keepMounted,j=void 0!==A&&A,P=r.manager,I=void 0===P?ei:P,L=r.onBackdropClick,R=r.onClose,N=r.onEscapeKeyDown,D=r.onRendered,M=r.open,B=(0,Yn.c)(r,["BackdropComponent","BackdropProps","children","closeAfterTransition","container","disableAutoFocus","disableBackdropClick","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","manager","onBackdropClick","onClose","onEscapeKeyDown","onRendered","open"]),Q=i.useState(!0),U=Q[0],F=Q[1],z=i.useRef({}),q=i.useRef(null),H=i.useRef(null),W=(0,ar.c)(H,t),G=function(e){return!!e.children&&e.children.props.hasOwnProperty("in")}(r),V=function(){return(0,Lr.c)(q.current)},$=function(){return z.current.modalRef=H.current,z.current.mountNode=q.current,z.current},K=function(){I.mount($(),{disableScrollLock:k}),H.current.scrollTop=0},Y=(0,sr.c)((function(){var e=function(e){return e="function"===typeof e?e():e,o.findDOMNode(e)}(p)||V().body;I.add($(),e),H.current&&K()})),Z=i.useCallback((function(){return I.isTopModal($())}),[I]),J=(0,sr.c)((function(e){q.current=e,e&&(D&&D(),M&&Z()?K():Wr(H.current,!0))})),X=i.useCallback((function(){I.remove($())}),[I]);if(i.useEffect((function(){return function(){X()}}),[X]),i.useEffect((function(){M?Y():G&&d||X()}),[M,X,G,d,Y]),!j&&!M&&(!G||U))return null;var ee=function(e){return{root:{position:"fixed",zIndex:e.zIndex.modal,right:0,bottom:0,top:0,left:0},hidden:{visibility:"hidden"}}}(n||{zIndex:Fr.c}),te={};return void 0===c.props.tabIndex&&(te.tabIndex=c.props.tabIndex||"-1"),G&&(te.onEnter=(0,Dr.c)((function(){F(!1)}),c.props.onEnter),te.onExited=(0,Dr.c)((function(){F(!0),d&&X()}),c.props.onExited)),i.createElement(Ur,{ref:J,container:p,disablePortal:w},i.createElement("div",(0,at.c)({ref:W,onKeyDown:function(e){"Escape"===e.key&&Z()&&(N&&N(e),_||(e.stopPropagation(),R&&R(e,"escapeKeyDown")))},role:"presentation"},B,{style:(0,at.c)({},ee.root,!M&&U?ee.hidden:{},B.style)}),O?null:i.createElement(s,(0,at.c)({open:M,onClick:function(e){e.target===e.currentTarget&&(L&&L(e),!g&&R&&R(e,"backdropClick"))}},l)),i.createElement(Zr,{disableEnforceFocus:b,disableAutoFocus:f,disableRestoreFocus:T,getDoc:V,isEnabled:Z,open:M},i.cloneElement(c,te))))})),ni=!1;var ri=function(e){return e.scrollTop},ii="unmounted",oi="exited",ai="entering",si="entered",li="exiting",ci=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=oi,r.appearStatus=ai):i=si:i=t.unmountOnExit||t.mountOnEnter?ii:oi,r.state={status:i},r.nextCallback=null,r}(0,rt.c)(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===ii?{status:oi}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==ai&&n!==si&&(t=ai):n!==ai&&n!==si||(t=li)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!==typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===ai){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:o.findDOMNode(this);n&&ri(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===oi&&this.setState({status:ii})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[o.findDOMNode(this),r],a=i[0],s=i[1],l=this.getTimeouts(),c=r?l.appear:l.enter;!e&&!n||ni?this.safeSetState({status:si},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,s),this.safeSetState({status:ai},(function(){t.props.onEntering(a,s),t.onTransitionEnd(c,(function(){t.safeSetState({status:si},(function(){t.props.onEntered(a,s)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:o.findDOMNode(this);t&&!ni?(this.props.onExit(r),this.safeSetState({status:li},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:oi},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:oi},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:o.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],s=i[1];this.props.addEndListener(a,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===ii)return null;var t=this.props,n=t.children,r=(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,(0,Mt.c)(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return i.createElement(dr.Provider,{value:null},"function"===typeof n?n(e,r):i.cloneElement(i.Children.only(n),r))},t}(i.Component);function ui(){}ci.contextType=dr,ci.propTypes={},ci.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ui,onEntering:ui,onEntered:ui,onExit:ui,onExiting:ui,onExited:ui},ci.UNMOUNTED=ii,ci.EXITED=oi,ci.ENTERING=ai,ci.ENTERED=si,ci.EXITING=li;const di=ci;var pi=function(e){return e.scrollTop};function hi(e,t){var n=e.timeout,r=e.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"===typeof n?n:n[t.mode]||0,delay:i.transitionDelay}}function fi(e){return"scale(".concat(e,", ").concat(Math.pow(e,2),")")}var mi={entering:{opacity:1,transform:fi(1)},entered:{opacity:1,transform:"none"}},gi=i.forwardRef((function(e,t){var n=e.children,r=e.disableStrictModeCompat,o=void 0!==r&&r,a=e.in,s=e.onEnter,l=e.onEntered,c=e.onEntering,u=e.onExit,d=e.onExited,p=e.onExiting,h=e.style,f=e.timeout,m=void 0===f?"auto":f,g=e.TransitionComponent,v=void 0===g?di:g,b=(0,Yn.c)(e,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),y=i.useRef(),_=i.useRef(),x=Pn(),w=x.unstable_strictMode&&!o,E=i.useRef(null),T=(0,ar.c)(n.ref,t),C=(0,ar.c)(w?E:void 0,T),k=function(e){return function(t,n){if(e){var r=w?[E.current,t]:[t,n],i=(0,jr.c)(r,2),o=i[0],a=i[1];void 0===a?e(o):e(o,a)}}},S=k(c),O=k((function(e,t){pi(e);var n,r=hi({style:h,timeout:m},{mode:"enter"}),i=r.duration,o=r.delay;"auto"===m?(n=x.transitions.getAutoHeightDuration(e.clientHeight),_.current=n):n=i,e.style.transition=[x.transitions.create("opacity",{duration:n,delay:o}),x.transitions.create("transform",{duration:.666*n,delay:o})].join(","),s&&s(e,t)})),A=k(l),j=k(p),P=k((function(e){var t,n=hi({style:h,timeout:m},{mode:"exit"}),r=n.duration,i=n.delay;"auto"===m?(t=x.transitions.getAutoHeightDuration(e.clientHeight),_.current=t):t=r,e.style.transition=[x.transitions.create("opacity",{duration:t,delay:i}),x.transitions.create("transform",{duration:.666*t,delay:i||.333*t})].join(","),e.style.opacity="0",e.style.transform=fi(.75),u&&u(e)})),I=k(d);return i.useEffect((function(){return function(){clearTimeout(y.current)}}),[]),i.createElement(v,(0,at.c)({appear:!0,in:a,nodeRef:w?E:void 0,onEnter:O,onEntered:A,onEntering:S,onExit:P,onExited:I,onExiting:j,addEndListener:function(e,t){var n=w?e:t;"auto"===m&&(y.current=setTimeout(n,_.current||0))},timeout:"auto"===m?null:m},b),(function(e,t){return i.cloneElement(n,(0,at.c)({style:(0,at.c)({opacity:0,transform:fi(.75),visibility:"exited"!==e||a?void 0:"hidden"},mi[e],h,n.props.style),ref:C},t))}))}));gi.muiSupportAuto=!0;const vi=gi;function bi(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function yi(e,t){var n=0;return"number"===typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function _i(e){return[e.horizontal,e.vertical].map((function(e){return"number"===typeof e?"".concat(e,"px"):e})).join(" ")}function xi(e){return"function"===typeof e?e():e}var wi=i.forwardRef((function(e,t){var n=e.action,r=e.anchorEl,a=e.anchorOrigin,s=void 0===a?{vertical:"top",horizontal:"left"}:a,l=e.anchorPosition,c=e.anchorReference,u=void 0===c?"anchorEl":c,d=e.children,p=e.classes,h=e.className,f=e.container,m=e.elevation,g=void 0===m?8:m,v=e.getContentAnchorEl,b=e.marginThreshold,y=void 0===b?16:b,_=e.onEnter,x=e.onEntered,w=e.onEntering,E=e.onExit,T=e.onExited,C=e.onExiting,k=e.open,S=e.PaperProps,O=void 0===S?{}:S,A=e.transformOrigin,j=void 0===A?{vertical:"top",horizontal:"left"}:A,P=e.TransitionComponent,I=void 0===P?vi:P,L=e.transitionDuration,R=void 0===L?"auto":L,N=e.TransitionProps,D=void 0===N?{}:N,M=(0,Yn.c)(e,["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","classes","className","container","elevation","getContentAnchorEl","marginThreshold","onEnter","onEntered","onEntering","onExit","onExited","onExiting","open","PaperProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps"]),B=i.useRef(),Q=i.useCallback((function(e){if("anchorPosition"===u)return l;var t=xi(r),n=(t&&1===t.nodeType?t:(0,Lr.c)(B.current).body).getBoundingClientRect(),i=0===e?s.vertical:"center";return{top:n.top+bi(n,i),left:n.left+yi(n,s.horizontal)}}),[r,s.horizontal,s.vertical,l,u]),U=i.useCallback((function(e){var t=0;if(v&&"anchorEl"===u){var n=v(e);if(n&&e.contains(n)){var r=function(e,t){for(var n=t,r=0;n&&n!==e;)r+=(n=n.parentElement).scrollTop;return r}(e,n);t=n.offsetTop+n.clientHeight/2-r||0}0}return t}),[s.vertical,u,v]),F=i.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{vertical:bi(e,j.vertical)+t,horizontal:yi(e,j.horizontal)}}),[j.horizontal,j.vertical]),z=i.useCallback((function(e){var t=U(e),n={width:e.offsetWidth,height:e.offsetHeight},i=F(n,t);if("none"===u)return{top:null,left:null,transformOrigin:_i(i)};var o=Q(t),a=o.top-i.vertical,s=o.left-i.horizontal,l=a+n.height,c=s+n.width,d=(0,Nr.c)(xi(r)),p=d.innerHeight-y,h=d.innerWidth-y;if(a p){var m=l-p;a-=m,i.vertical+=m}if(s h){var v=c-h;s-=v,i.horizontal+=v}return{top:"".concat(Math.round(a),"px"),left:"".concat(Math.round(s),"px"),transformOrigin:_i(i)}}),[r,u,Q,U,F,y]),q=i.useCallback((function(){var e=B.current;if(e){var t=z(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin}}),[z]),H=i.useCallback((function(e){B.current=o.findDOMNode(e)}),[]);i.useEffect((function(){k&&q()})),i.useImperativeHandle(n,(function(){return k?{updatePosition:function(){q()}}:null}),[k,q]),i.useEffect((function(){if(k){var e=(0,Rr.c)((function(){q()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[k,q]);var W=R;"auto"!==R||I.muiSupportAuto||(W=void 0);var G=f||(r?(0,Lr.c)(xi(r)).body:void 0);return i.createElement(ti,(0,at.c)({container:G,open:k,ref:t,BackdropProps:{invisible:!0},className:(0,kn.c)(p.root,h)},M),i.createElement(I,(0,at.c)({appear:!0,in:k,onEnter:_,onEntered:x,onExit:E,onExited:T,onExiting:C,timeout:W},D,{onEntering:(0,Dr.c)((function(e,t){w&&w(e,t),q()}),D.onEntering)}),i.createElement(Xn,(0,at.c)({elevation:g,ref:H},O,{className:(0,kn.c)(p.paper,O.className)}),d)))}));const Ei=(0,Gn.c)({root:{},paper:{position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}},{name:"MuiPopover"})(wi);const Ti=i.createContext({});var Ci=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.component,s=void 0===a?"ul":a,l=e.dense,c=void 0!==l&&l,u=e.disablePadding,d=void 0!==u&&u,p=e.subheader,h=(0,Yn.c)(e,["children","classes","className","component","dense","disablePadding","subheader"]),f=i.useMemo((function(){return{dense:c}}),[c]);return i.createElement(Ti.Provider,{value:f},i.createElement(s,(0,at.c)({className:(0,kn.c)(r.root,o,c&&r.dense,!d&&r.padding,p&&r.subheader),ref:t},h),p,n))}));const ki=(0,Gn.c)({root:{listStyle:"none",margin:0,padding:0,position:"relative"},padding:{paddingTop:8,paddingBottom:8},dense:{},subheader:{paddingTop:0}},{name:"MuiList"})(Ci);function Si(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function Oi(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function Ai(e,t){if(void 0===t)return!0;var n=e.innerText;return void 0===n&&(n=e.textContent),0!==(n=n.trim().toLowerCase()).length&&(t.repeating?n[0]===t.keys[0]:0===n.indexOf(t.keys.join("")))}function ji(e,t,n,r,i,o){for(var a=!1,s=i(e,t,!!t&&n);s;){if(s===e.firstChild){if(a)return;a=!0}var l=!r&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&Ai(s,o)&&!l)return void s.focus();s=i(e,s,n)}}var Pi="undefined"===typeof window?i.useEffect:i.useLayoutEffect,Ii=i.forwardRef((function(e,t){var n=e.actions,r=e.autoFocus,a=void 0!==r&&r,s=e.autoFocusItem,l=void 0!==s&&s,c=e.children,u=e.className,d=e.disabledItemsFocusable,p=void 0!==d&&d,h=e.disableListWrap,f=void 0!==h&&h,m=e.onKeyDown,g=e.variant,v=void 0===g?"selectedMenu":g,b=(0,Yn.c)(e,["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"]),y=i.useRef(null),_=i.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Pi((function(){a&&y.current.focus()}),[a]),i.useImperativeHandle(n,(function(){return{adjustStyleForScrollbar:function(e,t){var n=!y.current.style.width;if(e.clientHeight 0&&(a-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&o!==i.keys[0]&&(i.repeating=!1)),i.lastTime=a,i.keys.push(o);var s=r&&!i.repeating&&Ai(r,i);i.previousKeyMatched&&(s||ji(t,r,!1,p,Si,i))?e.preventDefault():i.previousKeyMatched=!1}m&&m(e)},tabIndex:a?0:-1},b),T)}));const Li=Ii;var Ri={vertical:"top",horizontal:"right"},Ni={vertical:"top",horizontal:"left"},Di=i.forwardRef((function(e,t){var n=e.autoFocus,r=void 0===n||n,a=e.children,s=e.classes,l=e.disableAutoFocusItem,c=void 0!==l&&l,u=e.MenuListProps,d=void 0===u?{}:u,p=e.onClose,h=e.onEntering,f=e.open,m=e.PaperProps,g=void 0===m?{}:m,v=e.PopoverClasses,b=e.transitionDuration,y=void 0===b?"auto":b,_=e.TransitionProps,x=(_=void 0===_?{}:_).onEntering,w=(0,Yn.c)(_,["onEntering"]),E=e.variant,T=void 0===E?"selectedMenu":E,C=(0,Yn.c)(e,["autoFocus","children","classes","disableAutoFocusItem","MenuListProps","onClose","onEntering","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant"]),k=Pn(),S=r&&!c&&f,O=i.useRef(null),A=i.useRef(null),j=-1;i.Children.map(a,(function(e,t){i.isValidElement(e)&&(e.props.disabled||("menu"!==T&&e.props.selected||-1===j)&&(j=t))}));var P=i.Children.map(a,(function(e,t){return t===j?i.cloneElement(e,{ref:function(t){A.current=o.findDOMNode(t),(0,Br.c)(e.ref,t)}}):e}));return i.createElement(Ei,(0,at.c)({getContentAnchorEl:function(){return A.current},classes:v,onClose:p,TransitionProps:(0,at.c)({onEntering:function(e,t){O.current&&O.current.adjustStyleForScrollbar(e,k),h&&h(e,t),x&&x(e,t)}},w),anchorOrigin:"rtl"===k.direction?Ri:Ni,transformOrigin:"rtl"===k.direction?Ri:Ni,PaperProps:(0,at.c)({},g,{classes:(0,at.c)({},g.classes,{root:s.paper})}),open:f,ref:t,transitionDuration:y},C),i.createElement(Li,(0,at.c)({onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),p&&p(e,"tabKeyDown"))},actions:O,autoFocus:r&&(-1===j||c),autoFocusItem:S,variant:T},d,{className:(0,kn.c)(s.list,d.className)}),P))}));const Mi=(0,Gn.c)({paper:{maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"},list:{outline:0}},{name:"MuiMenu"})(Di);function Bi(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function Qi(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(Bi(e.value)&&""!==e.value||t&&Bi(e.defaultValue)&&""!==e.defaultValue)}var Ui=n(6960);function Fi(e,t){return"object"===(0,Pr.c)(t)&&null!==t?e===t:String(e)===String(t)}var zi=i.forwardRef((function(e,t){var n=e["aria-label"],r=e.autoFocus,o=e.autoWidth,a=e.children,s=e.classes,l=e.className,c=e.defaultValue,u=e.disabled,d=e.displayEmpty,p=e.IconComponent,h=e.inputRef,f=e.labelId,m=e.MenuProps,g=void 0===m?{}:m,v=e.multiple,b=e.name,y=e.onBlur,_=e.onChange,x=e.onClose,w=e.onFocus,E=e.onOpen,T=e.open,C=e.readOnly,k=e.renderValue,S=e.SelectDisplayProps,O=void 0===S?{}:S,A=e.tabIndex,j=(e.type,e.value),P=e.variant,I=void 0===P?"standard":P,L=(0,Yn.c)(e,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),R=(0,Ui.c)({controlled:j,default:c,name:"Select"}),N=(0,jr.c)(R,2),D=N[0],M=N[1],B=i.useRef(null),Q=i.useState(null),U=Q[0],F=Q[1],z=i.useRef(null!=T).current,q=i.useState(),H=q[0],W=q[1],G=i.useState(!1),V=G[0],$=G[1],K=(0,ar.c)(t,h);i.useImperativeHandle(K,(function(){return{focus:function(){U.focus()},node:B.current,value:D}}),[U,D]),i.useEffect((function(){r&&U&&U.focus()}),[r,U]),i.useEffect((function(){if(U){var e=(0,Lr.c)(U).getElementById(f);if(e){var t=function(){getSelection().isCollapsed&&U.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}}),[f,U]);var Y,Z,J=function(e,t){e?E&&E(t):x&&x(t),z||(W(o?null:U.clientWidth),$(e))},X=i.Children.toArray(a),ee=function(e){return function(t){var n;if(v||J(!1,t),v){n=Array.isArray(D)?D.slice():[];var r=D.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;e.props.onClick&&e.props.onClick(t),D!==n&&(M(n),_&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:b}}),_(t,e)))}},te=null!==U&&(z?T:V);delete L["aria-invalid"];var ne=[],re=!1;(Qi({value:D})||d)&&(k?Y=k(D):re=!0);var ie=X.map((function(e){if(!i.isValidElement(e))return null;var t;if(v){if(!Array.isArray(D))throw new Error((0,Ir.c)(2));(t=D.some((function(t){return Fi(t,e.props.value)})))&&re&&ne.push(e.props.children)}else(t=Fi(D,e.props.value))&&re&&(Z=e.props.children);return t&&!0,i.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:ee(e),onKeyUp:function(t){" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})}));re&&(Y=v?ne.join(", "):Z);var oe,ae=H;!o&&z&&U&&(ae=U.clientWidth),oe="undefined"!==typeof A?A:u?null:0;var se=O.id||(b?"mui-component-select-".concat(b):void 0);return i.createElement(i.Fragment,null,i.createElement("div",(0,at.c)({className:(0,kn.c)(s.root,s.select,s.selectMenu,s[I],l,u&&s.disabled),ref:F,tabIndex:oe,role:"button","aria-disabled":u?"true":void 0,"aria-expanded":te?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[f,se].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){if(!C){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),J(!0,e))}},onMouseDown:u||C?null:function(e){0===e.button&&(e.preventDefault(),U.focus(),J(!0,e))},onBlur:function(e){!te&&y&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:D,name:b}}),y(e))},onFocus:w},O,{id:se}),function(e){return null==e||"string"===typeof e&&!e.trim()}(Y)?i.createElement("span",{dangerouslySetInnerHTML:{__html:""}}):Y),i.createElement("input",(0,at.c)({value:Array.isArray(D)?D.join(","):D,name:b,ref:B,"aria-hidden":!0,onChange:function(e){var t=X.map((function(e){return e.props.value})).indexOf(e.target.value);if(-1!==t){var n=X[t];M(n.props.value),_&&_(e,n)}},tabIndex:-1,className:s.nativeInput,autoFocus:r},L)),i.createElement(p,{className:(0,kn.c)(s.icon,s["icon".concat((0,Zn.c)(I))],te&&s.iconOpen,u&&s.disabled)}),i.createElement(Mi,(0,at.c)({id:"menu-".concat(b||""),anchorEl:U,open:te,onClose:function(e){J(!1,e)}},g,{MenuListProps:(0,at.c)({"aria-labelledby":f,role:"listbox",disableListWrap:!0},g.MenuListProps),PaperProps:(0,at.c)({},g.PaperProps,{style:(0,at.c)({minWidth:ae},null!=g.PaperProps?g.PaperProps.style:null)})}),ie))}));const qi=zi;function Hi(e){var t=e.props,n=e.states,r=e.muiFormControl;return n.reduce((function(e,n){return e[n]=t[n],r&&"undefined"===typeof t[n]&&(e[n]=r[n]),e}),{})}var Wi=i.createContext();function Gi(){return i.useContext(Wi)}const Vi=Wi;function $i(){return i.useContext(Vi)}const Ki=(0,In.c)(i.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Yi(e,t){return parseInt(e[t],10)||0}var Zi="undefined"!==typeof window?i.useLayoutEffect:i.useEffect,Ji={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},Xi=i.forwardRef((function(e,t){var n=e.onChange,r=e.rows,o=e.rowsMax,a=e.rowsMin,s=e.maxRows,l=e.minRows,c=void 0===l?1:l,u=e.style,d=e.value,p=(0,Yn.c)(e,["onChange","rows","rowsMax","rowsMin","maxRows","minRows","style","value"]),h=s||o,f=r||a||c,m=i.useRef(null!=d).current,g=i.useRef(null),v=(0,ar.c)(t,g),b=i.useRef(null),y=i.useRef(0),_=i.useState({}),x=_[0],w=_[1],E=i.useCallback((function(){var t=g.current,n=window.getComputedStyle(t),r=b.current;r.style.width=n.width,r.value=t.value||e.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");var i=n["box-sizing"],o=Yi(n,"padding-bottom")+Yi(n,"padding-top"),a=Yi(n,"border-bottom-width")+Yi(n,"border-top-width"),s=r.scrollHeight-o;r.value="x";var l=r.scrollHeight-o,c=s;f&&(c=Math.max(Number(f)*l,c)),h&&(c=Math.min(Number(h)*l,c));var u=(c=Math.max(c,l))+("border-box"===i?o+a:0),d=Math.abs(c-s)<=1;w((function(e){return y.current<20&&(u>0&&Math.abs((e.outerHeightStyle||0)-u)>1||e.overflow!==d)?(y.current+=1,{overflow:d,outerHeightStyle:u}):e}))}),[h,f,e.placeholder]);i.useEffect((function(){var e=(0,Rr.c)((function(){y.current=0,E()}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[E]),Zi((function(){E()})),i.useEffect((function(){y.current=0}),[d]);return i.createElement(i.Fragment,null,i.createElement("textarea",(0,at.c)({value:d,onChange:function(e){y.current=0,m||E(),n&&n(e)},ref:v,rows:f,style:(0,at.c)({height:x.outerHeightStyle,overflow:x.overflow?"hidden":null},u)},p)),i.createElement("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:b,tabIndex:-1,style:(0,at.c)({},Ji,u)}))}));const eo=Xi;var to="undefined"===typeof window?i.useEffect:i.useLayoutEffect,no=i.forwardRef((function(e,t){var n=e["aria-describedby"],r=e.autoComplete,o=e.autoFocus,a=e.classes,s=e.className,l=(e.color,e.defaultValue),c=e.disabled,u=e.endAdornment,d=(e.error,e.fullWidth),p=void 0!==d&&d,h=e.id,f=e.inputComponent,m=void 0===f?"input":f,g=e.inputProps,v=void 0===g?{}:g,b=e.inputRef,y=(e.margin,e.multiline),_=void 0!==y&&y,x=e.name,w=e.onBlur,E=e.onChange,T=e.onClick,C=e.onFocus,k=e.onKeyDown,S=e.onKeyUp,O=e.placeholder,A=e.readOnly,j=e.renderSuffix,P=e.rows,I=e.rowsMax,L=e.rowsMin,R=e.maxRows,N=e.minRows,D=e.startAdornment,M=e.type,B=void 0===M?"text":M,Q=e.value,U=(0,Yn.c)(e,["aria-describedby","autoComplete","autoFocus","classes","className","color","defaultValue","disabled","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","rowsMax","rowsMin","maxRows","minRows","startAdornment","type","value"]),F=null!=v.value?v.value:Q,z=i.useRef(null!=F).current,q=i.useRef(),H=i.useCallback((function(e){0}),[]),W=(0,ar.c)(v.ref,H),G=(0,ar.c)(b,W),V=(0,ar.c)(q,G),$=i.useState(!1),K=$[0],Y=$[1],Z=Gi();var J=Hi({props:e,muiFormControl:Z,states:["color","disabled","error","hiddenLabel","margin","required","filled"]});J.focused=Z?Z.focused:K,i.useEffect((function(){!Z&&c&&K&&(Y(!1),w&&w())}),[Z,c,K,w]);var X=Z&&Z.onFilled,ee=Z&&Z.onEmpty,te=i.useCallback((function(e){Qi(e)?X&&X():ee&&ee()}),[X,ee]);to((function(){z&&te({value:F})}),[F,te,z]);i.useEffect((function(){te(q.current)}),[]);var ne=m,re=(0,at.c)({},v,{ref:V});"string"!==typeof ne?re=(0,at.c)({inputRef:V,type:B},re,{ref:null}):_?!P||R||N||I||L?(re=(0,at.c)({minRows:P||N,rowsMax:I,maxRows:R},re),ne=eo):ne="textarea":re=(0,at.c)({type:B},re);return i.useEffect((function(){Z&&Z.setAdornedStart(Boolean(D))}),[Z,D]),i.createElement("div",(0,at.c)({className:(0,kn.c)(a.root,a["color".concat((0,Zn.c)(J.color||"primary"))],s,J.disabled&&a.disabled,J.error&&a.error,p&&a.fullWidth,J.focused&&a.focused,Z&&a.formControl,_&&a.multiline,D&&a.adornedStart,u&&a.adornedEnd,"dense"===J.margin&&a.marginDense),onClick:function(e){q.current&&e.currentTarget===e.target&&q.current.focus(),T&&T(e)},ref:t},U),D,i.createElement(Vi.Provider,{value:null},i.createElement(ne,(0,at.c)({"aria-invalid":J.error,"aria-describedby":n,autoComplete:r,autoFocus:o,defaultValue:l,disabled:J.disabled,id:h,onAnimationStart:function(e){te("mui-auto-fill-cancel"===e.animationName?q.current:{value:"x"})},name:x,placeholder:O,readOnly:A,required:J.required,rows:P,value:F,onKeyDown:k,onKeyUp:S},re,{className:(0,kn.c)(a.input,v.className,J.disabled&&a.disabled,_&&a.inputMultiline,J.hiddenLabel&&a.inputHiddenLabel,D&&a.inputAdornedStart,u&&a.inputAdornedEnd,"search"===B&&a.inputTypeSearch,"dense"===J.margin&&a.inputMarginDense),onBlur:function(e){w&&w(e),v.onBlur&&v.onBlur(e),Z&&Z.onBlur?Z.onBlur(e):Y(!1)},onChange:function(e){if(!z){var t=e.target||q.current;if(null==t)throw new Error((0,Ir.c)(1));te({value:t.value})}for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i 0?.75*a+8:.01;return i.createElement("fieldset",(0,at.c)({"aria-hidden":!0,style:(0,at.c)((0,nr.c)({},"padding".concat((0,Zn.c)(u)),8),l),className:(0,kn.c)(n.root,r),ref:t},c),i.createElement("legend",{className:n.legend,style:{width:s?d:.01}},i.createElement("span",{dangerouslySetInnerHTML:{__html:""}})))}));const mo=(0,Gn.c)((function(e){return{root:{position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden"},legend:{textAlign:"left",padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},legendLabelled:{display:"block",width:"auto",textAlign:"left",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),"& > span":{paddingLeft:5,paddingRight:5,display:"inline-block"}},legendNotched:{maxWidth:1e3,transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}}),{name:"PrivateNotchedOutline"})(fo);var go=i.forwardRef((function(e,t){var n=e.classes,r=e.fullWidth,o=void 0!==r&&r,a=e.inputComponent,s=void 0===a?"input":a,l=e.label,c=e.labelWidth,u=void 0===c?0:c,d=e.multiline,p=void 0!==d&&d,h=e.notched,f=e.type,m=void 0===f?"text":f,g=(0,Yn.c)(e,["classes","fullWidth","inputComponent","label","labelWidth","multiline","notched","type"]);return i.createElement(ro,(0,at.c)({renderSuffix:function(e){return i.createElement(mo,{className:n.notchedOutline,label:l,labelWidth:u,notched:"undefined"!==typeof h?h:Boolean(e.startAdornment||e.filled||e.focused)})},classes:(0,at.c)({},n,{root:(0,kn.c)(n.root,n.underline),notchedOutline:null}),fullWidth:o,inputComponent:s,multiline:p,ref:t,type:m},g))}));go.muiName="Input";const vo=(0,Gn.c)((function(e){var t="light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{root:{position:"relative",borderRadius:e.shape.borderRadius,"&:hover $notchedOutline":{borderColor:e.palette.text.primary},"@media (hover: none)":{"&:hover $notchedOutline":{borderColor:t}},"&$focused $notchedOutline":{borderColor:e.palette.primary.main,borderWidth:2},"&$error $notchedOutline":{borderColor:e.palette.error.main},"&$disabled $notchedOutline":{borderColor:e.palette.action.disabled}},colorSecondary:{"&$focused $notchedOutline":{borderColor:e.palette.secondary.main}},focused:{},disabled:{},adornedStart:{paddingLeft:14},adornedEnd:{paddingRight:14},error:{},marginDense:{},multiline:{padding:"18.5px 14px","&$marginDense":{paddingTop:10.5,paddingBottom:10.5}},notchedOutline:{borderColor:t},input:{padding:"18.5px 14px","&:-webkit-autofill":{WebkitBoxShadow:"light"===e.palette.type?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===e.palette.type?null:"#fff",caretColor:"light"===e.palette.type?null:"#fff",borderRadius:"inherit"}},inputMarginDense:{paddingTop:10.5,paddingBottom:10.5},inputMultiline:{padding:0},inputAdornedStart:{paddingLeft:0},inputAdornedEnd:{paddingRight:0}}}),{name:"MuiOutlinedInput"})(go);var bo=lo,yo=i.createElement(oo,null),_o=i.createElement(ho,null),xo=i.forwardRef((function e(t,n){var r=t.autoWidth,o=void 0!==r&&r,a=t.children,s=t.classes,l=t.displayEmpty,c=void 0!==l&&l,u=t.IconComponent,d=void 0===u?Ki:u,p=t.id,h=t.input,f=t.inputProps,m=t.label,g=t.labelId,v=t.labelWidth,b=void 0===v?0:v,y=t.MenuProps,_=t.multiple,x=void 0!==_&&_,w=t.native,E=void 0!==w&&w,T=t.onClose,C=t.onOpen,k=t.open,S=t.renderValue,O=t.SelectDisplayProps,A=t.variant,j=void 0===A?"standard":A,P=(0,Yn.c)(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),I=E?so:qi,L=Hi({props:t,muiFormControl:$i(),states:["variant"]}).variant||j,R=h||{standard:yo,outlined:i.createElement(vo,{label:m,labelWidth:b}),filled:_o}[L];return i.cloneElement(R,(0,at.c)({inputComponent:I,inputProps:(0,at.c)({children:a,IconComponent:d,variant:L,type:void 0,multiple:x},E?{id:p}:{autoWidth:o,displayEmpty:c,labelId:g,MenuProps:y,onClose:T,onOpen:C,open:k,renderValue:S,SelectDisplayProps:(0,at.c)({id:p},O)},f,{classes:f?(0,Ar.c)({baseClasses:s,newClasses:f.classes,Component:e}):s},h?h.props.inputProps:{}),ref:n},P))}));xo.muiName="Select";const wo=(0,Gn.c)(bo,{name:"MuiSelect"})(xo);var Eo=n(168),To="undefined"===typeof window?i.useEffect:i.useLayoutEffect,Co=i.forwardRef((function(e,t){var n=e.alignItems,r=void 0===n?"center":n,a=e.autoFocus,s=void 0!==a&&a,l=e.button,c=void 0!==l&&l,u=e.children,d=e.classes,p=e.className,h=e.component,f=e.ContainerComponent,m=void 0===f?"li":f,g=e.ContainerProps,v=(g=void 0===g?{}:g).className,b=(0,Yn.c)(g,["className"]),y=e.dense,_=void 0!==y&&y,x=e.disabled,w=void 0!==x&&x,E=e.disableGutters,T=void 0!==E&&E,C=e.divider,k=void 0!==C&&C,S=e.focusVisibleClassName,O=e.selected,A=void 0!==O&&O,j=(0,Yn.c)(e,["alignItems","autoFocus","button","children","classes","className","component","ContainerComponent","ContainerProps","dense","disabled","disableGutters","divider","focusVisibleClassName","selected"]),P=i.useContext(Ti),I={dense:_||P.dense||!1,alignItems:r},L=i.useRef(null);To((function(){s&&L.current&&L.current.focus()}),[s]);var R=i.Children.toArray(u),N=R.length&&(0,Eo.c)(R[R.length-1],["ListItemSecondaryAction"]),D=i.useCallback((function(e){L.current=o.findDOMNode(e)}),[]),M=(0,ar.c)(D,t),B=(0,at.c)({className:(0,kn.c)(d.root,p,I.dense&&d.dense,!T&&d.gutters,k&&d.divider,w&&d.disabled,c&&d.button,"center"!==r&&d.alignItemsFlexStart,N&&d.secondaryAction,A&&d.selected),disabled:w},j),Q=h||"li";return c&&(B.component=h||"div",B.focusVisibleClassName=(0,kn.c)(d.focusVisible,S),Q=Er),N?(Q=B.component||h?Q:"div","li"===m&&("li"===Q?Q="div":"li"===B.component&&(B.component="div")),i.createElement(Ti.Provider,{value:I},i.createElement(m,(0,at.c)({className:(0,kn.c)(d.container,v),ref:M},b),i.createElement(Q,B,R),R.pop()))):i.createElement(Ti.Provider,{value:I},i.createElement(Q,(0,at.c)({ref:M},B),R))}));const ko=(0,Gn.c)((function(e){return{root:{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,"&$focusVisible":{backgroundColor:e.palette.action.selected},"&$selected, &$selected:hover":{backgroundColor:e.palette.action.selected},"&$disabled":{opacity:.5}},container:{position:"relative"},focusVisible:{},dense:{paddingTop:4,paddingBottom:4},alignItemsFlexStart:{alignItems:"flex-start"},disabled:{},divider:{borderBottom:"1px solid ".concat(e.palette.divider),backgroundClip:"padding-box"},gutters:{paddingLeft:16,paddingRight:16},button:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:e.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}},secondaryAction:{paddingRight:48},selected:{}}}),{name:"MuiListItem"})(Co);var So=i.forwardRef((function(e,t){var n,r=e.classes,o=e.className,a=e.component,s=void 0===a?"li":a,l=e.disableGutters,c=void 0!==l&&l,u=e.ListItemClasses,d=e.role,p=void 0===d?"menuitem":d,h=e.selected,f=e.tabIndex,m=(0,Yn.c)(e,["classes","className","component","disableGutters","ListItemClasses","role","selected","tabIndex"]);return e.disabled||(n=void 0!==f?f:-1),i.createElement(ko,(0,at.c)({button:!0,role:p,tabIndex:n,component:s,selected:h,disableGutters:c,classes:(0,at.c)({dense:r.dense},u),className:(0,kn.c)(r.root,o,h&&r.selected,!c&&r.gutters),ref:t},m))}));const Oo=(0,Gn.c)((function(e){return{root:(0,at.c)({},e.typography.body1,(0,nr.c)({minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",width:"auto",overflow:"hidden",whiteSpace:"nowrap"},e.breakpoints.up("sm"),{minHeight:"auto"})),gutters:{},selected:{},dense:(0,at.c)({},e.typography.body2,{minHeight:"auto"})}}),{name:"MuiMenuItem"})(So);var Ao=n(4880),jo={entering:{opacity:1},entered:{opacity:1}},Po={enter:Ao.rV.enteringScreen,exit:Ao.rV.leavingScreen},Io=i.forwardRef((function(e,t){var n=e.children,r=e.disableStrictModeCompat,o=void 0!==r&&r,a=e.in,s=e.onEnter,l=e.onEntered,c=e.onEntering,u=e.onExit,d=e.onExited,p=e.onExiting,h=e.style,f=e.TransitionComponent,m=void 0===f?di:f,g=e.timeout,v=void 0===g?Po:g,b=(0,Yn.c)(e,["children","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","TransitionComponent","timeout"]),y=Pn(),_=y.unstable_strictMode&&!o,x=i.useRef(null),w=(0,ar.c)(n.ref,t),E=(0,ar.c)(_?x:void 0,w),T=function(e){return function(t,n){if(e){var r=_?[x.current,t]:[t,n],i=(0,jr.c)(r,2),o=i[0],a=i[1];void 0===a?e(o):e(o,a)}}},C=T(c),k=T((function(e,t){pi(e);var n=hi({style:h,timeout:v},{mode:"enter"});e.style.webkitTransition=y.transitions.create("opacity",n),e.style.transition=y.transitions.create("opacity",n),s&&s(e,t)})),S=T(l),O=T(p),A=T((function(e){var t=hi({style:h,timeout:v},{mode:"exit"});e.style.webkitTransition=y.transitions.create("opacity",t),e.style.transition=y.transitions.create("opacity",t),u&&u(e)})),j=T(d);return i.createElement(m,(0,at.c)({appear:!0,in:a,nodeRef:_?x:void 0,onEnter:k,onEntered:S,onEntering:C,onExit:A,onExited:j,onExiting:O,timeout:v},b),(function(e,t){return i.cloneElement(n,(0,at.c)({style:(0,at.c)({opacity:0,visibility:"exited"!==e||a?void 0:"hidden"},jo[e],h,n.props.style),ref:E},t))}))}));const Lo=Io;var Ro=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.invisible,s=void 0!==a&&a,l=e.open,c=e.transitionDuration,u=e.TransitionComponent,d=void 0===u?Lo:u,p=(0,Yn.c)(e,["children","classes","className","invisible","open","transitionDuration","TransitionComponent"]);return i.createElement(d,(0,at.c)({in:l,timeout:c},p),i.createElement("div",{className:(0,kn.c)(r.root,o,s&&r.invisible),"aria-hidden":!0,ref:t},n))}));const No=(0,Gn.c)({root:{zIndex:-1,position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},invisible:{backgroundColor:"transparent"}},{name:"MuiBackdrop"})(Ro);function Do(e,t){var n=function(e,t){var n,r=t.getBoundingClientRect();if(t.fakeTransform)n=t.fakeTransform;else{var i=window.getComputedStyle(t);n=i.getPropertyValue("-webkit-transform")||i.getPropertyValue("transform")}var o=0,a=0;if(n&&"none"!==n&&"string"===typeof n){var s=n.split("(")[1].split(")")[0].split(",");o=parseInt(s[4],10),a=parseInt(s[5],10)}return"left"===e?"translateX(".concat(window.innerWidth,"px) translateX(").concat(o-r.left,"px)"):"right"===e?"translateX(-".concat(r.left+r.width-o,"px)"):"up"===e?"translateY(".concat(window.innerHeight,"px) translateY(").concat(a-r.top,"px)"):"translateY(-".concat(r.top+r.height-a,"px)")}(e,t);n&&(t.style.webkitTransform=n,t.style.transform=n)}var Mo={enter:Ao.rV.enteringScreen,exit:Ao.rV.leavingScreen},Bo=i.forwardRef((function(e,t){var n=e.children,r=e.direction,a=void 0===r?"down":r,s=e.in,l=e.onEnter,c=e.onEntered,u=e.onEntering,d=e.onExit,p=e.onExited,h=e.onExiting,f=e.style,m=e.timeout,g=void 0===m?Mo:m,v=e.TransitionComponent,b=void 0===v?di:v,y=(0,Yn.c)(e,["children","direction","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),_=Pn(),x=i.useRef(null),w=i.useCallback((function(e){x.current=o.findDOMNode(e)}),[]),E=(0,ar.c)(n.ref,w),T=(0,ar.c)(E,t),C=function(e){return function(t){e&&(void 0===t?e(x.current):e(x.current,t))}},k=C((function(e,t){Do(a,e),pi(e),l&&l(e,t)})),S=C((function(e,t){var n=hi({timeout:g,style:f},{mode:"enter"});e.style.webkitTransition=_.transitions.create("-webkit-transform",(0,at.c)({},n,{easing:_.transitions.easing.easeOut})),e.style.transition=_.transitions.create("transform",(0,at.c)({},n,{easing:_.transitions.easing.easeOut})),e.style.webkitTransform="none",e.style.transform="none",u&&u(e,t)})),O=C(c),A=C(h),j=C((function(e){var t=hi({timeout:g,style:f},{mode:"exit"});e.style.webkitTransition=_.transitions.create("-webkit-transform",(0,at.c)({},t,{easing:_.transitions.easing.sharp})),e.style.transition=_.transitions.create("transform",(0,at.c)({},t,{easing:_.transitions.easing.sharp})),Do(a,e),d&&d(e)})),P=C((function(e){e.style.webkitTransition="",e.style.transition="",p&&p(e)})),I=i.useCallback((function(){x.current&&Do(a,x.current)}),[a]);return i.useEffect((function(){if(!s&&"down"!==a&&"right"!==a){var e=(0,Rr.c)((function(){x.current&&Do(a,x.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}}),[a,s]),i.useEffect((function(){s||I()}),[s,I]),i.createElement(b,(0,at.c)({nodeRef:x,onEnter:k,onEntered:O,onEntering:S,onExit:j,onExited:P,onExiting:A,appear:!0,in:s,timeout:g},y),(function(e,t){return i.cloneElement(n,(0,at.c)({ref:T,style:(0,at.c)({visibility:"exited"!==e||s?void 0:"hidden"},f,n.props.style)},t))}))}));const Qo=Bo;var Uo={left:"right",right:"left",top:"down",bottom:"up"};var Fo={enter:Ao.rV.enteringScreen,exit:Ao.rV.leavingScreen},zo=i.forwardRef((function(e,t){var n=e.anchor,r=void 0===n?"left":n,o=e.BackdropProps,a=e.children,s=e.classes,l=e.className,c=e.elevation,u=void 0===c?16:c,d=e.ModalProps,p=(d=void 0===d?{}:d).BackdropProps,h=(0,Yn.c)(d,["BackdropProps"]),f=e.onClose,m=e.open,g=void 0!==m&&m,v=e.PaperProps,b=void 0===v?{}:v,y=e.SlideProps,_=e.TransitionComponent,x=void 0===_?Qo:_,w=e.transitionDuration,E=void 0===w?Fo:w,T=e.variant,C=void 0===T?"temporary":T,k=(0,Yn.c)(e,["anchor","BackdropProps","children","classes","className","elevation","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"]),S=Pn(),O=i.useRef(!1);i.useEffect((function(){O.current=!0}),[]);var A=function(e,t){return"rtl"===e.direction&&function(e){return-1!==["left","right"].indexOf(e)}(t)?Uo[t]:t}(S,r),j=i.createElement(Xn,(0,at.c)({elevation:"temporary"===C?u:0,square:!0},b,{className:(0,kn.c)(s.paper,s["paperAnchor".concat((0,Zn.c)(A))],b.className,"temporary"!==C&&s["paperAnchorDocked".concat((0,Zn.c)(A))])}),a);if("permanent"===C)return i.createElement("div",(0,at.c)({className:(0,kn.c)(s.root,s.docked,l),ref:t},k),j);var P=i.createElement(x,(0,at.c)({in:g,direction:Uo[A],timeout:E,appear:O.current},y),j);return"persistent"===C?i.createElement("div",(0,at.c)({className:(0,kn.c)(s.root,s.docked,l),ref:t},k),P):i.createElement(ti,(0,at.c)({BackdropProps:(0,at.c)({},o,p,{transitionDuration:E}),BackdropComponent:No,className:(0,kn.c)(s.root,s.modal,l),open:g,onClose:f,ref:t},k,h),P)}));const qo=(0,Gn.c)((function(e){return{root:{},docked:{flex:"0 0 auto"},paper:{overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:e.zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},paperAnchorLeft:{left:0,right:"auto"},paperAnchorRight:{left:"auto",right:0},paperAnchorTop:{top:0,left:0,bottom:"auto",right:0,height:"auto",maxHeight:"100%"},paperAnchorBottom:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},paperAnchorDockedLeft:{borderRight:"1px solid ".concat(e.palette.divider)},paperAnchorDockedTop:{borderBottom:"1px solid ".concat(e.palette.divider)},paperAnchorDockedRight:{borderLeft:"1px solid ".concat(e.palette.divider)},paperAnchorDockedBottom:{borderTop:"1px solid ".concat(e.palette.divider)},modal:{}}}),{name:"MuiDrawer",flip:!1})(zo);var Ho=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=(0,Yn.c)(e,["classes","className"]),a=i.useContext(Ti);return i.createElement("div",(0,at.c)({className:(0,kn.c)(n.root,r,"flex-start"===a.alignItems&&n.alignItemsFlexStart),ref:t},o))}));const Wo=(0,Gn.c)((function(e){return{root:{minWidth:56,color:e.palette.action.active,flexShrink:0,display:"inline-flex"},alignItemsFlexStart:{marginTop:8}}}),{name:"MuiListItemIcon"})(Ho),Go=(0,In.c)(i.createElement("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");var Vo=i.forwardRef((function(e,t){var n=e.alt,r=e.children,o=e.classes,a=e.className,s=e.component,l=void 0===s?"div":s,c=e.imgProps,u=e.sizes,d=e.src,p=e.srcSet,h=e.variant,f=void 0===h?"circular":h,m=(0,Yn.c)(e,["alt","children","classes","className","component","imgProps","sizes","src","srcSet","variant"]),g=null,v=function(e){var t=e.src,n=e.srcSet,r=i.useState(!1),o=r[0],a=r[1];return i.useEffect((function(){if(t||n){a(!1);var e=!0,r=new Image;return r.src=t,r.srcSet=n,r.onload=function(){e&&a("loaded")},r.onerror=function(){e&&a("error")},function(){e=!1}}}),[t,n]),o}({src:d,srcSet:p}),b=d||p,y=b&&"error"!==v;return g=y?i.createElement("img",(0,at.c)({alt:n,src:d,srcSet:p,sizes:u,className:o.img},c)):null!=r?r:b&&n?n[0]:i.createElement(Go,{className:o.fallback}),i.createElement(l,(0,at.c)({className:(0,kn.c)(o.root,o.system,o[f],a,!y&&o.colorDefault),ref:t},m),g)}));const $o=(0,Gn.c)((function(e){return{root:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none"},colorDefault:{color:e.palette.background.default,backgroundColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},circle:{},circular:{},rounded:{borderRadius:e.shape.borderRadius},square:{borderRadius:0},img:{width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4},fallback:{width:"75%",height:"75%"}}}),{name:"MuiAvatar"})(Vo);var Ko=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.disableTypography,s=void 0!==a&&a,l=e.inset,c=void 0!==l&&l,u=e.primary,d=e.primaryTypographyProps,p=e.secondary,h=e.secondaryTypographyProps,f=(0,Yn.c)(e,["children","classes","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"]),m=i.useContext(Ti).dense,g=null!=u?u:n;null==g||g.type===Or||s||(g=i.createElement(Or,(0,at.c)({variant:m?"body2":"body1",className:r.primary,component:"span",display:"block"},d),g));var v=p;return null==v||v.type===Or||s||(v=i.createElement(Or,(0,at.c)({variant:"body2",className:r.secondary,color:"textSecondary",display:"block"},h),v)),i.createElement("div",(0,at.c)({className:(0,kn.c)(r.root,o,m&&r.dense,c&&r.inset,g&&v&&r.multiline),ref:t},f),g,v)}));const Yo=(0,Gn.c)({root:{flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},multiline:{marginTop:6,marginBottom:6},dense:{},inset:{paddingLeft:56},primary:{},secondary:{}},{name:"MuiListItemText"})(Ko);var Zo=i.forwardRef((function(e,t){var n=e.absolute,r=void 0!==n&&n,o=e.classes,a=e.className,s=e.component,l=void 0===s?"hr":s,c=e.flexItem,u=void 0!==c&&c,d=e.light,p=void 0!==d&&d,h=e.orientation,f=void 0===h?"horizontal":h,m=e.role,g=void 0===m?"hr"!==l?"separator":void 0:m,v=e.variant,b=void 0===v?"fullWidth":v,y=(0,Yn.c)(e,["absolute","classes","className","component","flexItem","light","orientation","role","variant"]);return i.createElement(l,(0,at.c)({className:(0,kn.c)(o.root,a,"fullWidth"!==b&&o[b],r&&o.absolute,u&&o.flexItem,p&&o.light,"vertical"===f&&o.vertical),role:g,ref:t},y))}));const Jo=(0,Gn.c)((function(e){return{root:{height:1,margin:0,border:"none",flexShrink:0,backgroundColor:e.palette.divider},absolute:{position:"absolute",bottom:0,left:0,width:"100%"},inset:{marginLeft:72},light:{backgroundColor:(0,or.W4)(e.palette.divider,.08)},middle:{marginLeft:e.spacing(2),marginRight:e.spacing(2)},vertical:{height:"100%",width:1},flexItem:{alignSelf:"stretch",height:"auto"}}}),{name:"MuiDivider"})(Zo);var Xo=n(8384),ea="undefined"!==typeof window&&"undefined"!==typeof document&&"undefined"!==typeof navigator,ta=function(){for(var e=["Edge","Trident","Firefox"],t=0;t =0)return 1;return 0}();var na=ea&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),ta))}};function ra(e){return e&&"[object Function]"==={}.toString.call(e)}function ia(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function oa(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function aa(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=ia(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:aa(oa(e))}function sa(e){return e&&e.referenceNode?e.referenceNode:e}var la=ea&&!(!window.MSInputMethodContext||!document.documentMode),ca=ea&&/MSIE 10/.test(navigator.userAgent);function ua(e){return 11===e?la:10===e?ca:la||ca}function da(e){if(!e)return document.documentElement;for(var t=ua(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===ia(n,"position")?da(n):n:e?e.ownerDocument.documentElement:document.documentElement}function pa(e){return null!==e.parentNode?pa(e.parentNode):e}function ha(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a=o.commonAncestorContainer;if(e!==a&&t!==a||r.contains(i))return function(e){var t=e.nodeName;return"BODY"!==t&&("HTML"===t||da(e.firstElementChild)===e)}(a)?a:da(a);var s=pa(e);return s.host?ha(s.host,t):ha(e,pa(t).host)}function fa(e){var t="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=e.nodeName;if("BODY"===n||"HTML"===n){var r=e.ownerDocument.documentElement;return(e.ownerDocument.scrollingElement||r)[t]}return e[t]}function ma(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"])+parseFloat(e["border"+r+"Width"])}function ga(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],ua(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function va(e){var t=e.body,n=e.documentElement,r=ua(10)&&getComputedStyle(n);return{height:ga("Height",t,n,r),width:ga("Width",t,n,r)}}var ba=function(){function e(e,t){for(var n=0;n 2&&void 0!==arguments[2]&&arguments[2],r=ua(10),i="HTML"===t.nodeName,o=wa(e),a=wa(t),s=aa(e),l=ia(t),c=parseFloat(l.borderTopWidth),u=parseFloat(l.borderLeftWidth);n&&i&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var d=xa({top:o.top-a.top-c,left:o.left-a.left-u,width:o.width,height:o.height});if(d.marginTop=0,d.marginLeft=0,!r&&i){var p=parseFloat(l.marginTop),h=parseFloat(l.marginLeft);d.top-=c-p,d.bottom-=c-p,d.left-=u-h,d.right-=u-h,d.marginTop=p,d.marginLeft=h}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=fa(t,"top"),i=fa(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}(d,t)),d}function Ta(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===ia(e,"position"))return!0;var n=oa(e);return!!n&&Ta(n)}function Ca(e){if(!e||!e.parentElement||ua())return document.documentElement;for(var t=e.parentElement;t&&"none"===ia(t,"transform");)t=t.parentElement;return t||document.documentElement}function ka(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?Ca(e):ha(e,sa(t));if("viewport"===r)o=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=Ea(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:fa(n),s=t?0:fa(n,"left");return xa({top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o})}(a,i);else{var s=void 0;"scrollParent"===r?"BODY"===(s=aa(oa(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var l=Ea(s,a,i);if("HTML"!==s.nodeName||Ta(a))o=l;else{var c=va(e.ownerDocument),u=c.height,d=c.width;o.top+=l.top-l.marginTop,o.bottom=u+l.top,o.left+=l.left-l.marginLeft,o.right=d+l.left}}var p="number"===typeof(n=n||0);return o.left+=p?n:n.left||0,o.top+=p?n:n.top||0,o.right-=p?n:n.right||0,o.bottom-=p?n:n.bottom||0,o}function Sa(e){return e.width*e.height}function Oa(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=ka(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map((function(e){return _a({key:e},s[e],{area:Sa(s[e])})})).sort((function(e,t){return t.area-e.area})),c=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),u=c.length>0?c[0].key:l[0].key,d=e.split("-")[1];return u+(d?"-"+d:"")}function Aa(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Ea(n,r?Ca(t):ha(t,sa(n)),r)}function ja(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function Pa(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function Ia(e,t,n){n=n.split("-")[0];var r=ja(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return i[a]=t[a]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[c]:t[Pa(s)],i}function La(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function Ra(e,t,n){var r=void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=La(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n));return r.forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&ra(n)&&(t.offsets.popper=xa(t.offsets.popper),t.offsets.reference=xa(t.offsets.reference),t=n(t,e))})),t}function Na(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=Aa(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=Oa(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=Ia(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=Ra(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function Da(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function Ma(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r 1&&void 0!==arguments[1]&&arguments[1],n=Ka.indexOf(e),r=Ka.slice(n+1).concat(Ka.slice(0,n));return t?r.reverse():r}var Za="flip",Ja="clockwise",Xa="counterclockwise";function es(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(La(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return c=c.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){return xa("%p"===a?n:r)[t]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,i,t,n)}))})),c.forEach((function(e,t){e.forEach((function(n,r){Ha(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var ts={shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",c=s?"width":"height",u={start:ya({},l,o[l]),end:ya({},l,o[l]+o[c]-a[c])};e.offsets.popper=_a({},a,u[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],l=void 0;return l=Ha(+n)?[+n,0]:es(n,o,a,s),"left"===s?(o.top+=l[0],o.left-=l[1]):"right"===s?(o.top+=l[0],o.left+=l[1]):"top"===s?(o.left+=l[0],o.top-=l[1]):"bottom"===s&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||da(e.instance.popper);e.instance.reference===n&&(n=da(n));var r=Ma("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=ka(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=l;var c=t.priority,u=e.offsets.popper,d={primary:function(e){var n=u[e];return u[e] l[e]&&!t.escapeWithReference&&(r=Math.min(u[n],l[e]-("right"===e?u.width:u.height))),ya({},n,r)}};return c.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=_a({},u,d[t](e))})),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",l=a?"left":"top",c=a?"width":"height";return n[s] o(r[s])&&(e.offsets.popper[l]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!Va(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"===typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,a=o.popper,s=o.reference,l=-1!==["left","right"].indexOf(i),c=l?"height":"width",u=l?"Top":"Left",d=u.toLowerCase(),p=l?"left":"top",h=l?"bottom":"right",f=ja(r)[c];s[h]-fa[h]&&(e.offsets.popper[d]+=s[d]+f-a[h]),e.offsets.popper=xa(e.offsets.popper);var m=s[d]+s[c]/2-f/2,g=ia(e.instance.popper),v=parseFloat(g["margin"+u]),b=parseFloat(g["border"+u+"Width"]),y=m-e.offsets.popper[d]-v-b;return y=Math.max(Math.min(a[c]-f,y),0),e.arrowElement=r,e.offsets.arrow=(ya(n={},d,Math.round(y)),ya(n,p,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(Da(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=ka(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=Pa(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case Za:a=[r,i];break;case Ja:a=Ya(r);break;case Xa:a=Ya(r,!0);break;default:a=t.behavior}return a.forEach((function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],i=Pa(r);var c=e.offsets.popper,u=e.offsets.reference,d=Math.floor,p="left"===r&&d(c.right)>d(u.left)||"right"===r&&d(c.left) d(u.top)||"bottom"===r&&d(c.top) d(n.right),m=d(c.top) d(n.bottom),v="left"===r&&h||"right"===r&&f||"top"===r&&m||"bottom"===r&&g,b=-1!==["top","bottom"].indexOf(r),y=!!t.flipVariations&&(b&&"start"===o&&h||b&&"end"===o&&f||!b&&"start"===o&&m||!b&&"end"===o&&g),_=!!t.flipVariationsByContent&&(b&&"start"===o&&f||b&&"end"===o&&h||!b&&"start"===o&&g||!b&&"end"===o&&m),x=y||_;(p||v||x)&&(e.flipped=!0,(p||v)&&(r=a[l+1]),x&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=_a({},e.offsets.popper,Ia(e.instance.popper,e.offsets.reference,e.placement)),e=Ra(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=Pa(t),e.offsets.popper=xa(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!Va(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=La(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom n.right||t.top>n.bottom||t.right 2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=na(this.update.bind(this)),this.options=_a({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(_a({},e.Defaults.modifiers,i.modifiers)).forEach((function(t){r.options.modifiers[t]=_a({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return _a({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&ra(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return ba(e,[{key:"update",value:function(){return Na.call(this)}},{key:"destroy",value:function(){return Ba.call(this)}},{key:"enableEventListeners",value:function(){return za.call(this)}},{key:"disableEventListeners",value:function(){return qa.call(this)}}]),e}();rs.Utils=("undefined"!==typeof window?window:n.g).PopperUtils,rs.placements=$a,rs.Defaults=ns;const is=rs;function os(e){return"function"===typeof e?e():e}var as="undefined"!==typeof window?i.useLayoutEffect:i.useEffect,ss={},ls=i.forwardRef((function(e,t){var n=e.anchorEl,r=e.children,o=e.container,a=e.disablePortal,s=void 0!==a&&a,l=e.keepMounted,c=void 0!==l&&l,u=e.modifiers,d=e.open,p=e.placement,h=void 0===p?"bottom":p,f=e.popperOptions,m=void 0===f?ss:f,g=e.popperRef,v=e.style,b=e.transition,y=void 0!==b&&b,_=(0,Yn.c)(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition"]),x=i.useRef(null),w=(0,ar.c)(x,t),E=i.useRef(null),T=(0,ar.c)(E,g),C=i.useRef(T);as((function(){C.current=T}),[T]),i.useImperativeHandle(g,(function(){return E.current}),[]);var k=i.useState(!0),S=k[0],O=k[1],A=function(e,t){if("ltr"===(t&&t.direction||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(h,(0,jn.c)()),j=i.useState(A),P=j[0],I=j[1];i.useEffect((function(){E.current&&E.current.update()}));var L=i.useCallback((function(){if(x.current&&n&&d){E.current&&(E.current.destroy(),C.current(null));var e=function(e){I(e.placement)},t=(os(n),new is(os(n),x.current,(0,at.c)({placement:A},m,{modifiers:(0,at.c)({},s?{}:{preventOverflow:{boundariesElement:"window"}},u,m.modifiers),onCreate:(0,Dr.c)(e,m.onCreate),onUpdate:(0,Dr.c)(e,m.onUpdate)})));C.current(t)}}),[n,s,u,d,A,m]),R=i.useCallback((function(e){(0,Br.c)(w,e),L()}),[w,L]),N=function(){E.current&&(E.current.destroy(),C.current(null))};if(i.useEffect((function(){return function(){N()}}),[]),i.useEffect((function(){d||y||N()}),[d,y]),!c&&!d&&(!y||S))return null;var D={placement:P};return y&&(D.TransitionProps={in:d,onEnter:function(){O(!1)},onExited:function(){O(!0),N()}}),i.createElement(Ur,{disablePortal:s,container:o},i.createElement("div",(0,at.c)({ref:R,role:"tooltip"},_,{style:(0,at.c)({position:"fixed",top:0,left:0,display:d||!c||y?null:"none"},v)}),"function"===typeof r?r(D):r))}));const cs=ls;var us=n(5064);function ds(e){return Math.round(1e5*e)/1e5}var ps=!1,hs=null;var fs=i.forwardRef((function(e,t){var n=e.arrow,r=void 0!==n&&n,a=e.children,s=e.classes,l=e.disableFocusListener,c=void 0!==l&&l,u=e.disableHoverListener,d=void 0!==u&&u,p=e.disableTouchListener,h=void 0!==p&&p,f=e.enterDelay,m=void 0===f?100:f,g=e.enterNextDelay,v=void 0===g?0:g,b=e.enterTouchDelay,y=void 0===b?700:b,_=e.id,x=e.interactive,w=void 0!==x&&x,E=e.leaveDelay,T=void 0===E?0:E,C=e.leaveTouchDelay,k=void 0===C?1500:C,S=e.onClose,O=e.onOpen,A=e.open,j=e.placement,P=void 0===j?"bottom":j,I=e.PopperComponent,L=void 0===I?cs:I,R=e.PopperProps,N=e.title,D=e.TransitionComponent,M=void 0===D?vi:D,B=e.TransitionProps,Q=(0,Yn.c)(e,["arrow","children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","title","TransitionComponent","TransitionProps"]),U=Pn(),F=i.useState(),z=F[0],q=F[1],H=i.useState(null),W=H[0],G=H[1],V=i.useRef(!1),$=i.useRef(),K=i.useRef(),Y=i.useRef(),Z=i.useRef(),J=(0,Ui.c)({controlled:A,default:!1,name:"Tooltip",state:"open"}),X=(0,jr.c)(J,2),ee=X[0],te=X[1],ne=ee,re=(0,us.c)(_);i.useEffect((function(){return function(){clearTimeout($.current),clearTimeout(K.current),clearTimeout(Y.current),clearTimeout(Z.current)}}),[]);var ie=function(e){clearTimeout(hs),ps=!0,te(!0),O&&O(e)},oe=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=a.props;"mouseover"===t.type&&n.onMouseOver&&e&&n.onMouseOver(t),V.current&&"touchstart"!==t.type||(z&&z.removeAttribute("title"),clearTimeout(K.current),clearTimeout(Y.current),m||ps&&v?(t.persist(),K.current=setTimeout((function(){ie(t)}),ps?v:m)):ie(t))}},ae=(0,lr.c)(),se=ae.isFocusVisible,le=ae.onBlurVisible,ce=ae.ref,ue=i.useState(!1),de=ue[0],pe=ue[1],he=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){z||q(t.currentTarget),se(t)&&(pe(!0),oe()(t));var n=a.props;n.onFocus&&e&&n.onFocus(t)}},fe=function(e){clearTimeout(hs),hs=setTimeout((function(){ps=!1}),800+T),te(!1),S&&S(e),clearTimeout($.current),$.current=setTimeout((function(){V.current=!1}),U.transitions.duration.shortest)},me=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(t){var n=a.props;"blur"===t.type&&(n.onBlur&&e&&n.onBlur(t),de&&(pe(!1),le())),"mouseleave"===t.type&&n.onMouseLeave&&t.currentTarget===z&&n.onMouseLeave(t),clearTimeout(K.current),clearTimeout(Y.current),t.persist(),Y.current=setTimeout((function(){fe(t)}),T)}},ge=function(e){V.current=!0;var t=a.props;t.onTouchStart&&t.onTouchStart(e)},ve=(0,ar.c)(q,t),be=(0,ar.c)(ce,ve),ye=i.useCallback((function(e){(0,Br.c)(be,o.findDOMNode(e))}),[be]),_e=(0,ar.c)(a.ref,ye);""===N&&(ne=!1);var xe=!ne&&!d,we=(0,at.c)({"aria-describedby":ne?re:null,title:xe&&"string"===typeof N?N:null},Q,a.props,{className:(0,kn.c)(Q.className,a.props.className),onTouchStart:ge,ref:_e}),Ee={};h||(we.onTouchStart=function(e){ge(e),clearTimeout(Y.current),clearTimeout($.current),clearTimeout(Z.current),e.persist(),Z.current=setTimeout((function(){oe()(e)}),y)},we.onTouchEnd=function(e){a.props.onTouchEnd&&a.props.onTouchEnd(e),clearTimeout(Z.current),clearTimeout(Y.current),e.persist(),Y.current=setTimeout((function(){fe(e)}),k)}),d||(we.onMouseOver=oe(),we.onMouseLeave=me(),w&&(Ee.onMouseOver=oe(!1),Ee.onMouseLeave=me(!1))),c||(we.onFocus=he(),we.onBlur=me(),w&&(Ee.onFocus=he(!1),Ee.onBlur=me(!1)));var Te=i.useMemo((function(){return(0,Xo.c)({popperOptions:{modifiers:{arrow:{enabled:Boolean(W),element:W}}}},R)}),[W,R]);return i.createElement(i.Fragment,null,i.cloneElement(a,we),i.createElement(L,(0,at.c)({className:(0,kn.c)(s.popper,w&&s.popperInteractive,r&&s.popperArrow),placement:P,anchorEl:z,open:!!z&&ne,id:we["aria-describedby"],transition:!0},Ee,Te),(function(e){var t=e.placement,n=e.TransitionProps;return i.createElement(M,(0,at.c)({timeout:U.transitions.duration.shorter},n,B),i.createElement("div",{className:(0,kn.c)(s.tooltip,s["tooltipPlacement".concat((0,Zn.c)(t.split("-")[0]))],V.current&&s.touch,r&&s.tooltipArrow)},N,r?i.createElement("span",{className:s.arrow,ref:G}):null))})))}));const ms=(0,Gn.c)((function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none"},popperInteractive:{pointerEvents:"auto"},popperArrow:{'&[x-placement*="bottom"] $arrow':{top:0,left:0,marginTop:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"0 100%"}},'&[x-placement*="top"] $arrow':{bottom:0,left:0,marginBottom:"-0.71em",marginLeft:4,marginRight:4,"&::before":{transformOrigin:"100% 0"}},'&[x-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"100% 100%"}},'&[x-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em",marginTop:4,marginBottom:4,"&::before":{transformOrigin:"0 0"}}},tooltip:{backgroundColor:(0,or.W4)(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(ds(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},tooltipArrow:{position:"relative",margin:"0"},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:(0,or.W4)(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(ds(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:(0,nr.c)({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:(0,nr.c)({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:(0,nr.c)({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:(0,nr.c)({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}}),{name:"MuiTooltip",flip:!1})(fs),gs=!1,vs=!1,bs="${JSCORE_VERSION}",ys=function(e,t){if(!e)throw _s(t)},_s=function(e){return new Error("Firebase Database ("+bs+") INTERNAL ASSERT FAILED: "+e)},xs=function(e){const t=[];let n=0;for(let r=0;r >6|192,t[n++]=63&i|128):55296===(64512&i)&&r+1 >18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},ws={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i >2,u=(3&t)<<4|a>>4;let d=(15&a)<<2|l>>6,p=63&l;s||(p=64,o||(d=64)),r.push(n[c],n[u],n[d],n[p])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(xs(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n 191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const o=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(o>>10)),t[r++]=String.fromCharCode(56320+(1023&o))}else{const o=e[n++],a=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i >4;if(r.push(l),64!==a){const e=o<<4&240|a>>2;if(r.push(e),64!==s){const e=a<<6&192|s;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e =this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class Es extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Ts=function(e){const t=xs(e);return ws.encodeByteArray(t,!0)},Cs=function(e){return Ts(e).replace(/\./g,"")},ks=function(e){try{return ws.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function Ss(e){return Os(void 0,e)}function Os(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const n in t)t.hasOwnProperty(n)&&As(n)&&(e[n]=Os(e[n],t[n]));return e}function As(e){return"__proto__"!==e}const js=()=>function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,Ps=()=>{try{return js()||(()=>{if("undefined"===typeof process)return;const e={NODE_ENV:"production",PUBLIC_URL:"/metadata-entry-form",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_GOOGLE_CLOUD_API_KEY:"AIzaSyBz4kb3hJHXw0voYZgHZuAgmqGosxntMHM",REACT_APP_GOOGLE_CLOUD_API_KEY_DEV:"AIzaSyADkNENzpoqj3O7uGPsRA_4s1zQdbH708c"}.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"===typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(n){return}const t=e&&ks(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info("Unable to get __FIREBASE_DEFAULTS__ due to: ".concat(e))}},Is=e=>{var t,n;return null===(n=null===(t=Ps())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},Ls=e=>{const t=Is(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error("Invalid host ".concat(t," with no separate hostname and port!"));const r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},Rs=()=>{var e;return null===(e=Ps())||void 0===e?void 0:e.config},Ns=e=>{var t;return null===(t=Ps())||void 0===t?void 0:t["_".concat(e)]};class Ds{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"===typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}}function Ms(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function Bs(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Ms())}function Qs(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function Us(){return!0===gs||!0===vs}class Fs extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,Fs.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,zs.prototype.create)}}class zs{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e){const t=(arguments.length<=1?void 0:arguments[1])||{},n="".concat(this.service,"/").concat(e),r=this.errors[e],i=r?function(e,t){return e.replace(qs,((e,n)=>{const r=t[n];return null!=r?String(r):"<".concat(n,"?>")}))}(r,t):"Error",o="".concat(this.serviceName,": ").concat(i," (").concat(n,").");return new Fs(n,o,t)}}const qs=/\{\$([^}]+)}/g;function Hs(e){return JSON.parse(e)}function Ws(e){return JSON.stringify(e)}const Gs=function(e){let t={},n={},r={},i="";try{const o=e.split(".");t=Hs(ks(o[0])||""),n=Hs(ks(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(o){}return{header:t,claims:n,data:r,signature:i}};function Vs(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $s(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function Ks(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Ys(e,t,n){const r={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r}function Zs(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],o=t[i];if(Js(n)&&Js(o)){if(!Zs(n,o))return!1}else if(n!==o)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function Js(e){return null!==e&&"object"===typeof e}function Xs(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach((e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function el(e){const t={};return e.replace(/^\?/,"").split("&").forEach((e=>{if(e){const[n,r]=e.split("=");t[decodeURIComponent(n)]=decodeURIComponent(r)}})),t}function tl(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}class nl{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e >>31)}let r,i,o=this.chain_[0],a=this.chain_[1],s=this.chain_[2],l=this.chain_[3],c=this.chain_[4];for(let u=0;u<80;u++){u<40?u<20?(r=l^a&(s^l),i=1518500249):(r=a^s^l,i=1859775393):u<60?(r=a&s|l&(a|s),i=2400959708):(r=a^s^l,i=3395469782);const e=(o<<5|o>>>27)+r+c+i+n[u]&4294967295;c=l,l=s,s=4294967295&(a<<30|a>>>2),a=o,o=e}this.chain_[0]=this.chain_[0]+o&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+s&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(e,t){if(null==e)return;void 0===t&&(t=e.length);const n=t-this.blockSize;let r=0;const i=this.buf_;let o=this.inbuf_;for(;r =56;r--)this.buf_[r]=255&t,t/=256;this.compress_(this.buf_);let n=0;for(let r=0;r<5;r++)for(let t=24;t>=0;t-=8)e[n]=this.chain_[r]>>t&255,++n;return e}}class rl{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!==typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"===typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=il),void 0===r.error&&(r.error=il),void 0===r.complete&&(r.complete=il);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}})),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t {if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(n){"undefined"!==typeof console&&console.error&&console.error(n)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function il(){}function ol(e,t){return"".concat(e," failed: ").concat(t," argument ")}const al=function(e){let t=0;for(let n=0;n =55296&&r<=56319?(t+=4,n++):t+=3}return t};function sl(e){return e&&e._delegate?e._delegate:e}class ll{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const cl="[DEFAULT]";class ul{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new Ds;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(n){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null===e||void 0===e?void 0:e.identifier),r=null!==(t=null===e||void 0===e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service ".concat(this.name," is not available"))}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error("Mismatching Component ".concat(e.name," for Provider ").concat(this.name,"."));if(this.component)throw Error("Component for ".concat(this.name," has already been provided"));if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:cl})}catch(t){}for(const[e,n]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:r});n.resolve(e)}catch(t){}}}}clearInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cl;this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cl;return this.instances.has(e)}getOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cl;return this.instancesOptions.get(e)||{}}initialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error("".concat(this.name,"(").concat(n,") has already been initialized"));if(!this.isComponentSet())throw Error("Component ".concat(this.name," has not been registered yet"));const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[i,o]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(i)&&o.resolve(r)}return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const o=this.instances.get(r);return o&&e(o,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const i of n)try{i(e,t)}catch(r){}}getOrInitializeService(e){let{instanceIdentifier:t,options:n={}}=e,r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:(i=t,i===cl?void 0:i),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch(o){}var i;return r||null}normalizeInstanceIdentifier(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:cl;return this.component?this.component.multipleInstances?e:cl:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class dl{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component ".concat(e.name," has already been registered with ").concat(this.name));t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new ul(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const pl=[];var hl;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(hl||(hl={}));const fl={debug:hl.DEBUG,verbose:hl.VERBOSE,info:hl.INFO,warn:hl.WARN,error:hl.ERROR,silent:hl.SILENT},ml=hl.INFO,gl={[hl.DEBUG]:"log",[hl.VERBOSE]:"log",[hl.INFO]:"info",[hl.WARN]:"warn",[hl.ERROR]:"error"},vl=function(e,t){if(t 2?i-2:0),a=2;at.some((t=>e instanceof t));let _l,xl;const wl=new WeakMap,El=new WeakMap,Tl=new WeakMap,Cl=new WeakMap,kl=new WeakMap;let Sl={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return El.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Tl.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return jl(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Ol(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(xl||(xl=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,n=new Array(t),r=0;r 1?n-1:0),i=1;i {const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),r()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)}));El.set(e,t)}(e),yl(e,_l||(_l=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,Sl):e)}function jl(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(jl(e.result)),r()},o=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",o)}));return t.then((t=>{t instanceof IDBCursor&&wl.set(t,e)})).catch((()=>{})),kl.set(t,e),t}(e);if(Cl.has(e))return Cl.get(e);const t=Al(e);return t!==e&&(Cl.set(e,t),kl.set(t,e)),t}const Pl=e=>kl.get(e);const Il=["get","getKey","getAll","getAllKeys","count"],Ll=["put","add","delete","clear"],Rl=new Map;function Nl(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(Rl.get(t))return Rl.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=Ll.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!Il.includes(n))return;const o=async function(e){const t=this.transaction(e,i?"readwrite":"readonly");let o=t.store;for(var a=arguments.length,s=new Array(a>1?a-1:0),l=1;l({...e,get:(t,n,r)=>Nl(t,n)||e.get(t,n,r),has:(t,n)=>!!Nl(t,n)||e.has(t,n)}))(Sl);class Dl{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null===t||void 0===t?void 0:t.type)}(e)){const t=e.getImmediate();return"".concat(t.library,"/").concat(t.version)}return null})).filter((e=>e)).join(" ")}}const Ml="@firebase/app",Bl="0.9.27",Ql=new bl("@firebase/app"),Ul="[DEFAULT]",Fl={[Ml]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},zl=new Map,ql=new Map;function Hl(e,t){try{e.container.addComponent(t)}catch(n){Ql.debug("Component ".concat(t.name," failed to register with FirebaseApp ").concat(e.name),n)}}function Wl(e){const t=e.name;if(ql.has(t))return Ql.debug("There were multiple attempts to register component ".concat(t,".")),!1;ql.set(t,e);for(const n of zl.values())Hl(n,e);return!0}function Gl(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}const Vl=new zs("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."});class $l{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new ll("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Vl.create("app-deleted",{appName:this._name})}}const Kl="10.8.0";function Yl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;if("object"!==typeof t){t={name:t}}const r=Object.assign({name:Ul,automaticDataCollectionEnabled:!1},t),i=r.name;if("string"!==typeof i||!i)throw Vl.create("bad-app-name",{appName:String(i)});if(n||(n=Rs()),!n)throw Vl.create("no-options");const o=zl.get(i);if(o){if(Zs(n,o.options)&&Zs(r,o.config))return o;throw Vl.create("duplicate-app",{appName:i})}const a=new dl(i);for(const l of ql.values())a.addComponent(l);const s=new $l(n,r,a);return zl.set(i,s),s}function Zl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ul;const t=zl.get(e);if(!t&&e===Ul&&Rs())return Yl();if(!t)throw Vl.create("no-app",{appName:e});return t}function Jl(e,t,n){var r;let i=null!==(r=Fl[e])&&void 0!==r?r:e;n&&(i+="-".concat(n));const o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=['Unable to register library "'.concat(i,'" with version "').concat(t,'":')];return o&&e.push('library name "'.concat(i,'" contains illegal characters (whitespace or "/")')),o&&a&&e.push("and"),a&&e.push('version name "'.concat(t,'" contains illegal characters (whitespace or "/")')),void Ql.warn(e.join(" "))}Wl(new ll("".concat(i,"-version"),(()=>({library:i,version:t})),"VERSION"))}const Xl="firebase-heartbeat-database",ec=1,tc="firebase-heartbeat-store";let nc=null;function rc(){return nc||(nc=function(e,t){let{blocked:n,upgrade:r,blocking:i,terminated:o}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=indexedDB.open(e,t),s=jl(a);return r&&a.addEventListener("upgradeneeded",(e=>{r(jl(a.result),e.oldVersion,e.newVersion,jl(a.transaction),e)})),n&&a.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),s.then((e=>{o&&e.addEventListener("close",(()=>o())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),s}(Xl,ec,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(tc)}catch(n){console.warn(n)}}}).catch((e=>{throw Vl.create("idb-open",{originalErrorMessage:e.message})}))),nc}async function ic(e,t){try{const n=(await rc()).transaction(tc,"readwrite"),r=n.objectStore(tc);await r.put(t,oc(e)),await n.done}catch(n){if(n instanceof Fs)Ql.warn(n.message);else{const e=Vl.create("idb-set",{originalErrorMessage:null===n||void 0===n?void 0:n.message});Ql.warn(e.message)}}}function oc(e){return"".concat(e.name,"!").concat(e.options.appId)}class ac{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new lc(t),this._heartbeatsCachePromise=this._storage.read().then((e=>(this._heartbeatsCache=e,e)))}async triggerHeartbeat(){var e,t;const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=sc();if((null!=(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||(this._heartbeatsCache=await this._heartbeatsCachePromise,null!=(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))&&this._heartbeatsCache.lastSentHeartbeatDate!==r&&!this._heartbeatsCache.heartbeats.some((e=>e.date===r)))return this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){var e;if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=sc(),{heartbeatsToSend:n,unsentEntries:r}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024;const n=[];let r=e.slice();for(const i of e){const e=n.find((e=>e.agent===i.agent));if(e){if(e.dates.push(i.date),cc(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),cc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),i=Cs(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}}function sc(){return(new Date).toISOString().substring(0,10)}class lc{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!function(){try{return"object"===typeof indexedDB}catch(e){return!1}}()&&new Promise(((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(gh){t(gh)}})).then((()=>!0)).catch((()=>!1))}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await rc()).transaction(tc),n=await t.objectStore(tc).get(oc(e));return await t.done,n}catch(t){if(t instanceof Fs)Ql.warn(t.message);else{const e=Vl.create("idb-get",{originalErrorMessage:null===t||void 0===t?void 0:t.message});Ql.warn(e.message)}}}(this.app);return(null===e||void 0===e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ic(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ic(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function cc(e){return Cs(JSON.stringify({version:2,heartbeats:e})).length}var uc;uc="",Wl(new ll("platform-logger",(e=>new Dl(e)),"PRIVATE")),Wl(new ll("heartbeat",(e=>new ac(e)),"PRIVATE")),Jl(Ml,Bl,uc),Jl(Ml,Bl,"esm2017"),Jl("fire-js","");function dc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i 1?t-1:0),r=1;r 1?t-1:0),r=1;r 1?t-1:0),r=1;r 1?t-1:0),r=1;r 2?n-2:0),i=2;i e,"Short delay should be less than long delay!"),this.isMobile=Bs()||Qs()}get(){return Oc()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function jc(e,t){Tc(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?"".concat(n).concat(t.startsWith("/")?t.slice(1):t):n}class Pc{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!==typeof self&&"fetch"in self?self.fetch:"undefined"!==typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!==typeof fetch?fetch:void Ec("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!==typeof self&&"Headers"in self?self.Headers:"undefined"!==typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!==typeof Headers?Headers:void Ec("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!==typeof self&&"Response"in self?self.Response:"undefined"!==typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!==typeof Response?Response:void Ec("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Ic={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},Lc=new Ac(3e4,6e4);function Rc(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function Nc(e,t,n,r){return Dc(e,arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},(async()=>{let i={},o={};r&&("GET"===t?o=r:i={body:JSON.stringify(r)});const a=Xs(Object.assign({key:e.config.apiKey},o)).slice(1),s=await e._getAdditionalHeaders();return s["Content-Type"]="application/json",e.languageCode&&(s["X-Firebase-Locale"]=e.languageCode),Pc.fetch()(Bc(e,e.config.apiHost,n,a),Object.assign({method:t,headers:s,referrerPolicy:"no-referrer"},i))}))}async function Dc(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},Ic),t);try{const t=new Uc(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw Fc(e,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const t=i.ok?o.errorMessage:o.error.message,[n,a]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw Fc(e,"credential-already-in-use",o);if("EMAIL_EXISTS"===n)throw Fc(e,"email-already-in-use",o);if("USER_DISABLED"===n)throw Fc(e,"user-disabled",o);const s=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(a)throw yc(e,s,a);vc(e,s)}}catch(i){if(i instanceof Fs)throw i;vc(e,"network-request-failed",{message:String(i)})}}async function Mc(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=await Nc(e,t,n,r,i);return"mfaPendingCredential"in o&&vc(e,"multi-factor-auth-required",{_serverResponse:o}),o}function Bc(e,t,n,r){const i="".concat(t).concat(n,"?").concat(r);return e.config.emulator?jc(e.config,i):"".concat(e.config.apiScheme,"://").concat(i)}function Qc(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Uc{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise(((e,t)=>{this.timer=setTimeout((()=>t(bc(this.auth,"network-request-failed"))),Lc.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}function Fc(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=bc(e,t,r);return i.customData._tokenResponse=n,i}function zc(e){return void 0!==e&&void 0!==e.enterprise}class qc{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Qc(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}}async function Hc(e,t){return Nc(e,"GET","/v2/recaptchaConfig",Rc(e,t))}function Wc(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(t){}}function Gc(e){return 1e3*Number(e)}function Vc(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return gc("JWT malformed, contained fewer than 3 sections"),null;try{const e=ks(n);return e?JSON.parse(e):(gc("Failed to decode base64 JWT payload"),null)}catch(i){return gc("Caught error parsing JWT payload as JSON",null===i||void 0===i?void 0:i.toString()),null}}async function $c(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2])return t;try{return await t}catch(n){throw n instanceof Fs&&function(e){let{code:t}=e;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}(n)&&e.auth.currentUser===e&&await e.auth.signOut(),n}}class Kc{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout((async()=>{await this.iteration()}),t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void((null===e||void 0===e?void 0:e.code)==="auth/".concat("network-request-failed")&&this.schedule(!0))}this.schedule()}}class Yc{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Wc(this.lastLoginAt),this.creationTime=Wc(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function Zc(e){var t;const n=e.auth,r=await e.getIdToken(),i=await $c(e,async function(e,t){return Nc(e,"POST","/v1/accounts:lookup",t)}(n,{idToken:r}));wc(null===i||void 0===i?void 0:i.users.length,n,"internal-error");const o=i.users[0];e._notifyReloadListener(o);const a=(null===(t=o.providerUserInfo)||void 0===t?void 0:t.length)?o.providerUserInfo.map((e=>{var{providerId:t}=e,n=dc(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[];const s=function(e,t){const n=e.filter((e=>!t.some((t=>t.providerId===e.providerId))));return[...n,...t]}(e.providerData,a),l=e.isAnonymous,c=!(e.email&&o.passwordHash)&&!(null===s||void 0===s?void 0:s.length),u=!!l&&c,d={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:s,metadata:new Yc(o.createdAt,o.lastLoginAt),isAnonymous:u};Object.assign(e,d)}class Jc{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){wc(e.idToken,"internal-error"),wc("undefined"!==typeof e.idToken,"internal-error"),wc("undefined"!==typeof e.refreshToken,"internal-error");const t="expiresIn"in e&&"undefined"!==typeof e.expiresIn?Number(e.expiresIn):function(e){const t=Vc(e);return wc(t,"internal-error"),wc("undefined"!==typeof t.exp,"internal-error"),wc("undefined"!==typeof t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return wc(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired?this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:i}=await async function(e,t){const n=await Dc(e,{},(async()=>{const n=Xs({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:i}=e.config,o=Bc(e,r,"/v1/token","key=".concat(i)),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",Pc.fetch()(o,{method:"POST",headers:a,body:n})}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(i))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,o=new Jc;return n&&(wc("string"===typeof n,"internal-error",{appName:e}),o.refreshToken=n),r&&(wc("string"===typeof r,"internal-error",{appName:e}),o.accessToken=r),i&&(wc("number"===typeof i,"internal-error",{appName:e}),o.expirationTime=i),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Jc,this.toJSON())}_performRefresh(){return Ec("not implemented")}}function Xc(e,t){wc("string"===typeof e||"undefined"===typeof e,"internal-error",{appName:t})}class eu{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=dc(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Kc(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new Yc(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await $c(this,this.stsTokenManager.getToken(this.auth,e));return wc(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=sl(e),r=await n.getIdToken(t),i=Vc(r);wc(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const o="object"===typeof i.firebase?i.firebase:void 0,a=null===o||void 0===o?void 0:o.sign_in_provider;return{claims:i,token:r,authTime:Wc(Gc(i.auth_time)),issuedAtTime:Wc(Gc(i.iat)),expirationTime:Wc(Gc(i.exp)),signInProvider:a||null,signInSecondFactor:(null===o||void 0===o?void 0:o.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=sl(e);await Zc(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(wc(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map((e=>Object.assign({},e))),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new eu(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){wc(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await Zc(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await $c(this,async function(e,t){return Nc(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((e=>Object.assign({},e))),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,i,o,a,s,l,c;const u=null!==(n=t.displayName)&&void 0!==n?n:void 0,d=null!==(r=t.email)&&void 0!==r?r:void 0,p=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,h=null!==(o=t.photoURL)&&void 0!==o?o:void 0,f=null!==(a=t.tenantId)&&void 0!==a?a:void 0,m=null!==(s=t._redirectEventId)&&void 0!==s?s:void 0,g=null!==(l=t.createdAt)&&void 0!==l?l:void 0,v=null!==(c=t.lastLoginAt)&&void 0!==c?c:void 0,{uid:b,emailVerified:y,isAnonymous:_,providerData:x,stsTokenManager:w}=t;wc(b&&w,e,"internal-error");const E=Jc.fromJSON(this.name,w);wc("string"===typeof b,e,"internal-error"),Xc(u,e.name),Xc(d,e.name),wc("boolean"===typeof y,e,"internal-error"),wc("boolean"===typeof _,e,"internal-error"),Xc(p,e.name),Xc(h,e.name),Xc(f,e.name),Xc(m,e.name),Xc(g,e.name),Xc(v,e.name);const T=new eu({uid:b,auth:e,email:d,emailVerified:y,displayName:u,isAnonymous:_,photoURL:h,phoneNumber:p,tenantId:f,stsTokenManager:E,createdAt:g,lastLoginAt:v});return x&&Array.isArray(x)&&(T.providerData=x.map((e=>Object.assign({},e)))),m&&(T._redirectEventId=m),T}static async _fromIdTokenResponse(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=new Jc;r.updateFromServerResponse(t);const i=new eu({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await Zc(i),i}}const tu=new Map;function nu(e){Tc(e instanceof Function,"Expected a class definition");let t=tu.get(e);return t?(Tc(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,tu.set(e,t),t)}class ru{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}ru.type="NONE";const iu=ru;function ou(e,t,n){return"firebase".concat(":",e,":").concat(t,":").concat(n)}class au{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=ou(this.userKey,r.apiKey,i),this.fullPersistenceKey=ou("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?eu._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"authUser";if(!t.length)return new au(nu(iu),e,n);const r=(await Promise.all(t.map((async e=>{if(await e._isAvailable())return e})))).filter((e=>e));let i=r[0]||nu(iu);const o=ou(n,e.config.apiKey,e.name);let a=null;for(const c of t)try{const t=await c._get(o);if(t){const n=eu._fromJSON(e,t);c!==i&&(a=n),i=c;break}}catch(l){}const s=r.filter((e=>e._shouldAllowMigration));return i._shouldAllowMigration&&s.length?(i=s[0],a&&await i._set(o,a.toJSON()),await Promise.all(t.map((async e=>{if(e!==i)try{await e._remove(o)}catch(l){}}))),new au(i,e,n)):new au(i,e,n)}}function su(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(du(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(lu(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(hu(t))return"Blackberry";if(fu(t))return"Webos";if(cu(t))return"Safari";if((t.includes("chrome/")||uu(t))&&!t.includes("edge/"))return"Chrome";if(pu(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null===n||void 0===n?void 0:n.length))return n[1]}return"Other"}function lu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms();return/firefox\//i.test(e)}function cu(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms()).toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function uu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms();return/crios\//i.test(e)}function du(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms();return/iemobile/i.test(e)}function pu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms();return/android/i.test(e)}function hu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms();return/blackberry/i.test(e)}function fu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms();return/webos/i.test(e)}function mu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms();return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function gu(){return function(){const e=Ms();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}()&&10===document.documentMode}function vu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms();return mu(e)||pu(e)||fu(e)||hu(e)||/windows phone/i.test(e)||du(e)}function bu(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];switch(e){case"Browser":t=su(Ms());break;case"Worker":t="".concat(su(Ms()),"-").concat(e);break;default:t=e}const r=n.length?n.join(","):"FirebaseCore-web";return"".concat(t,"/","JsCore","/").concat(Kl,"/").concat(r)}class yu{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise(((n,r)=>{try{n(e(t))}catch(i){r(i)}}));n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(n){t.reverse();for(const e of t)try{e()}catch(r){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null===n||void 0===n?void 0:n.message})}}}class _u{constructor(e){var t,n,r,i;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=o.minPasswordLength)&&void 0!==t?t:6,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),void 0!==o.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),void 0!==o.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),void 0!==o.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),void 0!==o.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(r=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==r?r:"",this.forceUpgradeOnSignin=null!==(i=e.forceUpgradeOnSignin)&&void 0!==i&&i,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,r,i,o,a;const s={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,s),this.validatePasswordCharacterOptions(e,s),s.isValid&&(s.isValid=null===(t=s.meetsMinPasswordLength)||void 0===t||t),s.isValid&&(s.isValid=null===(n=s.meetsMaxPasswordLength)||void 0===n||n),s.isValid&&(s.isValid=null===(r=s.containsLowercaseLetter)||void 0===r||r),s.isValid&&(s.isValid=null===(i=s.containsUppercaseLetter)||void 0===i||i),s.isValid&&(s.isValid=null===(o=s.containsNumericCharacter)||void 0===o||o),s.isValid&&(s.isValid=null===(a=s.containsNonAlphanumericCharacter)||void 0===a||a),s}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r ="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,r,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class xu{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Eu(this),this.idTokenSubscription=new Eu(this),this.beforeStateQueue=new yu(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=fc,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=nu(t)),this._initializationPromise=this.queue((async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await au.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(i){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUser(e){var t;const n=await this.assertedPersistence.getCurrentUser();let r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,o=null===r||void 0===r?void 0:r._redirectEventId,a=await this.tryRedirectSignIn(e);n&&n!==o||!(null===a||void 0===a?void 0:a.user)||(r=a.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(o){r=n,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(o)))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return wc(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(n){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Zc(e)}catch(t){if((null===t||void 0===t?void 0:t.code)!=="auth/".concat("network-request-failed"))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"===typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?sl(e):null;return t&&wc(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this._deleted)return e&&wc(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue((async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()}))}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue((async()=>{await this.assertedPersistence.setPersistence(nu(e))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e){return Nc(e,"GET","/v2/passwordPolicy",Rc(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}(this),t=new _u(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new zs("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise(((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged((()=>{n(),e()}),t)}}))}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return Nc(e,"POST","/v2/accounts:revokeToken",Rc(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&nu(e)||this._popupRedirectResolver;wc(t,this,"argument-error"),this.redirectPersistenceManager=await au.create(this,[nu(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue((async()=>{})),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(e)))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const i="function"===typeof t?t:t.next.bind(t);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(wc(a,this,"internal-error"),a.then((()=>{o||i(this.currentUser)})),"function"===typeof t){const i=e.addObserver(t,n,r);return()=>{o=!0,i()}}{const n=e.addObserver(t);return()=>{o=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return wc(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=bu(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null===t||void 0===t?void 0:t.error)&&function(e){if(mc.logLevel<=hl.WARN){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r this.observer=e))}get next(){return wc(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let Tu={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Cu(e){return Tu.loadJS(e)}function ku(e){return"__".concat(e).concat(Math.floor(1e6*Math.random()))}class Su{constructor(e){this.type="recaptcha-enterprise",this.auth=wu(e)}async verify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"verify",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(t,n,r){const i=window.grecaptcha;zc(i)?i.enterprise.ready((()=>{i.enterprise.execute(t,{action:e}).then((e=>{n(e)})).catch((()=>{n("NO_RECAPTCHA")}))})):r(Error("No reCAPTCHA enterprise script loaded."))}return new Promise(((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise((async(t,n)=>{Hc(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then((r=>{if(void 0!==r.recaptchaKey){const n=new qc(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))})).catch((e=>{n(e)}))}))})(this.auth).then((i=>{if(!t&&zc(window.grecaptcha))n(i,e,r);else{if("undefined"===typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=Tu.recaptchaEnterpriseScript;0!==t.length&&(t+=i),Cu(t).then((()=>{n(i,e,r)})).catch((e=>{r(e)}))}})).catch((e=>{r(e)}))}))}}async function Ou(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=new Su(e);let o;try{o=await i.verify(n)}catch(gh){o=await i.verify(n,!0)}const a=Object.assign({},t);return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function Au(e,t,n,r){var i;if(null===(i=e._getRecaptchaConfig())||void 0===i?void 0:i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await Ou(e,t,n,"getOobCode"===n);return r(e,i)}return r(e,t).catch((async i=>{if(i.code==="auth/".concat("missing-recaptcha-token")){console.log("".concat(n," is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow."));const i=await Ou(e,t,n,"getOobCode"===n);return r(e,i)}return Promise.reject(i)}))}function ju(e,t,n){const r=wu(e);wc(r._canInitEmulator,r,"emulator-config-failed"),wc(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(null===n||void 0===n?void 0:n.disableWarnings),o=Pu(t),{host:a,port:s}=function(e){const t=Pu(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:Iu(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:Iu(t)}}}(t),l=null===s?"":":".concat(s);r.config.emulator={url:"".concat(o,"//").concat(a).concat(l,"/")},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:a,port:s,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!==typeof console&&"function"===typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials.");"undefined"!==typeof window&&"undefined"!==typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function Pu(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Iu(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Lu{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Ec("not implemented")}_getIdTokenResponse(e){return Ec("not implemented")}_linkToIdToken(e,t){return Ec("not implemented")}_getReauthenticationResolver(e){return Ec("not implemented")}}async function Ru(e,t){return Nc(e,"POST","/v1/accounts:signUp",t)}async function Nu(e,t){return Mc(e,"POST","/v1/accounts:signInWithPassword",Rc(e,t))}class Du extends Lu{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new Du(e,t,"password")}static _fromEmailAndCode(e,t){return new Du(e,t,"emailLink",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e;if((null===t||void 0===t?void 0:t.email)&&(null===t||void 0===t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Au(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",Nu);case"emailLink":return async function(e,t){return Mc(e,"POST","/v1/accounts:signInWithEmailLink",Rc(e,t))}(e,{email:this._email,oobCode:this._password});default:vc(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Au(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Ru);case"emailLink":return async function(e,t){return Mc(e,"POST","/v1/accounts:signInWithEmailLink",Rc(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:vc(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Mu(e,t){return Mc(e,"POST","/v1/accounts:signInWithIdp",Rc(e,t))}class Bu extends Lu{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Bu(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):vc("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,i=dc(t,["providerId","signInMethod"]);if(!n||!r)return null;const o=new Bu(n,r);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(e){return Mu(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Mu(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Mu(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=Xs(t)}return e}}const Qu={USER_NOT_FOUND:"user-not-found"};class Uu extends Lu{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Uu({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Uu({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return Mc(e,"POST","/v1/accounts:signInWithPhoneNumber",Rc(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await Mc(e,"POST","/v1/accounts:signInWithPhoneNumber",Rc(e,t));if(n.temporaryProof)throw Fc(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return Mc(e,"POST","/v1/accounts:signInWithPhoneNumber",Rc(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),Qu)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"===typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new Uu({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class Fu{constructor(e){var t,n,r,i,o,a;const s=el(tl(e)),l=null!==(t=s.apiKey)&&void 0!==t?t:null,c=null!==(n=s.oobCode)&&void 0!==n?n:null,u=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=s.mode)&&void 0!==r?r:null);wc(l&&c&&u,"argument-error"),this.apiKey=l,this.operation=u,this.code=c,this.continueUrl=null!==(i=s.continueUrl)&&void 0!==i?i:null,this.languageCode=null!==(o=s.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(a=s.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=el(tl(e)).link,n=t?el(tl(t)).deep_link_id:null,r=el(tl(e)).deep_link_id;return(r?el(tl(r)).link:null)||r||n||t||e}(e);try{return new Fu(t)}catch(n){return null}}}class zu{constructor(){this.providerId=zu.PROVIDER_ID}static credential(e,t){return Du._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Fu.parseLink(t);return wc(n,"argument-error"),Du._fromEmailAndCode(e,n.code,n.tenantId)}}zu.PROVIDER_ID="password",zu.EMAIL_PASSWORD_SIGN_IN_METHOD="password",zu.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class qu{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class Hu extends qu{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Wu extends Hu{constructor(){super("facebook.com")}static credential(e){return Bu._fromParams({providerId:Wu.PROVIDER_ID,signInMethod:Wu.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Wu.credentialFromTaggedObject(e)}static credentialFromError(e){return Wu.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Wu.credential(t.oauthAccessToken)}catch(n){return null}}}Wu.FACEBOOK_SIGN_IN_METHOD="facebook.com",Wu.PROVIDER_ID="facebook.com";class Gu extends Hu{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Bu._fromParams({providerId:Gu.PROVIDER_ID,signInMethod:Gu.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Gu.credentialFromTaggedObject(e)}static credentialFromError(e){return Gu.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return Gu.credential(n,r)}catch(i){return null}}}Gu.GOOGLE_SIGN_IN_METHOD="google.com",Gu.PROVIDER_ID="google.com";class Vu extends Hu{constructor(){super("github.com")}static credential(e){return Bu._fromParams({providerId:Vu.PROVIDER_ID,signInMethod:Vu.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Vu.credentialFromTaggedObject(e)}static credentialFromError(e){return Vu.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Vu.credential(t.oauthAccessToken)}catch(n){return null}}}Vu.GITHUB_SIGN_IN_METHOD="github.com",Vu.PROVIDER_ID="github.com";class $u extends Hu{constructor(){super("twitter.com")}static credential(e,t){return Bu._fromParams({providerId:$u.PROVIDER_ID,signInMethod:$u.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return $u.credentialFromTaggedObject(e)}static credentialFromError(e){return $u.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return $u.credential(n,r)}catch(i){return null}}}$u.TWITTER_SIGN_IN_METHOD="twitter.com",$u.PROVIDER_ID="twitter.com";class Ku{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=await eu._fromIdTokenResponse(e,n,r),o=Yu(n);return new Ku({user:i,providerId:o,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=Yu(n);return new Ku({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function Yu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class Zu extends Fs{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,Zu.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new Zu(e,t,n,r)}}function Ju(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch((n=>{if(n.code==="auth/".concat("multi-factor-auth-required"))throw Zu._fromErrorAndOperation(e,n,t,r);throw n}))}async function Xu(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=await $c(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return Ku._forOperation(e,"link",r)}async function ed(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{auth:r}=e,i="reauthenticate";try{const o=await $c(e,Ju(r,i,t,e),n);wc(o.idToken,r,"internal-error");const a=Vc(o.idToken);wc(a,r,"internal-error");const{sub:s}=a;return wc(e.uid===s,r,"user-mismatch"),Ku._forOperation(e,i,o)}catch(o){throw(null===o||void 0===o?void 0:o.code)==="auth/".concat("user-not-found")&&vc(r,"user-mismatch"),o}}async function td(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r="signIn",i=await Ju(e,r,t),o=await Ku._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(o.user),o}function nd(e,t,n,r){return sl(e).onAuthStateChanged(t,n,r)}new WeakMap;const rd="__sak";class id{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(rd,"1"),this.storage.removeItem(rd),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class od extends id{constructor(){super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const e=Ms();return cu(e)||mu(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=vu(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.key)return void this.forAllChangedKeys(((e,t,n)=>{this.notifyListeners(e,n)}));const n=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const r=this.storage.getItem(n);if(e.newValue!==r)null!==e.newValue?this.storage.setItem(n,e.newValue):this.storage.removeItem(n);else if(this.localCache[n]===e.newValue&&!t)return}const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},i=this.storage.getItem(n);gu()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const r of Array.from(n))r(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)}))}),1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}od.type="LOCAL";const ad=od;class sd extends id{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(e,t){}_removeListener(e,t){}}sd.type="SESSION";const ld=sd;class cd{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find((t=>t.isListeningto(e)));if(t)return t;const n=new cd(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,o=this.handlersMap[r];if(!(null===o||void 0===o?void 0:o.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const a=Array.from(o).map((async e=>e(t.origin,i))),s=await function(e){return Promise.all(e.map((async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}})))}(a);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:s})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function ud(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n="";for(let r=0;r 2&&void 0!==arguments[2]?arguments[2]:50;const r="undefined"!==typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,o;return new Promise(((a,s)=>{const l=ud("",20);r.port1.start();const c=setTimeout((()=>{s(new Error("unsupported_event"))}),n);o={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===l)switch(t.data.status){case"ack":clearTimeout(c),i=setTimeout((()=>{s(new Error("timeout"))}),3e3);break;case"done":clearTimeout(i),a(t.data.response);break;default:clearTimeout(c),clearTimeout(i),s(new Error("invalid_response"))}}},this.handlers.add(o),r.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[r.port2])})).finally((()=>{o&&this.removeMessageHandler(o)}))}}function pd(){return window}function hd(){return"undefined"!==typeof pd().WorkerGlobalScope&&"function"===typeof pd().importScripts}const fd="firebaseLocalStorageDb",md="firebaseLocalStorage",gd="fbase_key";class vd{constructor(e){this.request=e}toPromise(){return new Promise(((e,t)=>{this.request.addEventListener("success",(()=>{e(this.request.result)})),this.request.addEventListener("error",(()=>{t(this.request.error)}))}))}}function bd(e,t){return e.transaction([md],t?"readwrite":"readonly").objectStore(md)}function yd(){const e=indexedDB.open(fd,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(md,{keyPath:gd})}catch(r){n(r)}})),e.addEventListener("success",(async()=>{const n=e.result;n.objectStoreNames.contains(md)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(fd);return new vd(e).toPromise()}(),t(await yd()))}))}))}async function _d(e,t,n){const r=bd(e,!0).put({[gd]:t,value:n});return new vd(r).toPromise()}function xd(e,t){const n=bd(e,!0).delete(t);return new vd(n).toPromise()}class wd{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await yd()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(n){if(t++>3)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return hd()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=cd._getInstance(hd()?self:null),this.receiver._subscribe("keyChanged",(async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)}))),this.receiver._subscribe("ping",(async(e,t)=>["keyChanged"]))}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new dd(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&function(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}()===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await yd();return await _d(e,rd,"1"),await xd(e,rd),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite((async()=>(await this._withRetries((n=>_d(n,e,t))),this.localCache[e]=t,this.notifyServiceWorker(e))))}async _get(e){const t=await this._withRetries((t=>async function(e,t){const n=bd(e,!1).get(t),r=await new vd(n).toPromise();return void 0===r?null:r.value}(t,e)));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite((async()=>(await this._withRetries((t=>xd(t,e))),delete this.localCache[e],this.notifyServiceWorker(e))))}async _poll(){const e=await this._withRetries((e=>{const t=bd(e,!1).getAll();return new vd(t).toPromise()}));if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!n.has(r)&&(this.notifyListeners(r,null),t.push(r));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const r of Array.from(n))r(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}wd.type="LOCAL";const Ed=wd;ku("rcb"),new Ac(3e4,6e4);const Td="recaptcha";async function Cd(e,t,n){var r;const i=await n.verify();try{let o;if(wc("string"===typeof i,e,"argument-error"),wc(n.type===Td,e,"argument-error"),o="string"===typeof t?{phoneNumber:t}:t,"session"in o){const t=o.session;if("phoneNumber"in o){wc("enroll"===t.type,e,"internal-error");const n=await function(e,t){return Nc(e,"POST","/v2/accounts/mfaEnrollment:start",Rc(e,t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:o.phoneNumber,recaptchaToken:i}});return n.phoneSessionInfo.sessionInfo}{wc("signin"===t.type,e,"internal-error");const n=(null===(r=o.multiFactorHint)||void 0===r?void 0:r.uid)||o.multiFactorUid;wc(n,e,"missing-multi-factor-info");const a=await function(e,t){return Nc(e,"POST","/v2/accounts/mfaSignIn:start",Rc(e,t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:i}});return a.phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return Nc(e,"POST","/v1/accounts:sendVerificationCode",Rc(e,t))}(e,{phoneNumber:o.phoneNumber,recaptchaToken:i});return t}}finally{n._reset()}}class kd{constructor(e){this.providerId=kd.PROVIDER_ID,this.auth=wu(e)}verifyPhoneNumber(e,t){return Cd(this.auth,e,sl(t))}static credential(e,t){return Uu._fromVerification(e,t)}static credentialFromResult(e){const t=e;return kd.credentialFromTaggedObject(t)}static credentialFromError(e){return kd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{phoneNumber:n,temporaryProof:r}=t;return n&&r?Uu._fromTokenResponse(n,r):null}}function Sd(e,t){return t?nu(t):(wc(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}kd.PROVIDER_ID="phone",kd.PHONE_SIGN_IN_METHOD="phone";class Od extends Lu{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Mu(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Mu(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Mu(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Ad(e){return td(e.auth,new Od(e),e.bypassAuthState)}function jd(e){const{auth:t,user:n}=e;return wc(n,t,"internal-error"),ed(n,new Od(e),e.bypassAuthState)}async function Pd(e){const{auth:t,user:n}=e;return wc(n,t,"internal-error"),Xu(n,new Od(e),e.bypassAuthState)}class Id{constructor(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}}))}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:o,type:a}=e;if(o)return void this.reject(o);const s={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(s))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Ad;case"linkViaPopup":case"linkViaRedirect":return Pd;case"reauthViaPopup":case"reauthViaRedirect":return jd;default:vc(this.auth,"internal-error")}}resolve(e){Tc(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Tc(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const Ld=new Ac(2e3,1e4);class Rd extends Id{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,Rd.currentPopupAction&&Rd.currentPopupAction.cancel(),Rd.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return wc(e,this.auth,"internal-error"),e}async onExecution(){Tc(1===this.filter.length,"Popup operations only handle one event");const e=ud();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch((e=>{this.reject(e)})),this.resolver._isIframeWebStorageSupported(this.auth,(e=>{e||this.reject(bc(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(bc(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Rd.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(bc(this.auth,"popup-closed-by-user"))}),8e3):this.pollId=window.setTimeout(e,Ld.get())};e()}}Rd.currentPopupAction=null;const Nd="pendingRedirect",Dd=new Map;class Md extends Id{constructor(e,t){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,arguments.length>2&&void 0!==arguments[2]&&arguments[2]),this.eventId=null}async execute(){let e=Dd.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=Ud(t),r=Qd(e);if(!await r._isAvailable())return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth),n=t?await super.execute():null;e=()=>Promise.resolve(n)}catch(t){e=()=>Promise.reject(t)}Dd.set(this.auth._key(),e)}return this.bypassAuthState||Dd.set(this.auth._key(),(()=>Promise.resolve(null))),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function Bd(e,t){Dd.set(e._key(),t)}function Qd(e){return nu(e._redirectPersistence)}function Ud(e){return ou(Nd,e.config.apiKey,e.name)}async function Fd(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=wu(e),i=Sd(r,t),o=new Md(r,i,n),a=await o.execute();return a&&!n&&(delete a.user._redirectEventId,await r._persistUserIfCurrent(a.user),await r._setRedirectUser(null,t)),a}class zd{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach((n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))})),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Hd(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!Hd(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(bc(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(qd(e))}saveEventToCache(e){this.cachedEventUids.add(qd(e)),this.lastProcessedEventTime=Date.now()}}function qd(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((e=>e)).join("-")}function Hd(e){let{type:t,error:n}=e;return"unknown"===t&&(null===n||void 0===n?void 0:n.code)==="auth/".concat("no-auth-event")}const Wd=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Gd=/^https?/;async function Vd(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e){return Nc(e,"GET","/v1/projects",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e);for(const r of t)try{if($d(r))return}catch(n){}vc(e,"unauthorized-domain")}function $d(e){const t=Cc(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!Gd.test(n))return!1;if(Wd.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const Kd=new Ac(3e4,6e4);function Yd(){const e=pd().___jsl;if(null===e||void 0===e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n {var r,i,o;function a(){Yd(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Yd(),n(bc(e,"network-request-failed"))},timeout:Kd.get()})}if(null===(i=null===(r=pd().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(o=pd().gapi)||void 0===o?void 0:o.load)){const t=ku("iframefcb");return pd()[t]=()=>{gapi.load?a():n(bc(e,"network-request-failed"))},Cu("".concat(Tu.gapiScript,"?onload=").concat(t)).catch((e=>n(e)))}a()}})).catch((e=>{throw Jd=null,e}))}let Jd=null;const Xd=new Ac(5e3,15e3),ep="__/auth/iframe",tp="emulator/auth/iframe",np={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},rp=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function ip(e){const t=e.config;wc(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?jc(t,tp):"https://".concat(e.config.authDomain,"/").concat(ep),r={apiKey:t.apiKey,appName:e.name,v:Kl},i=rp.get(e.config.apiHost);i&&(r.eid=i);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),"".concat(n,"?").concat(Xs(r).slice(1))}async function op(e){const t=await function(e){return Jd=Jd||Zd(e),Jd}(e),n=pd().gapi;return wc(n,e,"internal-error"),t.open({where:document.body,url:ip(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:np,dontclear:!0},(t=>new Promise((async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=bc(e,"network-request-failed"),o=pd().setTimeout((()=>{r(i)}),Xd.get());function a(){pd().clearTimeout(o),n(t)}t.ping(a).then(a,(()=>{r(i)}))}))))}const ap={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class sp{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function lp(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:600;const o=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let s="";const l=Object.assign(Object.assign({},ap),{width:r.toString(),height:i.toString(),top:o,left:a}),c=Ms().toLowerCase();n&&(s=uu(c)?"_blank":n),lu(c)&&(t=t||"http://localhost",l.scrollbars="yes");const u=Object.entries(l).reduce(((e,t)=>{let[n,r]=t;return"".concat(e).concat(n,"=").concat(r,",")}),"");if(function(){var e;return mu(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ms())&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}(c)&&"_self"!==s)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",s),new sp(null);const d=window.open(t||"",s,u);wc(d,e,"popup-blocked");try{d.focus()}catch(p){}return new sp(d)}const cp="__/auth/handler",up="emulator/auth/handler",dp=encodeURIComponent("fac");async function pp(e,t,n,r,i,o){wc(e.config.authDomain,e,"auth-domain-config-required"),wc(e.config.apiKey,e,"invalid-api-key");const a={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:Kl,eventId:i};if(t instanceof qu){t.setDefaultLanguage(e.languageCode),a.providerId=t.providerId||"",Ks(t.getCustomParameters())||(a.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(o||{}))a[e]=t}if(t instanceof Hu){const e=t.getScopes().filter((e=>""!==e));e.length>0&&(a.scopes=e.join(","))}e.tenantId&&(a.tid=e.tenantId);const s=a;for(const u of Object.keys(s))void 0===s[u]&&delete s[u];const l=await e._getAppCheckToken(),c=l?"#".concat(dp,"=").concat(encodeURIComponent(l)):"";return"".concat(function(e){let{config:t}=e;if(!t.emulator)return"https://".concat(t.authDomain,"/").concat(cp);return jc(t,up)}(e),"?").concat(Xs(s).slice(1)).concat(c)}const hp="webStorageSupport";const fp=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ld,this._completeRedirectFn=Fd,this._overrideRedirectResult=Bd}async _openPopup(e,t,n,r){var i;Tc(null===(i=this.eventManagers[e._key()])||void 0===i?void 0:i.manager,"_initialize() not called before _openPopup()");return lp(e,await pp(e,t,n,Cc(),r),ud())}async _openRedirect(e,t,n,r){await this._originValidation(e);return function(e){pd().location.href=e}(await pp(e,t,n,Cc(),r)),new Promise((()=>{}))}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(Tc(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch((()=>{delete this.eventManagers[t]})),n}async initAndGetManager(e){const t=await op(e),n=new zd(e);return t.register("authEvent",(t=>{wc(null===t||void 0===t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(hp,{type:hp},(n=>{var r;const i=null===(r=null===n||void 0===n?void 0:n[0])||void 0===r?void 0:r[hp];void 0!==i&&t(!!i),vc(e,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=Vd(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return vu()||cu()||mu()}};var mp="@firebase/auth",gp="1.6.0";class vp{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged((t=>{e((null===t||void 0===t?void 0:t.stsTokenManager.accessToken)||null)}));this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){wc(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const bp=Ns("authIdTokenMaxAge")||300;let yp=null;function _p(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zl();const t=Gl(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=Gl(e,"auth");if(n.isInitialized()){const e=n.getImmediate();if(Zs(n.getOptions(),null!==t&&void 0!==t?t:{}))return e;vc(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:fp,persistence:[Ed,ad,ld]}),r=Ns("authTokenSyncURL");if(r){const e=(i=r,async e=>{const t=e&&await e.getIdTokenResult(),n=t&&((new Date).getTime()-Date.parse(t.issuedAtTime))/1e3;if(n&&n>bp)return;const r=null===t||void 0===t?void 0:t.token;yp!==r&&(yp=r,await fetch(i,{method:r?"POST":"DELETE",headers:r?{Authorization:"Bearer ".concat(r)}:{}}))});!function(e,t,n){sl(e).beforeAuthStateChanged(t,n)}(n,e,(()=>e(n.currentUser))),function(e,t,n,r){sl(e).onIdTokenChanged(t,n,r)}(n,(t=>e(t)))}var i;const o=Is("auth");return o&&ju(n,"http://".concat(o)),n}var xp,wp;xp={loadJS:e=>new Promise(((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=bc("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",function(){var e,t;return null!==(t=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0])&&void 0!==t?t:document}().appendChild(r)})),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},Tu=xp,wp="Browser",Wl(new ll("auth",((e,t)=>{let{options:n}=t;const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:a,authDomain:s}=r.options;wc(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:a,authDomain:s,clientPlatform:wp,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:bu(wp)},c=new xu(r,i,o,l);return function(e,t){const n=(null===t||void 0===t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(nu);(null===t||void 0===t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null===t||void 0===t?void 0:t.popupRedirectResolver)}(c,n),c}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((e,t,n)=>{e.getProvider("auth-internal").initialize()}))),Wl(new ll("auth-internal",(e=>(e=>new vp(e))(wu(e.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),Jl(mp,gp,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(wp)),Jl(mp,gp,"esm2017");Jl("firebase","10.8.0","app");const Ep={NODE_ENV:"production",PUBLIC_URL:"/metadata-entry-form",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_GOOGLE_CLOUD_API_KEY:"AIzaSyBz4kb3hJHXw0voYZgHZuAgmqGosxntMHM",REACT_APP_GOOGLE_CLOUD_API_KEY_DEV:"AIzaSyADkNENzpoqj3O7uGPsRA_4s1zQdbH708c"}.REACT_APP_DEV_DEPLOYMENT,Tp=Ep?{apiKey:"AIzaSyADkNENzpoqj3O7uGPsRA_4s1zQdbH708c",authDomain:"cioos-metadata-form-dev.firebaseapp.com",databaseURL:"https://cioos-metadata-form-dev-default-rtdb.firebaseio.com/",projectId:"cioos-metadata-form-dev",storageBucket:"cioos-metadata-form-dev.appspot.com",messagingSenderId:"392401521083",appId:"1:392401521083:web:45d1539f9d284f446d5c9e"}:{apiKey:"AIzaSyBz4kb3hJHXw0voYZgHZuAgmqGosxntMHM",authDomain:"cioos-metadata-form.firebaseapp.com",databaseURL:"https://cioos-metadata-form.firebaseio.com",projectId:"cioos-metadata-form",storageBucket:"cioos-metadata-form.appspot.com",messagingSenderId:"646114203434",appId:"1:646114203434:web:bccceadc5144270f98f053"};"localhost"===window.location.hostname&&Ep&&(Tp.databaseURL="http://localhost:9001?ns=cioos-metadata-form");const Cp=Yl(Tp),kp=new Gu;kp.setCustomParameters({promt:"select_account"});const Sp=_p(Cp),Op=()=>async function(e,t,n){const r=wu(e);_c(e,t,qu);const i=Sd(r,n);return new Rd(r,"signInViaPopup",t,i).executeNotNull()}(Sp,kp);var Ap=n(492);const jp=e=>t=>{let{children:n}=t;const{language:r}=mn();return r===e&&(0,Ap.jsx)(Ap.Fragment,{children:n})},Pp=jp("en"),Ip=jp("fr"),Lp=e=>{const{en:t,fr:n,children:r}=e,{language:i="en"}=mn();return t||n?t&&n?"en"===i?t:n:(console.error("Tag missing french or english!"),null):(Array.isArray(r)&&2!==r.length&&console.error(e,"Tag missing french or english!"),r)},Rp="type.googleapis.com/google.protobuf.Int64Value",Np="type.googleapis.com/google.protobuf.UInt64Value";function Dp(e,t){const n={};for(const r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}function Mp(e){if(null==e)return null;if(e instanceof Number&&(e=e.valueOf()),"number"===typeof e&&isFinite(e))return e;if(!0===e||!1===e)return e;if("[object String]"===Object.prototype.toString.call(e))return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map((e=>Mp(e)));if("function"===typeof e||"object"===typeof e)return Dp(e,(e=>Mp(e)));throw new Error("Data cannot be encoded in JSON: "+e)}function Bp(e){if(null==e)return e;if(e["@type"])switch(e["@type"]){case Rp:case Np:{const t=Number(e.value);if(isNaN(t))throw new Error("Data cannot be decoded from JSON: "+e);return t}default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map((e=>Bp(e))):"function"===typeof e||"object"===typeof e?Dp(e,(e=>Bp(e))):e}const Qp="functions",Up={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Fp extends Fs{constructor(e,t,n){super("".concat(Qp,"/").concat(e),t||""),this.details=n}}class zp{constructor(e,t,n){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then((e=>this.auth=e),(()=>{})),this.messaging||t.get().then((e=>this.messaging=e),(()=>{})),this.appCheck||n.get().then((e=>this.appCheck=e),(()=>{}))}async getAuthToken(){if(this.auth)try{const e=await this.auth.getToken();return null===e||void 0===e?void 0:e.accessToken}catch(e){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(e){return}}async getAppCheckToken(e){if(this.appCheck){const t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(e)}}}const qp="us-central1";class Hp{constructor(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:qp,o=arguments.length>5?arguments[5]:void 0;this.app=e,this.fetchImpl=o,this.emulatorOrigin=null,this.contextProvider=new zp(t,n,r),this.cancelAllRequests=new Promise((e=>{this.deleteService=()=>Promise.resolve(e())}));try{const e=new URL(i);this.customDomain=e.origin,this.region=qp}catch(a){this.customDomain=null,this.region=i}}_delete(){return this.deleteService()}_url(e){const t=this.app.options.projectId;if(null!==this.emulatorOrigin){const n=this.emulatorOrigin;return"".concat(n,"/").concat(t,"/").concat(this.region,"/").concat(e)}return null!==this.customDomain?"".concat(this.customDomain,"/").concat(e):"https://".concat(this.region,"-").concat(t,".cloudfunctions.net/").concat(e)}}function Wp(e,t,n){return r=>function(e,t,n,r){const i=e._url(t);return Vp(e,i,n,r)}(e,t,r,n||{})}async function Gp(e,t,n,r){let i;n["Content-Type"]="application/json";try{i=await r(e,{method:"POST",body:JSON.stringify(t),headers:n})}catch(a){return{status:0,json:null}}let o=null;try{o=await i.json()}catch(a){}return{status:i.status,json:o}}async function Vp(e,t,n,r){const i={data:n=Mp(n)},o={},a=await e.contextProvider.getContext(r.limitedUseAppCheckTokens);a.authToken&&(o.Authorization="Bearer "+a.authToken),a.messagingToken&&(o["Firebase-Instance-ID-Token"]=a.messagingToken),null!==a.appCheckToken&&(o["X-Firebase-AppCheck"]=a.appCheckToken);const s=function(e){let t=null;return{promise:new Promise(((n,r)=>{t=setTimeout((()=>{r(new Fp("deadline-exceeded","deadline-exceeded"))}),e)})),cancel:()=>{t&&clearTimeout(t)}}}(r.timeout||7e4),l=await Promise.race([Gp(t,i,o,e.fetchImpl),s.promise,e.cancelAllRequests]);if(s.cancel(),!l)throw new Fp("cancelled","Firebase Functions instance was deleted.");const c=function(e,t){let n,r=function(e){if(e>=200&&e<300)return"ok";switch(e){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),i=r;try{const e=t&&t.error;if(e){const t=e.status;if("string"===typeof t){if(!Up[t])return new Fp("internal","internal");r=Up[t],i=t}const o=e.message;"string"===typeof o&&(i=o),n=e.details,void 0!==n&&(n=Bp(n))}}catch(o){}return"ok"===r?null:new Fp(r,i,n)}(l.status,l.json);if(c)throw c;if(!l.json)throw new Fp("internal","Response is not valid JSON object.");let u=l.json.data;if("undefined"===typeof u&&(u=l.json.result),"undefined"===typeof u)throw new Fp("internal","Response is missing data field.");return{data:Bp(u)}}const $p="@firebase/functions",Kp="0.11.1";function Yp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zl(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qp;const n=Gl(sl(e),Qp).getImmediate({identifier:t}),r=Ls("functions");return r&&function(e,t,n){!function(e,t,n){e.emulatorOrigin="http://".concat(t,":").concat(n)}(sl(e),t,n)}(n,...r),n}function Zp(e,t,n){return Wp(sl(e),t,n)}!function(e,t){Wl(new ll(Qp,((t,n)=>{let{instanceIdentifier:r}=n;const i=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),a=t.getProvider("messaging-internal"),s=t.getProvider("app-check-internal");return new Hp(i,o,a,s,r,e)}),"PUBLIC").setMultipleInstances(!0)),Jl($p,Kp,t),Jl($p,Kp,"esm2017")}(fetch.bind(self));const Jp="@firebase/database",Xp="1.0.3";let eh="";function th(e){eh=e}class nh{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),Ws(t))}get(e){const t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:Hs(t)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}class rh{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t}get(e){return Vs(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}const ih=function(e){try{if("undefined"!==typeof window&&"undefined"!==typeof window[e]){const t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new nh(t)}}catch(t){}return new rh},oh=ih("localStorage"),ah=ih("sessionStorage"),sh=new bl("@firebase/database"),lh=function(){let e=1;return function(){return e++}}(),ch=function(e){const t=function(e){const t=[];let n=0;for(let r=0;r =55296&&i<=56319){const t=i-55296;r++,ys(r >6|192,t[n++]=63&i|128):i<65536?(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t}(e),n=new nl;n.update(t);const r=n.digest();return ws.encodeByteArray(r)},uh=function(){let e="";for(let t=0;t n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r};function Sh(e,t){for(const n in e)e.hasOwnProperty(n)&&t(n,e[n])}const Oh=function(e){ys(!yh(e),"Invalid JSON number");const t=1023;let n,r,i,o,a;0===e?(r=0,i=0,n=1/e===-1/0?1:0):(n=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(o=Math.min(Math.floor(Math.log(e)/Math.LN2),t),r=o+t,i=Math.round(e*Math.pow(2,52-o)-Math.pow(2,52))):(r=0,i=Math.round(e/Math.pow(2,-1074))));const s=[];for(a=52;a;a-=1)s.push(i%2?1:0),i=Math.floor(i/2);for(a=11;a;a-=1)s.push(r%2?1:0),r=Math.floor(r/2);s.push(n?1:0),s.reverse();const l=s.join("");let c="";for(a=0;a<64;a+=8){let e=parseInt(l.substr(a,8),2).toString(16);1===e.length&&(e="0"+e),c+=e}return c.toLowerCase()};const Ah=new RegExp("^-?(0*)\\d{1,10}$"),jh=function(e){if(Ah.test(e)){const t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},Ph=function(e){try{e()}catch(t){setTimeout((()=>{const e=t.stack||"";throw bh("Exception was thrown by user callback.",e),t}),Math.floor(0))}},Ih=function(e,t){const n=setTimeout(e,t);return"number"===typeof n&&"undefined"!==typeof Deno&&Deno.unrefTimer?Deno.unrefTimer(n):"object"===typeof n&&n.unref&&n.unref(),n};class Lh{constructor(e,t){this.appName_=e,this.appCheckProvider=t,this.appCheck=null===t||void 0===t?void 0:t.getImmediate({optional:!0}),this.appCheck||null===t||void 0===t||t.get().then((e=>this.appCheck=e))}getToken(e){return this.appCheck?this.appCheck.getToken(e):new Promise(((t,n)=>{setTimeout((()=>{this.appCheck?this.getToken(e).then(t,n):t(null)}),0)}))}addTokenChangeListener(e){var t;null===(t=this.appCheckProvider)||void 0===t||t.get().then((t=>t.addTokenListener(e)))}notifyForInvalidToken(){bh('Provided AppCheck credentials for the app named "'.concat(this.appName_,'" ')+"are invalid. This usually indicates your app was not initialized correctly.")}}class Rh{constructor(e,t,n){this.appName_=e,this.firebaseOptions_=t,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit((e=>this.auth_=e))}getToken(e){return this.auth_?this.auth_.getToken(e).catch((e=>e&&"auth/token-not-initialized"===e.code?(fh("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(e))):new Promise(((t,n)=>{setTimeout((()=>{this.auth_?this.getToken(e).then(t,n):t(null)}),0)}))}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then((t=>t.addAuthTokenListener(e)))}removeTokenChangeListener(e){this.authProvider_.get().then((t=>t.removeAuthTokenListener(e)))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',bh(e)}}class Nh{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}Nh.OWNER="owner";const Dh="5",Mh=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Bh="ac",Qh="websocket",Uh="long_polling";class Fh{constructor(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];this.secure=t,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=s,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=oh.get("host:"+e)||this._host}isCacheableHost(){return"s-"===this.internalHost.substr(0,2)}isCustomHost(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&oh.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",t=this.includeNamespaceInQueryParams?"?ns=".concat(this.namespace):"";return"".concat(e).concat(this.host,"/").concat(t)}}function zh(e,t,n){let r;if(ys("string"===typeof t,"typeof type must == string"),ys("object"===typeof n,"typeof params must == object"),t===Qh)r=(e.secure?"wss://":"ws://")+e.internalHost+"/.ws?";else{if(t!==Uh)throw new Error("Unknown connection type: "+t);r=(e.secure?"https://":"http://")+e.internalHost+"/.lp?"}(function(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams})(e)&&(n.ns=e.namespace);const i=[];return Sh(n,((e,t)=>{i.push(e+"="+t)})),r+i.join("&")}class qh{constructor(){this.counters_={}}incrementCounter(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;Vs(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t}get(){return Ss(this.counters_)}}const Hh={},Wh={};function Gh(e){const t=e.toString();return Hh[t]||(Hh[t]=new qh),Hh[t]}class Vh{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse {this.onMessage_(e[t])}));if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}const $h="start";class Kh{constructor(e,t,n,r,i,o,a){this.connId=e,this.repoInfo=t,this.applicationId=n,this.appCheckToken=r,this.authToken=i,this.transportSessionId=o,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=mh(e),this.stats_=Gh(t),this.urlFn=e=>(this.appCheckToken&&(e[Bh]=this.appCheckToken),zh(t,Uh,e))}open(e,t){var n=this;this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new Vh(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null}),Math.floor(3e4)),function(e){if(Us()||"complete"===document.readyState)e();else{let t=!1;const n=function(){document.body?t||(t=!0,e()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(()=>{"complete"===document.readyState&&n()})),window.attachEvent("onload",n))}}((()=>{if(this.isClosed_)return;this.scriptTagHolder=new Yh((function(){for(var e=arguments.length,t=new Array(e),r=0;r {n.onClosed_()}))):n.onClosed_()}}),(function(){for(var e=arguments.length,t=new Array(e),r=0;r {this.onClosed_()}),this.urlFn);const e={};e[$h]="t",e.ser=Math.floor(1e8*Math.random()),this.scriptTagHolder.uniqueCallbackIdentifier&&(e.cb=this.scriptTagHolder.uniqueCallbackIdentifier),e.v=Dh,this.transportSessionId&&(e.s=this.transportSessionId),this.lastSessionId&&(e.ls=this.lastSessionId),this.applicationId&&(e.p=this.applicationId),this.appCheckToken&&(e[Bh]=this.appCheckToken),"undefined"!==typeof location&&location.hostname&&Mh.test(location.hostname)&&(e.r="f");const t=this.urlFn(e);this.log_("Connecting via long-poll to "+t),this.scriptTagHolder.addTag(t,(()=>{}))}))}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){Kh.forceAllow_=!0}static forceDisallow(){Kh.forceDisallow_=!0}static isAvailable(){return!Us()&&(!!Kh.forceAllow_||!Kh.forceDisallow_&&"undefined"!==typeof document&&null!=document.createElement&&!("object"===typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"===typeof Windows&&"object"===typeof Windows.UI))}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const t=Ws(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const n=Ts(t),r=kh(n,1840);for(let i=0;i document.domain="'+document.domain+'";<\/script>'}const r=""+n+"";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(r),this.myIFrame.doc.close()}catch(i){fh("frame writing exception"),i.stack&&fh(i.stack),fh(i)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||fh("No IE domain setting required")}catch(t){const n=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+n+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout((()=>{null!==this.myIFrame&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)}),Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;let t=this.urlFn(e),n="",r=0;for(;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;{const e=this.pendingSegs.shift();n=n+"&seg"+r+"="+e.seg+"&ts"+r+"="+e.ts+"&d"+r+"="+e.d,r++}}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1}enqueueSegment(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()}addLongPollTag_(e,t){this.outstandingRequests.add(t);const n=()=>{this.outstandingRequests.delete(t),this.newRequest_()},r=setTimeout(n,Math.floor(25e3));this.addTag(e,(()=>{clearTimeout(r),n()}))}addTag(e,t){Us()?this.doNodeLongPoll(e,t):setTimeout((()=>{try{if(!this.sendNewPolls)return;const n=this.myIFrame.doc.createElement("script");n.type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){const e=n.readyState;e&&"loaded"!==e&&"complete"!==e||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),t())},n.onerror=()=>{fh("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(n)}catch(n){}}),Math.floor(1))}}let Zh=null;"undefined"!==typeof MozWebSocket?Zh=MozWebSocket:"undefined"!==typeof WebSocket&&(Zh=WebSocket);class Jh{constructor(e,t,n,r,i,o,a){this.connId=e,this.applicationId=n,this.appCheckToken=r,this.authToken=i,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=mh(this.connId),this.stats_=Gh(t),this.connURL=Jh.connectionURL_(t,o,a,r,n),this.nodeAdmin=t.nodeAdmin}static connectionURL_(e,t,n,r,i){const o={};return o.v=Dh,!Us()&&"undefined"!==typeof location&&location.hostname&&Mh.test(location.hostname)&&(o.r="f"),t&&(o.s=t),n&&(o.ls=n),r&&(o[Bh]=r),i&&(o.p=i),zh(e,Qh,o)}open(e,t){this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,oh.set("previous_websocket_failure",!0);try{let e;if(Us()){const t=this.nodeAdmin?"AdminNode":"Node";e={headers:{"User-Agent":"Firebase/".concat(Dh,"/").concat(eh,"/").concat(process.platform,"/").concat(t),"X-Firebase-GMPID":this.applicationId||""}},this.authToken&&(e.headers.Authorization="Bearer ".concat(this.authToken)),this.appCheckToken&&(e.headers["X-Firebase-AppCheck"]=this.appCheckToken);const n={NODE_ENV:"production",PUBLIC_URL:"/metadata-entry-form",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_GOOGLE_CLOUD_API_KEY:"AIzaSyBz4kb3hJHXw0voYZgHZuAgmqGosxntMHM",REACT_APP_GOOGLE_CLOUD_API_KEY_DEV:"AIzaSyADkNENzpoqj3O7uGPsRA_4s1zQdbH708c"},r=0===this.connURL.indexOf("wss://")?n.HTTPS_PROXY||n.https_proxy:n.HTTP_PROXY||n.http_proxy;r&&(e.proxy={origin:r})}this.mySock=new Zh(this.connURL,[],e)}catch(n){this.log_("Error instantiating WebSocket.");const e=n.message||n.data;return e&&this.log_(e),void this.onClosed_()}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=e=>{this.handleIncomingFrame(e)},this.mySock.onerror=e=>{this.log_("WebSocket error. Closing connection.");const t=e.message||e.data;t&&this.log_(t),this.onClosed_()}}start(){}static forceDisallow(){Jh.forceDisallow_=!0}static isAvailable(){let e=!1;if("undefined"!==typeof navigator&&navigator.userAgent){const t=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(t);n&&n.length>1&&parseFloat(n[1])<4.4&&(e=!0)}return!e&&null!==Zh&&!Jh.forceDisallow_}static previouslyFailed(){return oh.isInMemoryStorage||!0===oh.get("previous_websocket_failure")}markConnectionHealthy(){oh.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const e=this.frames.join("");this.frames=null;const t=Hs(e);this.onMessage(t)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(ys(null===this.frames,"We already have a frame buffer"),e.length<=6){const t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(null===this.mySock)return;const t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{const e=this.extractFrameCount_(t);null!==e&&this.appendFrame_(e)}}send(e){this.resetKeepAlive();const t=Ws(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);const n=kh(t,16384);n.length>1&&this.sendString_(String(n.length));for(let r=0;r {this.mySock&&this.sendString_("0"),this.resetKeepAlive()}),Math.floor(45e3))}sendString_(e){try{this.mySock.send(e)}catch(t){this.log_("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}Jh.responsesRequiredToBeHealthy=2,Jh.healthyTimeout=3e4;class Xh{constructor(e){this.initTransports_(e)}static get ALL_TRANSPORTS(){return[Kh,Jh]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}initTransports_(e){const t=Jh&&Jh.isAvailable();let n=t&&!Jh.previouslyFailed();if(e.webSocketOnly&&(t||bh("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),n=!0),n)this.transports_=[Jh];else{const e=this.transports_=[];for(const t of Xh.ALL_TRANSPORTS)t&&t.isAvailable()&&e.push(t);Xh.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}Xh.globalTransportInitialized_=!1;class ef{constructor(e,t,n,r,i,o,a,s,l,c){this.id=e,this.repoInfo_=t,this.applicationId_=n,this.appCheckToken_=r,this.authToken_=i,this.onMessage_=o,this.onReady_=a,this.onDisconnect_=s,this.onKill_=l,this.lastSessionId=c,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=mh("c:"+this.id+":"),this.transportManager_=new Xh(t),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const t=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((()=>{this.conn_&&this.conn_.open(t,n)}),Math.floor(0));const r=e.healthyTimeout||0;r>0&&(this.healthyTimeout_=Ih((()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>102400?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>10240?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))}),Math.floor(r)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return t=>{e===this.conn_?this.onConnectionLost_(t):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return t=>{2!==this.state_&&(e===this.rx_?this.onPrimaryMessageReceived_(t):e===this.secondaryConn_?this.onSecondaryMessageReceived_(t):this.log_("message on old connection"))}}sendRequest(e){const t={t:"d",d:e};this.sendData_(t)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if("t"in e){const t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const t=Th("t",e),n=Th("d",e);if("c"===t)this.onSecondaryControl_(n);else{if("d"!==t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const t=Th("t",e),n=Th("d",e);"c"===t?this.onControl_(n):"d"===t&&this.onDataMessage_(n)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const t=Th("t",e);if("d"in e){const n=e.d;if("h"===t){const e=Object.assign({},n);this.repoInfo_.isUsingEmulator&&(e.h=this.repoInfo_.host),this.onHandshake_(e)}else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let e=0;e {this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())}),Math.floor(6e4))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,1===this.state_?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,t){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Ih((()=>{this.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))}sendPingOnPrimaryIfNecessary_(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()}onConnectionLost_(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(oh.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)}close(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}class tf{put(e,t,n,r){}merge(e,t,n,r){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,t,n){}onDisconnectMerge(e,t,n){}onDisconnectCancel(e,t){}reportStats(e){}}class nf{constructor(e){this.allowedEvents_=e,this.listeners_={},ys(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e){if(Array.isArray(this.listeners_[e])){const i=[...this.listeners_[e]];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r t===e)),"Unknown event: "+e)}}class rf extends nf{constructor(){super(["online"]),this.online_=!0,"undefined"===typeof window||"undefined"===typeof window.addEventListener||Bs()||(window.addEventListener("online",(()=>{this.online_||(this.online_=!0,this.trigger("online",!0))}),!1),window.addEventListener("offline",(()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))}),!1))}static getInstance(){return new rf}getInitialEvent(e){return ys("online"===e,"Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}const of=32,af=768;class sf{constructor(e,t){if(void 0===t){this.pieces_=e.split("/");let t=0;for(let e=0;e 0&&(this.pieces_[t]=this.pieces_[e],t++);this.pieces_.length=t,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}toString(){let e="";for(let t=this.pieceNum_;t =e.pieces_.length?null:e.pieces_[e.pieceNum_]}function uf(e){return e.pieces_.length-e.pieceNum_}function df(e){let t=e.pieceNum_;return t 1&&void 0!==arguments[1]?arguments[1]:0;return e.pieces_.slice(e.pieceNum_+t)}function ff(e){if(e.pieceNum_>=e.pieces_.length)return null;const t=[];for(let n=e.pieceNum_;n 0&&n.push(e[t])}return new sf(n,0)}function gf(e){return e.pieceNum_>=e.pieces_.length}function vf(e,t){const n=cf(e),r=cf(t);if(null===n)return t;if(n===r)return vf(df(e),df(t));throw new Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")}function bf(e,t){const n=hf(e,0),r=hf(t,0);for(let i=0;i uf(t))return!1;for(;n af)throw new Error(e.errorPrefix_+"has a key path longer than "+af+" bytes ("+e.byteLength_+").");if(e.parts_.length>of)throw new Error(e.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+of+") or object contains a cycle "+Ef(e))}function Ef(e){return 0===e.parts_.length?"":"in property '"+e.parts_.join(".")+"'"}class Tf extends nf{constructor(){let e,t;super(["visible"]),"undefined"!==typeof document&&"undefined"!==typeof document.addEventListener&&("undefined"!==typeof document.hidden?(t="visibilitychange",e="hidden"):"undefined"!==typeof document.mozHidden?(t="mozvisibilitychange",e="mozHidden"):"undefined"!==typeof document.msHidden?(t="msvisibilitychange",e="msHidden"):"undefined"!==typeof document.webkitHidden&&(t="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,t&&document.addEventListener(t,(()=>{const t=!document[e];t!==this.visible_&&(this.visible_=t,this.trigger("visible",t))}),!1)}static getInstance(){return new Tf}getInitialEvent(e){return ys("visible"===e,"Unknown event type: "+e),[this.visible_]}}const Cf=1e3;class kf extends tf{constructor(e,t,n,r,i,o,a,s){if(super(),this.repoInfo_=e,this.applicationId_=t,this.onDataUpdate_=n,this.onConnectStatus_=r,this.onServerInfoUpdate_=i,this.authTokenProvider_=o,this.appCheckTokenProvider_=a,this.authOverride_=s,this.id=kf.nextPersistentConnectionId_++,this.log_=mh("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=Cf,this.maxReconnectDelay_=3e5,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,s&&!Us())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");Tf.getInstance().on("visible",this.onVisible_,this),-1===e.host.indexOf("fblocal")&&rf.getInstance().on("online",this.onOnline_,this)}sendRequest(e,t,n){const r=++this.requestNumber_,i={r:r,a:e,b:t};this.log_(Ws(i)),ys(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)}get(e){this.initConnection_();const t=new Ds,n={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:e=>{const n=e.d;"ok"===e.s?t.resolve(n):t.reject(n)}};this.outstandingGets_.push(n),this.outstandingGetCount_++;const r=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(r),t.promise}listen(e,t,n,r){this.initConnection_();const i=e._queryIdentifier,o=e._path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),ys(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),ys(!this.listens.get(o).has(i),"listen() called twice for same path/queryId.");const a={onComplete:r,hashFn:t,query:e,tag:n};this.listens.get(o).set(i,a),this.connected_&&this.sendListen_(a)}sendGet_(e){const t=this.outstandingGets_[e];this.sendRequest("g",t.request,(n=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,0===this.outstandingGetCount_&&(this.outstandingGets_=[]),t.onComplete&&t.onComplete(n)}))}sendListen_(e){const t=e.query,n=t._path.toString(),r=t._queryIdentifier;this.log_("Listen on "+n+" for "+r);const i={p:n};e.tag&&(i.q=t._queryObject,i.t=e.tag),i.h=e.hashFn(),this.sendRequest("q",i,(i=>{const o=i.d,a=i.s;kf.warnOnListenWarnings_(o,t);(this.listens.get(n)&&this.listens.get(n).get(r))===e&&(this.log_("listen response",i),"ok"!==a&&this.removeListen_(n,r),e.onComplete&&e.onComplete(a,o))}))}static warnOnListenWarnings_(e,t){if(e&&"object"===typeof e&&Vs(e,"w")){const n=$s(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){const e='".indexOn": "'+t._queryParams.getIndex().toString()+'"',n=t._path.toString();bh("Using an unspecified index. Your data will be downloaded and "+"filtered on the client. Consider adding ".concat(e," at ")+"".concat(n," to your security rules for better performance."))}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(()=>{})),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&40===e.length||function(e){const t=Gs(e).claims;return"object"===typeof t&&!0===t.admin}(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},(()=>{}))}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,t=function(e){const t=Gs(e).claims;return!!t&&"object"===typeof t&&t.hasOwnProperty("iat")}(e)?"auth":"gauth",n={cred:e};null===this.authOverride_?n.noauth=!0:"object"===typeof this.authOverride_&&(n.authvar=this.authOverride_),this.sendRequest(t,n,(t=>{const n=t.s,r=t.d||"error";this.authToken_===e&&("ok"===n?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(n,r))}))}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},(e=>{const t=e.s,n=e.d||"error";"ok"===t?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(t,n)}))}unlisten(e,t){const n=e._path.toString(),r=e._queryIdentifier;this.log_("Unlisten called for "+n+" "+r),ys(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query");this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,e._queryObject,t)}sendUnlisten_(e,t,n,r){this.log_("Unlisten on "+e+" for "+t);const i={p:e};r&&(i.q=n,i.t=r),this.sendRequest("n",i)}onDisconnectPut(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})}onDisconnectMerge(e,t,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})}onDisconnectCancel(e,t){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})}sendOnDisconnect_(e,t,n,r){const i={p:t,d:n};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,(e=>{r&&setTimeout((()=>{r(e.s,e.d)}),Math.floor(0))}))}put(e,t,n,r){this.putInternal("p",e,t,n,r)}merge(e,t,n,r){this.putInternal("m",e,t,n,r)}putInternal(e,t,n,r,i){this.initConnection_();const o={p:t,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:e,request:o,onComplete:r}),this.outstandingPutCount_++;const a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)}sendPut_(e){const t=this.outstandingPuts_[e].action,n=this.outstandingPuts_[e].request,r=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(t,n,(n=>{this.log_(t+" response",n),delete this.outstandingPuts_[e],this.outstandingPutCount_--,0===this.outstandingPutCount_&&(this.outstandingPuts_=[]),r&&r(n.s,n.d)}))}reportStats(e){if(this.connected_){const t={c:e};this.log_("reportStats",t),this.sendRequest("s",t,(e=>{if("ok"!==e.s){const t=e.d;this.log_("reportStats","Error sending stats: "+t)}}))}}onDataMessage_(e){if("r"in e){this.log_("from server: "+Ws(e));const t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"apc"===e?this.onAppCheckRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):gh("Unrecognized action received from server: "+Ws(e)+"\nAre you using the latest client?")}onReady_(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){ys(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((()=>{this.establishConnectionTimer_=null,this.establishConnection_()}),Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=Cf,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=Cf,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=Cf),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();const e=(new Date).getTime()-this.lastConnectionAttemptTime_;let t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),t=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),r=this.id+":"+kf.nextConnectionId_++,i=this.lastSessionId;let o=!1,a=null;const s=function(){a?a.close():(o=!0,n())},l=function(e){ys(a,"sendRequest call when we're not connected not allowed."),a.sendRequest(e)};this.realtime_={close:s,sendRequest:l};const c=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[s,l]=await Promise.all([this.authTokenProvider_.getToken(c),this.appCheckTokenProvider_.getToken(c)]);o?fh("getToken() completed but was canceled"):(fh("getToken() completed. Creating connection."),this.authToken_=s&&s.accessToken,this.appCheckToken_=l&&l.token,a=new ef(r,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,t,n,(e=>{bh(e+" ("+this.repoInfo_.toString()+")"),this.interrupt("server_kill")}),i))}catch(gh){this.log_("Failed to get token: "+gh),o||(this.repoInfo_.nodeAdmin&&bh(gh),s())}}}interrupt(e){fh("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){fh("Resuming connection for reason: "+e),delete this.interruptReasons_[e],Ks(this.interruptReasons_)&&(this.reconnectDelay_=Cf,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})}cancelSentTransactions_(){for(let e=0;e Ch(e))).join("$"):"default";const r=this.removeListen_(e,n);r&&r.onComplete&&r.onComplete("permission_denied")}removeListen_(e,t){const n=new sf(e).toString();let r;if(this.listens.has(n)){const e=this.listens.get(n);r=e.get(t),e.delete(t),0===e.size&&this.listens.delete(n)}else r=void 0;return r}onAuthRevoked_(e,t){fh("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,t){fh("App check token revoked: "+e+"/"+t),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const t of e.values())this.sendListen_(t);for(let e=0;e 4&&void 0!==arguments[4]?arguments[4]:null;this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];let o=1;for(;!e.isEmpty();)if(o=t?n(e.key,t):1,r&&(o*=-1),o<0)e=this.isReverse_?e.left:e.right;else{if(0===o){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}getNext(){if(0===this.nodeStack_.length)return null;let e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e}hasNext(){return this.nodeStack_.length>0}peek(){if(0===this.nodeStack_.length)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class Lf{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:Lf.RED,this.left=null!=r?r:Rf.EMPTY_NODE,this.right=null!=i?i:Rf.EMPTY_NODE}copy(e,t,n,r,i){return new Lf(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this;const i=n(e,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp_()}removeMin_(){if(this.left.isEmpty())return Rf.EMPTY_NODE;let e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,t){let n,r;if(n=this,t(e,n.key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return Rf.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,Lf.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,Lf.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}Lf.RED=!0,Lf.BLACK=!1;class Rf{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rf.EMPTY_NODE;this.comparator_=e,this.root_=t}insert(e,t){return new Rf(this.comparator_,this.root_.insert(e,t,this.comparator_).copy(null,null,Lf.BLACK,null,null))}remove(e){return new Rf(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Lf.BLACK,null,null))}get(e){let t,n=this.root_;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),0===t)return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null}getPredecessorKey(e){let t,n=this.root_,r=null;for(;!n.isEmpty();){if(t=this.comparator_(e,n.key),0===t){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new If(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,t){return new If(this.root_,e,this.comparator_,!1,t)}getReverseIteratorFrom(e,t){return new If(this.root_,e,this.comparator_,!0,t)}getReverseIterator(e){return new If(this.root_,null,this.comparator_,!0,e)}}function Nf(e,t){return wh(e.name,t.name)}function Df(e,t){return wh(e,t)}let Mf;Rf.EMPTY_NODE=new class{copy(e,t,n,r,i){return this}insert(e,t,n){return new Lf(e,t,null)}remove(e,t){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}};const Bf=function(e){return"number"===typeof e?"number:"+Oh(e):"string:"+e},Qf=function(e){if(e.isLeafNode()){const t=e.val();ys("string"===typeof t||"number"===typeof t||"object"===typeof t&&Vs(t,".sv"),"Priority must be a string or number.")}else ys(e===Mf||e.isEmpty(),"priority of unexpected type.");ys(e===Mf||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};let Uf,Ff,zf;class qf{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qf.__childrenNodeConstructor.EMPTY_NODE;this.value_=e,this.priorityNode_=t,this.lazyHash_=null,ys(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Qf(this.priorityNode_)}static set __childrenNodeConstructor(e){Uf=e}static get __childrenNodeConstructor(){return Uf}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new qf(this.value_,e)}getImmediateChild(e){return".priority"===e?this.priorityNode_:qf.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return gf(e)?this:".priority"===cf(e)?this.priorityNode_:qf.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,t){return null}updateImmediateChild(e,t){return".priority"===e?this.updatePriority(t):t.isEmpty()&&".priority"!==e?this:qf.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,t).updatePriority(this.priorityNode_)}updateChild(e,t){const n=cf(e);return null===n?t:t.isEmpty()&&".priority"!==n?this:(ys(".priority"!==n||1===uf(e),".priority must be the last token in a path"),this.updateImmediateChild(n,qf.__childrenNodeConstructor.EMPTY_NODE.updateChild(df(e),t)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,t){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(null===this.lazyHash_){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+Bf(this.priorityNode_.val())+":");const t=typeof this.value_;e+=t+":",e+="number"===t?Oh(this.value_):this.value_,this.lazyHash_=ch(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===qf.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof qf.__childrenNodeConstructor?-1:(ys(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const t=typeof e.value_,n=typeof this.value_,r=qf.VALUE_TYPE_ORDER.indexOf(t),i=qf.VALUE_TYPE_ORDER.indexOf(n);return ys(r>=0,"Unknown leaf type: "+t),ys(i>=0,"Unknown leaf type: "+n),r===i?"object"===n?0:this.value_ {const i=$s(this.indexSet_,r);if(ys(i,"Missing index implementation for "+r),n===Kf){if(i.isDefinedOn(e.node)){const n=[],r=t.getIterator(Sf.Wrap);let o=r.getNext();for(;o;)o.name!==e.name&&n.push(o),o=r.getNext();return n.push(e),Vf(n,i.getCompare())}return Kf}{const r=t.get(e.name);let i=n;return r&&(i=i.remove(new Sf(e.name,r))),i.insert(e,e.node)}}));return new Yf(n,this.indexSet_)}removeFromIndexes(e,t){const n=Ys(this.indexes_,(n=>{if(n===Kf)return n;{const r=t.get(e.name);return r?n.remove(new Sf(e.name,r)):n}}));return new Yf(n,this.indexSet_)}}let Zf;class Jf{constructor(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Qf(this.priorityNode_),this.children_.isEmpty()&&ys(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}static get EMPTY_NODE(){return Zf||(Zf=new Jf(new Rf(Df),null,Yf.Default))}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Zf}updatePriority(e){return this.children_.isEmpty()?this:new Jf(this.children_,e,this.indexMap_)}getImmediateChild(e){if(".priority"===e)return this.getPriority();{const t=this.children_.get(e);return null===t?Zf:t}}getChild(e){const t=cf(e);return null===t?this:this.getImmediateChild(t).getChild(df(e))}hasChild(e){return null!==this.children_.get(e)}updateImmediateChild(e,t){if(ys(t,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(t);{const n=new Sf(e,t);let r,i;t.isEmpty()?(r=this.children_.remove(e),i=this.indexMap_.removeFromIndexes(n,this.children_)):(r=this.children_.insert(e,t),i=this.indexMap_.addToIndexes(n,this.children_));const o=r.isEmpty()?Zf:this.priorityNode_;return new Jf(r,o,i)}}updateChild(e,t){const n=cf(e);if(null===n)return t;{ys(".priority"!==cf(e)||1===uf(e),".priority must be the last token in a path");const r=this.getImmediateChild(n).updateChild(df(e),t);return this.updateImmediateChild(n,r)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const t={};let n=0,r=0,i=!0;if(this.forEachChild(Hf,((o,a)=>{t[o]=a.val(e),n++,i&&Jf.INTEGER_REGEXP_.test(o)?r=Math.max(r,Number(o)):i=!1})),!e&&i&&r<2*n){const e=[];for(const n in t)e[n]=t[n];return e}return e&&!this.getPriority().isEmpty()&&(t[".priority"]=this.getPriority().val()),t}hash(){if(null===this.lazyHash_){let e="";this.getPriority().isEmpty()||(e+="priority:"+Bf(this.getPriority().val())+":"),this.forEachChild(Hf,((t,n)=>{const r=n.hash();""!==r&&(e+=":"+t+":"+r)})),this.lazyHash_=""===e?"":ch(e)}return this.lazyHash_}getPredecessorChildName(e,t,n){const r=this.resolveIndex_(n);if(r){const n=r.getPredecessorKey(new Sf(e,t));return n?n.name:null}return this.children_.getPredecessorKey(e)}getFirstChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.minKey();return e&&e.name}return this.children_.minKey()}getFirstChild(e){const t=this.getFirstChildName(e);return t?new Sf(t,this.children_.get(t)):null}getLastChildName(e){const t=this.resolveIndex_(e);if(t){const e=t.maxKey();return e&&e.name}return this.children_.maxKey()}getLastChild(e){const t=this.getLastChildName(e);return t?new Sf(t,this.children_.get(t)):null}forEachChild(e,t){const n=this.resolveIndex_(e);return n?n.inorderTraversal((e=>t(e.name,e.node))):this.children_.inorderTraversal(t)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,t){const n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,(e=>e));{const n=this.children_.getIteratorFrom(e.name,Sf.Wrap);let r=n.peek();for(;null!=r&&t.compare(r,e)<0;)n.getNext(),r=n.peek();return n}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,t){const n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,(e=>e));{const n=this.children_.getReverseIteratorFrom(e.name,Sf.Wrap);let r=n.peek();for(;null!=r&&t.compare(r,e)>0;)n.getNext(),r=n.peek();return n}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Xf?-1:0}withIndex(e){if(e===Pf||this.indexMap_.hasIndex(e))return this;{const t=this.indexMap_.addIndex(e,this.children_);return new Jf(this.children_,this.priorityNode_,t)}}isIndexed(e){return e===Pf||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){const e=this.getIterator(Hf),n=t.getIterator(Hf);let r=e.getNext(),i=n.getNext();for(;r&&i;){if(r.name!==i.name||!r.node.equals(i.node))return!1;r=e.getNext(),i=n.getNext()}return null===r&&null===i}return!1}return!1}}resolveIndex_(e){return e===Pf?null:this.indexMap_.get(e.toString())}}Jf.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;const Xf=new class extends Jf{constructor(){super(new Rf(Df),Jf.EMPTY_NODE,Yf.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return Jf.EMPTY_NODE}isEmpty(){return!1}};Object.defineProperties(Sf,{MIN:{value:new Sf(_h,Jf.EMPTY_NODE)},MAX:{value:new Sf(xh,Xf)}}),jf.__EMPTY_NODE=Jf.EMPTY_NODE,qf.__childrenNodeConstructor=Jf,Mf=Xf,function(e){zf=e}(Xf);const em=!0;function tm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===e)return Jf.EMPTY_NODE;if("object"===typeof e&&".priority"in e&&(t=e[".priority"]),ys(null===t||"string"===typeof t||"number"===typeof t||"object"===typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"===typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!==typeof e||".sv"in e){return new qf(e,tm(t))}if(e instanceof Array||!em){let n=Jf.EMPTY_NODE;return Sh(e,((t,r)=>{if(Vs(e,t)&&"."!==t.substring(0,1)){const e=tm(r);!e.isLeafNode()&&e.isEmpty()||(n=n.updateImmediateChild(t,e))}})),n.updatePriority(tm(t))}{const n=[];let r=!1;if(Sh(e,((e,t)=>{if("."!==e.substring(0,1)){const i=tm(t);i.isEmpty()||(r=r||!i.getPriority().isEmpty(),n.push(new Sf(e,i)))}})),0===n.length)return Jf.EMPTY_NODE;const i=Vf(n,Nf,(e=>e.name),Df);if(r){const e=Vf(n,Hf.getCompare());return new Jf(i,tm(t),new Yf({".priority":e},{".priority":Hf}))}return new Jf(i,tm(t),Yf.Default)}}!function(e){Ff=e}(tm);class nm extends Of{constructor(e){super(),this.indexPath_=e,ys(!gf(e)&&".priority"!==cf(e),"Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,t){const n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?wh(e.name,t.name):i}makePost(e,t){const n=tm(e),r=Jf.EMPTY_NODE.updateChild(this.indexPath_,n);return new Sf(t,r)}maxPost(){const e=Jf.EMPTY_NODE.updateChild(this.indexPath_,Xf);return new Sf(xh,e)}toString(){return hf(this.indexPath_,0).join("/")}}const rm=new class extends Of{compare(e,t){const n=e.node.compareTo(t.node);return 0===n?wh(e.name,t.name):n}isDefinedOn(e){return!0}indexedValueChanged(e,t){return!e.equals(t)}minPost(){return Sf.MIN}maxPost(){return Sf.MAX}makePost(e,t){const n=tm(e);return new Sf(t,n)}toString(){return".value"}};function im(e){return{type:"value",snapshotNode:e}}function om(e,t){return{type:"child_added",snapshotNode:t,childName:e}}function am(e,t){return{type:"child_removed",snapshotNode:t,childName:e}}function sm(e,t,n){return{type:"child_changed",snapshotNode:t,childName:e,oldSnap:n}}class lm{constructor(e){this.index_=e}updateChild(e,t,n,r,i,o){ys(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");const a=e.getImmediateChild(t);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()===n.isEmpty()?e:(null!=o&&(n.isEmpty()?e.hasChild(t)?o.trackChildChange(am(t,a)):ys(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(om(t,n)):o.trackChildChange(sm(t,n,a))),e.isLeafNode()&&n.isEmpty()?e:e.updateImmediateChild(t,n).withIndex(this.index_))}updateFullNode(e,t,n){return null!=n&&(e.isLeafNode()||e.forEachChild(Hf,((e,r)=>{t.hasChild(e)||n.trackChildChange(am(e,r))})),t.isLeafNode()||t.forEachChild(Hf,((t,r)=>{if(e.hasChild(t)){const i=e.getImmediateChild(t);i.equals(r)||n.trackChildChange(sm(t,r,i))}else n.trackChildChange(om(t,r))}))),t.withIndex(this.index_)}updatePriority(e,t){return e.isEmpty()?Jf.EMPTY_NODE:e.updatePriority(t)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}}class cm{constructor(e){this.indexedFilter_=new lm(e.getIndex()),this.index_=e.getIndex(),this.startPost_=cm.getStartPost_(e),this.endPost_=cm.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){const t=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,n=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return t&&n}updateChild(e,t,n,r,i,o){return this.matches(new Sf(t,n))||(n=Jf.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,r,i,o)}updateFullNode(e,t,n){t.isLeafNode()&&(t=Jf.EMPTY_NODE);let r=t.withIndex(this.index_);r=r.updatePriority(Jf.EMPTY_NODE);const i=this;return t.forEachChild(Hf,((e,t)=>{i.matches(new Sf(e,t))||(r=r.updateImmediateChild(e,Jf.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(e,r,n)}updatePriority(e,t){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){const t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){const t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()}}class um{constructor(e){this.withinDirectionalStart=e=>this.reverse_?this.withinEndPost(e):this.withinStartPost(e),this.withinDirectionalEnd=e=>this.reverse_?this.withinStartPost(e):this.withinEndPost(e),this.withinStartPost=e=>{const t=this.index_.compare(this.rangedFilter_.getStartPost(),e);return this.startIsInclusive_?t<=0:t<0},this.withinEndPost=e=>{const t=this.index_.compare(e,this.rangedFilter_.getEndPost());return this.endIsInclusive_?t<=0:t<0},this.rangedFilter_=new cm(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,t,n,r,i,o){return this.rangedFilter_.matches(new Sf(t,n))||(n=Jf.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren() e(n,t)}else o=this.index_.getCompare();const a=e;ys(a.numChildren()===this.limit_,"");const s=new Sf(t,n),l=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),c=this.rangedFilter_.matches(s);if(a.hasChild(t)){const e=a.getImmediateChild(t);let u=r.getChildAfterChild(this.index_,l,this.reverse_);for(;null!=u&&(u.name===t||a.hasChild(u.name));)u=r.getChildAfterChild(this.index_,u,this.reverse_);const d=null==u?1:o(u,s);if(c&&!n.isEmpty()&&d>=0)return null!=i&&i.trackChildChange(sm(t,n,e)),a.updateImmediateChild(t,n);{null!=i&&i.trackChildChange(am(t,e));const n=a.updateImmediateChild(t,Jf.EMPTY_NODE);return null!=u&&this.rangedFilter_.matches(u)?(null!=i&&i.trackChildChange(om(u.name,u.node)),n.updateImmediateChild(u.name,u.node)):n}}return n.isEmpty()?e:c&&o(l,s)>=0?(null!=i&&(i.trackChildChange(am(l.name,l.node)),i.trackChildChange(om(t,n))),a.updateImmediateChild(t,n).updateImmediateChild(l.name,Jf.EMPTY_NODE)):e}}class dm{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Hf}hasStart(){return this.startSet_}isViewFromLeft(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_}getIndexStartValue(){return ys(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return ys(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:_h}hasEnd(){return this.endSet_}getIndexEndValue(){return ys(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return ys(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:xh}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&""!==this.viewFrom_}getLimit(){return ys(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===Hf}copy(){const e=new dm;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function pm(e){const t={};if(e.isDefault())return t;let n;if(e.index_===Hf?n="$priority":e.index_===rm?n="$value":e.index_===Pf?n="$key":(ys(e.index_ instanceof nm,"Unrecognized index type!"),n=e.index_.toString()),t.orderBy=Ws(n),e.startSet_){const n=e.startAfterSet_?"startAfter":"startAt";t[n]=Ws(e.indexStartValue_),e.startNameSet_&&(t[n]+=","+Ws(e.indexStartName_))}if(e.endSet_){const n=e.endBeforeSet_?"endBefore":"endAt";t[n]=Ws(e.indexEndValue_),e.endNameSet_&&(t[n]+=","+Ws(e.indexEndName_))}return e.limitSet_&&(e.isViewFromLeft()?t.limitToFirst=e.limit_:t.limitToLast=e.limit_),t}function hm(e){const t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_),t.sin=!e.startAfterSet_),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_),t.ein=!e.endBeforeSet_),e.limitSet_){t.l=e.limit_;let n=e.viewFrom_;""===n&&(n=e.isViewFromLeft()?"l":"r"),t.vf=n}return e.index_!==Hf&&(t.i=e.index_.toString()),t}class fm extends tf{constructor(e,t,n,r){super(),this.repoInfo_=e,this.onDataUpdate_=t,this.authTokenProvider_=n,this.appCheckTokenProvider_=r,this.log_=mh("p:rest:"),this.listens_={}}reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,t){return void 0!==t?"tag$"+t:(ys(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}listen(e,t,n,r){const i=e._path.toString();this.log_("Listen called for "+i+" "+e._queryIdentifier);const o=fm.getListenId_(e,n),a={};this.listens_[o]=a;const s=pm(e._queryParams);this.restRequest_(i+".json",s,((e,t)=>{let s=t;if(404===e&&(s=null,e=null),null===e&&this.onDataUpdate_(i,s,!1,n),$s(this.listens_,o)===a){let t;t=e?401===e?"permission_denied":"rest_error:"+e:"ok",r(t,null)}}))}unlisten(e,t){const n=fm.getListenId_(e,t);delete this.listens_[n]}get(e){const t=pm(e._queryParams),n=e._path.toString(),r=new Ds;return this.restRequest_(n+".json",t,((e,t)=>{let i=t;404===e&&(i=null,e=null),null===e?(this.onDataUpdate_(n,i,!1,null),r.resolve(i)):r.reject(new Error(i))})),r.promise}refreshAuthToken(e){}restRequest_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return t.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then((r=>{let[i,o]=r;i&&i.accessToken&&(t.auth=i.accessToken),o&&o.token&&(t.ac=o.token);const a=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+Xs(t);this.log_("Sending REST request for "+a);const s=new XMLHttpRequest;s.onreadystatechange=()=>{if(n&&4===s.readyState){this.log_("REST Response for "+a+" received. status:",s.status,"response:",s.responseText);let t=null;if(s.status>=200&&s.status<300){try{t=Hs(s.responseText)}catch(e){bh("Failed to parse JSON response for "+a+": "+s.responseText)}n(null,t)}else 401!==s.status&&404!==s.status&&bh("Got unsuccessful REST response for "+a+" Status: "+s.status),n(s.status);n=null}},s.open("GET",a,!0),s.send()}))}}class mm{constructor(){this.rootNode_=Jf.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)}}function gm(){return{value:null,children:new Map}}function vm(e,t,n){if(gf(t))e.value=n,e.children.clear();else if(null!==e.value)e.value=e.value.updateChild(t,n);else{const r=cf(t);e.children.has(r)||e.children.set(r,gm());vm(e.children.get(r),t=df(t),n)}}function bm(e,t,n){null!==e.value?n(t,e.value):function(e,t){e.children.forEach(((e,n)=>{t(n,e)}))}(e,((e,r)=>{bm(r,new sf(t.toString()+"/"+e),n)}))}class ym{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),t=Object.assign({},e);return this.last_&&Sh(this.last_,((e,n)=>{t[e]=t[e]-n})),this.last_=e,t}}class _m{constructor(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new ym(e);const n=1e4+2e4*Math.random();Ih(this.reportStats_.bind(this),Math.floor(n))}reportStats_(){const e=this.statsListener_.get(),t={};let n=!1;Sh(e,((e,r)=>{r>0&&Vs(this.statsToReport_,e)&&(t[e]=r,n=!0)})),n&&this.server_.reportStats(t),Ih(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))}}var xm;function wm(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}}!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(xm||(xm={}));class Em{constructor(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=xm.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}operationForChild(e){if(gf(this.path)){if(null!=this.affectedTree.value)return ys(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const t=this.affectedTree.subtree(new sf(e));return new Em(lf(),t,this.revert)}}return ys(cf(this.path)===e,"operationForChild called for unrelated child."),new Em(df(this.path),this.affectedTree,this.revert)}}class Tm{constructor(e,t){this.source=e,this.path=t,this.type=xm.LISTEN_COMPLETE}operationForChild(e){return gf(this.path)?new Tm(this.source,lf()):new Tm(this.source,df(this.path))}}class Cm{constructor(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=xm.OVERWRITE}operationForChild(e){return gf(this.path)?new Cm(this.source,lf(),this.snap.getImmediateChild(e)):new Cm(this.source,df(this.path),this.snap)}}class km{constructor(e,t,n){this.source=e,this.path=t,this.children=n,this.type=xm.MERGE}operationForChild(e){if(gf(this.path)){const t=this.children.subtree(new sf(e));return t.isEmpty()?null:t.value?new Cm(this.source,lf(),t.value):new km(this.source,lf(),t)}return ys(cf(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new km(this.source,df(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}class Sm{constructor(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(gf(e))return this.isFullyInitialized()&&!this.filtered_;const t=cf(e);return this.isCompleteForChild(t)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}class Om{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}}function Am(e,t,n,r,i,o){const a=r.filter((e=>e.type===n));a.sort(((t,n)=>function(e,t,n){if(null==t.childName||null==n.childName)throw _s("Should only compare child_ events.");const r=new Sf(t.childName,t.snapshotNode),i=new Sf(n.childName,n.snapshotNode);return e.index_.compare(r,i)}(e,t,n))),a.forEach((n=>{const r=function(e,t,n){return"value"===t.type||"child_removed"===t.type||(t.prevName=n.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}(e,n,o);i.forEach((i=>{i.respondsTo(n.type)&&t.push(i.createEvent(r,e.query_))}))}))}function jm(e,t){return{eventCache:e,serverCache:t}}function Pm(e,t,n,r){return jm(new Sm(t,n,r),e.serverCache)}function Im(e,t,n,r){return jm(e.eventCache,new Sm(t,n,r))}function Lm(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function Rm(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null}let Nm;class Dm{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(Nm||(Nm=new Rf(Eh)),Nm);this.value=e,this.children=t}static fromObject(e){let t=new Dm(null);return Sh(e,((e,n)=>{t=t.set(new sf(e),n)})),t}isEmpty(){return null===this.value&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,t){if(null!=this.value&&t(this.value))return{path:lf(),value:this.value};if(gf(e))return null;{const n=cf(e),r=this.children.get(n);if(null!==r){const i=r.findRootMostMatchingPathAndValue(df(e),t);if(null!=i){return{path:mf(new sf(n),i.path),value:i.value}}return null}return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,(()=>!0))}subtree(e){if(gf(e))return this;{const t=cf(e),n=this.children.get(t);return null!==n?n.subtree(df(e)):new Dm(null)}}set(e,t){if(gf(e))return new Dm(t,this.children);{const n=cf(e),r=(this.children.get(n)||new Dm(null)).set(df(e),t),i=this.children.insert(n,r);return new Dm(this.value,i)}}remove(e){if(gf(e))return this.children.isEmpty()?new Dm(null):new Dm(null,this.children);{const t=cf(e),n=this.children.get(t);if(n){const r=n.remove(df(e));let i;return i=r.isEmpty()?this.children.remove(t):this.children.insert(t,r),null===this.value&&i.isEmpty()?new Dm(null):new Dm(this.value,i)}return this}}get(e){if(gf(e))return this.value;{const t=cf(e),n=this.children.get(t);return n?n.get(df(e)):null}}setTree(e,t){if(gf(e))return t;{const n=cf(e),r=(this.children.get(n)||new Dm(null)).setTree(df(e),t);let i;return i=r.isEmpty()?this.children.remove(n):this.children.insert(n,r),new Dm(this.value,i)}}fold(e){return this.fold_(lf(),e)}fold_(e,t){const n={};return this.children.inorderTraversal(((r,i)=>{n[r]=i.fold_(mf(e,r),t)})),t(e,this.value,n)}findOnPath(e,t){return this.findOnPath_(e,lf(),t)}findOnPath_(e,t,n){const r=!!this.value&&n(t,this.value);if(r)return r;if(gf(e))return null;{const r=cf(e),i=this.children.get(r);return i?i.findOnPath_(df(e),mf(t,r),n):null}}foreachOnPath(e,t){return this.foreachOnPath_(e,lf(),t)}foreachOnPath_(e,t,n){if(gf(e))return this;{this.value&&n(t,this.value);const r=cf(e),i=this.children.get(r);return i?i.foreachOnPath_(df(e),mf(t,r),n):new Dm(null)}}foreach(e){this.foreach_(lf(),e)}foreach_(e,t){this.children.inorderTraversal(((n,r)=>{r.foreach_(mf(e,n),t)})),this.value&&t(e,this.value)}foreachChild(e){this.children.inorderTraversal(((t,n)=>{n.value&&e(t,n.value)}))}}class Mm{constructor(e){this.writeTree_=e}static empty(){return new Mm(new Dm(null))}}function Bm(e,t,n){if(gf(t))return new Mm(new Dm(n));{const r=e.writeTree_.findRootMostValueAndPath(t);if(null!=r){const i=r.path;let o=r.value;const a=vf(i,t);return o=o.updateChild(a,n),new Mm(e.writeTree_.set(i,o))}{const r=new Dm(n),i=e.writeTree_.setTree(t,r);return new Mm(i)}}}function Qm(e,t,n){let r=e;return Sh(n,((e,n)=>{r=Bm(r,mf(t,e),n)})),r}function Um(e,t){if(gf(t))return Mm.empty();{const n=e.writeTree_.setTree(t,new Dm(null));return new Mm(n)}}function Fm(e,t){return null!=zm(e,t)}function zm(e,t){const n=e.writeTree_.findRootMostValueAndPath(t);return null!=n?e.writeTree_.get(n.path).getChild(vf(n.path,t)):null}function qm(e){const t=[],n=e.writeTree_.value;return null!=n?n.isLeafNode()||n.forEachChild(Hf,((e,n)=>{t.push(new Sf(e,n))})):e.writeTree_.children.inorderTraversal(((e,n)=>{null!=n.value&&t.push(new Sf(e,n.value))})),t}function Hm(e,t){if(gf(t))return e;{const n=zm(e,t);return new Mm(null!=n?new Dm(n):e.writeTree_.subtree(t))}}function Wm(e){return e.writeTree_.isEmpty()}function Gm(e,t){return Vm(lf(),e.writeTree_,t)}function Vm(e,t,n){if(null!=t.value)return n.updateChild(e,t.value);{let r=null;return t.children.inorderTraversal(((t,i)=>{".priority"===t?(ys(null!==i.value,"Priority writes must always be leaf nodes"),r=i.value):n=Vm(mf(e,t),i,n)})),n.getChild(e).isEmpty()||null===r||(n=n.updateChild(mf(e,".priority"),r)),n}}function $m(e,t){return sg(t,e)}function Km(e,t){const n=e.allWrites.findIndex((e=>e.writeId===t));ys(n>=0,"removeWrite called with nonexistent writeId.");const r=e.allWrites[n];e.allWrites.splice(n,1);let i=r.visible,o=!1,a=e.allWrites.length-1;for(;i&&a>=0;){const t=e.allWrites[a];t.visible&&(a>=n&&Ym(t,r.path)?i=!1:_f(r.path,t.path)&&(o=!0)),a--}if(i){if(o)return function(e){e.visibleWrites=Jm(e.allWrites,Zm,lf()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}(e),!0;if(r.snap)e.visibleWrites=Um(e.visibleWrites,r.path);else{Sh(r.children,(t=>{e.visibleWrites=Um(e.visibleWrites,mf(r.path,t))}))}return!0}return!1}function Ym(e,t){if(e.snap)return _f(e.path,t);for(const n in e.children)if(e.children.hasOwnProperty(n)&&_f(mf(e.path,n),t))return!0;return!1}function Zm(e){return e.visible}function Jm(e,t,n){let r=Mm.empty();for(let i=0;i {r=r.updateImmediateChild(e,t)})),r;if(n){const i=Hm(e.visibleWrites,t);return n.forEachChild(Hf,((e,t)=>{const n=Gm(Hm(i,new sf(e)),t);r=r.updateImmediateChild(e,n)})),qm(i).forEach((e=>{r=r.updateImmediateChild(e.name,e.node)})),r}return qm(Hm(e.visibleWrites,t)).forEach((e=>{r=r.updateImmediateChild(e.name,e.node)})),r}(e.writeTree,e.treePath,t)}function ng(e,t,n,r){return function(e,t,n,r,i){ys(r||i,"Either existingEventSnap or existingServerSnap must exist");const o=mf(t,n);if(Fm(e.visibleWrites,o))return null;{const t=Hm(e.visibleWrites,o);return Wm(t)?i.getChild(n):Gm(t,i.getChild(n))}}(e.writeTree,e.treePath,t,n,r)}function rg(e,t){return function(e,t){return zm(e.visibleWrites,t)}(e.writeTree,mf(e.treePath,t))}function ig(e,t,n,r,i,o){return function(e,t,n,r,i,o,a){let s;const l=Hm(e.visibleWrites,t),c=zm(l,lf());if(null!=c)s=c;else{if(null==n)return[];s=Gm(l,n)}if(s=s.withIndex(a),s.isEmpty()||s.isLeafNode())return[];{const e=[],t=a.getCompare(),n=o?s.getReverseIteratorFrom(r,a):s.getIteratorFrom(r,a);let l=n.getNext();for(;l&&e.length2&&void 0!==arguments[2]?arguments[2]:null;this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}getCompleteChild(e){const t=this.viewCache_.eventCache;if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);{const t=null!=this.optCompleteServerCache_?new Sm(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return og(this.writes_,e,t)}}getChildAfterChild(e,t,n){const r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:Rm(this.viewCache_),i=ig(this.writes_,r,t,1,n,e);return 0===i.length?null:i[0]}}function dg(e,t,n,r,i){const o=new lg;let a,s;if(n.type===xm.OVERWRITE){const l=n;l.source.fromUser?a=fg(e,t,l.path,l.snap,r,i,o):(ys(l.source.fromServer,"Unknown source."),s=l.source.tagged||t.serverCache.isFiltered()&&!gf(l.path),a=hg(e,t,l.path,l.snap,r,i,s,o))}else if(n.type===xm.MERGE){const l=n;l.source.fromUser?a=function(e,t,n,r,i,o,a){let s=t;return r.foreach(((r,l)=>{const c=mf(n,r);mg(t,cf(c))&&(s=fg(e,s,c,l,i,o,a))})),r.foreach(((r,l)=>{const c=mf(n,r);mg(t,cf(c))||(s=fg(e,s,c,l,i,o,a))})),s}(e,t,l.path,l.children,r,i,o):(ys(l.source.fromServer,"Unknown source."),s=l.source.tagged||t.serverCache.isFiltered(),a=vg(e,t,l.path,l.children,r,i,s,o))}else if(n.type===xm.ACK_USER_WRITE){const s=n;a=s.revert?function(e,t,n,r,i,o){let a;if(null!=rg(r,n))return t;{const s=new ug(r,t,i),l=t.eventCache.getNode();let c;if(gf(n)||".priority"===cf(n)){let n;if(t.serverCache.isFullyInitialized())n=eg(r,Rm(t));else{const e=t.serverCache.getNode();ys(e instanceof Jf,"serverChildren would be complete if leaf node"),n=tg(r,e)}c=e.filter.updateFullNode(l,n,o)}else{const i=cf(n);let u=og(r,i,t.serverCache);null==u&&t.serverCache.isCompleteForChild(i)&&(u=l.getImmediateChild(i)),c=null!=u?e.filter.updateChild(l,i,u,df(n),s,o):t.eventCache.getNode().hasChild(i)?e.filter.updateChild(l,i,Jf.EMPTY_NODE,df(n),s,o):l,c.isEmpty()&&t.serverCache.isFullyInitialized()&&(a=eg(r,Rm(t)),a.isLeafNode()&&(c=e.filter.updateFullNode(c,a,o)))}return a=t.serverCache.isFullyInitialized()||null!=rg(r,lf()),Pm(t,c,a,e.filter.filtersNodes())}}(e,t,s.path,r,i,o):function(e,t,n,r,i,o,a){if(null!=rg(i,n))return t;const s=t.serverCache.isFiltered(),l=t.serverCache;if(null!=r.value){if(gf(n)&&l.isFullyInitialized()||l.isCompleteForPath(n))return hg(e,t,n,l.getNode().getChild(n),i,o,s,a);if(gf(n)){let r=new Dm(null);return l.getNode().forEachChild(Pf,((e,t)=>{r=r.set(new sf(e),t)})),vg(e,t,n,r,i,o,s,a)}return t}{let c=new Dm(null);return r.foreach(((e,t)=>{const r=mf(n,e);l.isCompleteForPath(r)&&(c=c.set(e,l.getNode().getChild(r)))})),vg(e,t,n,c,i,o,s,a)}}(e,t,s.path,s.affectedTree,r,i,o)}else{if(n.type!==xm.LISTEN_COMPLETE)throw _s("Unknown operation type: "+n.type);a=function(e,t,n,r,i){const o=t.serverCache,a=Im(t,o.getNode(),o.isFullyInitialized()||gf(n),o.isFiltered());return pg(e,a,n,r,cg,i)}(e,t,n.path,r,o)}const l=o.getChanges();return function(e,t,n){const r=t.eventCache;if(r.isFullyInitialized()){const i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=Lm(e);(n.length>0||!e.eventCache.isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(im(Lm(t)))}}(t,a,l),{viewCache:a,changes:l}}function pg(e,t,n,r,i,o){const a=t.eventCache;if(null!=rg(r,n))return t;{let s,l;if(gf(n))if(ys(t.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),t.serverCache.isFiltered()){const n=Rm(t),i=tg(r,n instanceof Jf?n:Jf.EMPTY_NODE);s=e.filter.updateFullNode(t.eventCache.getNode(),i,o)}else{const n=eg(r,Rm(t));s=e.filter.updateFullNode(t.eventCache.getNode(),n,o)}else{const c=cf(n);if(".priority"===c){ys(1===uf(n),"Can't have a priority with additional path components");const i=a.getNode();l=t.serverCache.getNode();const o=ng(r,n,i,l);s=null!=o?e.filter.updatePriority(i,o):a.getNode()}else{const u=df(n);let d;if(a.isCompleteForChild(c)){l=t.serverCache.getNode();const e=ng(r,n,a.getNode(),l);d=null!=e?a.getNode().getImmediateChild(c).updateChild(u,e):a.getNode().getImmediateChild(c)}else d=og(r,c,t.serverCache);s=null!=d?e.filter.updateChild(a.getNode(),c,d,u,i,o):a.getNode()}}return Pm(t,s,a.isFullyInitialized()||gf(n),e.filter.filtersNodes())}}function hg(e,t,n,r,i,o,a,s){const l=t.serverCache;let c;const u=a?e.filter:e.filter.getIndexedFilter();if(gf(n))c=u.updateFullNode(l.getNode(),r,null);else if(u.filtersNodes()&&!l.isFiltered()){const e=l.getNode().updateChild(n,r);c=u.updateFullNode(l.getNode(),e,null)}else{const e=cf(n);if(!l.isCompleteForPath(n)&&uf(n)>1)return t;const i=df(n),o=l.getNode().getImmediateChild(e).updateChild(i,r);c=".priority"===e?u.updatePriority(l.getNode(),o):u.updateChild(l.getNode(),e,o,i,cg,null)}const d=Im(t,c,l.isFullyInitialized()||gf(n),u.filtersNodes());return pg(e,d,n,i,new ug(i,d,o),s)}function fg(e,t,n,r,i,o,a){const s=t.eventCache;let l,c;const u=new ug(i,t,o);if(gf(n))c=e.filter.updateFullNode(t.eventCache.getNode(),r,a),l=Pm(t,c,!0,e.filter.filtersNodes());else{const i=cf(n);if(".priority"===i)c=e.filter.updatePriority(t.eventCache.getNode(),r),l=Pm(t,c,s.isFullyInitialized(),s.isFiltered());else{const o=df(n),c=s.getNode().getImmediateChild(i);let d;if(gf(o))d=r;else{const e=u.getCompleteChild(i);d=null!=e?".priority"===pf(o)&&e.getChild(ff(o)).isEmpty()?e:e.updateChild(o,r):Jf.EMPTY_NODE}if(c.equals(d))l=t;else{l=Pm(t,e.filter.updateChild(s.getNode(),i,d,o,u,a),s.isFullyInitialized(),e.filter.filtersNodes())}}}return l}function mg(e,t){return e.eventCache.isCompleteForChild(t)}function gg(e,t,n){return n.foreach(((e,n)=>{t=t.updateChild(e,n)})),t}function vg(e,t,n,r,i,o,a,s){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;let l,c=t;l=gf(n)?r:new Dm(null).setTree(n,r);const u=t.serverCache.getNode();return l.children.inorderTraversal(((n,r)=>{if(u.hasChild(n)){const l=gg(0,t.serverCache.getNode().getImmediateChild(n),r);c=hg(e,c,new sf(n),l,i,o,a,s)}})),l.children.inorderTraversal(((n,r)=>{const l=!t.serverCache.isCompleteForChild(n)&&null===r.value;if(!u.hasChild(n)&&!l){const l=gg(0,t.serverCache.getNode().getImmediateChild(n),r);c=hg(e,c,new sf(n),l,i,o,a,s)}})),c}class bg{constructor(e,t){this.query_=e,this.eventRegistrations_=[];const n=this.query_._queryParams,r=new lm(n.getIndex()),i=(o=n).loadsAllData()?new lm(o.getIndex()):o.hasLimit()?new um(o):new cm(o);var o;this.processor_=function(e){return{filter:e}}(i);const a=t.serverCache,s=t.eventCache,l=r.updateFullNode(Jf.EMPTY_NODE,a.getNode(),null),c=i.updateFullNode(Jf.EMPTY_NODE,s.getNode(),null),u=new Sm(l,a.isFullyInitialized(),r.filtersNodes()),d=new Sm(c,s.isFullyInitialized(),i.filtersNodes());this.viewCache_=jm(d,u),this.eventGenerator_=new Om(this.query_)}get query(){return this.query_}}function yg(e,t){const n=Rm(e.viewCache_);return n&&(e.query._queryParams.loadsAllData()||!gf(t)&&!n.getImmediateChild(cf(t)).isEmpty())?n.getChild(t):null}function _g(e){return 0===e.eventRegistrations_.length}function xg(e,t,n){const r=[];if(n){ys(null==t,"A cancel should cancel all event registrations.");const i=e.query._path;e.eventRegistrations_.forEach((e=>{const t=e.createCancelEvent(n,i);t&&r.push(t)}))}if(t){let n=[];for(let r=0;r {var n;"child_changed"===t.type&&e.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push((n=t.childName,{type:"child_moved",snapshotNode:t.snapshotNode,childName:n}))})),Am(e,i,"child_removed",t,r,n),Am(e,i,"child_added",t,r,n),Am(e,i,"child_moved",o,r,n),Am(e,i,"child_changed",t,r,n),Am(e,i,"value",t,r,n),i}(e.eventGenerator_,t,n,i)}let Tg,Cg;class kg{constructor(){this.views=new Map}}function Sg(e,t,n,r){const i=t.source.queryId;if(null!==i){const o=e.views.get(i);return ys(null!=o,"SyncTree gave us an op for an invalid query."),wg(o,t,n,r)}{let i=[];for(const o of e.views.values())i=i.concat(wg(o,t,n,r));return i}}function Og(e,t,n,r,i){const o=t._queryIdentifier,a=e.views.get(o);if(!a){let e=eg(n,i?r:null),o=!1;e?o=!0:r instanceof Jf?(e=tg(n,r),o=!1):(e=Jf.EMPTY_NODE,o=!1);const a=jm(new Sm(e,o,!1),new Sm(r,i,!1));return new bg(t,a)}return a}function Ag(e,t,n,r,i,o){const a=Og(e,t,r,i,o);return e.views.has(t._queryIdentifier)||e.views.set(t._queryIdentifier,a),function(e,t){e.eventRegistrations_.push(t)}(a,n),function(e,t){const n=e.viewCache_.eventCache,r=[];n.getNode().isLeafNode()||n.getNode().forEachChild(Hf,((e,t)=>{r.push(om(e,t))}));return n.isFullyInitialized()&&r.push(im(n.getNode())),Eg(e,r,n.getNode(),t)}(a,n)}function jg(e,t,n,r){const i=t._queryIdentifier,o=[];let a=[];const s=Ng(e);if("default"===i)for(const[l,c]of e.views.entries())a=a.concat(xg(c,n,r)),_g(c)&&(e.views.delete(l),c.query._queryParams.loadsAllData()||o.push(c.query));else{const t=e.views.get(i);t&&(a=a.concat(xg(t,n,r)),_g(t)&&(e.views.delete(i),t.query._queryParams.loadsAllData()||o.push(t.query)))}return s&&!Ng(e)&&o.push(new(ys(Tg,"Reference.ts has not been loaded"),Tg)(t._repo,t._path)),{removed:o,events:a}}function Pg(e){const t=[];for(const n of e.views.values())n.query._queryParams.loadsAllData()||t.push(n);return t}function Ig(e,t){let n=null;for(const r of e.views.values())n=n||yg(r,t);return n}function Lg(e,t){if(t._queryParams.loadsAllData())return Dg(e);{const n=t._queryIdentifier;return e.views.get(n)}}function Rg(e,t){return null!=Lg(e,t)}function Ng(e){return null!=Dg(e)}function Dg(e){for(const t of e.views.values())if(t.query._queryParams.loadsAllData())return t;return null}let Mg=1;class Bg{constructor(e){this.listenProvider_=e,this.syncPointTree_=new Dm(null),this.pendingWriteTree_={visibleWrites:Mm.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function Qg(e,t,n,r,i){return function(e,t,n,r,i){ys(r>e.lastWriteId,"Stacking an older write on top of newer ones"),void 0===i&&(i=!0),e.allWrites.push({path:t,snap:n,writeId:r,visible:i}),i&&(e.visibleWrites=Bm(e.visibleWrites,t,n)),e.lastWriteId=r}(e.pendingWriteTree_,t,n,r,i),i?$g(e,new Cm({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,n)):[]}function Ug(e,t,n,r){!function(e,t,n,r){ys(r>e.lastWriteId,"Stacking an older merge on top of newer ones"),e.allWrites.push({path:t,children:n,writeId:r,visible:!0}),e.visibleWrites=Qm(e.visibleWrites,t,n),e.lastWriteId=r}(e.pendingWriteTree_,t,n,r);const i=Dm.fromObject(n);return $g(e,new km({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},t,i))}function Fg(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=function(e,t){for(let n=0;n {t=t.set(new sf(e),!0)})),$g(e,new Em(r.path,t,n))}return[]}function zg(e,t,n){return $g(e,new Cm({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,n))}function qg(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const o=t._path,a=e.syncPointTree_.get(o);let s=[];if(a&&("default"===t._queryIdentifier||Rg(a,t))){const l=jg(a,t,n,r);0===a.views.size&&(e.syncPointTree_=e.syncPointTree_.remove(o));const c=l.removed;if(s=l.events,!i){const n=-1!==c.findIndex((e=>e._queryParams.loadsAllData())),i=e.syncPointTree_.findOnPath(o,((e,t)=>Ng(t)));if(n&&!i){const t=e.syncPointTree_.subtree(o);if(!t.isEmpty()){const n=function(e){return e.fold(((e,t,n)=>{if(t&&Ng(t)){return[Dg(t)]}{let e=[];return t&&(e=Pg(t)),Sh(n,((t,n)=>{e=e.concat(n)})),e}}))}(t);for(let t=0;t 0&&!r)if(n){const n=null;e.listenProvider_.stopListening(rv(t),n)}else c.forEach((t=>{const n=e.queryToTagMap.get(Xg(t));e.listenProvider_.stopListening(rv(t),n)}))}!function(e,t){for(let n=0;n 3&&void 0!==arguments[3]&&arguments[3];const i=t._path;let o=null,a=!1;e.syncPointTree_.foreachOnPath(i,((e,t)=>{const n=vf(e,i);o=o||Ig(t,n),a=a||Ng(t)}));let s,l=e.syncPointTree_.get(i);if(l?(a=a||Ng(l),o=o||Ig(l,lf())):(l=new kg,e.syncPointTree_=e.syncPointTree_.set(i,l)),null!=o)s=!0;else{s=!1,o=Jf.EMPTY_NODE;e.syncPointTree_.subtree(i).foreachChild(((e,t)=>{const n=Ig(t,lf());n&&(o=o.updateImmediateChild(e,n))}))}const c=Rg(l,t);if(!c&&!t._queryParams.loadsAllData()){const n=Xg(t);ys(!e.queryToTagMap.has(n),"View does not exist, but we have a tag");const r=Mg++;e.queryToTagMap.set(n,r),e.tagToQueryMap.set(r,n)}let u=Ag(l,t,n,$m(e.pendingWriteTree_,i),o,s);if(!c&&!a&&!r){const n=Lg(l,t);u=u.concat(function(e,t,n){const r=t._path,i=Jg(e,t),o=Zg(e,n),a=e.listenProvider_.startListening(rv(t),i,o.hashFn,o.onComplete),s=e.syncPointTree_.subtree(r);if(i)ys(!Ng(s.value),"If we're adding a query, it shouldn't be shadowed");else{const t=s.fold(((e,t,n)=>{if(!gf(e)&&t&&Ng(t))return[Dg(t).query];{let e=[];return t&&(e=e.concat(Pg(t).map((e=>e.query)))),Sh(n,((t,n)=>{e=e.concat(n)})),e}}));for(let n=0;n {const r=Ig(n,vf(e,t));if(r)return r}));return Xm(r,t,i,n,!0)}function Vg(e,t){const n=t._path;let r=null;e.syncPointTree_.foreachOnPath(n,((e,t)=>{const i=vf(e,n);r=r||Ig(t,i)}));let i=e.syncPointTree_.get(n);i?r=r||Ig(i,lf()):(i=new kg,e.syncPointTree_=e.syncPointTree_.set(n,i));const o=null!=r,a=o?new Sm(r,!0,!1):null;return function(e){return Lm(e.viewCache_)}(Og(i,t,$m(e.pendingWriteTree_,t._path),o?a.getNode():Jf.EMPTY_NODE,o))}function $g(e,t){return Kg(t,e.syncPointTree_,null,$m(e.pendingWriteTree_,lf()))}function Kg(e,t,n,r){if(gf(e.path))return Yg(e,t,n,r);{const i=t.get(lf());null==n&&null!=i&&(n=Ig(i,lf()));let o=[];const a=cf(e.path),s=e.operationForChild(a),l=t.children.get(a);if(l&&s){const e=n?n.getImmediateChild(a):null,t=ag(r,a);o=o.concat(Kg(s,l,e,t))}return i&&(o=o.concat(Sg(i,e,r,n))),o}}function Yg(e,t,n,r){const i=t.get(lf());null==n&&null!=i&&(n=Ig(i,lf()));let o=[];return t.children.inorderTraversal(((t,i)=>{const a=n?n.getImmediateChild(t):null,s=ag(r,t),l=e.operationForChild(t);l&&(o=o.concat(Yg(l,i,a,s)))})),i&&(o=o.concat(Sg(i,e,r,n))),o}function Zg(e,t){const n=t.query,r=Jg(e,n);return{hashFn:()=>{const e=function(e){return e.viewCache_.serverCache.getNode()}(t)||Jf.EMPTY_NODE;return e.hash()},onComplete:t=>{if("ok"===t)return r?function(e,t,n){const r=ev(e,n);if(r){const n=tv(r),i=n.path,o=n.queryId,a=vf(i,t);return nv(e,i,new Tm(wm(o),a))}return[]}(e,n._path,r):function(e,t){return $g(e,new Tm({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t))}(e,n._path);{const r=function(e,t){let n="Unknown Error";"too_big"===e?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===e?n="Client doesn't have permission to access the desired data.":"unavailable"===e&&(n="The service is unavailable");const r=new Error(e+" at "+t._path.toString()+": "+n);return r.code=e.toUpperCase(),r}(t,n);return qg(e,n,null,r)}}}}function Jg(e,t){const n=Xg(t);return e.queryToTagMap.get(n)}function Xg(e){return e._path.toString()+"$"+e._queryIdentifier}function ev(e,t){return e.tagToQueryMap.get(t)}function tv(e){const t=e.indexOf("$");return ys(-1!==t&&t {const i=pv(r,t.getImmediateChild(e),n);i!==r&&(o=o.updateImmediateChild(e,i))})),o}}class hv{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{children:{},childCount:0};this.name=e,this.parent=t,this.node=n}}function fv(e,t){let n=t instanceof sf?t:new sf(t),r=e,i=cf(n);for(;null!==i;){const e=$s(r.node.children,i)||{children:{},childCount:0};r=new hv(i,r,e),n=df(n),i=cf(n)}return r}function mv(e){return e.node.value}function gv(e,t){e.node.value=t,xv(e)}function vv(e){return e.node.childCount>0}function bv(e,t){Sh(e.node.children,((n,r)=>{t(new hv(n,e,r))}))}function yv(e,t,n,r){n&&!r&&t(e),bv(e,(e=>{yv(e,t,!0,r)})),n&&r&&t(e)}function _v(e){return new sf(null===e.parent?e.name:_v(e.parent)+"/"+e.name)}function xv(e){null!==e.parent&&function(e,t,n){const r=function(e){return void 0===mv(e)&&!vv(e)}(n),i=Vs(e.node.children,t);r&&i?(delete e.node.children[t],e.node.childCount--,xv(e)):r||i||(e.node.children[t]=n.node,e.node.childCount++,xv(e))}(e.parent,e.name,e)}const wv=/[\[\].#$\/\u0000-\u001F\u007F]/,Ev=/[\[\].#$\u0000-\u001F\u007F]/,Tv=10485760,Cv=function(e){return"string"===typeof e&&0!==e.length&&!wv.test(e)},kv=function(e){return"string"===typeof e&&0!==e.length&&!Ev.test(e)},Sv=function(e){return null===e||"string"===typeof e||"number"===typeof e&&!yh(e)||e&&"object"===typeof e&&Vs(e,".sv")},Ov=function(e,t,n,r){r&&void 0===t||Av(ol(e,"value"),t,n)},Av=function(e,t,n){const r=n instanceof sf?new xf(n,e):n;if(void 0===t)throw new Error(e+"contains undefined "+Ef(r));if("function"===typeof t)throw new Error(e+"contains a function "+Ef(r)+" with contents = "+t.toString());if(yh(t))throw new Error(e+"contains "+t.toString()+" "+Ef(r));if("string"===typeof t&&t.length>Tv/3&&al(t)>Tv)throw new Error(e+"contains a string greater than "+Tv+" utf8 bytes "+Ef(r)+" ('"+t.substring(0,50)+"...')");if(t&&"object"===typeof t){let n=!1,i=!1;if(Sh(t,((t,o)=>{if(".value"===t)n=!0;else if(".priority"!==t&&".sv"!==t&&(i=!0,!Cv(t)))throw new Error(e+" contains an invalid key ("+t+") "+Ef(r)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');!function(e,t){e.parts_.length>0&&(e.byteLength_+=1),e.parts_.push(t),e.byteLength_+=al(t),wf(e)}(r,t),Av(e,o,r),function(e){const t=e.parts_.pop();e.byteLength_-=al(t),e.parts_.length>0&&(e.byteLength_-=1)}(r)})),n&&i)throw new Error(e+' contains ".value" child '+Ef(r)+" in addition to actual children.")}},jv=function(e,t,n,r){if(r&&void 0===t)return;const i=ol(e,"values");if(!t||"object"!==typeof t||Array.isArray(t))throw new Error(i+" must be an object containing the children to replace.");const o=[];Sh(t,((e,t)=>{const r=new sf(e);if(Av(i,t,mf(n,r)),".priority"===pf(r)&&!Sv(t))throw new Error(i+"contains an invalid value for '"+r.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");o.push(r)})),function(e,t){let n,r;for(n=0;n yf(e,t)))}function Bv(e,t,n){Dv(e,n),Qv(e,(e=>_f(e,t)||_f(t,e)))}function Qv(e,t){e.recursionDepth_++;let n=!0;for(let r=0;r =0)e.server_=new fm(e.repoInfo_,((t,n,r,i)=>{Vv(e,t,n,r,i)}),e.authTokenProvider_,e.appCheckProvider_),setTimeout((()=>$v(e,!0)),0);else{if("undefined"!==typeof n&&null!==n){if("object"!==typeof n)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Ws(n)}catch(r){throw new Error("Invalid authOverride provided: "+r)}}e.persistentConnection_=new kf(e.repoInfo_,t,((t,n,r,i)=>{Vv(e,t,n,r,i)}),(t=>{$v(e,t)}),(t=>{!function(e,t){Sh(t,((t,n)=>{Kv(e,t,n)}))}(e,t)}),e.authTokenProvider_,e.appCheckProvider_,n),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener((t=>{e.server_.refreshAuthToken(t)})),e.appCheckProvider_.addTokenChangeListener((t=>{e.server_.refreshAppCheckToken(t.token)})),e.statsReporter_=function(e,t){const n=e.toString();return Wh[n]||(Wh[n]=t()),Wh[n]}(e.repoInfo_,(()=>new _m(e.stats_,e.server_))),e.infoData_=new mm,e.infoSyncTree_=new Bg({startListening:(t,n,r,i)=>{let o=[];const a=e.infoData_.getNode(t._path);return a.isEmpty()||(o=zg(e.infoSyncTree_,t._path,a),setTimeout((()=>{i("ok")}),0)),o},stopListening:()=>{}}),Kv(e,"connected",!1),e.serverSyncTree_=new Bg({startListening:(t,n,r,i)=>(e.server_.listen(t,r,n,((n,r)=>{const o=i(n,r);Bv(e.eventQueue_,t._path,o)})),[]),stopListening:(t,n)=>{e.server_.unlisten(t,n)}})}function Wv(e){const t=e.infoData_.getNode(new sf(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t}function Gv(e){return av({timestamp:Wv(e)})}function Vv(e,t,n,r,i){e.dataUpdateCount++;const o=new sf(t);n=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,n):n;let a=[];if(i)if(r){const t=Ys(n,(e=>tm(e)));a=function(e,t,n,r){const i=ev(e,r);if(i){const r=tv(i),o=r.path,a=r.queryId,s=vf(o,t),l=Dm.fromObject(n);return nv(e,o,new km(wm(a),s,l))}return[]}(e.serverSyncTree_,o,t,i)}else{const t=tm(n);a=Hg(e.serverSyncTree_,o,t,i)}else if(r){const t=Ys(n,(e=>tm(e)));a=function(e,t,n){const r=Dm.fromObject(n);return $g(e,new km({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},t,r))}(e.serverSyncTree_,o,t)}else{const t=tm(n);a=zg(e.serverSyncTree_,o,t)}let s=o;a.length>0&&(s=ib(e,o)),Bv(e.eventQueue_,s,a)}function $v(e,t){Kv(e,"connected",t),!1===t&&function(e){eb(e,"onDisconnectEvents");const t=Gv(e),n=gm();bm(e.onDisconnect_,lf(),((r,i)=>{const o=uv(r,i,e.serverSyncTree_,t);vm(n,r,o)}));let r=[];bm(n,lf(),((t,n)=>{r=r.concat(zg(e.serverSyncTree_,t,n));const i=cb(e,t);ib(e,i)})),e.onDisconnect_=gm(),Bv(e.eventQueue_,lf(),r)}(e)}function Kv(e,t,n){const r=new sf("/.info/"+t),i=tm(n);e.infoData_.updateSnapshot(r,i);const o=zg(e.infoSyncTree_,r,i);Bv(e.eventQueue_,r,o)}function Yv(e){return e.nextWriteId_++}function Zv(e,t,n,r,i){eb(e,"set",{path:t.toString(),value:n,priority:r});const o=Gv(e),a=tm(n,r),s=Gg(e.serverSyncTree_,t),l=dv(a,s,o),c=Yv(e),u=Qg(e.serverSyncTree_,t,l,c,!0);Dv(e.eventQueue_,u),e.server_.put(t.toString(),a.val(!0),((n,r)=>{const o="ok"===n;o||bh("set at "+t+" failed: "+n);const a=Fg(e.serverSyncTree_,c,!o);Bv(e.eventQueue_,t,a),tb(e,i,n,r)}));const d=cb(e,t);ib(e,d),Bv(e.eventQueue_,d,[])}function Jv(e,t,n){let r;r=".info"===cf(t._path)?qg(e.infoSyncTree_,t,n):qg(e.serverSyncTree_,t,n),Mv(e.eventQueue_,t._path,r)}function Xv(e){e.persistentConnection_&&e.persistentConnection_.interrupt(Fv)}function eb(e){let t="";e.persistentConnection_&&(t=e.persistentConnection_.id+":");for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i {if("ok"===n)t(null);else{const e=(n||"error").toUpperCase();let i=e;r&&(i+=": "+r);const o=new Error(i);o.code=e,t(o)}}))}function nb(e,t,n){return Gg(e.serverSyncTree_,t,n)||Jf.EMPTY_NODE}function rb(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.transactionQueueTree_;if(t||lb(e,t),mv(t)){const n=ab(e,t);ys(n.length>0,"Sending zero length transaction queue");n.every((e=>0===e.status))&&function(e,t,n){const r=n.map((e=>e.currentWriteId)),i=nb(e,t,r);let o=i;const a=i.hash();for(let c=0;c {eb(e,"transaction put response",{path:l.toString(),status:r});let i=[];if("ok"===r){const r=[];for(let t=0;t n[t].onComplete(null,!0,n[t].currentOutputSnapshotResolved))),n[t].unwatcher();lb(e,fv(e.transactionQueueTree_,t)),rb(e,e.transactionQueueTree_),Bv(e.eventQueue_,t,i);for(let e=0;e {rb(e,t)}))}function ib(e,t){const n=ob(e,t),r=_v(n);return function(e,t,n){if(0===t.length)return;const r=[];let i=[];const o=t.filter((e=>0===e.status)),a=o.map((e=>e.currentWriteId));for(let l=0;l =zv)d=!0,u="maxretry",i=i.concat(Fg(e.serverSyncTree_,o.currentWriteId,!0));else{const n=nb(e,o.path,a);o.currentInputSnapshot=n;const r=t[l].update(n.val());if(void 0!==r){Av("transaction failed: Data returned ",r,o.path);let t=tm(r);"object"===typeof r&&null!=r&&Vs(r,".priority")||(t=t.updatePriority(n.getPriority()));const s=o.currentWriteId,l=Gv(e),c=dv(t,n,l);o.currentOutputSnapshotRaw=t,o.currentOutputSnapshotResolved=c,o.currentWriteId=Yv(e),a.splice(a.indexOf(s),1),i=i.concat(Qg(e.serverSyncTree_,o.path,c,o.currentWriteId,o.applyLocally)),i=i.concat(Fg(e.serverSyncTree_,s,!0))}else d=!0,u="nodata",i=i.concat(Fg(e.serverSyncTree_,o.currentWriteId,!0))}Bv(e.eventQueue_,n,i),i=[],d&&(t[l].status=2,s=t[l].unwatcher,setTimeout(s,Math.floor(0)),t[l].onComplete&&("nodata"===u?r.push((()=>t[l].onComplete(null,!1,t[l].currentInputSnapshot))):r.push((()=>t[l].onComplete(new Error(u),!1,null)))))}var s;lb(e,e.transactionQueueTree_);for(let l=0;l e.order-t.order)),n}function sb(e,t,n){const r=mv(t);if(r)for(let i=0;i {sb(e,t,n)}))}function lb(e,t){const n=mv(t);if(n){let e=0;for(let t=0;t 0?n:void 0)}bv(t,(t=>{lb(e,t)}))}function cb(e,t){const n=_v(ob(e,t)),r=fv(e.transactionQueueTree_,t);return function(e,t,n){let r=n?e:e.parent;for(;null!==r;){if(t(r))return!0;r=r.parent}}(r,(t=>{ub(e,t)})),ub(e,r),yv(r,(t=>{ub(e,t)})),n}function ub(e,t){const n=mv(t);if(n){const r=[];let i=[],o=-1;for(let t=0;t .firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||vh("Cannot parse Firebase url. Please use https:// .firebaseio.com"),n.secure||"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&bh("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");const i="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new Fh(n.host,n.secure,r,i,t,"",r!==n.subdomain),path:new sf(n.pathString)}},pb=function(e){let t="",n="",r="",i="",o="",a=!0,s="https",l=443;if("string"===typeof e){let c=e.indexOf("//");c>=0&&(s=e.substring(0,c-1),e=e.substring(c+2));let u=e.indexOf("/");-1===u&&(u=e.length);let d=e.indexOf("?");-1===d&&(d=e.length),t=e.substring(0,Math.min(u,d)),u 0){let e=n[i];try{e=decodeURIComponent(e.replace(/\+/g," "))}catch(r){}t+="/"+e}return t}(e.substring(u,d)));const p=function(e){const t={};"?"===e.charAt(0)&&(e=e.substring(1));for(const n of e.split("&")){if(0===n.length)continue;const r=n.split("=");2===r.length?t[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):bh("Invalid query segment '".concat(n,"' in query '").concat(e,"'"))}return t}(e.substring(Math.min(e.length,d)));c=t.indexOf(":"),c>=0?(a="https"===s||"wss"===s,l=parseInt(t.substring(c+1),10)):c=t.length;const h=t.slice(0,c);if("localhost"===h.toLowerCase())n="localhost";else if(h.split(".").length<=2)n=h;else{const e=t.indexOf(".");r=t.substring(0,e).toLowerCase(),n=t.substring(e+1),o=r}"ns"in p&&(o=p.ns)}return{host:t,port:l,domain:n,subdomain:r,secure:a,scheme:s,pathString:i,namespace:o}},hb="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",fb=function(){let e=0;const t=[];return function(n){const r=n===e;let i;e=n;const o=new Array(8);for(i=7;i>=0;i--)o[i]=hb.charAt(n%64),n=Math.floor(n/64);ys(0===n,"Cannot push at time == 0");let a=o.join("");if(r){for(i=11;i>=0&&63===t[i];i--)t[i]=0;t[i]++}else for(i=0;i<12;i++)t[i]=Math.floor(64*Math.random());for(i=0;i<12;i++)a+=hb.charAt(t[i]);return ys(20===a.length,"nextPushId: Length should be 20."),a}}();class mb{constructor(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}getPath(){const e=this.snapshot.ref;return"value"===this.eventType?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+Ws(this.snapshot.exportVal())}}class gb{constructor(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}class vb{constructor(e,t){this.snapshotCallback=e,this.cancelCallback=t}onValue(e,t){this.snapshotCallback.call(null,e,t)}onCancel(e){return ys(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||void 0!==this.snapshotCallback.userCallback&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}}class bb{constructor(e,t,n,r){this._repo=e,this._path=t,this._queryParams=n,this._orderByCalled=r}get key(){return gf(this._path)?null:pf(this._path)}get ref(){return new yb(this._repo,this._path)}get _queryIdentifier(){const e=hm(this._queryParams),t=Ch(e);return"{}"===t?"default":t}get _queryObject(){return hm(this._queryParams)}isEqual(e){if(!((e=sl(e))instanceof bb))return!1;const t=this._repo===e._repo,n=yf(this._path,e._path),r=this._queryIdentifier===e._queryIdentifier;return t&&n&&r}toJSON(){return this.toString()}toString(){return this._repo.toString()+function(e){let t="";for(let n=e.pieceNum_;n e(new _b(n,wb(this.ref,t),Hf))))}hasChild(e){const t=new sf(e);return!this._node.getChild(t).isEmpty()}hasChildren(){return!this._node.isLeafNode()&&!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function xb(e,t){return(e=sl(e))._checkNotDeleted("ref"),void 0!==t?wb(e._root,t):e._root}function wb(e,t){return null===cf((e=sl(e))._path)?Iv("child","path",t,!1):Pv("child","path",t,!1),new yb(e._repo,mf(e._path,t))}function Eb(e,t){e=sl(e),Lv("push",e._path),Ov("push",t,e._path,!0);const n=Wv(e._repo),r=fb(n),i=wb(e,r),o=wb(e,r);let a;return a=null!=t?Cb(o,t).then((()=>o)):Promise.resolve(o),i.then=a.then.bind(a),i.catch=a.then.bind(a,void 0),i}function Tb(e){return Lv("remove",e._path),Cb(e,null)}function Cb(e,t){e=sl(e),Lv("set",e._path),Ov("set",t,e._path,!1);const n=new Ds;return Zv(e._repo,e._path,t,null,n.wrapCallback((()=>{}))),n.promise}function kb(e,t){jv("update",t,e._path,!1);const n=new Ds;return function(e,t,n,r){eb(e,"update",{path:t.toString(),value:n});let i=!0;const o=Gv(e),a={};if(Sh(n,((n,r)=>{i=!1,a[n]=uv(mf(t,n),tm(r),e.serverSyncTree_,o)})),i)fh("update() called with empty data. Don't do anything."),tb(0,r,"ok",void 0);else{const i=Yv(e),o=Ug(e.serverSyncTree_,t,a,i);Dv(e.eventQueue_,o),e.server_.merge(t.toString(),n,((n,o)=>{const a="ok"===n;a||bh("update at "+t+" failed: "+n);const s=Fg(e.serverSyncTree_,i,!a),l=s.length>0?ib(e,t):t;Bv(e.eventQueue_,l,s),tb(0,r,n,o)})),Sh(n,(n=>{const r=cb(e,mf(t,n));ib(e,r)})),Bv(e.eventQueue_,t,[])}}(e._repo,e._path,t,n.wrapCallback((()=>{}))),n.promise}function Sb(e){e=sl(e);const t=new vb((()=>{})),n=new Ob(t);return function(e,t,n){const r=Vg(e.serverSyncTree_,t);return null!=r?Promise.resolve(r):e.server_.get(t).then((r=>{const i=tm(r).withIndex(t._queryParams.getIndex());let o;if(Wg(e.serverSyncTree_,t,n,!0),t._queryParams.loadsAllData())o=zg(e.serverSyncTree_,t._path,i);else{const n=Jg(e.serverSyncTree_,t);o=Hg(e.serverSyncTree_,t._path,i,n)}return Bv(e.eventQueue_,t._path,o),qg(e.serverSyncTree_,t,n,null,!0),i}),(n=>(eb(e,"get for query "+Ws(t)+" failed: "+n),Promise.reject(new Error(n)))))}(e._repo,e,n).then((t=>new _b(t,new yb(e._repo,e._path),e._queryParams.getIndex())))}class Ob{constructor(e){this.callbackContext=e}respondsTo(e){return"value"===e}createEvent(e,t){const n=t._queryParams.getIndex();return new mb("value",this,new _b(e.snapshotNode,new yb(t._repo,t._path),n))}getEventRunner(e){return"cancel"===e.getEventType()?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new gb(this,e,t):null}matches(e){return e instanceof Ob&&(!e.callbackContext||!this.callbackContext||e.callbackContext.matches(this.callbackContext))}hasAnyCallback(){return null!==this.callbackContext}}class Ab{constructor(e,t){this.eventType=e,this.callbackContext=t}respondsTo(e){let t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,this.eventType===t}createCancelEvent(e,t){return this.callbackContext.hasCancelCallback?new gb(this,e,t):null}createEvent(e,t){ys(null!=e.childName,"Child events should have a childName.");const n=wb(new yb(t._repo,t._path),e.childName),r=t._queryParams.getIndex();return new mb(e.type,this,new _b(e.snapshotNode,n,r),e.prevName)}getEventRunner(e){return"cancel"===e.getEventType()?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(e){return e instanceof Ab&&(this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)))}hasAnyCallback(){return!!this.callbackContext}}function jb(e,t,n,r,i){let o;if("object"===typeof r&&(o=void 0,i=r),"function"===typeof r&&(o=r),i&&i.onlyOnce){const t=n,r=(n,r)=>{Jv(e._repo,e,s),t(n,r)};r.userCallback=n.userCallback,r.context=n.context,n=r}const a=new vb(n,o||void 0),s="value"===t?new Ob(a):new Ab(t,a);return function(e,t,n){let r;r=".info"===cf(t._path)?Wg(e.infoSyncTree_,t,n):Wg(e.serverSyncTree_,t,n),Mv(e.eventQueue_,t._path,r)}(e._repo,e,s),()=>Jv(e._repo,e,s)}function Pb(e,t,n,r){return jb(e,"value",t,n,r)}function Ib(e,t,n){let r=null;const i=n?new vb(n):null;"value"===t?r=new Ob(i):t&&(r=new Ab(t,i)),Jv(e._repo,e,r)}!function(e){ys(!Tg,"__referenceConstructor has already been defined"),Tg=e}(yb),function(e){ys(!Cg,"__referenceConstructor has already been defined"),Cg=e}(yb);const Lb="FIREBASE_DATABASE_EMULATOR_HOST",Rb={};let Nb=!1;function Db(e,t,n,r,i){let o=r||e.options.databaseURL;void 0===o&&(e.options.projectId||vh("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),fh("Using default host for project ",e.options.projectId),o="".concat(e.options.projectId,"-default-rtdb.firebaseio.com"));let a,s,l=db(o,i),c=l.repoInfo;"undefined"!==typeof process&&(s={NODE_ENV:"production",PUBLIC_URL:"/metadata-entry-form",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_GOOGLE_CLOUD_API_KEY:"AIzaSyBz4kb3hJHXw0voYZgHZuAgmqGosxntMHM",REACT_APP_GOOGLE_CLOUD_API_KEY_DEV:"AIzaSyADkNENzpoqj3O7uGPsRA_4s1zQdbH708c"}[Lb]),s?(a=!0,o="http://".concat(s,"?ns=").concat(c.namespace),l=db(o,i),c=l.repoInfo):a=!l.repoInfo.secure;const u=i&&a?new Nh(Nh.OWNER):new Rh(e.name,e.options,t);Rv("Invalid Firebase Database URL",l),gf(l.path)||vh("Database URL must point to the root of a Firebase Database (not including a child path).");const d=function(e,t,n,r){let i=Rb[t.name];i||(i={},Rb[t.name]=i);let o=i[e.toURLString()];o&&vh("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.");return o=new qv(e,Nb,n,r),i[e.toURLString()]=o,o}(c,e,u,new Lh(e.name,n));return new Mb(d,e)}class Mb{constructor(e,t){this._repoInternal=e,this.app=t,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(Hv(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new yb(this._repo,lf())),this._rootInternal}_delete(){return null!==this._rootInternal&&(!function(e,t){const n=Rb[t];n&&n[e.key]===e||vh("Database ".concat(t,"(").concat(e.repoInfo_,") has already been deleted.")),Xv(e),delete n[e.key]}(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){null===this._rootInternal&&vh("Cannot call "+e+" on a deleted database.")}}function Bb(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zl(),t=arguments.length>1?arguments[1]:void 0;const n=Gl(e,"database").getImmediate({identifier:t});if(!n._instanceStarted){const e=Ls("database");e&&function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e=sl(e),e._checkNotDeleted("useEmulator"),e._instanceStarted&&vh("Cannot call useEmulator() after instance has already been initialized.");const i=e._repoInternal;let o;if(i.repoInfo_.nodeAdmin)r.mockUserToken&&vh('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),o=new Nh(Nh.OWNER);else if(r.mockUserToken){const t="string"===typeof r.mockUserToken?r.mockUserToken:function(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",r=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:"https://securetoken.google.com/".concat(n),aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[Cs(JSON.stringify({alg:"none",type:"JWT"})),Cs(JSON.stringify(o)),""].join(".")}(r.mockUserToken,e.app.options.projectId);o=new Nh(t)}!function(e,t,n,r){e.repoInfo_=new Fh("".concat(t,":").concat(n),!1,e.repoInfo_.namespace,e.repoInfo_.webSocketOnly,e.repoInfo_.nodeAdmin,e.repoInfo_.persistenceKey,e.repoInfo_.includeNamespaceInQueryParams,!0),r&&(e.authTokenProvider_=r)}(i,t,n,o)}(n,...e)}return n}kf.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},kf.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};!function(e){th(Kl),Wl(new ll("database",((e,t)=>{let{instanceIdentifier:n}=t;return Db(e.getProvider("app").getImmediate(),e.getProvider("auth-internal"),e.getProvider("app-check-internal"),n)}),"PUBLIC").setMultipleInstances(!0)),Jl(Jp,Xp,e),Jl(Jp,Xp,"esm2017")}();class Qb extends i.Component{constructor(){super(),this.listenerRefs=[]}componentDidUpdate(e){const{match:t}=this.props;t.params.region!==e.match.params.region&&(this.unsubscribeAndCloseListeners(),this.componentDidMount())}componentWillUnmount(){this.unsubscribeAndCloseListeners()}unsubscribeAndCloseListeners(){this.unsubscribe&&this.unsubscribe(),this.listenerRefs.length&&this.listenerRefs.forEach((e=>Ib(e)))}}const Ub=Qb,Fb=(0,i.createContext)({user:null,authIsLoading:!1});const zb=dn(class extends Ub{constructor(e){super(e),this.componentDidMount=()=>{const{match:e}=this.props,{region:t}=e.params;this.setState({authIsLoading:!0}),this.unsubscribe=nd(_p(Cp),(e=>{if(e){const{displayName:n,email:r,uid:i}=e;this.setState({user:e,authIsLoading:!1,loggedIn:!0}),function(e){ie("configureScope",e)}((e=>{e.setUser({email:r,username:r})}));Zp(Yp(),"getDatacitePrefix")(t).then((e=>{this.setState({datacitePrefix:null===e||void 0===e?void 0:e.data})}));const o=Bb(Cp);kb(xb(o,"".concat(t,"/users/").concat(i,"/userinfo")),{displayName:n,email:r});const a=xb(o,"admin/".concat(t,"/permissions"));Pb(a,(e=>{const t=e.toJSON(),n=(null===t||void 0===t?void 0:t.admins)||"",i=(null===t||void 0===t?void 0:t.reviewers)||"",o=n.includes(r),a=i.includes(r);this.setState({admins:n,reviewers:i,isAdmin:o,isReviewer:a})})),this.listenerRefs.push(a);const s=xb(o,"".concat(t,"/shares/").concat(i));Pb(s,(e=>{const t=e.exists();this.setState({hasSharedRecords:t,authIsLoading:!1})})),this.listenerRefs.push(s)}else this.setState({loggedIn:!1,authIsLoading:!1});this.setState({user:e,authIsLoading:!1})}))},this.state={user:null,authIsLoading:!1,admins:[],reviewers:[],isReviewer:!1,loggedIn:!1,hasSharedRecords:!1}}render(){const{children:e}=this.props,t=Yp(),n=Zp(t,"translate"),r=Zp(t,"regenerateXMLforRecord"),i=Zp(t,"downloadRecord"),o=Zp(t,"createDraftDoi"),a=Zp(t,"updateDraftDoi"),s=Zp(t,"deleteDraftDoi"),l=Zp(t,"getDoiStatus"),c=Zp(t,"checkURLActive"),u=Zp(t,"getCredentialsStored"),d=Zp(t,"getDatacitePrefix");return(0,Ap.jsx)(Fb.Provider,{value:{...this.state,translate:n,regenerateXMLforRecord:r,downloadRecord:i,createDraftDoi:o,updateDraftDoi:a,deleteDraftDoi:s,getDoiStatus:l,checkURLActive:c,getCredentialsStored:u,getDatacitePrefix:d},children:e})}}),qb=240,Hb=An((e=>({root:{display:"flex",flexGrow:1},appBar:{zIndex:e.zIndex.drawer+1,transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen})},appBarShift:{marginLeft:qb,width:"calc(100% - ".concat(qb,"px)"),transition:e.transitions.create(["width","margin"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})},menuButton:{marginRight:36},languageSelector:{"&:before":{borderColor:"white"},"&:hover:not(.Mui-disabled):before":{borderColor:"white"},color:"white",borderColor:"white",marginRight:e.spacing(2)},hide:{display:"none"},drawer:{width:qb,flexShrink:0,whiteSpace:"nowrap"},drawerOpen:{width:qb,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})},drawerClose:{transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:e.spacing(7)+1,[e.breakpoints.up("sm")]:{width:e.spacing(9)+1}},toolbar:{display:"flex",alignItems:"center",justifyContent:"flex-end",padding:e.spacing(0,1),...e.mixins.toolbar},content:{flexGrow:1,padding:e.spacing(3)}})));function Wb(e){let{children:t}=e;const n=hn(),r=Hb(),o=Pn(),{user:a,isReviewer:s,isAdmin:l,authIsLoading:c,hasSharedRecords:u}=(0,i.useContext)(Fb);let{language:d="en",region:p="region-select"}=mn();["en","fr"].includes(d)||(d="en"),Object.keys(Cn).includes(p)||(p="");const{pathname:h}=fn(),f=h.split("/").map((e=>e)).slice(2).join("/"),m="/".concat(d,"/").concat(p),[g,v]=i.useState(Boolean(p)),b={home:(0,Ap.jsx)(Lp,{en:"Home",fr:"Accueil"}),new:(0,Ap.jsx)(Lp,{en:"Metadata Editor",fr:"\xc9diteur de m\xe9ta-donn\xe9es"}),contacts:(0,Ap.jsx)(Lp,{en:"Contacts",fr:"Contacts"}),instruments:(0,Ap.jsx)(Lp,{en:"Instruments",fr:"Instruments"}),platforms:(0,Ap.jsx)(Lp,{en:"Platforms",fr:"Plateformes"}),saved:(0,Ap.jsx)(Lp,{en:"My Records",fr:"Enregistrements"}),published:(0,Ap.jsx)(Lp,{en:"Published Records",fr:"Dossiers publi\xe9s"}),review:(0,Ap.jsx)(Lp,{en:"Review submissions",fr:"Examen des soumissions"}),admin:(0,Ap.jsx)(Lp,{en:"Admin",fr:"Admin"}),signIn:(0,Ap.jsx)(Lp,{en:"Sign in",fr:"Se Connecter"}),logout:(0,Ap.jsx)(Lp,{en:"Logout",fr:"D\xe9connexion"}),sharedWithMe:(0,Ap.jsx)(Lp,{en:"Shared with me",fr:"Partag\xe9 avec moi"})},y=p?Cn[p].colors.primary:"#52a79b",_={NODE_ENV:"production",PUBLIC_URL:"/metadata-entry-form",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_GOOGLE_CLOUD_API_KEY:"AIzaSyBz4kb3hJHXw0voYZgHZuAgmqGosxntMHM",REACT_APP_GOOGLE_CLOUD_API_KEY_DEV:"AIzaSyADkNENzpoqj3O7uGPsRA_4s1zQdbH708c"}.REACT_APP_DEV_DEPLOYMENT||!1;return(0,Ap.jsxs)("div",{className:r.root,children:[(0,Ap.jsx)(Kn,{}),(0,Ap.jsx)(tr,{position:"fixed",className:(0,kn.c)(r.appBar,{[r.appBarShift]:g}),children:(0,Ap.jsxs)(ir,{style:{backgroundColor:y,alignItems:"end"},children:[p&&(0,Ap.jsx)(Cr,{"aria-label":"open drawer",onClick:()=>{v(!0)},edge:"start",className:(0,kn.c)(r.menuButton,{[r.hide]:g}),children:(0,Ap.jsx)(Ln,{})}),(0,Ap.jsx)(Or,{variant:"h5",noWrap:!0,style:{marginLeft:"10px",marginBottom:"10px",flex:1,color:"white"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Metadata Entry Tool"}),(0,Ap.jsx)(Ip,{children:"Outil de saisie de m\xe9tadonn\xe9es"})]})}),(0,Ap.jsxs)("div",{style:{marginLeft:"auto"},children:[(0,Ap.jsx)("img",{src:"".concat("/metadata-entry-form","/cioos_website_top_banner_").concat(d,".png"),alt:"CIOOS/SIOOC",width:350,style:{verticalAlign:"bottom",paddingRight:"15px"}}),(0,Ap.jsxs)(wo,{color:"primary",className:r.languageSelector,value:d,onChange:e=>n.push("/".concat(e.target.value,"/").concat(f)),children:[(0,Ap.jsx)(Oo,{value:"en",children:"EN"}),(0,Ap.jsx)(Oo,{value:"fr",children:"FR"})]})]})]})}),p&&(0,Ap.jsxs)(qo,{variant:"permanent",className:(0,kn.c)(r.drawer,{[r.drawerOpen]:g,[r.drawerClose]:!g}),classes:{paper:(0,kn.c)({[r.drawerOpen]:g,[r.drawerClose]:!g})},children:[(0,Ap.jsx)("div",{className:r.toolbar,children:(0,Ap.jsx)(Cr,{onClick:()=>{v(!1)},children:"rtl"===o.direction?(0,Ap.jsx)(Rn,{}):(0,Ap.jsx)(Nn,{})})}),a&&(0,Ap.jsxs)(ko,{children:[(0,Ap.jsx)(Wo,{children:(0,Ap.jsx)($o,{src:a.photoURL})}),(0,Ap.jsx)(Yo,{primary:a.displayName})]},"userInfo"),(0,Ap.jsx)(Jo,{}),(0,Ap.jsxs)(ki,{children:[!a&&p&&(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.signIn,children:(0,Ap.jsxs)(ko,{disabled:c,button:!0,onClick:async()=>{try{await Op(),n.push(h)}catch(gh){if("auth/cancelled-popup-request"!==gh.code)throw gh}},children:[(0,Ap.jsx)(Wo,{children:(0,Ap.jsx)(Dn,{})}),(0,Ap.jsx)(Yo,{primary:b.signIn})]},"Sign in")}),a&&p&&(0,Ap.jsxs)(Ap.Fragment,{children:[(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.saved,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>n.push("".concat(m,"/submissions")),children:[(0,Ap.jsx)(Wo,{children:(0,Ap.jsx)(Mn,{})}),(0,Ap.jsx)(Yo,{primary:b.saved})]},"My Records")}),(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.saved,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>n.push("".concat(m,"/published")),children:[(0,Ap.jsx)(Wo,{children:(0,Ap.jsx)(Bn,{})}),(0,Ap.jsx)(Yo,{primary:b.published})]},"Region's Published Records")}),(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.contacts,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>n.push("".concat(m,"/contacts")),children:[(0,Ap.jsx)(Wo,{disabled:!0,children:(0,Ap.jsx)(Qn,{})}),(0,Ap.jsx)(Yo,{primary:b.contacts})]},"Contacts")}),(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.instruments,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>n.push("".concat(m,"/instruments")),children:[(0,Ap.jsx)(Wo,{disabled:!0,children:(0,Ap.jsx)(Un,{})}),(0,Ap.jsx)(Yo,{primary:b.instruments})]},"instruments")}),(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.instruments,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>n.push("".concat(m,"/platforms")),children:[(0,Ap.jsx)(Wo,{disabled:!0,children:(0,Ap.jsx)(Fn,{})}),(0,Ap.jsx)(Yo,{primary:b.platforms})]},"Platforms")}),u&&(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.sharedWithMe,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>n.push("".concat(m,"/shared")),children:[(0,Ap.jsx)(Wo,{children:(0,Ap.jsx)(zn,{})}),(0,Ap.jsx)(Yo,{primary:b.sharedWithMe})]},"SharedWithMe")}),s&&(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.review,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>n.push("".concat(m,"/reviewer")),children:[(0,Ap.jsx)(Wo,{children:(0,Ap.jsx)(qn,{})}),(0,Ap.jsx)(Yo,{primary:b.review})]},"Review")}),l&&(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.admin,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>n.push("".concat(m,"/admin")),children:[(0,Ap.jsx)(Wo,{children:(0,Ap.jsx)(Hn,{})}),(0,Ap.jsx)(Yo,{primary:b.admin})]},"Admin")})]}),a&&(0,Ap.jsx)(ms,{placement:"right-start",title:g?"":b.logout,children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>Sp.signOut().then((()=>n.push(m))),children:[(0,Ap.jsx)(Wo,{children:(0,Ap.jsx)(Wn,{})}),(0,Ap.jsx)(Yo,{primary:b.logout})]},"Logout")})]}),(0,Ap.jsx)(Jo,{}),_&&(0,Ap.jsx)("h5",{children:"Connected to development database"})]}),(0,Ap.jsxs)("main",{className:r.content,children:[(0,Ap.jsx)("div",{className:r.toolbar}),t]})]})}var Gb=n(3460),Vb=n.n(Gb),$b=n(7920),Kb=n.n($b),Yb=n(4697),Zb=n.n(Yb),Jb="bodyAttributes",Xb="htmlAttributes",ey="titleAttributes",ty={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},ny=(Object.keys(ty).map((function(e){return ty[e]})),"charset"),ry="cssText",iy="href",oy="http-equiv",ay="innerHTML",sy="itemprop",ly="name",cy="property",uy="rel",dy="src",py="target",hy={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},fy="defaultTitle",my="defer",gy="encodeSpecialCharacters",vy="onChangeClientState",by="titleTemplate",yy=Object.keys(hy).reduce((function(e,t){return e[hy[t]]=t,e}),{}),_y=[ty.NOSCRIPT,ty.SCRIPT,ty.STYLE],xy="data-react-helmet",wy="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},Ey=function(){function e(e,t){for(var n=0;n =0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},ky=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},Sy=function(e){var t=Iy(e,ty.TITLE),n=Iy(e,by);if(n&&t)return n.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var r=Iy(e,fy);return t||r||void 0},Oy=function(e){return Iy(e,vy)||function(){}},Ay=function(e,t){return t.filter((function(t){return"undefined"!==typeof t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return Ty({},e,t)}),{})},jy=function(e,t){return t.filter((function(e){return"undefined"!==typeof e[ty.BASE]})).map((function(e){return e[ty.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),i=0;i =0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},Ly=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout((function(){Ly(t)}),0)}}(),Ry=function(e){return clearTimeout(e)},Ny="undefined"!==typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Ly:n.g.requestAnimationFrame||Ly,Dy="undefined"!==typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Ry:n.g.cancelAnimationFrame||Ry,My=function(e){return console&&"function"===typeof console.warn&&console.warn(e)},By=null,Qy=function(e,t){var n=e.baseTag,r=e.bodyAttributes,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,s=e.noscriptTags,l=e.onChangeClientState,c=e.scriptTags,u=e.styleTags,d=e.title,p=e.titleAttributes;zy(ty.BODY,r),zy(ty.HTML,i),Fy(d,p);var h={baseTag:qy(ty.BASE,n),linkTags:qy(ty.LINK,o),metaTags:qy(ty.META,a),noscriptTags:qy(ty.NOSCRIPT,s),scriptTags:qy(ty.SCRIPT,c),styleTags:qy(ty.STYLE,u)},f={},m={};Object.keys(h).forEach((function(e){var t=h[e],n=t.newTags,r=t.oldTags;n.length&&(f[e]=n),r.length&&(m[e]=h[e].oldTags)})),t&&t(),l(e,f,m)},Uy=function(e){return Array.isArray(e)?e.join(""):e},Fy=function(e,t){"undefined"!==typeof e&&document.title!==e&&(document.title=Uy(e)),zy(ty.TITLE,t)},zy=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(xy),i=r?r.split(","):[],o=[].concat(i),a=Object.keys(t),s=0;s =0;d--)n.removeAttribute(o[d]);i.length===o.length?n.removeAttribute(xy):n.getAttribute(xy)!==a.join(",")&&n.setAttribute(xy,a.join(","))}},qy=function(e,t){var n=document.head||document.querySelector(ty.HEAD),r=n.querySelectorAll(e+"["+xy+"]"),i=Array.prototype.slice.call(r),o=[],a=void 0;return t&&t.length&&t.forEach((function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===ay)n.innerHTML=t.innerHTML;else if(r===ry)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var s="undefined"===typeof t[r]?"":t[r];n.setAttribute(r,s)}n.setAttribute(xy,"true"),i.some((function(e,t){return a=t,n.isEqualNode(e)}))?i.splice(a,1):o.push(n)})),i.forEach((function(e){return e.parentNode.removeChild(e)})),o.forEach((function(e){return n.appendChild(e)})),{oldTags:i,newTags:o}},Hy=function(e){return Object.keys(e).reduce((function(t,n){var r="undefined"!==typeof e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},Wy=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[hy[n]||n]=e[n],t}),t)},Gy=function(e,t,n){switch(e){case ty.TITLE:return{toComponent:function(){return function(e,t,n){var r,o=((r={key:t})[xy]=!0,r),a=Wy(n,o);return[i.createElement(ty.TITLE,a,t)]}(0,t.title,t.titleAttributes)},toString:function(){return function(e,t,n,r){var i=Hy(n),o=Uy(t);return i?"<"+e+" "+xy+'="true" '+i+">"+ky(o,r)+""+e+">":"<"+e+" "+xy+'="true">'+ky(o,r)+""+e+">"}(e,t.title,t.titleAttributes,n)}};case Jb:case Xb:return{toComponent:function(){return Wy(t)},toString:function(){return Hy(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,n){var r,o=((r={key:n})[xy]=!0,r);return Object.keys(t).forEach((function(e){var n=hy[e]||e;if(n===ay||n===ry){var r=t.innerHTML||t.cssText;o.dangerouslySetInnerHTML={__html:r}}else o[n]=t[e]})),i.createElement(e,o)}))}(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var i=Object.keys(r).filter((function(e){return!(e===ay||e===ry)})).reduce((function(e,t){var i="undefined"===typeof r[t]?t:t+'="'+ky(r[t],n)+'"';return e?e+" "+i:i}),""),o=r.innerHTML||r.cssText||"",a=-1===_y.indexOf(e);return t+"<"+e+" "+xy+'="true" '+i+(a?"/>":">"+o+""+e+">")}),"")}(e,t,n)}}}},Vy=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,s=e.noscriptTags,l=e.scriptTags,c=e.styleTags,u=e.title,d=void 0===u?"":u,p=e.titleAttributes;return{base:Gy(ty.BASE,t,r),bodyAttributes:Gy(Jb,n,r),htmlAttributes:Gy(Xb,i,r),link:Gy(ty.LINK,o,r),meta:Gy(ty.META,a,r),noscript:Gy(ty.NOSCRIPT,s,r),script:Gy(ty.SCRIPT,l,r),style:Gy(ty.STYLE,c,r),title:Gy(ty.TITLE,{title:d,titleAttributes:p},r)}},$y=function(e){var t,n;return n=t=function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,t.apply(this,arguments))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),n.prototype.shouldComponentUpdate=function(e){return!Kb()(this.props,e)},n.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case ty.SCRIPT:case ty.NOSCRIPT:return{innerHTML:t};case ty.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},n.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,i=e.newChildProps,o=e.nestedChildren;return Ty({},r,((t={})[n.type]=[].concat(r[n.type]||[],[Ty({},i,this.mapNestedChildrenToProps(n,o))]),t))},n.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,i=e.newProps,o=e.newChildProps,a=e.nestedChildren;switch(r.type){case ty.TITLE:return Ty({},i,((t={})[r.type]=a,t.titleAttributes=Ty({},o),t));case ty.BODY:return Ty({},i,{bodyAttributes:Ty({},o)});case ty.HTML:return Ty({},i,{htmlAttributes:Ty({},o)})}return Ty({},i,((n={})[r.type]=Ty({},o),n))},n.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=Ty({},t);return Object.keys(e).forEach((function(t){var r;n=Ty({},n,((r={})[t]=e[t],r))})),n},n.prototype.warnOnInvalidChildren=function(e,t){return!0},n.prototype.mapChildrenToProps=function(e,t){var n=this,r={};return i.Children.forEach(e,(function(e){if(e&&e.props){var i=e.props,o=i.children,a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[yy[n]||n]=e[n],t}),t)}(Cy(i,["children"]));switch(n.warnOnInvalidChildren(e,o),e.type){case ty.LINK:case ty.META:case ty.NOSCRIPT:case ty.SCRIPT:case ty.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:a,nestedChildren:o});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:a,nestedChildren:o})}}})),t=this.mapArrayTypeChildrenToProps(r,t)},n.prototype.render=function(){var t=this.props,n=t.children,r=Cy(t,["children"]),o=Ty({},r);return n&&(o=this.mapChildrenToProps(n,o)),i.createElement(e,o)},Ey(n,null,[{key:"canUseDOM",set:function(t){e.canUseDOM=t}}]),n}(i.Component),t.propTypes={base:ot().object,bodyAttributes:ot().object,children:ot().oneOfType([ot().arrayOf(ot().node),ot().node]),defaultTitle:ot().string,defer:ot().bool,encodeSpecialCharacters:ot().bool,htmlAttributes:ot().object,link:ot().arrayOf(ot().object),meta:ot().arrayOf(ot().object),noscript:ot().arrayOf(ot().object),onChangeClientState:ot().func,script:ot().arrayOf(ot().object),style:ot().arrayOf(ot().object),title:ot().string,titleAttributes:ot().object,titleTemplate:ot().string},t.defaultProps={defer:!0,encodeSpecialCharacters:!0},t.peek=e.peek,t.rewind=function(){var t=e.rewind();return t||(t=Vy({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),t},n}(Vb()((function(e){return{baseTag:jy([iy,py],e),bodyAttributes:Ay(Jb,e),defer:Iy(e,my),encode:Iy(e,gy),htmlAttributes:Ay(Xb,e),linkTags:Py(ty.LINK,[uy,iy],e),metaTags:Py(ty.META,[ly,ny,oy,cy,sy],e),noscriptTags:Py(ty.NOSCRIPT,[ay],e),onChangeClientState:Oy(e),scriptTags:Py(ty.SCRIPT,[dy,ay],e),styleTags:Py(ty.STYLE,[ry],e),title:Sy(e),titleAttributes:Ay(ey,e)}}),(function(e){By&&Dy(By),e.defer?By=Ny((function(){Qy(e,(function(){By=null}))})):(Qy(e),By=null)}),Vy)((function(){return null})));$y.renderStatic=$y.rewind;var Ky=[0,1,2,3,4,5,6,7,8,9,10],Yy=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function Zy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=parseFloat(e);return"".concat(n/t).concat(String(e).replace(String(n),"")||"px")}var Jy=i.forwardRef((function(e,t){var n=e.alignContent,r=void 0===n?"stretch":n,o=e.alignItems,a=void 0===o?"stretch":o,s=e.classes,l=e.className,c=e.component,u=void 0===c?"div":c,d=e.container,p=void 0!==d&&d,h=e.direction,f=void 0===h?"row":h,m=e.item,g=void 0!==m&&m,v=e.justify,b=e.justifyContent,y=void 0===b?"flex-start":b,_=e.lg,x=void 0!==_&&_,w=e.md,E=void 0!==w&&w,T=e.sm,C=void 0!==T&&T,k=e.spacing,S=void 0===k?0:k,O=e.wrap,A=void 0===O?"wrap":O,j=e.xl,P=void 0!==j&&j,I=e.xs,L=void 0!==I&&I,R=e.zeroMinWidth,N=void 0!==R&&R,D=(0,Yn.c)(e,["alignContent","alignItems","classes","className","component","container","direction","item","justify","justifyContent","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),M=(0,kn.c)(s.root,l,p&&[s.container,0!==S&&s["spacing-xs-".concat(String(S))]],g&&s.item,N&&s.zeroMinWidth,"row"!==f&&s["direction-xs-".concat(String(f))],"wrap"!==A&&s["wrap-xs-".concat(String(A))],"stretch"!==a&&s["align-items-xs-".concat(String(a))],"stretch"!==r&&s["align-content-xs-".concat(String(r))],"flex-start"!==(v||y)&&s["justify-content-xs-".concat(String(v||y))],!1!==L&&s["grid-xs-".concat(String(L))],!1!==C&&s["grid-sm-".concat(String(C))],!1!==E&&s["grid-md-".concat(String(E))],!1!==x&&s["grid-lg-".concat(String(x))],!1!==P&&s["grid-xl-".concat(String(P))]);return i.createElement(u,(0,at.c)({className:M,ref:t},D))})),Xy=(0,Gn.c)((function(e){return(0,at.c)({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-content-xs-center":{justifyContent:"center"},"justify-content-xs-flex-end":{justifyContent:"flex-end"},"justify-content-xs-space-between":{justifyContent:"space-between"},"justify-content-xs-space-around":{justifyContent:"space-around"},"justify-content-xs-space-evenly":{justifyContent:"space-evenly"}},function(e,t){var n={};return Ky.forEach((function(r){var i=e.spacing(r);0!==i&&(n["spacing-".concat(t,"-").concat(r)]={margin:"-".concat(Zy(i,2)),width:"calc(100% + ".concat(Zy(i),")"),"& > $item":{padding:Zy(i,2)}})})),n}(e,"xs"),e.breakpoints.keys.reduce((function(t,n){return function(e,t,n){var r={};Yy.forEach((function(e){var t="grid-".concat(n,"-").concat(e);if(!0!==e)if("auto"!==e){var i="".concat(Math.round(e/12*1e8)/1e6,"%");r[t]={flexBasis:i,flexGrow:0,maxWidth:i}}else r[t]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};else r[t]={flexBasis:0,flexGrow:1,maxWidth:"100%"}})),"xs"===n?(0,at.c)(e,r):e[t.breakpoints.up(n)]=r}(t,e,n),t}),{}))}),{name:"MuiGrid"})(Jy);const e_=Xy;var t_=44,n_=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.color,a=void 0===o?"primary":o,s=e.disableShrink,l=void 0!==s&&s,c=e.size,u=void 0===c?40:c,d=e.style,p=e.thickness,h=void 0===p?3.6:p,f=e.value,m=void 0===f?0:f,g=e.variant,v=void 0===g?"indeterminate":g,b=(0,Yn.c)(e,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),y={},_={},x={};if("determinate"===v||"static"===v){var w=2*Math.PI*((t_-h)/2);y.strokeDasharray=w.toFixed(3),x["aria-valuenow"]=Math.round(m),y.strokeDashoffset="".concat(((100-m)/100*w).toFixed(3),"px"),_.transform="rotate(-90deg)"}return i.createElement("div",(0,at.c)({className:(0,kn.c)(n.root,r,"inherit"!==a&&n["color".concat((0,Zn.c)(a))],{determinate:n.determinate,indeterminate:n.indeterminate,static:n.static}[v]),style:(0,at.c)({width:u,height:u},_,d),ref:t,role:"progressbar"},x,b),i.createElement("svg",{className:n.svg,viewBox:"".concat(22," ").concat(22," ").concat(t_," ").concat(t_)},i.createElement("circle",{className:(0,kn.c)(n.circle,l&&n.circleDisableShrink,{determinate:n.circleDeterminate,indeterminate:n.circleIndeterminate,static:n.circleStatic}[v]),style:y,cx:t_,cy:t_,r:(t_-h)/2,fill:"none",strokeWidth:h})))}));const r_=(0,Gn.c)((function(e){return{root:{display:"inline-block"},static:{transition:e.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},determinate:{transition:e.transitions.create("transform")},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:e.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},circleDeterminate:{transition:e.transitions.create("stroke-dashoffset")},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}}),{name:"MuiCircularProgress",flip:!1})(n_);var i_=n(78),o_=n(7792),a_=n(9928);const s_=function(e){var t=e.children,n=e.theme,r=(0,jn.c)(),o=i.useMemo((function(){var e=null===r?n:function(e,t){return"function"===typeof t?t(e):(0,at.c)({},e,t)}(r,n);return null!=e&&(e[a_.c]=null!==r),e}),[n,r]);return i.createElement(o_.c.Provider,{value:o},t)};var l_=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.color,s=void 0===a?"default":a,l=e.component,c=void 0===l?"button":l,u=e.disabled,d=void 0!==u&&u,p=e.disableElevation,h=void 0!==p&&p,f=e.disableFocusRipple,m=void 0!==f&&f,g=e.endIcon,v=e.focusVisibleClassName,b=e.fullWidth,y=void 0!==b&&b,_=e.size,x=void 0===_?"medium":_,w=e.startIcon,E=e.type,T=void 0===E?"button":E,C=e.variant,k=void 0===C?"text":C,S=(0,Yn.c)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),O=w&&i.createElement("span",{className:(0,kn.c)(r.startIcon,r["iconSize".concat((0,Zn.c)(x))])},w),A=g&&i.createElement("span",{className:(0,kn.c)(r.endIcon,r["iconSize".concat((0,Zn.c)(x))])},g);return i.createElement(Er,(0,at.c)({className:(0,kn.c)(r.root,r[k],o,"inherit"===s?r.colorInherit:"default"!==s&&r["".concat(k).concat((0,Zn.c)(s))],"medium"!==x&&[r["".concat(k,"Size").concat((0,Zn.c)(x))],r["size".concat((0,Zn.c)(x))]],h&&r.disableElevation,d&&r.disabled,y&&r.fullWidth),component:c,disabled:d,focusRipple:!m,focusVisibleClassName:(0,kn.c)(r.focusVisible,v),ref:t,type:T},S),i.createElement("span",{className:r.label},O,n,A))}));const c_=(0,Gn.c)((function(e){return{root:(0,at.c)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:(0,or.W4)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,or.W4)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,or.W4)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat((0,or.W4)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:(0,or.W4)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat((0,or.W4)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:(0,or.W4)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(l_),u_=(0,In.c)(i.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");var d_,p_=new Uint8Array(16);function h_(){if(!d_&&!(d_="undefined"!==typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!==typeof msCrypto&&"function"===typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return d_(p_)}const f_=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const m_=function(e){return"string"===typeof e&&f_.test(e)};for(var g_=[],v_=0;v_<256;++v_)g_.push((v_+256).toString(16).substr(1));const b_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(g_[e[t+0]]+g_[e[t+1]]+g_[e[t+2]]+g_[e[t+3]]+"-"+g_[e[t+4]]+g_[e[t+5]]+"-"+g_[e[t+6]]+g_[e[t+7]]+"-"+g_[e[t+8]]+g_[e[t+9]]+"-"+g_[e[t+10]]+g_[e[t+11]]+g_[e[t+12]]+g_[e[t+13]]+g_[e[t+14]]+g_[e[t+15]]).toLowerCase();if(!m_(n))throw TypeError("Stringified UUID is invalid");return n};const y_=function(e,t,n){var r=(e=e||{}).random||(e.rng||h_)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return b_(r)};function __(e){return JSON.parse(JSON.stringify(e))}function x_(e,t){return JSON.stringify(e)===JSON.stringify(t)}function w_(e){if("object"===typeof e&&"0"===Object.keys(e)[0]){const t=Object.entries(e).map((e=>{let[,t]=e;return Object.keys(t).forEach((e=>{try{t[e]=w_(t[e])}catch(gh){if(gh instanceof TypeError)return t[e]}return t[e]})),t}));return t}return e}function E_(e){if(!e)return null;const t=__(e);return Object.keys(t).forEach((n=>{t[n]=w_(t[n]),e.keywords&&(t.keywords={en:Object.values(e.keywords.en||{}),fr:Object.values(e.keywords.fr||{})})})),t.contacts&&Object.values(t.contacts).forEach((e=>{e.role&&(e.role=Object.values(e.role))})),t}const T_=(e,t)=>"string"===typeof t?t.trim():t;function C_(e){return"".concat(e.title[e.language].slice(0,30),"_").concat(e.identifier.slice(0,5)).trim().toLowerCase().replace(/[^a-zA-Z0-9]/g,"_")}const k_=e=>[...new Set(e)],S_={title:{en:"",fr:""},abstract:{en:"",fr:""},keywords:{en:[],fr:[]},eov:[],progress:"",distribution:[],dateStart:null,dateEnd:null,map:{north:"",south:"",east:"",west:"",polygon:""},verticalExtentMin:"",verticalExtentMax:"",datePublished:null,dateRevised:null,edition:"",recordID:"",instruments:[],platforms:[],language:"",license:"",contacts:[],status:"",comment:"",limitations:"",lastEditedBy:{},category:"",verticalExtentDirection:"",datasetIdentifier:"",doiCreationStatus:"",noPlatform:!1,filename:"",organization:"",timeFirstPublished:"",history:[],associated_resources:[]};function O_(){const e=__(S_);return e.identifier=y_(),e.created=(new Date).toISOString(),e}const A_={role:[],orgName:"",orgEmail:"",orgURL:"",orgAdress:"",orgCity:"",orgCountry:"",orgRor:"",indPosition:"",indEmail:"",indOrcid:"",givenNames:"",lastName:"",inCitation:!0};function j_(){return __(A_)}const P_={id:"",manufacturer:"",version:"",type:{en:"",fr:""},description:{en:"",fr:""}};function I_(){return __(P_)}const L_={type:"",id:"",description:{en:"",fr:""}};function R_(){return __(L_)}async function N_(e,t,n,r){const i=Bb(Cp),o=xb(i,"".concat(r,"/users/").concat(t,"/records")),a=(await Sb(wb(o,e))).val();a.recordID="",a.status="",a.lastEditedBy={},a.created=(new Date).toISOString(),a.filename="",a.timeFirstPublished="",a.title.en&&(a.title.en="".concat(a.title.en," (Copy)")),a.title.fr&&(a.title.fr="".concat(a.title.fr," (Copte)")),a.identifier=y_(),a.created=(new Date).toISOString();Eb(xb(i,"".concat(r,"/users/").concat(n,"/records")),a)}function D_(e){return{...j_(),...e}}function M_(e,t,n,r){const i={...O_(),...e};return r&&(i.recordID=r),t&&n&&(i.userinfo={...null===t||void 0===t?void 0:t.userinfo,userID:n}),i.contacts=i.contacts.map(D_),i}function B_(e,t){const n=e.toJSON(),r=[];return Object.entries(n).forEach((e=>{let[n,i]=e;i.records&&Object.entries(i.records).forEach((e=>{let[o,a]=e;t.includes(a.status)&&r.push(M_(E_(a),i,n,o))}))})),r}async function Q_(e,t,n,r,i){const o=xb(Bb(Cp),"".concat(e,"/users/").concat(t,"/records/").concat(n));if(await Cb(wb(o,"status"),r),"published"===r&&await Cb(wb(o,"timeFirstPublished"),(new Date).toISOString()),i&&!i.filename){const e=C_(i);await Cb(wb(o,"filename"),e)}}function U_(e,t,n){return Tb(xb(Bb(Cp),"".concat(e,"/users/").concat(t,"/records/").concat(n)))}async function F_(e){const t=Bb(Cp);return Object.values((await Sb(xb(t,"admin/".concat(e,"/projects")))).toJSON()||{})}const z_=e=>Object.entries(e||{}).reduce(((e,t)=>{let[n,r]=t;return e[n]=M_(E_(__(r))),e}),{});async function q_(e,t,n,r,i){const o=xb(Bb(Cp),"".concat(r,"/shares/").concat(e,"/").concat(n,"/").concat(t));i?await Cb(o,{shared:!0}).catch((t=>{throw new Error("Error sharing record by author ".concat(n," with user ").concat(e,": ").concat(t))})):await Tb(o).catch((t=>{throw new Error("Error unsharing record by author ".concat(n," with user ").concat(e,": ").concat(t))}))}function H_(){return Math.round(20*Math.random())-10}function W_(){const e=50+H_(),t=50+H_();return{top:"".concat(e,"%"),left:"".concat(t,"%"),transform:"translate(-".concat(e,"%, -").concat(t,"%)")}}const G_=An((e=>({paper:{position:"absolute",width:400,backgroundColor:e.palette.background.paper,border:"2px solid #000",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}})));function V_(e){let{open:t,onClose:n,onAccept:r,modalQuestion:o}=e;const a=G_(),[s]=i.useState(W_);return(0,Ap.jsx)("div",{children:(0,Ap.jsx)(ti,{open:t,onClose:n,"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description",onKeyPress:e=>{"y"===e.key&&(n(),r())},children:(0,Ap.jsxs)("div",{style:s,className:a.paper,children:[(0,Ap.jsx)("h2",{id:"simple-modal-title",children:o||(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Are you sure?"}),(0,Ap.jsx)(Ip,{children:"Vous \xeates s\xfbr ?"})]})}),(0,Ap.jsx)("button",{type:"button",onClick:()=>{n(),r()},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Yes"}),(0,Ap.jsx)(Ip,{children:"Oui"})]})}),(0,Ap.jsx)("button",{type:"button",onClick:()=>n(),children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"No"}),(0,Ap.jsx)(Ip,{children:"Non"})]})})]})})})}var $_=n(3948),K_=n.n($_),Y_=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=(0,Yn.c)(e,["classes","className"]),a=i.useContext(Ti);return i.createElement("div",(0,at.c)({className:(0,kn.c)(n.root,r,"flex-start"===a.alignItems&&n.alignItemsFlexStart),ref:t},o))}));const Z_=(0,Gn.c)({root:{minWidth:56,flexShrink:0},alignItemsFlexStart:{marginTop:8}},{name:"MuiListItemAvatar"})(Y_);var J_=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=(0,Yn.c)(e,["classes","className"]);return i.createElement("div",(0,at.c)({className:(0,kn.c)(n.root,r),ref:t},o))}));J_.muiName="ListItemSecondaryAction";const X_=(0,Gn.c)({root:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"}},{name:"MuiListItemSecondaryAction"})(J_),ex=(0,In.c)(i.createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility"),tx=(0,In.c)(i.createElement("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}),"Edit"),nx=(0,In.c)(i.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete"),rx=(0,In.c)(i.createElement("path",{d:"M5 4v2h14V4H5zm0 10h4v6h6v-6h4l-7-7-7 7z"}),"Publish"),ix=(0,In.c)(i.createElement("path",{d:"M5 17h14v2H5zm7-12L5.33 15h13.34z"}),"Eject"),ox=(0,In.c)(i.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}),"FileCopy"),ax=(0,In.c)(i.createElement("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"}),"CloudDownload"),sx=(0,In.c)(i.createElement("path",{d:"M16.49 15.5v-1.75L14 16.25l2.49 2.5V17H22v-1.5zm3.02 4.25H14v1.5h5.51V23L22 20.5 19.51 18zM9.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM5.75 8.9L3 23h2.1l1.75-8L9 17v6h2v-7.55L8.95 13.4l.6-3C10.85 12 12.8 13 15 13v-2c-1.85 0-3.45-1-4.35-2.45l-.95-1.6C9.35 6.35 8.7 6 8 6c-.25 0-.5.05-.75.15L2 8.3V13h2V9.65l1.75-.75"}),"TransferWithinAStation"),lx=(0,In.c)(i.createElement("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNew"),cx=n.p+"static/media/emlTemplate.c7cac6e90d63ddf2962e.j2",ux=n.p+"static/media/emlCoverage.ba6b51994dacf1f20971.j2";var dx=n(3616),px=n.n(dx);function hx(e,t,n){const{title:r,datasetIdentifier:i="",created:o,contacts:a=[],datePublished:s,dateRevised:l,metadataScope:c}=e,u=a.filter((e=>e.inCitation&&e.role.includes("publisher"))).map((e=>e.orgName)),d=[{title:r[t],author:a.filter((e=>!(e.role.includes("publisher")&&1===e.role.length))).filter((e=>{var t,n,r;return e.inCitation&&((null===(t=e.givenNames)||void 0===t?void 0:t.length)>1&&(null===(n=e.lastName)||void 0===n?void 0:n.length)>1||(null===(r=e.orgName)||void 0===r?void 0:r.length)>1)})).map((e=>{var t,n;return(null===(t=e.givenNames)||void 0===t?void 0:t.length)>1&&(null===(n=e.lastName)||void 0===n?void 0:n.length)>1?{given:e.givenNames,family:e.lastName}:{family:e.orgName}})),issued:{"date-parts":[[l||s||o]]},publisher:u.join(", "),DOI:i.replace(/https?:\/\/doi\.org\//,""),version:"v".concat(e.edition),type:c}];try{const e=px()(d);return e.format("bibliography",{format:n,template:"apa",lang:"en-US"})}catch(p){return""}}function fx(e){let{record:t,language:n}=e;const r=hx(t,n,"html");return(0,Ap.jsx)("div",{children:(0,Ap.jsx)("div",{dangerouslySetInnerHTML:{__html:r},style:{padding:"5px"}})})}const mx=n(6411);function gx(e,t){return e.some((e=>t.includes(e)))}function vx(e){return e}const bx={creator:["author","originator"],metadataProvider:["distributor","custodian"],associatedParty:["principalInvestigator","editor"]};const yx=async function(e){mx.configure(window.location.origin,{autoescape:!0,web:!0});let t=await fetch(cx).then((e=>e.text()));const n=await fetch(ux).then((e=>e.text()));return t=t.replace("{% include 'emlCoverage.j2' %}",n),mx.renderString(t,{record:e,translateRole:vx,arrayOverlap:gx,citation:hx(e,e.language,"text"),roleMapping:bx,roleMappingKeys:Object.keys(bx)})};var _x=n(5740),xx=n.n(_x);const wx={"CC-BY-4.0":{title:{en:"Creative Commons Attribution 4.0 Attribution"},url:"https://creativecommons.org/licenses/by/4.0",code:"CC-BY-4.0"},"CC-BY-SA-4.0":{title:{en:"Creative Commons Attribution 4.0 Attribution-ShareAlike"},url:"https://creativecommons.org/licenses/by-sa/4.0/",code:"CC-BY-SA-4.0"},"CC-BY-ND-4.0":{title:{en:"Creative Commons Attribution 4.0 Attribution-NoDerivs"},url:"https://creativecommons.org/licenses/by-nd/4.0/",code:"CC-BY-ND-4.0"},"CC-BY-NC-4.0":{title:{en:"Creative Commons Attribution 4.0 Attribution-NonCommercial"},url:"https://creativecommons.org/licenses/by-nc/4.0/",code:"CC-BY-NC-4.0"},"CC-BY-NC-SA-4.0":{title:{en:"Creative Commons Attribution 4.0 Attribution-NonCommercial-ShareAlike"},url:"https://creativecommons.org/licenses/by-nc-sa/4.0/",code:"CC-BY-NC-SA-4.0"},"CC-BY-NC-ND-4.0":{title:{en:"Creative Commons Attribution 4.0 Attribution-NonCommercial-NoDerivs"},url:"https://creativecommons.org/licenses/by-nc-nd/4.0/",code:"CC-BY-NC-ND-4.0"},CC0:{title:{en:"Creative Commons 0"},url:"https://creativecommons.org/share-your-work/public-domain/cc0",code:"CC0"},"government-open-license-canada":{title:{en:"Open Government Licence - Canada",fr:"Licence du gouvernement ouvert \u2013 Canada "},url:"https://open.canada.ca/en/open-government-licence-canada",code:"government-open-license-canada"},"government-open-license-nova-scotia":{title:{en:"Open Government Licence - Nova Scotia"},url:"https://novascotia.ca/opendata/licence.asp",code:"government-open-license-nova-scotia"},"OGL-NB":{title:{en:"Open Government Licence \u2013 New Brunswick"},url:"http://www.snb.ca/e/2000/data-E.html",code:"OGL-NB"},"OGL-BC":{title:{en:"Open Government Licence - British Columbia"},url:"https://www2.gov.bc.ca/gov/content/data/open-data/open-government-licence-bc",code:"OGL-BC"},"government-open-license-newfoundland":{title:{en:"Open Government Licence - Newfoundland and Labrador"},url:"https://opendata.gov.nl.ca/public/opendata/page/?page-id=licence",code:"government-open-license-newfoundland"},"Apache-2.0":{title:{en:"Apache License, Version 2.0"},url:"https://www.apache.org/licenses/LICENSE-2.0",code:"Apache-2.0"},"No License":{title:{en:"No License",fr:"Aucune licence"},url:"https://choosealicense.com/no-permission/",code:"None"},"ca-eccc-odl":{title:{en:"Environment and Climate Change Canada Data Servers End-use Licence",fr:"Licence d\u2019utilisation finale pour les serveurs de donn\xe9es d\u2019Environnement et Changement climatique Canada"},url:"https://eccc-msc.github.io/open-data/licence/readme_en/",code:"ca-eccc-odl"}};function Ex(e,t){return e.some((e=>t.includes(e)))}const Tx=function(e){var t,n,r,i,o,a;const{contacts:s,language:l}=e,c=s.find((e=>Ex(e.role,["publisher","custodian"]))),u=s.find((e=>Ex(e.role,["orginator","owner"]))),d={citation:hx(e,e.language,"text"),creator_email:null===u||void 0===u?void 0:u.indEmail,creator_name:null===u||void 0===u?void 0:u.indName,creator_url:null===u||void 0===u?void 0:u.orgURL,creator_institution:null===u||void 0===u?void 0:u.orgName,publisher_email:null===c||void 0===c?void 0:c.indEmail,publisher_institution:null===c||void 0===c?void 0:c.orgName,publisher_url:null===c||void 0===c?void 0:c.orgURL,publisher_name:null===c||void 0===c?void 0:c.indName,date_created:(p=e.created,p.slice(0,10)),geospatial_lat_max:null===(t=e.map)||void 0===t?void 0:t.north,geospatial_lat_min:null===(n=e.map)||void 0===n?void 0:n.south,geospatial_lon_max:null===(r=e.map)||void 0===r?void 0:r.east,geospatial_lon_min:null===(i=e.map)||void 0===i?void 0:i.west,geospatial_vertical_min:e.verticalExtentMin,geospatial_vertical_max:e.verticalExtentMax,institution:s.map((e=>e.orgName)).filter((e=>e)).join(),project:null===(o=e.projects)||void 0===o?void 0:o.join(),product_version:e.edition,license:(null===(a=wx[e.license])||void 0===a?void 0:a.url)||e.license,instrument:e.instruments.map((e=>[e.manufacturer,e.id,e.version].join(" - "))).filter((e=>e)).join(),id:e.identifier,naming_authority:"ca.cioos",references:"https://doi.org/".concat(e.datasetIdentifier),keywords:e.keywords[l],platform:e.platform,platform_vocabulary:e.platform&&"http://vocab.nerc.ac.uk/collection/L06/current/",summary:e.abstract[l],title:e.title[l]};var p;const h=Object.entries(d).filter((e=>{let[,t]=e;return t})).map((e=>{let[t,n]=e;return' ').concat(xx()(String(n))," ")})).join("\n");return"\n/your/waf/".concat(e.filename||C_(e),".xml \n\n").concat(h,"\n ")};var Cx=n(7152),kx=n.n(Cx);const Sx=e=>!e||kx().isEmail(e),Ox=e=>!e||kx().isURL(e),Ax=Zp(Yp(),"checkURLActive"),jx=/^(https:\/\/doi.org\/)?10\.\d{4,9}\/[-._;()/:A-Z0-9]+$/i;const Px=e=>!e||jx.test(e)&&function(e){let t;try{t=new URL(e)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol}(e),Ix=e=>e>=-90&&e<=90,Lx=e=>e>=-360&&e<=360,Rx=e=>{const t=e.split(" ").map((e=>e.split(",")));return!(t.length<2)&&(n=t[0],r=t[t.length-1],!!JSON.parse(JSON.stringify(n)===JSON.stringify(r))&&t.filter((e=>{let[t,n]=e;return Lx(parseFloat(n))&&Ix(parseFloat(t))})).length===t.length);var n,r},Nx=e=>Boolean(e.role&&e.role.length&&(e.orgName||e.givenNames||e.lastName)),Dx={title:{validation:e=>e&&e.en&&e.fr,tab:"start",error:{en:"Missing title in French or English",fr:"Titre manquant en fran\xe7ais ou en anglais"}},resourceType:{validation:e=>e,tab:"start",error:{en:"Please select a theme for this record",fr:"Veuillez s\xe9lectionner un th\xe8me pour cet enregistrement"}},abstract:{validation:e=>e&&e.en&&e.fr,tab:"dataID",error:{en:"Missing abstract in French or English",fr:"Abr\xe9g\xe9 manquant en fran\xe7ais ou en anglais"}},keywords:{validation:e=>e&&(e.en.length||e.fr.length),tab:"dataID",error:{en:"At least one keyword is required",fr:"Au moins un mot cl\xe9 est requis"}},eov:{validation:e=>e&&e.length,tab:"dataID",error:{en:"At least one EOV is required",fr:"Au moins un variable essentielle oc\xe9anique est requise"}},datasetIdentifier:{validation:Px,optional:!0,tab:"start",error:{en:"Invalid DOI",fr:"DOI non valide"}},metadataScope:{tab:"start",validation:e=>e,error:{en:"Please select a resource type",fr:"Veuillez s\xe9lectionner un type de ressources"}},progress:{tab:"dataID",validation:e=>e,error:{en:"Please select a dataset status",fr:"L'information spatiale est manquante"}},language:{tab:"dataID",validation:e=>e,error:{en:"Language field is missing",fr:"Le champ de langue est vide"}},license:{tab:"dataID",validation:e=>e,error:{en:"Please select a license for the dataset",fr:"Veuillez s\xe9lectionner une licence pour le jeu de donn\xe9es"}},map:{error:{en:"Spatial information is missing",fr:"L'information g\xe9ographique est manquante"},tab:"spatial",validation:(e,t)=>{if(!e)return!1;const n=parseFloat(e.north),r=parseFloat(e.south),i=parseFloat(e.east),o=parseFloat(e.west),{polygon:a,description:s}=e;return n&&r&&i&&o&&n>=r&&i>=o&&Ix(n)&&Ix(r)&&Lx(i)&&Lx(o)||a&&Rx(a)||!t.resourceType||Array.isArray(t.resourceType)&&t.resourceType.includes("biological")&&s}},verticalExtentMin:{tab:"spatial",validation:(e,t)=>e||t.noVerticalExtent,error:{en:"Missing Vertical Extent Min",fr:"\xc9tendue verticale manquante Min"}},verticalExtentMax:{tab:"spatial",validation:(e,t)=>e||t.noVerticalExtent,error:{en:"Missing Vertical Extent Max",fr:"\xc9tendue verticale manquante Max"}},verticalExtentDirection:{tab:"spatial",validation:(e,t)=>e||t.noVerticalExtent,error:{en:"Missing Vertical Extent Direction",fr:"Direction de l'\xe9tendue verticale manquante"}},contacts:{tab:"contacts",validation:e=>e&&e.every(Nx)&&e.every((e=>Sx(e.indEmail)&&Sx(e.orgEmail)&&Ox(e.orgURL)))&&e.filter(Nx).find((e=>e.role.includes("custodian")))&&e.filter(Nx).find((e=>e.role.includes("owner")))&&e.filter(Nx).find((e=>e.inCitation)),error:{en:"Every contact must have at least one role checked, and 'Data Owner' or 'Metadata Custodian' must be added to at least one contact. One contact can occupy multiple roles. Email addresses must be in the form of user@example.com and URLs must be valid. At least one contact must be selected to appear in the citation.",fr:"Chaque contact doit avoir au moins un r\xf4le coch\xe9, et \xab Propri\xe9taire des donn\xe9es \xbb ou \xab D\xe9positaire des m\xe9tadonn\xe9es \xbb doit \xeatre ajout\xe9 \xe0 au moins un contact. Un contact peut occuper plusieurs r\xf4les. Les adresses e-mail doivent \xeatre au format user@example.com et les URL doivent \xeatre valides. Au moins un contact doit \xeatre s\xe9lectionn\xe9 pour appara\xeetre dans la citation."}},distribution:{tab:"resources",validation:e=>Array.isArray(e)&&e.filter((e=>e.name&&e.url&&kx().isURL(e.url))).length,error:{en:"Must have at least one resource. If a URL is included it must be valid.",fr:"Doit avoir au moins une ressource. V\xe9rifiez si votre URL est valide."}},associated_resources:{tab:"relatedworks",validation:e=>!e||e&&e.every((e=>e.title&&e.title.en&&e.title.fr&&e.authority&&e.code&&e.association_type)),error:{en:"Related works must contain a Title, Identifier, Identifier Type, and a Relation Type to be valid.",fr:"Les \u0153uvres connexes doivent contenir un titre, un identifiant, un type d'identifiant et un type de relation pour \xeatre valides."}},history:{tab:"lineage",validation:e=>!e||Array.isArray(e)&&e.every((e=>!e.processingStep||e.processingStep&&e.processingStep.every((e=>e.title&&e.description))))&&e.every((e=>!e.source||e.source&&e.source.every((e=>e.title&&e.description))))&&e.every((e=>"collectionSession"!==e.scope||"collectionSession"===e.scope&&e.statement.en&&e.statement.fr)),error:{en:"Lineage must contain a title and description for each processing step and source. If lineage scope is set to 'data collection' then lineage statement is required",fr:"Le lignage doit contenir un titre et une description pour chaque \xe9tape de traitement. Si la port\xe9e du lignage est d\xe9finie sur \xab collecte de donn\xe9es \xbb, alors une d\xe9claration de lignage est requise"}},platforms:{tab:"platform",validation:(e,t)=>t.noPlatform||e.every((e=>e.type&&e.id))||!t.metadataScope||"model"===t.metadataScope,error:{en:"Missing platform type or ID",fr:"Type ou ID de plateforme manquant"}},instruments:{tab:"platformInstruments",validation:e=>e.every((e=>e.id)),error:{en:"Instrument ID is required",fr:"L'identifiant de l'instrument est requis"}},taxa:{tab:"taxa",validation:(e,t)=>t.noTaxa||e,error:{en:"Missing Taxonomic Coverage",fr:"Couverture taxonomique manquante"}}},Mx=(e,t)=>{const n=e[t],r=Dx[t]&&Dx[t].validation||(()=>!0);return r&&r(n,e)},Bx={distribution:{tab:"resources",validation:async e=>{const t=await Promise.all(e.map((async e=>{const t=await Ax(e.url);return{...e,status:t.data}}))),n=t.filter((e=>!e.status));return n.length},error:{en:"Resource URL is not accessible. This could be because it has not been created yet or is otherwise unreachable",fr:"L'URL de la ressource n'est pas accessible. Cela peut \xeatre d\xfb au fait qu'il n'a pas encore \xe9t\xe9 cr\xe9\xe9 ou qu'il est autrement inaccessible."}}},Qx=e=>{const t=Object.keys(Dx),n=t.filter((e=>!Dx[e].optional)).length;return t.filter((t=>!Dx[t].optional&&Mx(e,t))).length/n},Ux=e=>{const t=Object.entries(Dx).filter((e=>{let[,t]=e;return t.optional})).every((t=>{let[n]=t;return Mx(e,n)}));return 1===Qx(e)&&t};const Fx=function(e,t,n,r){const i=e.contacts?e.contacts.reduce(((e,t)=>{let n;if(t.inCitation&&!t.role.includes("publisher")){const{givenNames:e,lastName:r,orgName:i,indOrcid:o,orgRor:a}=t;e&&(n={name:"".concat(r,", ").concat(e),nameType:"Personal",givenName:e,familyName:r,affiliation:i?[{name:i,schemeUri:"https://ror.org",affiliationIdentifier:a,affiliationIdentifierScheme:"ROR"}]:[]},o&&(n.nameIdentifiers=[{schemeUri:"https://orcid.org",nameIdentifier:o,nameIdentifierScheme:"ORCID"}]))}return n&&e.push(n),e}),[]):[],o=e.contacts.find((e=>e.role.includes("publisher"))),a=e.contacts.filter((e=>e.role.includes("funder")));let s;if(e.dateRevised){const t=parseInt(e.dateRevised.slice(0,4),10);s=Number.isNaN(t)?void 0:t}else if(e.datePublished){const t=parseInt(e.datePublished.slice(0,4),10);s=Number.isNaN(t)?void 0:t}else s=void 0;const l=e.keywords?Object.entries(e.keywords).flatMap((e=>{let[t,n]=e;return n.map((e=>({lang:t,subject:e})))})):void 0,c=[];e.dateStart&&c.push({date:e.dateStart,dateType:"Collected",dateInformation:"Start date when data was first collected"}),e.dateEnd&&c.push({date:e.dateEnd,dateType:"Collected",dateInformation:"End date when data was last collected"}),e.dateRevised&&c.push({date:e.dateRevised,dateType:"Updated",dateInformation:"Date when the data was last revised"});const u=wx[e.license],d=u&&u.title?[{rights:u.title.en,rightsUri:u.url,schemeUri:"https://spdx.org/licenses/",rightsIdentifier:u.code,rightsIdentifierScheme:"SPDX"}]:[];let{east:p,north:h,south:f,west:m}=e.map?e.map:{};p=Number.isNaN(p)?void 0:p,h=Number.isNaN(h)?void 0:h,f=Number.isNaN(f)?void 0:f,m=Number.isNaN(m)?void 0:m;const g=e.map&&p&&h&&f&&m?[{geoLocationBox:{eastBoundLongitude:parseFloat(p),northBoundLatitude:parseFloat(h),southBoundLatitude:parseFloat(f),westBoundLongitude:parseFloat(m)}}]:[],v={data:{type:"dois",attributes:{prefix:r,creators:i,titles:[]}}};return e.title.en&&v.data.attributes.titles.push({lang:"en",title:e.title.en}),e.title.fr&&v.data.attributes.titles.push({lang:"fr",title:e.title.fr}),o&&(v.data.attributes.publisher=o.orgName||o.indName),a&&a.length>0&&(v.data.attributes.fundingReferences=a.map((e=>{const t={funderName:e.orgName};return e.orgRor&&(t.funderIdentifier=e.orgRor,t.funderIdentifierType="ROR"),t}))),e.datePublished&&(v.data.attributes.publicationYear=s),e.keywords&&(v.data.attributes.subjects=l),e.edition&&(v.data.attributes.version=e.edition),c.length>0&&(v.data.attributes.dates=c),v.data.attributes.rightsList=d,delete e.abstract.translations,v.data.attributes.descriptions=Object.entries(e.abstract).map((e=>{let[t,n]=e;return{lang:t,description:n,descriptionType:"Abstract"}})),e.map&&(v.data.attributes.geoLocations=g),v.data.attributes.types={resourceTypeGeneral:e.metadataScope||"Dataset"},e.associated_resources&&(v.data.attributes.relatedIdentifiers=[...e.associated_resources.map((e=>{let{authority:t,code:n,association_type:r}=e;return{relatedIdentifier:n,relatedIdentifierType:t,relationType:r}}))]),e.history&&(v.data.attributes.relatedIdentifiers=[...v.data.attributes.relatedIdentifiers,...e.history.flatMap((e=>{let{source:t,processingStep:n,additionalDocumentation:r}=e;return[...(null===t||void 0===t?void 0:t.map((e=>{let{authority:t,code:n}=e;return{relatedIdentifier:n,relatedIdentifierType:t,relationType:"isDerivedFrom"}})))||[],...(null===n||void 0===n?void 0:n.map((e=>{let{authority:t,code:n}=e;return{relatedIdentifier:n,relatedIdentifierType:t,relationType:"IsDocumentedBy"}})))||[],...(null===r||void 0===r?void 0:r.map((e=>{let{authority:t,code:n}=e;return{relatedIdentifier:n,relatedIdentifierType:t,relationType:"IsDocumentedBy"}})))||[]]}))]),v.data.attributes.relatedIdentifiers&&(v.data.attributes.relatedIdentifiers=v.data.attributes.relatedIdentifiers.filter((e=>e.relatedIdentifier&&e.relatedIdentifierType))),v.data.attributes.url="".concat(Cn[n].catalogueURL[t],"dataset/ca-cioos_").concat(e.identifier),v};var zx="en",qx={},Hx={};function Wx(){return zx}function Gx(e){return qx[e]?e:Hx[e.toLowerCase()]?Hx[e.toLowerCase()]:void 0}function Vx(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).localeMatcher||"lookup";switch(t){case"lookup":case"best fit":return $x(e);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(t))}}function $x(e){var t=Gx(e);if(t)return t;for(var n=e.split("-");e.length>1;){n.pop();var r=Gx(e=n.join("-"));if(r)return r}}var Kx={af:function(e){return 1==e?"one":"other"},am:function(e){return e>=0&&e<=1?"one":"other"},ar:function(e){var t=String(e).split("."),n=Number(t[0])==e&&t[0].slice(-2);return 0==e?"zero":1==e?"one":2==e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},ast:function(e){var t=!String(e).split(".")[1];return 1==e&&t?"one":"other"},be:function(e){var t=String(e).split("."),n=Number(t[0])==e,r=n&&t[0].slice(-1),i=n&&t[0].slice(-2);return 1==r&&11!=i?"one":r>=2&&r<=4&&(i<12||i>14)?"few":n&&0==r||r>=5&&r<=9||i>=11&&i<=14?"many":"other"},br:function(e){var t=String(e).split("."),n=Number(t[0])==e,r=n&&t[0].slice(-1),i=n&&t[0].slice(-2),o=n&&t[0].slice(-6);return 1==r&&11!=i&&71!=i&&91!=i?"one":2==r&&12!=i&&72!=i&&92!=i?"two":(3==r||4==r||9==r)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":0!=e&&n&&0==o?"many":"other"},bs:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],o=n.slice(-1),a=n.slice(-2),s=r.slice(-1),l=r.slice(-2);return i&&1==o&&11!=a||1==s&&11!=l?"one":i&&o>=2&&o<=4&&(a<12||a>14)||s>=2&&s<=4&&(l<12||l>14)?"few":"other"},ca:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-6);return 1==e&&r?"one":0!=n&&0==i&&r?"many":"other"},ceb:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],o=n.slice(-1),a=r.slice(-1);return i&&(1==n||2==n||3==n)||i&&4!=o&&6!=o&&9!=o||!i&&4!=a&&6!=a&&9!=a?"one":"other"},cs:function(e){var t=String(e).split("."),n=t[0],r=!t[1];return 1==e&&r?"one":n>=2&&n<=4&&r?"few":r?"other":"many"},cy:function(e){return 0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e){var t=String(e).split("."),n=t[0],r=Number(t[0])==e;return 1!=e&&(r||0!=n&&1!=n)?"other":"one"},dsb:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],o=n.slice(-2),a=r.slice(-2);return i&&1==o||1==a?"one":i&&2==o||2==a?"two":i&&(3==o||4==o)||3==a||4==a?"few":"other"},dz:function(e){return"other"},es:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-6);return 1==e?"one":0!=n&&0==i&&r?"many":"other"},ff:function(e){return e>=0&&e<2?"one":"other"},fr:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-6);return e>=0&&e<2?"one":0!=n&&0==i&&r?"many":"other"},ga:function(e){var t=String(e).split("."),n=Number(t[0])==e;return 1==e?"one":2==e?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"},gd:function(e){var t=String(e).split("."),n=Number(t[0])==e;return 1==e||11==e?"one":2==e||12==e?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"},he:function(e){var t=String(e).split("."),n=t[0],r=!t[1];return 1==n&&r||0==n&&!r?"one":2==n&&r?"two":"other"},is:function(e){var t=String(e).split("."),n=t[0],r=(t[1]||"").replace(/0+$/,""),i=Number(t[0])==e,o=n.slice(-1),a=n.slice(-2);return i&&1==o&&11!=a||r%10==1&&r%100!=11?"one":"other"},ksh:function(e){return 0==e?"zero":1==e?"one":"other"},lt:function(e){var t=String(e).split("."),n=t[1]||"",r=Number(t[0])==e,i=r&&t[0].slice(-1),o=r&&t[0].slice(-2);return 1==i&&(o<11||o>19)?"one":i>=2&&i<=9&&(o<11||o>19)?"few":0!=n?"many":"other"},lv:function(e){var t=String(e).split("."),n=t[1]||"",r=n.length,i=Number(t[0])==e,o=i&&t[0].slice(-1),a=i&&t[0].slice(-2),s=n.slice(-2),l=n.slice(-1);return i&&0==o||a>=11&&a<=19||2==r&&s>=11&&s<=19?"zero":1==o&&11!=a||2==r&&1==l&&11!=s||2!=r&&1==l?"one":"other"},mk:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"",i=!t[1],o=n.slice(-1),a=n.slice(-2),s=r.slice(-1),l=r.slice(-2);return i&&1==o&&11!=a||1==s&&11!=l?"one":"other"},mt:function(e){var t=String(e).split("."),n=Number(t[0])==e&&t[0].slice(-2);return 1==e?"one":2==e?"two":0==e||n>=3&&n<=10?"few":n>=11&&n<=19?"many":"other"},pa:function(e){return 0==e||1==e?"one":"other"},pl:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-1),o=n.slice(-2);return 1==e&&r?"one":r&&i>=2&&i<=4&&(o<12||o>14)?"few":r&&1!=n&&(0==i||1==i)||r&&i>=5&&i<=9||r&&o>=12&&o<=14?"many":"other"},pt:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-6);return 0==n||1==n?"one":0!=n&&0==i&&r?"many":"other"},ro:function(e){var t=String(e).split("."),n=!t[1],r=Number(t[0])==e&&t[0].slice(-2);return 1==e&&n?"one":!n||0==e||1!=e&&r>=1&&r<=19?"few":"other"},ru:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-1),o=n.slice(-2);return r&&1==i&&11!=o?"one":r&&i>=2&&i<=4&&(o<12||o>14)?"few":r&&0==i||r&&i>=5&&i<=9||r&&o>=11&&o<=14?"many":"other"},se:function(e){return 1==e?"one":2==e?"two":"other"},si:function(e){var t=String(e).split("."),n=t[0],r=t[1]||"";return 0==e||1==e||0==n&&1==r?"one":"other"},sl:function(e){var t=String(e).split("."),n=t[0],r=!t[1],i=n.slice(-2);return r&&1==i?"one":r&&2==i?"two":r&&(3==i||4==i)||!r?"few":"other"}};Kx.as=Kx.am,Kx.az=Kx.af,Kx.bg=Kx.af,Kx.bn=Kx.am,Kx.brx=Kx.af,Kx.ce=Kx.af,Kx.chr=Kx.af,Kx.de=Kx.ast,Kx.ee=Kx.af,Kx.el=Kx.af,Kx.en=Kx.ast,Kx.et=Kx.ast,Kx.eu=Kx.af,Kx.fa=Kx.am,Kx.fi=Kx.ast,Kx.fil=Kx.ceb,Kx.fo=Kx.af,Kx.fur=Kx.af,Kx.fy=Kx.ast,Kx.gl=Kx.ast,Kx.gu=Kx.am,Kx.ha=Kx.af,Kx.hi=Kx.am,Kx.hr=Kx.bs,Kx.hsb=Kx.dsb,Kx.hu=Kx.af,Kx.hy=Kx.ff,Kx.ia=Kx.ast,Kx.id=Kx.dz,Kx.ig=Kx.dz,Kx.it=Kx.ca,Kx.ja=Kx.dz,Kx.jgo=Kx.af,Kx.jv=Kx.dz,Kx.ka=Kx.af,Kx.kea=Kx.dz,Kx.kk=Kx.af,Kx.kl=Kx.af,Kx.km=Kx.dz,Kx.kn=Kx.am,Kx.ko=Kx.dz,Kx.ks=Kx.af,Kx.ku=Kx.af,Kx.ky=Kx.af,Kx.lb=Kx.af,Kx.lkt=Kx.dz,Kx.lo=Kx.dz,Kx.ml=Kx.af,Kx.mn=Kx.af,Kx.mr=Kx.af,Kx.ms=Kx.dz,Kx.my=Kx.dz,Kx.nb=Kx.af,Kx.ne=Kx.af,Kx.nl=Kx.ast,Kx.nn=Kx.af,Kx.no=Kx.af,Kx.or=Kx.af,Kx.pcm=Kx.am,Kx.ps=Kx.af,Kx.rm=Kx.af,Kx.sah=Kx.dz,Kx.sc=Kx.ast,Kx.sd=Kx.af,Kx.sk=Kx.cs,Kx.so=Kx.af,Kx.sq=Kx.af,Kx.sr=Kx.bs,Kx.su=Kx.dz,Kx.sv=Kx.ast,Kx.sw=Kx.ast,Kx.ta=Kx.af,Kx.te=Kx.af,Kx.th=Kx.dz,Kx.ti=Kx.pa,Kx.tk=Kx.af,Kx.to=Kx.dz,Kx.tr=Kx.af,Kx.ug=Kx.af,Kx.uk=Kx.ru,Kx.ur=Kx.ast,Kx.uz=Kx.af,Kx.vi=Kx.dz,Kx.wae=Kx.af,Kx.wo=Kx.dz,Kx.xh=Kx.af,Kx.yi=Kx.ast,Kx.yo=Kx.dz,Kx.yue=Kx.dz,Kx.zh=Kx.dz,Kx.zu=Kx.am;const Yx=Kx;function Zx(e){return"pt-PT"===e?e:function(e){var t=e.match(Jx);if(!t)throw new TypeError("Invalid locale: ".concat(e));return t[1]}(e)}var Jx=/^([a-z0-9]+)/i;function Xx(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n 0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var r=n.numeric,i=n.style,o=n.localeMatcher;if(this.numeric="always",this.style="long",this.localeMatcher="lookup",void 0!==r){if(cw.indexOf(r)<0)throw new RangeError('Invalid "numeric" option: '.concat(r));this.numeric=r}if(void 0!==i){if(uw.indexOf(i)<0)throw new RangeError('Invalid "style" option: '.concat(i));this.style=i}if(void 0!==o){if(dw.indexOf(o)<0)throw new RangeError('Invalid "localeMatcher" option: '.concat(o));this.localeMatcher=o}if("string"===typeof t&&(t=[t]),t.push(Wx()),this.locale=e.supportedLocalesOf(t,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new Error("No supported locale was found");ew.supportedLocalesOf(this.locale).length>0?this.pluralRules=new ew(this.locale):console.warn('"'.concat(this.locale,'" locale is not supported')),"undefined"!==typeof Intl&&Intl.NumberFormat?(this.numberFormat=new Intl.NumberFormat(this.locale),this.numberingSystem=this.numberFormat.resolvedOptions().numberingSystem):this.numberingSystem="latn",this.locale=Vx(this.locale,{localeMatcher:this.localeMatcher})}var t,n,r;return t=e,n=[{key:"format",value:function(){var e=ow(vw(arguments),2),t=e[0],n=e[1];return this.getRule(t,n).replace("{0}",this.formatNumber(Math.abs(t)))}},{key:"formatToParts",value:function(){var e=ow(vw(arguments),2),t=e[0],n=e[1],r=this.getRule(t,n),i=r.indexOf("{0}");if(i<0)return[{type:"literal",value:r}];var o=[];return i>0&&o.push({type:"literal",value:r.slice(0,i)}),o=o.concat(this.formatNumberToParts(Math.abs(t)).map((function(e){return rw(rw({},e),{},{unit:n})}))),i+3 1&&void 0!==arguments[1]?arguments[1]:{};if("string"===typeof e)e=[e];else if(!Array.isArray(e))throw new TypeError('Invalid "locales" argument');return e.filter((function(e){return Vx(e,t)}))},pw.addLocale=function(e){if(!e)throw new Error("No locale data passed");qx[e.locale]=e,Hx[e.locale.toLowerCase()]=e.locale},pw.setDefaultLocale=function(e){zx=e},pw.getDefaultLocale=Wx,pw.PluralRules=ew;var hw='Invalid "unit" argument';function fw(e){if("symbol"===tw(e))throw new TypeError(hw);if("string"!==typeof e)throw new RangeError("".concat(hw,": ").concat(e));if("s"===e[e.length-1]&&(e=e.slice(0,e.length-1)),lw.indexOf(e)<0)throw new RangeError("".concat(hw,": ").concat(e));return e}var mw='Invalid "number" argument';function gw(e){if(e=Number(e),Number.isFinite&&!Number.isFinite(e))throw new RangeError("".concat(mw,": ").concat(e));return e}function vw(e){if(e.length<2)throw new TypeError('"unit" argument is required');return[gw(e[0]),fw(e[1])]}function bw(e){return bw="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},bw(e)}function yw(e,t){for(var n=0;n =e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ew(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n =0}))}(e,a);var l=function(e,t,n){var r=n.now,i=n.future,o=n.round;if(0===e.length)return;var a=Hw(e,t,{now:r,future:i||t<0,round:o});if(-1===a)return;var s=e[a];if(s.granularity){if(0===Dw(o)(Math.abs(t)/Nw(s)/s.granularity)*s.granularity&&a>0)return e[a-1]}return s}(e,t,{now:r,future:i,round:o});return s?l?[e[e.indexOf(l)-1],l,e[e.indexOf(l)+1]]:[void 0,void 0,e[0]]:l}function Hw(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=Qw(e[r],function(e){for(var t=1;t r,s=Math.abs(t-r),l=Dw(i)(s/o)*o;return a?l>0?s-l+function(e,t){return(1-Mw(e))*t+1}(i,o):s-l+1:-(s-l)+function(e,t){return Mw(e)*t}(i,o)}}var Gw=31536e9;function Vw(e,t,n){var r=n.prevStep,i=n.nextStep,o=n.now,a=n.future,s=n.round,l=e.getTime?e.getTime():e,c=function(e){return Ww(e,l,{now:o,round:s})},u=function(e,t,n){var r=n.now,i=n.future,o=n.round,a=n.prevStep;if(e){var s=function(e,t,n){var r=n.now,i=n.future,o=n.round,a=n.prevStep,s=Qw(e,{timestamp:t,now:r,future:i,round:o,prevStep:a});if(void 0===s)return;return i?t-1e3*s+1:0===s&&t===r?Gw:t+1e3*s}(e,t,{now:r,future:i,round:o,prevStep:a});if(void 0===s)return;return s-r}return i?t-r+1:Gw}(a?t:i,l,{future:a,now:o,round:s,prevStep:a?r:t});if(void 0!==u){var d;if(t&&(t.getTimeToNextUpdate&&(d=t.getTimeToNextUpdate(l,{getTimeToNextUpdateForUnit:c,getRoundFunction:Dw,now:o,future:a,round:s})),void 0===d)){var p=t.unit||t.formatAs;p&&(d=c(p))}return void 0===d?u:Math.min(d,u)}}var $w={};function Kw(e){return $w[e]}function Yw(e){if(!e)throw new Error("[javascript-time-ago] No locale data passed.");$w[e.locale]=e}const Zw={steps:[{formatAs:"now"},{formatAs:"second"},{formatAs:"minute"},{formatAs:"hour"},{formatAs:"day"},{formatAs:"week"},{formatAs:"month"},{formatAs:"year"}],labels:"long"};function Jw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xw(e){for(var t=1;t e.length)&&(t=e.length);for(var n=0,r=new Array(t);n 0&&void 0!==arguments[0]?arguments[0]:[],n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).polyfill;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"===typeof t&&(t=[t]),this.locale=function(e,t){for(var n,r=ww(e);!(n=r()).done;){var i=n.value;if(t(i))return i;for(var o=i.split("-");o.length>1;)if(o.pop(),t(i=o.join("-")))return i}throw new Error("No locale data has been registered for any of the locales: ".concat(e.join(", ")))}(t.concat(e.getDefaultLocale()),Kw),"undefined"!==typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale)),!1===n?(this.IntlRelativeTimeFormat=Intl.RelativeTimeFormat,this.IntlPluralRules=Intl.PluralRules):(this.IntlRelativeTimeFormat=pw,this.IntlPluralRules=pw.PluralRules),this.relativeTimeFormatCache=new _w,this.pluralRulesCache=new _w}var t,n,r;return t=e,n=[{key:"format",value:function(e,t,n){var r;n||(t&&"string"!==typeof(r=t)&&!kw(r)?(n=t,t=void 0):n={}),t||(t=tE),"string"===typeof t&&(t=function(e){switch(e){case"default":case"round":return Zw;case"round-minute":return tE;case"approximate":default:return rE;case"time":case"approximate-time":return iE;case"mini":return SE;case"mini-now":return PE;case"mini-minute":return NE;case"mini-minute-now":return QE;case"twitter":return uE;case"twitter-now":return fE;case"twitter-minute":return bE;case"twitter-minute-now":return wE;case"twitter-first-minute":return kE}}(t));var i,o=function(e){if(e.constructor===Date||function(e){return"object"===UE(e)&&"function"===typeof e.getTime}(e))return e.getTime();if("number"===typeof e)return e;throw new Error("Unsupported relative time formatter input: ".concat(UE(e),", ").concat(e))}(e),a=this.getLabels(t.flavour||t.labels),s=a.labels,l=a.labelsType;void 0!==t.now&&(i=t.now),void 0===i&&void 0!==n.now&&(i=n.now),void 0===i&&(i=Date.now());var c=(i-o)/1e3,u=n.future||c<0,d=function(e,t,n,r){var i=e.now||t&&t.now;return i?"string"===typeof i?i:r?i.future:i.past:n&&n.second&&n.second.current?n.second.current:void 0}(s,Kw(this.locale).now,Kw(this.locale).long,u);if(t.custom){var p=t.custom({now:i,date:new Date(o),time:o,elapsed:c,locale:this.locale});if(void 0!==p)return p}var h=function(e,t,n){var r=Object.keys(t);return n&&r.push("now"),e&&(r=e.filter((function(e){return"now"===e||r.indexOf(e)>=0}))),r}(t.units,s,d),f=n.round||t.round,m=FE(qw(t.gradation||t.steps||tE.steps,c,{now:i,units:h,round:f,future:u,getNextStep:!0}),3),g=m[0],v=m[1],b=m[2],y=this.formatDateForStep(o,v,c,{labels:s,labelsType:l,nowLabel:d,now:i,future:u,round:f})||"";return n.getTimeToNextUpdate?[y,Vw(o,v,{nextStep:b,prevStep:g,now:i,future:u,round:f})]:y}},{key:"formatDateForStep",value:function(e,t,n,r){var i=this,o=r.labels,a=r.labelsType,s=r.nowLabel,l=r.now,c=r.future,u=r.round;if(t){if(t.format)return t.format(e,this.locale,{formatAs:function(e,t){return i.formatValue(t,e,{labels:o,future:c})},now:l,future:c});var d=t.unit||t.formatAs;if(!d)throw new Error("[javascript-time-ago] Each step must define either `formatAs` or `format()`. Step: ".concat(JSON.stringify(t)));if("now"===d)return s;var p=Math.abs(n)/Nw(t);t.granularity&&(p=Dw(u)(p/t.granularity)*t.granularity);var h=-1*Math.sign(n)*Dw(u)(p);switch(0===h&&(h=c?0:-0),a){case"long":case"short":case"narrow":return this.getFormatter(a).format(h,d);default:return this.formatValue(h,d,{labels:o,future:c})}}}},{key:"formatValue",value:function(e,t,n){var r=n.labels,i=n.future;return this.getFormattingRule(r,t,e,{future:i}).replace("{0}",this.formatNumber(Math.abs(e)))}},{key:"getFormattingRule",value:function(e,t,n,r){var i=r.future;if(this.locale,"string"===typeof(e=e[t]))return e;var o=e[0===n?i?"future":"past":n<0?"past":"future"]||e;return"string"===typeof o?o:o[this.getPluralRules().select(Math.abs(n))]||o.other}},{key:"formatNumber",value:function(e){return this.numberFormat?this.numberFormat.format(e):String(e)}},{key:"getFormatter",value:function(e){return this.relativeTimeFormatCache.get(this.locale,e)||this.relativeTimeFormatCache.put(this.locale,e,new this.IntlRelativeTimeFormat(this.locale,{style:e}))}},{key:"getPluralRules",value:function(){return this.pluralRulesCache.get(this.locale)||this.pluralRulesCache.put(this.locale,new this.IntlPluralRules(this.locale))}},{key:"getLabels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];"string"===typeof e&&(e=[e]),e=(e=e.map((function(e){switch(e){case"tiny":case"mini-time":return"mini";default:return e}}))).concat("long");for(var t,n=Kw(this.locale),r=function(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=zE(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(t=r()).done;){var i=t.value;if(n[i])return{labelsType:i,labels:n[i]}}}}],n&&HE(t.prototype,n),r&&HE(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),VE="en";GE.getDefaultLocale=function(){return VE},GE.setDefaultLocale=function(e){return VE=e},GE.addDefaultLocale=function(e){if(WE)return console.error("[javascript-time-ago] `TimeAgo.addDefaultLocale()` can only be called once. To add other locales, use `TimeAgo.addLocale()`.");WE=!0,GE.setDefaultLocale(e.locale),GE.addLocale(e)},GE.addLocale=function(e){Yw(e),pw.addLocale(e)},GE.locale=GE.addLocale,GE.addLabels=function(e,t,n){var r=Kw(e);r||(Yw({locale:e}),r=Kw(e)),r[t]=n};const $E={locale:"en",long:{year:{previous:"last year",current:"this year",next:"next year",past:{one:"{0} year ago",other:"{0} years ago"},future:{one:"in {0} year",other:"in {0} years"}},quarter:{previous:"last quarter",current:"this quarter",next:"next quarter",past:{one:"{0} quarter ago",other:"{0} quarters ago"},future:{one:"in {0} quarter",other:"in {0} quarters"}},month:{previous:"last month",current:"this month",next:"next month",past:{one:"{0} month ago",other:"{0} months ago"},future:{one:"in {0} month",other:"in {0} months"}},week:{previous:"last week",current:"this week",next:"next week",past:{one:"{0} week ago",other:"{0} weeks ago"},future:{one:"in {0} week",other:"in {0} weeks"}},day:{previous:"yesterday",current:"today",next:"tomorrow",past:{one:"{0} day ago",other:"{0} days ago"},future:{one:"in {0} day",other:"in {0} days"}},hour:{current:"this hour",past:{one:"{0} hour ago",other:"{0} hours ago"},future:{one:"in {0} hour",other:"in {0} hours"}},minute:{current:"this minute",past:{one:"{0} minute ago",other:"{0} minutes ago"},future:{one:"in {0} minute",other:"in {0} minutes"}},second:{current:"now",past:{one:"{0} second ago",other:"{0} seconds ago"},future:{one:"in {0} second",other:"in {0} seconds"}}},short:{year:{previous:"last yr.",current:"this yr.",next:"next yr.",past:"{0} yr. ago",future:"in {0} yr."},quarter:{previous:"last qtr.",current:"this qtr.",next:"next qtr.",past:{one:"{0} qtr. ago",other:"{0} qtrs. ago"},future:{one:"in {0} qtr.",other:"in {0} qtrs."}},month:{previous:"last mo.",current:"this mo.",next:"next mo.",past:"{0} mo. ago",future:"in {0} mo."},week:{previous:"last wk.",current:"this wk.",next:"next wk.",past:"{0} wk. ago",future:"in {0} wk."},day:{previous:"yesterday",current:"today",next:"tomorrow",past:{one:"{0} day ago",other:"{0} days ago"},future:{one:"in {0} day",other:"in {0} days"}},hour:{current:"this hour",past:"{0} hr. ago",future:"in {0} hr."},minute:{current:"this minute",past:"{0} min. ago",future:"in {0} min."},second:{current:"now",past:"{0} sec. ago",future:"in {0} sec."}},narrow:{year:{previous:"last yr.",current:"this yr.",next:"next yr.",past:"{0}y ago",future:"in {0}y"},quarter:{previous:"last qtr.",current:"this qtr.",next:"next qtr.",past:"{0}q ago",future:"in {0}q"},month:{previous:"last mo.",current:"this mo.",next:"next mo.",past:"{0}mo ago",future:"in {0}mo"},week:{previous:"last wk.",current:"this wk.",next:"next wk.",past:"{0}w ago",future:"in {0}w"},day:{previous:"yesterday",current:"today",next:"tomorrow",past:"{0}d ago",future:"in {0}d"},hour:{current:"this hour",past:"{0}h ago",future:"in {0}h"},minute:{current:"this minute",past:"{0}m ago",future:"in {0}m"},second:{current:"now",past:"{0}s ago",future:"in {0}s"}},now:{now:{current:"now",future:"in a moment",past:"just now"}},mini:{year:"{0}yr",month:"{0}mo",week:"{0}wk",day:"{0}d",hour:"{0}h",minute:"{0}m",second:"{0}s",now:"now"},"short-time":{year:"{0} yr.",month:"{0} mo.",week:"{0} wk.",day:{one:"{0} day",other:"{0} days"},hour:"{0} hr.",minute:"{0} min.",second:"{0} sec."},"long-time":{year:{one:"{0} year",other:"{0} years"},month:{one:"{0} month",other:"{0} months"},week:{one:"{0} week",other:"{0} weeks"},day:{one:"{0} day",other:"{0} days"},hour:{one:"{0} hour",other:"{0} hours"},minute:{one:"{0} minute",other:"{0} minutes"},second:{one:"{0} second",other:"{0} seconds"}}},KE={locale:"fr",long:{year:{previous:"l\u2019ann\xe9e derni\xe8re",current:"cette ann\xe9e",next:"l\u2019ann\xe9e prochaine",past:{one:"il y a {0} an",other:"il y a {0} ans"},future:{one:"dans {0} an",other:"dans {0} ans"}},quarter:{previous:"le trimestre dernier",current:"ce trimestre",next:"le trimestre prochain",past:{one:"il y a {0} trimestre",other:"il y a {0} trimestres"},future:{one:"dans {0} trimestre",other:"dans {0} trimestres"}},month:{previous:"le mois dernier",current:"ce mois-ci",next:"le mois prochain",past:"il y a {0} mois",future:"dans {0} mois"},week:{previous:"la semaine derni\xe8re",current:"cette semaine",next:"la semaine prochaine",past:{one:"il y a {0} semaine",other:"il y a {0} semaines"},future:{one:"dans {0} semaine",other:"dans {0} semaines"}},day:{previous:"hier","previous-2":"avant-hier",current:"aujourd\u2019hui",next:"demain","next-2":"apr\xe8s-demain",past:{one:"il y a {0} jour",other:"il y a {0} jours"},future:{one:"dans {0} jour",other:"dans {0} jours"}},hour:{current:"cette heure-ci",past:{one:"il y a {0} heure",other:"il y a {0} heures"},future:{one:"dans {0} heure",other:"dans {0} heures"}},minute:{current:"cette minute-ci",past:{one:"il y a {0} minute",other:"il y a {0} minutes"},future:{one:"dans {0} minute",other:"dans {0} minutes"}},second:{current:"maintenant",past:{one:"il y a {0} seconde",other:"il y a {0} secondes"},future:{one:"dans {0} seconde",other:"dans {0} secondes"}}},short:{year:{previous:"l\u2019ann\xe9e derni\xe8re",current:"cette ann\xe9e",next:"l\u2019ann\xe9e prochaine",past:"il y a {0} a",future:"dans {0} a"},quarter:{previous:"le trimestre dernier",current:"ce trimestre",next:"le trimestre prochain",past:"il y a {0} trim.",future:"dans {0} trim."},month:{previous:"le mois dernier",current:"ce mois-ci",next:"le mois prochain",past:"il y a {0} m.",future:"dans {0} m."},week:{previous:"la semaine derni\xe8re",current:"cette semaine",next:"la semaine prochaine",past:"il y a {0} sem.",future:"dans {0} sem."},day:{previous:"hier","previous-2":"avant-hier",current:"aujourd\u2019hui",next:"demain","next-2":"apr\xe8s-demain",past:"il y a {0}\xa0j",future:"dans {0}\xa0j"},hour:{current:"cette heure-ci",past:"il y a {0}\xa0h",future:"dans {0}\xa0h"},minute:{current:"cette minute-ci",past:"il y a {0}\xa0min",future:"dans {0}\xa0min"},second:{current:"maintenant",past:"il y a {0}\xa0s",future:"dans {0}\xa0s"}},narrow:{year:{previous:"l\u2019ann\xe9e derni\xe8re",current:"cette ann\xe9e",next:"l\u2019ann\xe9e prochaine",past:"-{0} a",future:"+{0} a"},quarter:{previous:"le trimestre dernier",current:"ce trimestre",next:"le trimestre prochain",past:"-{0} trim.",future:"+{0} trim."},month:{previous:"le mois dernier",current:"ce mois-ci",next:"le mois prochain",past:"-{0} m.",future:"+{0} m."},week:{previous:"la semaine derni\xe8re",current:"cette semaine",next:"la semaine prochaine",past:"-{0} sem.",future:"+{0} sem."},day:{previous:"hier","previous-2":"avant-hier",current:"aujourd\u2019hui",next:"demain","next-2":"apr\xe8s-demain",past:"-{0} j",future:"+{0} j"},hour:{current:"cette heure-ci",past:"-{0} h",future:"+{0} h"},minute:{current:"cette minute-ci",past:"-{0} min",future:"+{0} min"},second:{current:"maintenant",past:"-{0} s",future:"+{0} s"}},now:{now:{current:"maintenant",future:"dans un instant",past:"\xe0 l'instant"}},mini:{year:{one:"{0} an",other:"{0} ans"},month:"{0} mois",week:"{0} sem.",day:{one:"{0} jour",other:"{0} jours"},hour:"{0} h",minute:"{0} min.",second:"{0} sec.",now:"maintenant"},"long-time":{year:{one:"{0} an",other:"{0} ans"},month:{one:"{0} mois",other:"{0} mois"},week:{one:"{0} semaine",other:"{0} semaines"},day:{one:"{0} jour",other:"{0} jours"},hour:{one:"{0} heure",other:"{0} heures"},minute:{one:"{0} minute",other:"{0} minutes"},second:{one:"{0} seconde",other:"{0} secondes"}}},YE=e=>{let{dateStr:t}=e;const{language:n}=mn();if(!t)return null;let r;return"en"===n?(GE.addLocale($E),r=new GE("en-US")):(GE.addLocale(KE),r=new GE("fr-FR")),(0,Ap.jsxs)("span",{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Last edited"}),(0,Ap.jsx)(Ip,{children:"Derni\xe8re modification"})]})," ",r.format(new Date(t)),". "]})},ZE=(0,In.c)(i.createElement("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"}),"Description"),JE=(0,In.c)(i.createElement("path",{d:"M21.99 8c0-.72-.37-1.35-.94-1.7L12 1 2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zM12 13L3.74 7.84 12 3l8.26 4.84L12 13z"}),"Drafts"),XE=e=>{let{status:t}=e;return"published"===t?(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Published",fr:"Publi\xe9"}),children:(0,Ap.jsx)(Bn,{color:"primary"})}):"submitted"===t?(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Submitted",fr:"Soumis"}),children:(0,Ap.jsx)(ZE,{color:"secondary"})}):""===t?(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Draft",fr:"Brouillon"}),children:(0,Ap.jsx)(JE,{color:"action"})}):null},eT=e=>{var t,n,r;let{record:o,onViewEditClick:a,onDeleteClick:s,onCloneClick:l,onSubmitClick:c,showAuthor:u,showDeleteAction:d,showSubmitAction:p,showPublishAction:h,showUnPublishAction:f,showUnSubmitAction:m,showViewAction:g,showEditAction:v,showPercentComplete:b,showCloneAction:y,onUnSubmitClick:_,onUnPublishClick:x,showDownloadButton:w=!0,showTransferButton:E,onTransferClick:T}=e;const{language:C,region:k}=mn(),S="published"===o.status,{downloadRecord:O,datacitePrefix:A}=(0,i.useContext)(Fb),[j,P]=(0,i.useState)({downloadXML:!1}),I="".concat(Cn[k].catalogueURL[C],"dataset/ca-cioos_").concat(o.identifier),[L,R]=i.useState(null),N=Boolean(L),D=()=>{R(null)};if(!o.title)return console.log(o),(0,Ap.jsx)(Ap.Fragment,{});const M=(p||w)&&Ux(o),B=b&&Math.round(100*Qx(o));async function Q(e){const t={erddap:"_erddap.txt",xml:".xml",yaml:".yaml",eml:"_eml.xml",json:".json"};P({downloadXML:!0});try{let n;if("eml"===e){n=[await yx(o)]}else if("erddap"===e)n=[Tx(o)];else if("json"===e)n=await([JSON.stringify(Fx(o,C,k,A),null,2)]);else{const t=await O({record:o,fileType:e,region:k});n=Object.values(t.data.message)}const r=new Blob(n,{type:"".concat({xml:"application/xml",yaml:"application/x-yaml",eml:"application/xml",erddap:"application/xml",json:"application/json"}[e],";charset=utf-8")});K_().saveAs(r,"".concat(C_(o)).concat(t[e])),P({downloadXML:!1})}catch(n){console.log(n),P({downloadXML:!1})}}return(0,Ap.jsxs)(ko,{children:[(0,Ap.jsx)(Z_,{children:(0,Ap.jsx)(Cr,{onClick:a,children:(0,Ap.jsx)($o,{children:(0,Ap.jsx)(XE,{status:o.status})})})}),(0,Ap.jsx)(Yo,{primary:(0,Ap.jsx)("div",{style:{width:"80%"},children:null===(t=o.title)||void 0===t?void 0:t[C]}),secondaryTypographyProps:{variant:"body2"},secondary:(0,Ap.jsxs)("span",{children:[u&&(0,Ap.jsxs)("span",{children:[(0,Ap.jsx)(Lp,{en:"Author",fr:"Auteur"}),": ",null===(n=o.userinfo)||void 0===n?void 0:n.displayName," ",null===(r=o.userinfo)||void 0===r?void 0:r.email]}),(0,Ap.jsxs)("span",{style:{display:"block"},children:[(0,Ap.jsx)(YE,{dateStr:o.created}),b&&(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:[B,"% complete"]}),(0,Ap.jsxs)(Ip,{children:[B,"% Achev\xe9e"]})]})]}),(0,Ap.jsxs)("span",{style:{display:"block"},children:["UUID: ",o.identifier]})]})}),(0,Ap.jsxs)(X_,{children:[g&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"View",fr:"Vue"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:a,edge:"end","aria-label":"view record",children:(0,Ap.jsx)(ex,{})})})}),v&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Edit record",fr:"\xc9diter un enregistrement"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>a(),edge:"end","aria-label":"Edit record",children:(0,Ap.jsx)(tx,{})})})}),d&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Delete",fr:"Supprimer"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>s(),edge:"end","aria-label":"delete",children:(0,Ap.jsx)(nx,{})})})}),h&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Publish",fr:"Publier"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>c(),edge:"end","aria-label":"delete",children:(0,Ap.jsx)(rx,{})})})}),p&&(""===o.status?(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Ap.Fragment,{children:M?(0,Ap.jsx)(Lp,{en:"Submit for review",fr:"Soumettre pour examen"}):(0,Ap.jsx)(Lp,{en:"Can't submit incomplete or invalid record",fr:"Impossible de soumettre un enregistrement incomplet ou non valide"})}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>c(),edge:"end","aria-label":"submit",disabled:!M,children:(0,Ap.jsx)(rx,{})})})}):(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Return record to draft for editing",fr:"Retourner l'enregistrement au brouillon pour modification"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>c(),edge:"end","aria-label":"delete",children:(0,Ap.jsx)(ix,{})})})})),f&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Un-publish",fr:"De-Publier"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>x(),edge:"end","aria-label":"delete",children:(0,Ap.jsx)(ix,{})})})}),y&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Clone",fr:"Cloner"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>l(),edge:"end","aria-label":"clone",children:(0,Ap.jsx)(ox,{})})})}),m&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Return to draft",fr:"Revenir au brouillon"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>_(),edge:"end","aria-label":"delete",children:(0,Ap.jsx)(ix,{})})})}),w&&(0,Ap.jsx)(ms,{disableHoverListener:N,title:(0,Ap.jsx)(Lp,{en:"Download",fr:"Download"}),children:(0,Ap.jsxs)("span",{children:[(0,Ap.jsx)(Cr,{"aria-label":"more",id:"long-button","aria-controls":"long-menu","aria-expanded":N?"true":void 0,"aria-haspopup":"true",onClick:e=>{R(e.currentTarget)},disabled:!M,children:j.downloadXML?(0,Ap.jsx)(r_,{}):(0,Ap.jsx)(ax,{})}),(0,Ap.jsxs)(Mi,{id:"long-menu",MenuListProps:{"aria-labelledby":"long-button"},anchorEl:L,open:N,onClose:D,PaperProps:{style:{width:"20ch"}},children:[(0,Ap.jsx)(Oo,{onClick:()=>{Q("xml"),D()},children:"ISO 19115 XML"},"xml"),(0,Ap.jsx)(Oo,{onClick:()=>{Q("yaml"),D()},children:"YAML"},"yaml"),(0,Ap.jsx)(Oo,{onClick:()=>{Q("erddap"),D()},children:"ERDDAP snippet"},"erddap"),(0,Ap.jsx)(Oo,{onClick:()=>{Q("eml"),D()},children:"EML for OBIS IPT"},"eml"),(0,Ap.jsx)(Oo,{onClick:()=>{Q("json"),D()},children:"DATACITE JSON"},"json")]})]})}),E&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Transfer to user",fr:"Transfert vers l'utilisateur"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:T,edge:"end","aria-label":"transfer",children:(0,Ap.jsx)(sx,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Open catalogue entry in new window",fr:"Ouvrir l'entr\xe9e dans le catalogue dans une nouvelle fen\xeatre"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{disabled:!S,onClick:()=>{window.open(I,"_blank").focus()},edge:"end","aria-label":"transfer",children:(0,Ap.jsx)(lx,{})})})})]})]},o.recordID)};const tT=class extends Ub{constructor(e){super(e),this.state={records:{},deleteModalOpen:!1,submitModalOpen:!1,withdrawModalOpen:!1,modalKey:"",modalRecord:null,loading:!1}}async loadRecords(){this.setState({loading:!0});const{match:e}=this.props,{region:t}=e.params;this.unsubscribe=nd(_p(Cp),(e=>{if(e){const n=xb(Bb(Cp),"".concat(t,"/users/").concat(e.uid,"/records"));Pb(n,(e=>{const t=e.toJSON();this.setState({records:z_(t),loading:!1})})),this.listenerRefs.push(n)}}))}componentWillUnmount(){this.unsubscribeAndCloseListeners()}unsubscribeAndCloseListeners(){this.unsubscribe&&this.unsubscribe(),this.listenerRefs.length&&this.listenerRefs.forEach((e=>Ib(e)))}async componentDidMount(){this.loadRecords()}editRecord(e){const{match:t,history:n}=this.props,{language:r,region:i}=t.params,{currentUser:o}=Sp;n.push("/".concat(r,"/").concat(i,"/").concat(o.uid,"/").concat(e))}handleSubmitRecord(e){const{match:t}=this.props,{region:n}=t.params;return!(!Sp.currentUser||!e)&&Q_(n,Sp.currentUser.uid,e,"submitted")}withdrawRecord(e){const{match:t}=this.props,{region:n}=t.params;return!(!Sp.currentUser||!e)&&function(e,t,n){return Cb(xb(Bb(Cp),"".concat(e,")/users/").concat(t,"/records/").concat(n,"/status")),"")}(n,Sp.currentUser.uid,e)}cloneRecord(e){const{match:t}=this.props,{region:n}=t.params;Sp.currentUser&&N_(e,Sp.currentUser.uid,Sp.currentUser.uid,n)}deleteRecord(e){const{match:t}=this.props,{region:n}=t.params;return!!Sp.currentUser&&U_(n,Sp.currentUser.uid,e)}toggleModal(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.setState({modalKey:n,[e]:t,modalRecord:r})}render(){const{match:e,history:t}=this.props,{language:n,region:r}=e.params,{deleteModalOpen:i,withdrawModalOpen:o,modalKey:a,modalRecord:s,submitModalOpen:l,records:c,loading:u}=this.state;return(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(V_,{open:i,onClose:()=>this.toggleModal("deleteModalOpen",!1),onAccept:()=>this.deleteRecord(a),"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description"}),(0,Ap.jsx)(V_,{open:l,onClose:()=>this.toggleModal("submitModalOpen",!1),onAccept:()=>this.handleSubmitRecord(a,s),"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description"}),(0,Ap.jsx)(V_,{open:o,onClose:()=>this.toggleModal("withdrawModalOpen",!1),onAccept:()=>this.withdrawRecord(a),"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description"}),(0,Ap.jsx)(Or,{variant:"h5",children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"My Records"}),(0,Ap.jsx)(Ip,{children:"Mes dossiers"})]})}),u?(0,Ap.jsx)(r_,{}):(0,Ap.jsxs)("span",{children:[(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:['To start a new record, click on "New Record" and begin adding information. To continue working on a record, select it from the list below. Once your record is completed and information has been provided for all mandatory fields, you can submit your record for review by clicking the "Submit for review" icon to the right of your record title. The record will not be published until it is reviewed and approved by ',Cn[r].title[n]," staff."]}),(0,Ap.jsxs)(Ip,{children:["Afin de soumettre vos m\xe9tadonn\xe9es, cliquez sur \xab Nouvel enregistrement \xbb et ajoutez-y les informations demand\xe9es. Si vous d\xe9sirez reprendre la saisie d\u2019un formulaire d\xe9j\xe0 entam\xe9, s\xe9lectionnez-le dans la liste ci-dessous. Lorsque les informations sont saisies pour tous les champs obligatoires, vous pouvez soumettre vos m\xe9tadonn\xe9es pour validation en cliquant sur l\u2019ic\xf4ne \xab soumettre pour validation \xbb. Vos m\xe9tadonn\xe9es seront publi\xe9es lorsqu\u2019elles auront \xe9t\xe9 valid\xe9es et approuv\xe9es par un professionel du"," ",Cn[r].title[n],"."]})]})}),(0,Ap.jsx)("div",{style:{marginTop:"10px"},children:(0,Ap.jsx)(c_,{startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>t.push("/".concat(n,"/").concat(r,"/new")),children:(0,Ap.jsx)(Lp,{en:"New Record",fr:"Nouvel enregistrement"})})}),(0,Ap.jsx)(ki,{children:Object.entries(c||{}).sort(((e,t)=>new Date(t[1].created)-new Date(e[1].created))).map((e=>{let[t,n]=e;const{status:r,title:i}=n;return null!==i&&void 0!==i&&i.en||null===i||void 0===i||!i.fr?(0,Ap.jsx)(eT,{record:n,showCloneAction:!0,onCloneClick:()=>this.cloneRecord(t),showDeleteAction:!0,onDeleteClick:()=>this.toggleModal("deleteModalOpen",!0,t),showEditAction:!0,showPercentComplete:!0,onViewEditClick:()=>this.editRecord(t),showSubmitAction:!0,onSubmitClick:()=>{""===r?this.toggleModal("submitModalOpen",!0,t,n):this.toggleModal("withdrawModalOpen",!0,t)}},t):null}))})]}),!c&&(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"You don't have any records."}),(0,Ap.jsx)(Ip,{children:"Vous n'avez pas d'historique de saisie."})]})})]})]})}};const nT=class extends Ub{constructor(e){super(e),this.state={records:{},deleteModalOpen:!1,submitModalOpen:!1,withdrawModalOpen:!1,modalKey:"",modalRecord:null,loading:!1}}async loadRecords(){this.setState({loading:!0});const{match:e}=this.props,{region:t}=e.params;this.unsubscribe=nd(_p(Cp),(async e=>{if(e){const e=xb(Bb(Cp),"".concat(t,"/users"));Pb(e,(e=>{const t=B_(e,["published"]);this.setState({records:t,loading:!1})})),this.listenerRefs.push(e)}}))}async componentDidMount(){this.loadRecords()}editRecord(e,t){const{match:n,history:r}=this.props,{language:i,region:o}=n.params;r.push("/".concat(i,"/").concat(o,"/").concat(t,"/").concat(e))}handleCloneRecord(e,t){const{match:n}=this.props,{region:r}=n.params;Sp.currentUser&&N_(e,t,Sp.currentUser.uid,r)}render(){const{match:e}=this.props,{region:t}=e.params,{records:n,loading:r}=this.state;return(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(Or,{variant:"h5",children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Published Records"}),(0,Ap.jsx)(Ip,{children:"Dossiers publi\xe9s"})]})}),r?(0,Ap.jsx)(r_,{}):(0,Ap.jsxs)("span",{children:[(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"These are the published records in your region."}),(0,Ap.jsx)(Ip,{children:"Il s'agit des enregistrements publi\xe9s dans votre r\xe9gion."})]})}),(0,Ap.jsx)(ki,{children:n&&n.length?n.sort(((e,t)=>new Date(t.created)-new Date(e.created))).filter((e=>"published"===e.status)).map((e=>{const{title:n}=e;return null!==n&&void 0!==n&&n.en||null===n||void 0===n||!n.fr?(0,Ap.jsx)(eT,{record:e,onViewEditClick:()=>{var t;return this.editRecord(e.recordID,null===(t=e.userinfo)||void 0===t?void 0:t.userID)},showDeleteAction:!1,showUnSubmitAction:!1,showCloneAction:!0,showAuthor:!0,showViewAction:!0,onCloneClick:()=>{var n;return this.handleCloneRecord(e.recordID,null===(n=e.userinfo)||void 0===n?void 0:n.userID,t)}},e.recordID):null})):""})]}),!n&&(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"There are no published records."}),(0,Ap.jsx)(Ip,{children:"Il n'y a pas de documents publi\xe9s."})]})})]})]})}},rT=(0,In.c)(i.createElement("path",{d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1z"}),"PermContactCalendar");const iT=function(e){return function(e){const{orgName:t,givenNames:n,lastName:r}=e;return[[r,n].filter((e=>e)).join(", "),t].filter((e=>e)).map((e=>e.trim())).filter((e=>e)).join(" - ")}(e)||(0,Ap.jsx)(Lp,{en:"New contact",fr:"Nouveau contact"})};const oT=class extends Ub{constructor(e){super(e),this.state={contacts:{},modalOpen:!1,modalKey:"",loading:!1}}async componentDidMount(){this.setState({loading:!0});const{match:e}=this.props,{region:t}=e.params;this.unsubscribe=nd(_p(Cp),(e=>{if(e){const n=xb(Bb(Cp),"".concat(t,"/users/").concat(e.uid,"/contacts"));Pb(n,(e=>this.setState({contacts:e.toJSON(),loading:!1}))),this.listenerRefs.push(n)}}))}handleDeleteContact(e){const{match:t}=this.props,{region:n}=t.params;Sp.currentUser&&function(e,t,n){Tb(xb(Bb(Cp),"".concat(e,"/users/").concat(t,"/contacts/").concat(n)))}(n,Sp.currentUser.uid,e)}handleCloneContact(e){const{match:t}=this.props,{region:n}=t.params;return!!Sp.currentUser&&async function(e,t,n){const r=xb(Bb(Cp),"".concat(e,"/users/").concat(t,"/contacts")),i=(await Sb(wb(r,n))).val();i.lastName?i.lastName+=" (Copy)":i.orgName+=" (Copy)",Eb(r,i)}(n,Sp.currentUser.uid,e)}addContact(){const{history:e,match:t}=this.props,{language:n,region:r}=t.params;Sp.currentUser&&async function(e,t){const n=Bb(Cp);return(await Eb(xb(n,"".concat(e,"/users/").concat(t,"/contacts")),{})).key}(r,Sp.currentUser.uid).then((t=>{e.push("/".concat(n,"/").concat(r,"/contacts/").concat(t))}))}editContact(e){const{history:t,match:n}=this.props,{language:r,region:i}=n.params;t.push("/".concat(r,"/").concat(i,"/contacts/").concat(e))}toggleModal(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.setState({modalKey:t,modalOpen:e})}render(){const{modalOpen:e,modalKey:t,loading:n,contacts:r}=this.state;return(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:3,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsx)(V_,{open:e,onClose:()=>this.toggleModal(!1),onAccept:()=>this.handleDeleteContact(t),"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description"}),(0,Ap.jsx)(Or,{variant:"h5",children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Contacts"}),(0,Ap.jsx)(Ip,{children:"Contacts"})]})})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Create contacts here that you can reuse in multiple metadata records."}),(0,Ap.jsx)(Ip,{children:"Ajoutez ici les personnes ressources que vous d\xe9sirez r\xe9utiliser pour la saisie d\u2019autres m\xe9tadonn\xe9es."})]})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>this.addContact(),children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add contact"}),(0,Ap.jsx)(Ip,{children:"ajouter un contact"})]})})}),n?(0,Ap.jsx)(r_,{}):(0,Ap.jsx)(Ap.Fragment,{children:(0,Ap.jsx)(e_,{item:!0,xs:!0,children:r&&Object.keys(r).length?(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"These are your contacts"}),(0,Ap.jsx)(Ip,{children:"Ce sont vos contacts"})]})}),(0,Ap.jsx)(ki,{children:Object.entries(r).map((e=>{let[t,n]=e;return(0,Ap.jsxs)(ko,{button:!0,onClick:()=>this.editContact(t),children:[(0,Ap.jsx)(Z_,{children:(0,Ap.jsx)($o,{children:(0,Ap.jsx)(rT,{})})}),(0,Ap.jsx)(Yo,{primary:iT(n)}),(0,Ap.jsxs)(X_,{children:[(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Edit",fr:"\xc9diter"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>this.editContact(t),children:(0,Ap.jsx)(tx,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Clone",fr:"Clone"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>this.handleCloneContact(t),children:(0,Ap.jsx)(ox,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Delete",fr:"Supprimer"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>this.toggleModal(!0,t),children:(0,Ap.jsx)(nx,{})})})})]})]},t)}))})]}):(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"No contacts submitted yet"}),(0,Ap.jsx)(Ip,{children:"Aucun contacts n'a encore \xe9t\xe9 soumis"})]})})})})]})}};const aT=function(e){let{instrument:t}=e;return function(e){const{id:t,manufacturer:n}=e;return[n,t].filter((e=>e)).map((e=>e.trim())).filter((e=>e)).join(" - ")}(t)||(0,Ap.jsx)(Lp,{en:"New instrument",fr:"Nouvel instrument"})};const sT=class extends Ub{constructor(e){super(e),this.state={instruments:{},modalOpen:!1,modalKey:"",loading:!1}}async componentDidMount(){this.setState({loading:!0});const{match:e}=this.props,{region:t}=e.params;this.unsubscribe=Sp.onAuthStateChanged((e=>{if(e){const n=xb(Bb(Cp),"".concat(t,"/users/").concat(e.uid,"/instruments"));Pb(n,(e=>this.setState({instruments:e.toJSON(),loading:!1}))),this.listenerRefs.push(n)}}))}handleDeleteInstrument(e){const{match:t}=this.props,{region:n}=t.params;Sp.currentUser&&function(e,t,n){Tb(xb(Bb(Cp),"".concat(e,"/users/").concat(t,"/instruments/").concat(n)))}(n,Sp.currentUser.uid,e)}handleCloneInstrument(e){const{match:t}=this.props,{region:n}=t.params;return!!Sp.currentUser&&async function(e,t,n){const r=xb(Bb(Cp),"".concat(e,"/users/").concat(t,"/instruments/")),i=(await Sb(wb(r,n))).val();i.id&&(i.id+=" (Copy)"),Eb(r,i)}(n,Sp.currentUser.uid,e)}addInstrument(){const{history:e,match:t}=this.props,{language:n,region:r}=t.params;Sp.currentUser&&async function(e,t){const n=Bb(Cp);return(await Eb(xb(n,"".concat(e,"/users/").concat(t,"/instruments/")),{})).key}(r,Sp.currentUser.uid).then((t=>{e.push("/".concat(n,"/").concat(r,"/instruments/").concat(t))}))}editInstrument(e){const{history:t,match:n}=this.props,{language:r,region:i}=n.params;t.push("/".concat(r,"/").concat(i,"/instruments/").concat(e))}toggleModal(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.setState({modalKey:t,modalOpen:e})}render(){const{modalOpen:e,modalKey:t,loading:n,instruments:r}=this.state;return(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:3,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsx)(V_,{open:e,onClose:()=>this.toggleModal(!1),onAccept:()=>this.handleDeleteInstrument(t),"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description"}),(0,Ap.jsx)(Or,{variant:"h5",children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Instruments"}),(0,Ap.jsx)(Ip,{children:"Instruments"})]})})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Create instruments here that you can reuse in multiple metadata records."}),(0,Ap.jsx)(Ip,{children:"Ajoutez ici les personnes ressources que vous d\xe9sirez r\xe9utiliser pour la saisie d\u2019autres m\xe9tadonn\xe9es."})]})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>this.addInstrument(),children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add instrument"}),(0,Ap.jsx)(Ip,{children:"ajouter un instrument"})]})})}),n?(0,Ap.jsx)(r_,{}):(0,Ap.jsx)(Ap.Fragment,{children:(0,Ap.jsx)(e_,{item:!0,xs:!0,children:r&&Object.keys(r).length?(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"These are your instruments"}),(0,Ap.jsx)(Ip,{children:"Ce sont vos instruments"})]})}),(0,Ap.jsx)(ki,{children:Object.entries(r).map((e=>{let[t,n]=e;return(0,Ap.jsxs)(ko,{button:!0,onClick:()=>this.editInstrument(t),children:[(0,Ap.jsx)(Z_,{children:(0,Ap.jsx)($o,{children:(0,Ap.jsx)(rT,{})})}),(0,Ap.jsx)(Yo,{primary:aT({instrument:n})}),(0,Ap.jsxs)(X_,{children:[(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Edit",fr:"\xc9diter"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>this.editInstrument(t),children:(0,Ap.jsx)(tx,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Clone",fr:"Clone"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>this.handleCloneInstrument(t),children:(0,Ap.jsx)(ox,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Delete",fr:"Supprimer"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>this.toggleModal(!0,t),children:(0,Ap.jsx)(nx,{})})})})]})]},t)}))})]}):(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"No instruments submitted yet"}),(0,Ap.jsx)(Ip,{children:"Aucun instruments n'a encore \xe9t\xe9 soumis"})]})})})})]})}};const lT=class extends Ub{constructor(e){super(e),this.state={sharedRecords:{},loading:!1},this.unsubscribe=null,this.listenerRefs=[],this.handleCloneRecord=this.handleCloneRecord.bind(this)}async loadSharedRecords(){this.setState({loading:!0});const{match:e}=this.props,{region:t}=e.params,n=Bb();this.unsubscribe=nd(_p(Cp),(async e=>{if(e){const r=xb(n,"".concat(t,"/shares/").concat(e.uid));this.listenerRefs.push(r),Pb(r,(async e=>{const r=e.val(),i=[];Object.entries(r||{}).forEach((e=>{let[r,o]=e;Object.keys(o||{}).forEach((e=>{const o="".concat(t,"/users/").concat(r,"/records/").concat(e),a=Sb(xb(n,o)).then((t=>{const n=t.val();if(n)return{...n,recordID:e};throw new Error("No details found for record ".concat(e," by author ").concat(r))}));i.push(a)}))}));const o=(await Promise.all(i)).reduce(((e,t)=>(e[t.recordID]=t,e)),{});this.setState({sharedRecords:z_(o),loading:!1})})),this.listenerRefs.push(r)}}))}componentWillUnmount(){this.unsubscribeAndCloseListeners()}unsubscribeAndCloseListeners(){this.unsubscribe&&this.unsubscribe(),this.listenerRefs.length&&this.listenerRefs.forEach((e=>Ib(e)))}async componentDidMount(){this.loadSharedRecords()}editRecord(e,t){const{match:n,history:r}=this.props,{language:i,region:o}=n.params;r.push("/".concat(i,"/").concat(o,"/").concat(t,"/").concat(e))}handleCloneRecord(e,t){const{region:n}=this.props.match.params,{currentUser:r}=_p(Cp);r&&N_(e,t,r.uid,n)}render(){const{sharedRecords:e,loading:t}=this.state;return(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(Or,{variant:"h5",children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Shared with me"}),(0,Ap.jsx)(Ip,{children:"Partag\xe9 avec moi"})]})}),t?(0,Ap.jsx)(r_,{}):(0,Ap.jsxs)("span",{children:[(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(Or,{style:{marginTop:"20px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"The following records have been shared with you for editing."}),(0,Ap.jsx)(Ip,{children:"Les enregistrements suivants ont \xe9t\xe9 partag\xe9s avec vous pour modification."})]})}),(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"You can edit them, but you cannot submit or delete."}),(0,Ap.jsx)(Ip,{children:"Vous pouvez les modifier, mais vous ne pouvez pas les soumettre ou les supprimer."})]})}),(0,Ap.jsx)(ki,{children:Object.entries(e||{}).sort(((e,t)=>new Date(t[1].created)-new Date(e[1].created))).map((e=>{let[t,n]=e;const{title:r}=n;return null!==r&&void 0!==r&&r.en||null===r||void 0===r||!r.fr?(0,Ap.jsx)(eT,{record:n,showCloneAction:!0,onCloneClick:()=>this.handleCloneRecord(t,n.userID),showEditAction:!0,showPercentComplete:!0,onViewEditClick:()=>this.editRecord(t,n.userID)},t):null}))})]}),!e&&(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"You don't have any records shared with you."}),(0,Ap.jsx)(Ip,{children:"Vous n'avez aucun enregistrement partag\xe9 avec vous."})]})})]})]})}},cT=()=>(0,Ap.jsx)("div",{children:(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Please sign in to access your metadata records. You will need a Google account to login."}),(0,Ap.jsx)(Ip,{children:"Connectez-vous pour acc\xe9der \xe0 l'historique de saisie de vos m\xe9tadonn\xe9es. Vous aurez besoin d'un compte Google pour vous connecter."})]})})});var uT=n(208);function dT(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}function pT(e){var t=function(t){var n=e(t);return t.css?(0,at.c)({},(0,uT.c)(n,e((0,at.c)({theme:t.theme},t.css))),dT(t.css,[e.filterProps])):t.sx?(0,at.c)({},(0,uT.c)(n,e((0,at.c)({theme:t.theme},t.sx))),dT(t.sx,[e.filterProps])):n};return t.propTypes={},t.filterProps=["css","sx"].concat((0,cr.c)(e.filterProps)),t}const hT=pT;const fT=function(){for(var e=arguments.length,t=new Array(e),n=0;n 1&&void 0!==arguments[1]?arguments[1]:{},r=n.name,o=(0,Yn.c)(n,["name"]);var a,s=r,l="function"===typeof t?function(e){return{root:function(n){return t((0,at.c)({theme:e},n))}}}:{root:t},c=(0,Sn.c)(l,(0,at.c)({Component:e,name:r||e.displayName,classNamePrefix:s},o));t.filterProps&&(a=t.filterProps,delete t.filterProps),t.propTypes&&(t.propTypes,delete t.propTypes);var u=i.forwardRef((function(t,n){var r=t.children,o=t.className,s=t.clone,l=t.component,u=(0,Yn.c)(t,["children","className","clone","component"]),d=c(t),p=(0,kn.c)(d.root,o),h=u;if(a&&(h=function(e,t){var n={};return Object.keys(e).forEach((function(r){-1===t.indexOf(r)&&(n[r]=e[r])})),n}(h,a)),s)return i.cloneElement(r,(0,at.c)({className:(0,kn.c)(r.props.className,p)},h));if("function"===typeof r)return r((0,at.c)({className:p},h));var f=l||e;return i.createElement(f,(0,at.c)({ref:n,className:p},h),r)}));return Qt()(u,e),u}}const MT=function(e){var t=DT(e);return function(e,n){return t(e,(0,at.c)({defaultTheme:On.c},n))}};var BT=hT(fT(yT,_T,xT,wT,ET,TT,CT,LT,RT.c,NT));const QT=MT("div")(BT,{name:"MuiBox"});var UT=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.color,a=void 0===o?"primary":o,s=e.value,l=e.valueBuffer,c=e.variant,u=void 0===c?"indeterminate":c,d=(0,Yn.c)(e,["classes","className","color","value","valueBuffer","variant"]),p=Pn(),h={},f={bar1:{},bar2:{}};if("determinate"===u||"buffer"===u)if(void 0!==s){h["aria-valuenow"]=Math.round(s),h["aria-valuemin"]=0,h["aria-valuemax"]=100;var m=s-100;"rtl"===p.direction&&(m=-m),f.bar1.transform="translateX(".concat(m,"%)")}else 0;if("buffer"===u)if(void 0!==l){var g=(l||0)-100;"rtl"===p.direction&&(g=-g),f.bar2.transform="translateX(".concat(g,"%)")}else 0;return i.createElement("div",(0,at.c)({className:(0,kn.c)(n.root,n["color".concat((0,Zn.c)(a))],r,{determinate:n.determinate,indeterminate:n.indeterminate,buffer:n.buffer,query:n.query}[u]),role:"progressbar"},h,{ref:t},d),"buffer"===u?i.createElement("div",{className:(0,kn.c)(n.dashed,n["dashedColor".concat((0,Zn.c)(a))])}):null,i.createElement("div",{className:(0,kn.c)(n.bar,n["barColor".concat((0,Zn.c)(a))],("indeterminate"===u||"query"===u)&&n.bar1Indeterminate,{determinate:n.bar1Determinate,buffer:n.bar1Buffer}[u]),style:f.bar1}),"determinate"===u?null:i.createElement("div",{className:(0,kn.c)(n.bar,("indeterminate"===u||"query"===u)&&n.bar2Indeterminate,"buffer"===u?[n["color".concat((0,Zn.c)(a))],n.bar2Buffer]:n["barColor".concat((0,Zn.c)(a))]),style:f.bar2}))}));const FT=(0,Gn.c)((function(e){var t=function(t){return"light"===e.palette.type?(0,or.IV)(t,.62):(0,or.sP)(t,.5)},n=t(e.palette.primary.main),r=t(e.palette.secondary.main);return{root:{position:"relative",overflow:"hidden",height:4,"@media print":{colorAdjust:"exact"}},colorPrimary:{backgroundColor:n},colorSecondary:{backgroundColor:r},determinate:{},indeterminate:{},buffer:{backgroundColor:"transparent"},query:{transform:"rotate(180deg)"},dashed:{position:"absolute",marginTop:0,height:"100%",width:"100%",animation:"$buffer 3s infinite linear"},dashedColorPrimary:{backgroundImage:"radial-gradient(".concat(n," 0%, ").concat(n," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},dashedColorSecondary:{backgroundImage:"radial-gradient(".concat(r," 0%, ").concat(r," 16%, transparent 42%)"),backgroundSize:"10px 10px",backgroundPosition:"0 -23px"},bar:{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},barColorPrimary:{backgroundColor:e.palette.primary.main},barColorSecondary:{backgroundColor:e.palette.secondary.main},bar1Indeterminate:{width:"auto",animation:"$indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite"},bar1Determinate:{transition:"transform .".concat(4,"s linear")},bar1Buffer:{zIndex:1,transition:"transform .".concat(4,"s linear")},bar2Indeterminate:{width:"auto",animation:"$indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite"},bar2Buffer:{transition:"transform .".concat(4,"s linear")},"@keyframes indeterminate1":{"0%":{left:"-35%",right:"100%"},"60%":{left:"100%",right:"-90%"},"100%":{left:"100%",right:"-90%"}},"@keyframes indeterminate2":{"0%":{left:"-200%",right:"100%"},"60%":{left:"107%",right:"-8%"},"100%":{left:"107%",right:"-8%"}},"@keyframes buffer":{"0%":{opacity:1,backgroundPosition:"0 -23px"},"50%":{opacity:0,backgroundPosition:"0 -23px"},"100%":{opacity:1,backgroundPosition:"-200px -23px"}}}}),{name:"MuiLinearProgress"})(UT);var zT=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.color,s=void 0===a?"default":a,l=e.component,c=void 0===l?"button":l,u=e.disabled,d=void 0!==u&&u,p=e.disableFocusRipple,h=void 0!==p&&p,f=e.focusVisibleClassName,m=e.size,g=void 0===m?"large":m,v=e.variant,b=void 0===v?"circular":v,y=(0,Yn.c)(e,["children","classes","className","color","component","disabled","disableFocusRipple","focusVisibleClassName","size","variant"]);return i.createElement(Er,(0,at.c)({className:(0,kn.c)(r.root,o,"large"!==g&&r["size".concat((0,Zn.c)(g))],d&&r.disabled,"extended"===b&&r.extended,{primary:r.primary,secondary:r.secondary,inherit:r.colorInherit}[s]),component:c,disabled:d,focusRipple:!h,focusVisibleClassName:(0,kn.c)(r.focusVisible,f),ref:t},y),i.createElement("span",{className:r.label},n))}));const qT=(0,Gn.c)((function(e){return{root:(0,at.c)({},e.typography.button,{boxSizing:"border-box",minHeight:36,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,boxShadow:e.shadows[6],"&:active":{boxShadow:e.shadows[12]},color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],"&:hover":{backgroundColor:e.palette.grey.A100,"@media (hover: none)":{backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground},textDecoration:"none"},"&$focusVisible":{boxShadow:e.shadows[6]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},primary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},secondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},extended:{borderRadius:24,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48,"&$sizeSmall":{width:"auto",padding:"0 8px",borderRadius:17,minWidth:34,height:34},"&$sizeMedium":{width:"auto",padding:"0 16px",borderRadius:20,minWidth:40,height:40}},focusVisible:{},disabled:{},colorInherit:{color:"inherit"},sizeSmall:{width:40,height:40},sizeMedium:{width:48,height:48}}}),{name:"MuiFab"})(zT);var HT;function WT(){if(HT)return HT;var e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),HT="reverse",e.scrollLeft>0?HT="default":(e.scrollLeft=1,0===e.scrollLeft&&(HT="negative")),document.body.removeChild(e),HT}function GT(e,t){var n=e.scrollLeft;if("rtl"!==t)return n;switch(WT()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}function VT(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}var $T={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function KT(e){var t=e.onChange,n=(0,Yn.c)(e,["onChange"]),r=i.useRef(),o=i.useRef(null),a=function(){r.current=o.current.offsetHeight-o.current.clientHeight};return i.useEffect((function(){var e=(0,Rr.c)((function(){var e=r.current;a(),e!==r.current&&t(r.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[t]),i.useEffect((function(){a(),t(r.current)}),[t]),i.createElement("div",(0,at.c)({style:$T,ref:o},n))}var YT=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.color,a=e.orientation,s=(0,Yn.c)(e,["classes","className","color","orientation"]);return i.createElement("span",(0,at.c)({className:(0,kn.c)(n.root,n["color".concat((0,Zn.c)(o))],r,"vertical"===a&&n.vertical),ref:t},s))}));const ZT=(0,Gn.c)((function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}}),{name:"PrivateTabIndicator"})(YT),JT=(0,In.c)(i.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),XT=(0,In.c)(i.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");var eC=i.createElement(JT,{fontSize:"small"}),tC=i.createElement(XT,{fontSize:"small"}),nC=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.direction,a=e.orientation,s=e.disabled,l=(0,Yn.c)(e,["classes","className","direction","orientation","disabled"]);return i.createElement(Er,(0,at.c)({component:"div",className:(0,kn.c)(n.root,r,s&&n.disabled,"vertical"===a&&n.vertical),ref:t,role:null,tabIndex:null},l),"left"===o?eC:tC)}));const rC=(0,Gn.c)({root:{width:40,flexShrink:0,opacity:.8,"&$disabled":{opacity:0}},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}},disabled:{}},{name:"MuiTabScrollButton"})(nC);var iC=i.forwardRef((function(e,t){var n=e["aria-label"],r=e["aria-labelledby"],o=e.action,a=e.centered,s=void 0!==a&&a,l=e.children,c=e.classes,u=e.className,d=e.component,p=void 0===d?"div":d,h=e.indicatorColor,f=void 0===h?"secondary":h,m=e.onChange,g=e.orientation,v=void 0===g?"horizontal":g,b=e.ScrollButtonComponent,y=void 0===b?rC:b,_=e.scrollButtons,x=void 0===_?"auto":_,w=e.selectionFollowsFocus,E=e.TabIndicatorProps,T=void 0===E?{}:E,C=e.TabScrollButtonProps,k=e.textColor,S=void 0===k?"inherit":k,O=e.value,A=e.variant,j=void 0===A?"standard":A,P=(0,Yn.c)(e,["aria-label","aria-labelledby","action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant"]),I=Pn(),L="scrollable"===j,R="rtl"===I.direction,N="vertical"===v,D=N?"scrollTop":"scrollLeft",M=N?"top":"left",B=N?"bottom":"right",Q=N?"clientHeight":"clientWidth",U=N?"height":"width";var F=i.useState(!1),z=F[0],q=F[1],H=i.useState({}),W=H[0],G=H[1],V=i.useState({start:!1,end:!1}),$=V[0],K=V[1],Y=i.useState({overflow:"hidden",marginBottom:null}),Z=Y[0],J=Y[1],X=new Map,ee=i.useRef(null),te=i.useRef(null),ne=function(){var e,t,n=ee.current;if(n){var r=n.getBoundingClientRect();e={clientWidth:n.clientWidth,scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollLeftNormalized:GT(n,I.direction),scrollWidth:n.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(n&&!1!==O){var i=te.current.children;if(i.length>0){var o=i[X.get(O)];0,t=o?o.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},re=(0,sr.c)((function(){var e,t=ne(),n=t.tabsMeta,r=t.tabMeta,i=0;if(r&&n)if(N)i=r.top-n.top+n.scrollTop;else{var o=R?n.scrollLeftNormalized+n.clientWidth-n.scrollWidth:n.scrollLeft;i=r.left-n.left+o}var a=(e={},(0,nr.c)(e,M,i),(0,nr.c)(e,U,r?r[U]:0),e);if(isNaN(W[M])||isNaN(W[U]))G(a);else{var s=Math.abs(W[M]-a[M]),l=Math.abs(W[U]-a[U]);(s>=1||l>=1)&&G(a)}})),ie=function(e){!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=r.ease,a=void 0===o?VT:o,s=r.duration,l=void 0===s?300:s,c=null,u=t[e],d=!1,p=function(){d=!0};u===n?i(new Error("Element already at target position")):requestAnimationFrame((function r(o){if(d)i(new Error("Animation cancelled"));else{null===c&&(c=o);var s=Math.min(1,(o-c)/l);t[e]=a(s)*(n-u)+u,s>=1?requestAnimationFrame((function(){i(null)})):requestAnimationFrame(r)}}))}(D,ee.current,e)},oe=function(e){var t=ee.current[D];N?t+=e:(t+=e*(R?-1:1),t*=R&&"reverse"===WT()?-1:1),ie(t)},ae=function(){oe(-ee.current[Q])},se=function(){oe(ee.current[Q])},le=i.useCallback((function(e){J({overflow:null,marginBottom:-e})}),[]),ce=(0,sr.c)((function(){var e=ne(),t=e.tabsMeta,n=e.tabMeta;if(n&&t)if(n[M] t[B]){var i=t[D]+(n[B]-t[B]);ie(i)}})),ue=(0,sr.c)((function(){if(L&&"off"!==x){var e,t,n=ee.current,r=n.scrollTop,i=n.scrollHeight,o=n.clientHeight,a=n.scrollWidth,s=n.clientWidth;if(N)e=r>1,t=r 1,t=R?l>1:l *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled}},textColorSecondary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:e.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}}),{name:"MuiTab"})(aC),lC=(0,In.c)(i.createElement("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"}),"Save"),cC=(0,In.c)(i.createElement("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function uC(e){return"Backspace"===e.key||"Delete"===e.key}var dC=i.forwardRef((function(e,t){var n=e.avatar,r=e.classes,o=e.className,a=e.clickable,s=e.color,l=void 0===s?"default":s,c=e.component,u=e.deleteIcon,d=e.disabled,p=void 0!==d&&d,h=e.icon,f=e.label,m=e.onClick,g=e.onDelete,v=e.onKeyDown,b=e.onKeyUp,y=e.size,_=void 0===y?"medium":y,x=e.variant,w=void 0===x?"default":x,E=(0,Yn.c)(e,["avatar","classes","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant"]),T=i.useRef(null),C=(0,ar.c)(T,t),k=function(e){e.stopPropagation(),g&&g(e)},S=!(!1===a||!m)||a,O="small"===_,A=c||(S?Er:"div"),j=A===Er?{component:"div"}:{},P=null;if(g){var I=(0,kn.c)("default"!==l&&("default"===w?r["deleteIconColor".concat((0,Zn.c)(l))]:r["deleteIconOutlinedColor".concat((0,Zn.c)(l))]),O&&r.deleteIconSmall);P=u&&i.isValidElement(u)?i.cloneElement(u,{className:(0,kn.c)(u.props.className,r.deleteIcon,I),onClick:k}):i.createElement(cC,{className:(0,kn.c)(r.deleteIcon,I),onClick:k})}var L=null;n&&i.isValidElement(n)&&(L=i.cloneElement(n,{className:(0,kn.c)(r.avatar,n.props.className,O&&r.avatarSmall,"default"!==l&&r["avatarColor".concat((0,Zn.c)(l))])}));var R=null;return h&&i.isValidElement(h)&&(R=i.cloneElement(h,{className:(0,kn.c)(r.icon,h.props.className,O&&r.iconSmall,"default"!==l&&r["iconColor".concat((0,Zn.c)(l))])})),i.createElement(A,(0,at.c)({role:S||g?"button":void 0,className:(0,kn.c)(r.root,o,"default"!==l&&[r["color".concat((0,Zn.c)(l))],S&&r["clickableColor".concat((0,Zn.c)(l))],g&&r["deletableColor".concat((0,Zn.c)(l))]],"default"!==w&&[r.outlined,{primary:r.outlinedPrimary,secondary:r.outlinedSecondary}[l]],p&&r.disabled,O&&r.sizeSmall,S&&r.clickable,g&&r.deletable),"aria-disabled":!!p||void 0,tabIndex:S||g?0:void 0,onClick:m,onKeyDown:function(e){e.currentTarget===e.target&&uC(e)&&e.preventDefault(),v&&v(e)},onKeyUp:function(e){e.currentTarget===e.target&&(g&&uC(e)?g(e):"Escape"===e.key&&T.current&&T.current.blur()),b&&b(e)},ref:C},j,E),L||R,i.createElement("span",{className:(0,kn.c)(r.label,O&&r.labelSmall)},f),P)}));const pC=(0,Gn.c)((function(e){var t="light"===e.palette.type?e.palette.grey[300]:e.palette.grey[700],n=(0,or.W4)(e.palette.text.primary,.26);return{root:{fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:e.palette.getContrastText(t),backgroundColor:t,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:0,textDecoration:"none",border:"none",padding:0,verticalAlign:"middle",boxSizing:"border-box","&$disabled":{opacity:.5,pointerEvents:"none"},"& $avatar":{marginLeft:5,marginRight:-6,width:24,height:24,color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],fontSize:e.typography.pxToRem(12)},"& $avatarColorPrimary":{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.dark},"& $avatarColorSecondary":{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.dark},"& $avatarSmall":{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)}},sizeSmall:{height:24},colorPrimary:{backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText},colorSecondary:{backgroundColor:e.palette.secondary.main,color:e.palette.secondary.contrastText},disabled:{},clickable:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover, &:focus":{backgroundColor:(0,or.ct)(t,.08)},"&:active":{boxShadow:e.shadows[1]}},clickableColorPrimary:{"&:hover, &:focus":{backgroundColor:(0,or.ct)(e.palette.primary.main,.08)}},clickableColorSecondary:{"&:hover, &:focus":{backgroundColor:(0,or.ct)(e.palette.secondary.main,.08)}},deletable:{"&:focus":{backgroundColor:(0,or.ct)(t,.08)}},deletableColorPrimary:{"&:focus":{backgroundColor:(0,or.ct)(e.palette.primary.main,.2)}},deletableColorSecondary:{"&:focus":{backgroundColor:(0,or.ct)(e.palette.secondary.main,.2)}},outlined:{backgroundColor:"transparent",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,or.W4)(e.palette.text.primary,e.palette.action.hoverOpacity)},"& $avatar":{marginLeft:4},"& $avatarSmall":{marginLeft:2},"& $icon":{marginLeft:4},"& $iconSmall":{marginLeft:2},"& $deleteIcon":{marginRight:5},"& $deleteIconSmall":{marginRight:3}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(e.palette.primary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,or.W4)(e.palette.primary.main,e.palette.action.hoverOpacity)}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(e.palette.secondary.main),"$clickable&:hover, $clickable&:focus, $deletable&:focus":{backgroundColor:(0,or.W4)(e.palette.secondary.main,e.palette.action.hoverOpacity)}},avatar:{},avatarSmall:{},avatarColorPrimary:{},avatarColorSecondary:{},icon:{color:"light"===e.palette.type?e.palette.grey[700]:e.palette.grey[300],marginLeft:5,marginRight:-6},iconSmall:{width:18,height:18,marginLeft:4,marginRight:-4},iconColorPrimary:{color:"inherit"},iconColorSecondary:{color:"inherit"},label:{overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},labelSmall:{paddingLeft:8,paddingRight:8},deleteIcon:{WebkitTapHighlightColor:"transparent",color:n,height:22,width:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:(0,or.W4)(n,.4)}},deleteIconSmall:{height:16,width:16,marginRight:4,marginLeft:-4},deleteIconColorPrimary:{color:(0,or.W4)(e.palette.primary.contrastText,.7),"&:hover, &:active":{color:e.palette.primary.contrastText}},deleteIconColorSecondary:{color:(0,or.W4)(e.palette.secondary.contrastText,.7),"&:hover, &:active":{color:e.palette.secondary.contrastText}},deleteIconOutlinedColorPrimary:{color:(0,or.W4)(e.palette.primary.main,.7),"&:hover, &:active":{color:e.palette.primary.main}},deleteIconOutlinedColorSecondary:{color:(0,or.W4)(e.palette.secondary.main,.7),"&:hover, &:active":{color:e.palette.secondary.main}}}}),{name:"MuiChip"})(dC),hC=e=>{let{status:t}=e,n="";return n="submitted"===t?(0,Ap.jsx)(Lp,{en:"Submitted",fr:"Soumis"}):"published"===t?(0,Ap.jsx)(Lp,{en:"Published",fr:"Publi\xe9"}):(0,Ap.jsx)(Lp,{en:"Draft",fr:"Brouillon"}),(0,Ap.jsx)(pC,{label:n,variant:"outlined"})},fC=()=>(0,Ap.jsx)("div",{children:(0,Ap.jsx)(Or,{variant:"h5",children:"Not Found / Non trouv\xe9"})});var mC=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.color,s=void 0===a?"primary":a,l=e.component,c=void 0===l?"div":l,u=e.disabled,d=void 0!==u&&u,p=e.error,h=void 0!==p&&p,f=e.fullWidth,m=void 0!==f&&f,g=e.focused,v=e.hiddenLabel,b=void 0!==v&&v,y=e.margin,_=void 0===y?"none":y,x=e.required,w=void 0!==x&&x,E=e.size,T=e.variant,C=void 0===T?"standard":T,k=(0,Yn.c)(e,["children","classes","className","color","component","disabled","error","fullWidth","focused","hiddenLabel","margin","required","size","variant"]),S=i.useState((function(){var e=!1;return n&&i.Children.forEach(n,(function(t){if((0,Eo.c)(t,["Input","Select"])){var n=(0,Eo.c)(t,["Select"])?t.props.input:t;n&&n.props.startAdornment&&(e=!0)}})),e})),O=S[0],A=S[1],j=i.useState((function(){var e=!1;return n&&i.Children.forEach(n,(function(t){(0,Eo.c)(t,["Input","Select"])&&Qi(t.props,!0)&&(e=!0)})),e})),P=j[0],I=j[1],L=i.useState(!1),R=L[0],N=L[1],D=void 0!==g?g:R;d&&D&&N(!1);var M=i.useCallback((function(){I(!0)}),[]),B={adornedStart:O,setAdornedStart:A,color:s,disabled:d,error:h,filled:P,focused:D,fullWidth:m,hiddenLabel:b,margin:("small"===E?"dense":void 0)||_,onBlur:function(){N(!1)},onEmpty:i.useCallback((function(){I(!1)}),[]),onFilled:M,onFocus:function(){N(!0)},registerEffect:undefined,required:w,variant:C};return i.createElement(Vi.Provider,{value:B},i.createElement(c,(0,at.c)({className:(0,kn.c)(r.root,o,"none"!==_&&r["margin".concat((0,Zn.c)(_))],m&&r.fullWidth),ref:t},k),n))}));const gC=(0,Gn.c)({root:{display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},marginNormal:{marginTop:16,marginBottom:8},marginDense:{marginTop:8,marginBottom:4},fullWidth:{width:"100%"}},{name:"MuiFormControl"})(mC);var vC=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=(e.color,e.component),s=void 0===a?"label":a,l=(e.disabled,e.error,e.filled,e.focused,e.required,(0,Yn.c)(e,["children","classes","className","color","component","disabled","error","filled","focused","required"])),c=Hi({props:e,muiFormControl:$i(),states:["color","required","focused","disabled","error","filled"]});return i.createElement(s,(0,at.c)({className:(0,kn.c)(r.root,r["color".concat((0,Zn.c)(c.color||"primary"))],o,c.disabled&&r.disabled,c.error&&r.error,c.filled&&r.filled,c.focused&&r.focused,c.required&&r.required),ref:t},l),n,c.required&&i.createElement("span",{"aria-hidden":!0,className:(0,kn.c)(r.asterisk,c.error&&r.error)},"\u2009","*"))}));const bC=(0,Gn.c)((function(e){return{root:(0,at.c)({color:e.palette.text.secondary},e.typography.body1,{lineHeight:1,padding:0,"&$focused":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),colorSecondary:{"&$focused":{color:e.palette.secondary.main}},focused:{},disabled:{},error:{},filled:{},required:{},asterisk:{"&$error":{color:e.palette.error.main}}}}),{name:"MuiFormLabel"})(vC);var yC=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.disableAnimation,a=void 0!==o&&o,s=(e.margin,e.shrink),l=(e.variant,(0,Yn.c)(e,["classes","className","disableAnimation","margin","shrink","variant"])),c=$i(),u=s;"undefined"===typeof u&&c&&(u=c.filled||c.focused||c.adornedStart);var d=Hi({props:e,muiFormControl:c,states:["margin","variant"]});return i.createElement(bC,(0,at.c)({"data-shrink":u,className:(0,kn.c)(n.root,r,c&&n.formControl,!a&&n.animated,u&&n.shrink,"dense"===d.margin&&n.marginDense,{filled:n.filled,outlined:n.outlined}[d.variant]),classes:{focused:n.focused,disabled:n.disabled,error:n.error,required:n.required,asterisk:n.asterisk},ref:t},l))}));const _C=(0,Gn.c)((function(e){return{root:{display:"block",transformOrigin:"top left"},focused:{},disabled:{},error:{},required:{},asterisk:{},formControl:{position:"absolute",left:0,top:0,transform:"translate(0, 24px) scale(1)"},marginDense:{transform:"translate(0, 21px) scale(1)"},shrink:{transform:"translate(0, 1.5px) scale(0.75)",transformOrigin:"top left"},animated:{transition:e.transitions.create(["color","transform"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},filled:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 20px) scale(1)","&$marginDense":{transform:"translate(12px, 17px) scale(1)"},"&$shrink":{transform:"translate(12px, 10px) scale(0.75)","&$marginDense":{transform:"translate(12px, 7px) scale(0.75)"}}},outlined:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 20px) scale(1)","&$marginDense":{transform:"translate(14px, 12px) scale(1)"},"&$shrink":{transform:"translate(14px, -6px) scale(0.75)"}}}}),{name:"MuiInputLabel"})(yC);var xC=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.component,s=void 0===a?"p":a,l=(e.disabled,e.error,e.filled,e.focused,e.margin,e.required,e.variant,(0,Yn.c)(e,["children","classes","className","component","disabled","error","filled","focused","margin","required","variant"])),c=Hi({props:e,muiFormControl:$i(),states:["variant","margin","disabled","error","filled","focused","required"]});return i.createElement(s,(0,at.c)({className:(0,kn.c)(r.root,("filled"===c.variant||"outlined"===c.variant)&&r.contained,o,c.disabled&&r.disabled,c.error&&r.error,c.filled&&r.filled,c.focused&&r.focused,c.required&&r.required,"dense"===c.margin&&r.marginDense),ref:t},l)," "===n?i.createElement("span",{dangerouslySetInnerHTML:{__html:""}}):n)}));const wC=(0,Gn.c)((function(e){return{root:(0,at.c)({color:e.palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,margin:0,"&$disabled":{color:e.palette.text.disabled},"&$error":{color:e.palette.error.main}}),error:{},disabled:{},marginDense:{marginTop:4},contained:{marginLeft:14,marginRight:14},focused:{},filled:{},required:{}}}),{name:"MuiFormHelperText"})(xC);var EC={standard:oo,filled:ho,outlined:vo},TC=i.forwardRef((function(e,t){var n=e.autoComplete,r=e.autoFocus,o=void 0!==r&&r,a=e.children,s=e.classes,l=e.className,c=e.color,u=void 0===c?"primary":c,d=e.defaultValue,p=e.disabled,h=void 0!==p&&p,f=e.error,m=void 0!==f&&f,g=e.FormHelperTextProps,v=e.fullWidth,b=void 0!==v&&v,y=e.helperText,_=e.hiddenLabel,x=e.id,w=e.InputLabelProps,E=e.inputProps,T=e.InputProps,C=e.inputRef,k=e.label,S=e.multiline,O=void 0!==S&&S,A=e.name,j=e.onBlur,P=e.onChange,I=e.onFocus,L=e.placeholder,R=e.required,N=void 0!==R&&R,D=e.rows,M=e.rowsMax,B=e.maxRows,Q=e.minRows,U=e.select,F=void 0!==U&&U,z=e.SelectProps,q=e.type,H=e.value,W=e.variant,G=void 0===W?"standard":W,V=(0,Yn.c)(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","maxRows","minRows","select","SelectProps","type","value","variant"]);var $={};if("outlined"===G&&(w&&"undefined"!==typeof w.shrink&&($.notched=w.shrink),k)){var K,Y=null!==(K=null===w||void 0===w?void 0:w.required)&&void 0!==K?K:N;$.label=i.createElement(i.Fragment,null,k,Y&&"\xa0*")}F&&(z&&z.native||($.id=void 0),$["aria-describedby"]=void 0);var Z=y&&x?"".concat(x,"-helper-text"):void 0,J=k&&x?"".concat(x,"-label"):void 0,X=EC[G],ee=i.createElement(X,(0,at.c)({"aria-describedby":Z,autoComplete:n,autoFocus:o,defaultValue:d,fullWidth:b,multiline:O,name:A,rows:D,rowsMax:M,maxRows:B,minRows:Q,type:q,value:H,id:x,inputRef:C,onBlur:j,onChange:P,onFocus:I,placeholder:L,inputProps:E},$,T));return i.createElement(gC,(0,at.c)({className:(0,kn.c)(s.root,l),disabled:h,error:m,fullWidth:b,hiddenLabel:_,ref:t,required:N,color:u,variant:G},V),k&&i.createElement(_C,(0,at.c)({htmlFor:x,id:J},w),k),F?i.createElement(wo,(0,at.c)({"aria-describedby":Z,id:x,labelId:J,value:H,input:ee},z),a):ee,y&&i.createElement(wC,(0,at.c)({id:Z},g),y))}));const CC=(0,Gn.c)({root:{}},{name:"MuiTextField"})(TC);var kC=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.component,s=void 0===a?"div":a,l=e.disablePointerEvents,c=void 0!==l&&l,u=e.disableTypography,d=void 0!==u&&u,p=e.position,h=e.variant,f=(0,Yn.c)(e,["children","classes","className","component","disablePointerEvents","disableTypography","position","variant"]),m=Gi()||{},g=h;return h&&m.variant,m&&!g&&(g=m.variant),i.createElement(Vi.Provider,{value:null},i.createElement(s,(0,at.c)({className:(0,kn.c)(r.root,o,"end"===p?r.positionEnd:r.positionStart,c&&r.disablePointerEvents,m.hiddenLabel&&r.hiddenLabel,"filled"===g&&r.filled,"dense"===m.margin&&r.marginDense),ref:t},f),"string"!==typeof n||d?n:i.createElement(Or,{color:"textSecondary"},n)))}));const SC=(0,Gn.c)({root:{display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap"},filled:{"&$positionStart:not($hiddenLabel)":{marginTop:16}},positionStart:{marginRight:8},positionEnd:{marginLeft:8},disablePointerEvents:{pointerEvents:"none"},hiddenLabel:{},marginDense:{}},{name:"MuiInputAdornment"})(kC);var OC=i.forwardRef((function(e,t){e.checked;var n=e.classes,r=e.className,o=e.control,a=e.disabled,s=(e.inputRef,e.label),l=e.labelPlacement,c=void 0===l?"end":l,u=(e.name,e.onChange,e.value,(0,Yn.c)(e,["checked","classes","className","control","disabled","inputRef","label","labelPlacement","name","onChange","value"])),d=$i(),p=a;"undefined"===typeof p&&"undefined"!==typeof o.props.disabled&&(p=o.props.disabled),"undefined"===typeof p&&d&&(p=d.disabled);var h={disabled:p};return["checked","name","onChange","value","inputRef"].forEach((function(t){"undefined"===typeof o.props[t]&&"undefined"!==typeof e[t]&&(h[t]=e[t])})),i.createElement("label",(0,at.c)({className:(0,kn.c)(n.root,r,"end"!==c&&n["labelPlacement".concat((0,Zn.c)(c))],p&&n.disabled),ref:t},u),i.cloneElement(o,h),i.createElement(Or,{component:"span",className:(0,kn.c)(n.label,p&&n.disabled)},s))}));const AC=(0,Gn.c)((function(e){return{root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,"&$disabled":{cursor:"default"}},labelPlacementStart:{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},labelPlacementTop:{flexDirection:"column-reverse",marginLeft:16},labelPlacementBottom:{flexDirection:"column",marginLeft:16},disabled:{},label:{"&$disabled":{color:e.palette.text.disabled}}}}),{name:"MuiFormControlLabel"})(OC);var jC=i.forwardRef((function(e,t){var n=e.autoFocus,r=e.checked,o=e.checkedIcon,a=e.classes,s=e.className,l=e.defaultChecked,c=e.disabled,u=e.icon,d=e.id,p=e.inputProps,h=e.inputRef,f=e.name,m=e.onBlur,g=e.onChange,v=e.onFocus,b=e.readOnly,y=e.required,_=e.tabIndex,x=e.type,w=e.value,E=(0,Yn.c)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),T=(0,Ui.c)({controlled:r,default:Boolean(l),name:"SwitchBase",state:"checked"}),C=(0,jr.c)(T,2),k=C[0],S=C[1],O=$i(),A=c;O&&"undefined"===typeof A&&(A=O.disabled);var j="checkbox"===x||"radio"===x;return i.createElement(Cr,(0,at.c)({component:"span",className:(0,kn.c)(a.root,s,k&&a.checked,A&&a.disabled),disabled:A,tabIndex:null,role:void 0,onFocus:function(e){v&&v(e),O&&O.onFocus&&O.onFocus(e)},onBlur:function(e){m&&m(e),O&&O.onBlur&&O.onBlur(e)},ref:t},E),i.createElement("input",(0,at.c)({autoFocus:n,checked:r,defaultChecked:l,className:a.input,disabled:A,id:j&&d,name:f,onChange:function(e){var t=e.target.checked;S(t),g&&g(e,t)},readOnly:b,ref:h,required:y,tabIndex:_,type:x,value:w},p)),k?o:u)}));const PC=(0,Gn.c)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(jC),IC=(0,In.c)(i.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),LC=(0,In.c)(i.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),RC=(0,In.c)(i.createElement("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");var NC=i.createElement(LC,null),DC=i.createElement(IC,null),MC=i.createElement(RC,null),BC=i.forwardRef((function(e,t){var n=e.checkedIcon,r=void 0===n?NC:n,o=e.classes,a=e.color,s=void 0===a?"secondary":a,l=e.icon,c=void 0===l?DC:l,u=e.indeterminate,d=void 0!==u&&u,p=e.indeterminateIcon,h=void 0===p?MC:p,f=e.inputProps,m=e.size,g=void 0===m?"medium":m,v=(0,Yn.c)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),b=d?h:c,y=d?h:r;return i.createElement(PC,(0,at.c)({type:"checkbox",classes:{root:(0,kn.c)(o.root,o["color".concat((0,Zn.c)(s))],d&&o.indeterminate),checked:o.checked,disabled:o.disabled},color:s,inputProps:(0,at.c)({"data-indeterminate":d},f),icon:i.cloneElement(b,{fontSize:void 0===b.props.fontSize&&"small"===g?g:b.props.fontSize}),checkedIcon:i.cloneElement(y,{fontSize:void 0===y.props.fontSize&&"small"===g?g:y.props.fontSize}),ref:t},v))}));const QC=(0,Gn.c)((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,or.W4)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,or.W4)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(BC);var UC=n(4968),FC=n(3564);const zC=5e3,qC=e=>{var t,n;let{onChange:r,value:o,name:a,multiline:s,disabled:l,error:c,translationButonDisabled:u=!1}=e;const{translate:d}=(0,i.useContext)(Fb),[p,h]=(0,i.useState)(!1),{language:f}=mn();let m;const g=new Blob([null===o||void 0===o?void 0:o[f]]).size>=zC;m="en"===f?["en","fr"]:["fr","en"];const v=m[1],b=(null===o||void 0===o||null===(t=o.translations)||void 0===t||null===(n=t[v])||void 0===n?void 0:n.verified)||!1;function y(e,t){return{...e,[v]:{verified:t,...!t&&{message:"text translated using the Amazon translate service / texte traduit \xe0 l'aide du service de traduction Amazon"}}}}function _(e){const{translations:t,...n}={...o},i={...n,[e.target.name]:e.target.value,...e.target.name===v&&e.target.value&&{translations:t||y({},!1)}};r({target:{name:a,value:i}})}return(0,i.useEffect)((()=>{if(o&&!o.translations){if(o.en&&o.fr){const e={...o,translations:{[v]:{verified:!1,message:"text translated using the Amazon translate service / texte traduit \xe0 l'aide du service de traduction Amazon"}}};r({target:{name:a,value:e}})}}}),[a,r,o,v]),(0,Ap.jsx)("div",{children:m.map(((e,t)=>(0,Ap.jsxs)("div",{children:[(0,Ap.jsx)(CC,{name:e,fullWidth:!0,value:(null===o||void 0===o?void 0:o[e])||"",onChange:e=>_(e),InputProps:{startAdornment:(0,Ap.jsx)(SC,{position:"start",children:e.toUpperCase()})},multiline:s,disabled:l,error:Boolean(c)}),0===t&&!u&&(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Translate english to french",fr:"Traduire du fran\xe7ais en anglais"}),children:(0,Ap.jsxs)("span",{children:[(0,Ap.jsx)(c_,{style:{margin:"10px"},startIcon:p?(0,Ap.jsx)(r_,{size:20}):(0,Ap.jsx)(UC.c,{}),endIcon:p?null:(0,Ap.jsx)(FC.c,{}),disabled:l||p||!(null!==o&&void 0!==o&&o[e])||g,onClick:()=>{h(!0),d({text:o[e],fromLang:e}).then((e=>{h(!1);const t=e.data;_({target:{name:v,value:t}})}))},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Translate"}),(0,Ap.jsx)(Ip,{children:"Traduire"})]})}),(null===o||void 0===o?void 0:o[v])&&(0,Ap.jsx)(AC,{control:(0,Ap.jsx)(QC,{checked:b,onChange:e=>function(e){const{checked:t}=e.target,n={...o,translations:y(o.translations,t)};r({target:{name:a,value:n}})}(e),color:"primary"}),label:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"I have verified this translation"}),(0,Ap.jsx)(Ip,{children:"J'ai v\xe9rifi\xe9 cette traduction"})]})}),g&&(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:["Translation is disabled because text is larger than"," ",zC," characters."]}),(0,Ap.jsxs)(Ip,{children:["La traduction est d\xe9sactiv\xe9e car le texte est plus grand que ",zC," caract\xe8res."]})]})]})})]},e)))})};function HC(e,t,n){var r=this,o=(0,i.useRef)(null),a=(0,i.useRef)(0),s=(0,i.useRef)(null),l=(0,i.useRef)([]),c=(0,i.useRef)(),u=(0,i.useRef)(),d=(0,i.useRef)(e),p=(0,i.useRef)(!0);(0,i.useEffect)((function(){d.current=e}),[e]);var h=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var f=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,g="maxWait"in n,v=g?Math.max(+n.maxWait||0,t):null;(0,i.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]);var b=(0,i.useMemo)((function(){var e=function(e){var t=l.current,n=c.current;return l.current=c.current=null,a.current=e,u.current=d.current.apply(n,t)},n=function(e,t){h&&cancelAnimationFrame(s.current),s.current=h?requestAnimationFrame(e):setTimeout(e,t)},i=function(e){if(!p.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||g&&e-a.current>=v},b=function(t){return s.current=null,m&&l.current?e(t):(l.current=c.current=null,u.current)},y=function e(){var r=Date.now();if(i(r))return b(r);if(p.current){var s=t-(r-o.current),l=g?Math.min(s,v-(r-a.current)):s;n(e,l)}},_=function(){var d=Date.now(),h=i(d);if(l.current=[].slice.call(arguments),c.current=r,o.current=d,h){if(!s.current&&p.current)return a.current=o.current,n(y,t),f?e(o.current):u.current;if(g)return n(y,t),e(o.current)}return s.current||n(y,t),u.current};return _.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,l.current=o.current=c.current=s.current=null},_.isPending=function(){return!!s.current},_.flush=function(){return s.current?b(Date.now()):u.current},_}),[f,g,t,v,m,h]);return b}function WC(e,t){return e===t}function GC(e){return"function"==typeof e?function(){return e}:e}function VC(e,t,n){var r,o,a=n&&n.equalityFn||WC,s=(r=(0,i.useState)(GC(e)),o=r[1],[r[0],(0,i.useCallback)((function(e){return o(GC(e))}),[])]),l=s[0],c=s[1],u=HC((0,i.useCallback)((function(e){return c(e)}),[c]),t,n),d=(0,i.useRef)(e);return a(d.current,e)||(u(e),d.current=e),[l,u]}const $C=e=>{let{children:t}=e;return(0,Ap.jsx)(Or,{variant:"body2",component:"div",style:{marginTop:"10px"},children:t})},KC=e=>{let{children:t}=e;return(0,Ap.jsx)(Or,{variant:"body1",component:"div",style:{marginBottom:"10px"},children:t})},YC=e=>{let{children:t}=e;return(0,Ap.jsx)(Or,{variant:"h6",component:"div",children:t})},ZC={padding:"10px",margin:"20px",width:"90%"};const JC=async function(e,t,n,r){const i=Zp(Yp(),"updateDraftDoi"),o=Fx(e,n,t,r);delete o.data.type,delete o.data.attributes.prefix;const a={doi:e.datasetIdentifier.replace("https://doi.org/",""),region:t,data:o};return(await i(a)).data.status},XC=e=>{let{record:t,name:n,handleUpdateDatasetIdentifier:r,handleUpdateDoiCreationStatus:o,disabled:a}=e;const{createDraftDoi:s,deleteDraftDoi:l,getDoiStatus:c,datacitePrefix:u}=(0,i.useContext)(Fb),{language:d,region:p,userID:h}=mn(),f=Px(t.datasetIdentifier),[m,g]=(0,i.useState)(!1),[v,b]=(0,i.useState)(!1),[y]=VC(t.datasetIdentifier,1e3),[_,x]=(0,i.useState)(!1),[w,E]=(0,i.useState)(!1),[T,C]=(0,i.useState)(!1),[k,S]=(0,i.useState)(!1),O=m||_||""!==t.doiCreationStatus||""===t.recordID,A=Boolean(u),j=f&&u&&t.doiCreationStatus&&""!==t.doiCreationStatus,P=f&&u&&""!==t.doiCreationStatus&&t.datasetIdentifier.includes(u),I=f&&u&&""!==t.doiCreationStatus&&!v&&t.datasetIdentifier.includes(u),L=(0,i.useRef)(!1);return(0,i.useEffect)((()=>{if(L.current=!0,""===y)o({target:{name:n,value:""}});else if(y&&u&&f){let e=y;y.includes("doi.org/")&&(e=y.split("doi.org/").pop()),c({doi:e,region:p}).then((e=>{L.current&&o({target:{name:n,value:e.data}})})).catch((e=>{console.error(e)}))}return()=>{L.current=!1}}),[y,c,f]),(0,Ap.jsxs)(Xn,{style:ZC,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"What is the DOI for this dataset? Eg,"}),(0,Ap.jsx)(Ip,{children:"Quel est le DOI de ce jeu de donn\xe9es ? Par exemple,"})]})," ","https://doi.org/10.0000/0000",A&&(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:(0,Ap.jsx)("p",{children:"Please save the form before generating a draft DOI."})}),(0,Ap.jsx)(Ip,{children:(0,Ap.jsx)("p",{children:"Veuillez enregistrer le formulaire avant de g\xe9n\xe9rer un brouillon de DOI."})})]})})]}),A&&(0,Ap.jsx)(c_,{onClick:()=>async function(){x(!0);const e=Bb(Cp);try{const n=Fx(t,d,p,u);await s({record:n,region:p}).then((e=>e.data.data.attributes)).then((async n=>{r({target:{value:"https://doi.org/".concat(n.doi)}}),o({target:{value:"draft"}});const i={...t,datasetIdentifier:"https://doi.org/".concat(n.doi),doiCreationStatus:"draft"},a=xb(e,"".concat(p,"/users/").concat(h,"/records"));t.recordID&&await kb(wb(a,t.recordID),{datasetIdentifier:i.datasetIdentifier,doiCreationStatus:i.doiCreationStatus}),g(!0)})).finally((()=>{x(!1)}))}catch(n){throw b(!0),new Error("Error in handleGenerateDOI: ".concat(n))}}(),disabled:O,style:{display:"inline",marginRight:"15px"},children:(0,Ap.jsx)("div",{style:{display:"flex",alignItems:"center"},children:_?(0,Ap.jsxs)(Ap.Fragment,{children:[(0,Ap.jsx)(r_,{size:24,style:{marginRight:"8px"}}),"Loading..."]}):"Generate DOI"})}),P&&(0,Ap.jsx)(c_,{onClick:()=>async function(){E(!0);try{200===await JC(t,p,d,u)?(S(!0),b(!1)):(b(!0),S(!1))}catch(e){throw b(!0),e}finally{E(!1),setTimeout((()=>{S(!1)}),3e3)}}(),disabled:["not found","unknown"].includes(t.doiCreationStatus),style:{display:"inline",marginRight:"15px"},children:(0,Ap.jsx)("div",{style:{display:"flex",alignItems:"center"},children:w?(0,Ap.jsxs)(Ap.Fragment,{children:[(0,Ap.jsx)(r_,{size:24,style:{marginRight:"8px"}}),"Loading..."]}):"Update DOI"})}),I&&(0,Ap.jsx)(c_,{onClick:()=>async function(){C(!0);const e=Bb(Cp);try{const i=t.datasetIdentifier.replace("https://doi.org/","");l({doi:i,region:p}).then((e=>e.data)).then((async i=>{if(204===i){r({target:{name:n,value:""}}),o({target:{name:n,value:""}});const i={...t,datasetIdentifier:"",doiCreationStatus:""},a=xb(e,"".concat(p,"/users/").concat(h,"/records"));t.recordID&&await kb(wb(a,t.recordID),{datasetIdentifier:i.datasetIdentifier,doiCreationStatus:i.doiCreationStatus}),g(!1)}else b(!0)})).finally((()=>{C(!1)}))}catch(i){throw console.error(i),b(!0),i}}(),disabled:"draft"!==t.doiCreationStatus,style:{display:"inline",marginRight:"15px"},children:(0,Ap.jsx)("div",{style:{display:"flex",alignItems:"center"},children:T?(0,Ap.jsxs)(Ap.Fragment,{children:[(0,Ap.jsx)(r_,{size:24,style:{marginRight:"8px"}}),"Loading..."]}):"Delete DOI"})}),v&&(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Lp,{en:"Error occurred with DOI API",fr:"Une erreur s'est produite avec l'API DOI"})}),k&&(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Lp,{en:"DOI has been updated",fr:"Le DOI a \xe9t\xe9 mis \xe0 jour"})}),(0,Ap.jsx)(CC,{style:{marginTop:"10px"},name:n||"datasetIdentifier",helperText:(f?"":(0,Ap.jsx)(Lp,{en:"Invalid DOI",fr:"DOI non valide"}))||j&&(0,Ap.jsx)(Lp,{en:"DOI Status: ".concat(t.doiCreationStatus),fr:"Statut DOI: ".concat(t.doiCreationStatus)}),error:!f,value:t.datasetIdentifier,onChange:e=>r(e),disabled:a,fullWidth:!0})]})};const ek=function(e){let{passes:t}=e;return t?(0,Ap.jsxs)("span",{style:{color:"green",fontSize:"x-large",position:"relative",bottom:"-4px"},children:[" ","\u2713"," "]}):(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Required",fr:"Obligatoire"}),children:(0,Ap.jsxs)("span",{style:{color:"red",fontSize:"large"},children:[" ","\u2735"," "]})})},tk={custodian:{title:{en:"Metadata Custodian",fr:"D\xe9positaire des m\xe9tadonn\xe9es"},text:{en:"Party that accepts accountability and responsibility for the resource and ensures appropriate care and maintenance of the resource ",fr:"Partie qui accepte la reddition de comptes et la responsabilit\xe9 de la ressource et assure le soin et l'entretien appropri\xe9s de la ressource "},required:!0,showProminently:!0},owner:{title:{en:"Data Owner",fr:"Propri\xe9taire des donn\xe9es"},text:{en:"Party that owns the resource",fr:"Partie propri\xe9taire de la ressource"},required:!0,showProminently:!0},distributor:{title:{en:"Distributor",fr:"Distributeur"},text:{en:"Party who distributes the resource",fr:"Partie qui distribue la ressource"},showProminently:!0},author:{title:{en:"Author",fr:"Auteur"},text:{en:"Party who authored the resource"}},coAuthor:{title:{en:"Coauthor",fr:"Co-auteur"},text:{en:"Party who jointly authors the resource",fr:"Partie qui est l'auteur conjoint de la ressource"}},collaborator:{title:{en:"Collaborator",fr:"Collaborateur"},text:{en:"Party who assists with the generation of the resource other than the principal investigator",fr:"Partie qui aide \xe0 la production de la ressource autre que le chercheur principal"}},contributor:{title:{en:"Contributor",fr:"Contributeur"},text:{en:"Party contributing to the resource",fr:"Partie contribuant \xe0 la ressource"}},editor:{title:{en:"Editor",fr:"\xc9diteur"},text:{en:"Party who reviewed or modified the resource to improve the content",fr:"Partie qui a examin\xe9 ou modifi\xe9 la ressource pour am\xe9liorer le contenu"}},funder:{title:{en:"Funder",fr:"Financeur"},text:{en:"Party providing monetary support for the resource",fr:"Partie fournissant un soutien mon\xe9taire pour la ressource"}},mediator:{title:{en:"Mediator",fr:"M\xe9diateur"},text:{en:"A class of entity that mediates access to the resource and for whom the resource is intended or useful ",fr:"Classe d'entit\xe9 qui sert de m\xe9diateur \xe0 l'acc\xe8s \xe0 la ressource et pour laquelle la ressource est destin\xe9e ou utile"}},originator:{title:{en:"Originator",fr:"Initiateur"},text:{en:"Party who created the resource",fr:"Partie qui a cr\xe9\xe9 la ressource"}},pointOfContact:{title:{en:"Point Of Contact",fr:"Point de contact"},text:{en:"Party who can be contacted for acquiring knowledge about or acquisition of the resource",fr:"Partie qui peut \xeatre contact\xe9e pour acqu\xe9rir des connaissances sur la ressource ou l'acquisition de la ressource"}},principalInvestigator:{title:{en:"Principal Investigator",fr:"Responsable de recherche"},text:{en:"Key party responsible for gathering information and conducting research",fr:"Partie cl\xe9 responsable de la collecte de l'information et de la r\xe9alisation de la recherche"}},processor:{title:{en:"Processor",fr:"Transformateur"},text:{en:"Party who has processed the data in a manner such that the resource has been modified",fr:"Partie qui a trait\xe9 les donn\xe9es d'une mani\xe8re telle que la ressource a \xe9t\xe9 modifi\xe9e"}},publisher:{title:{en:"Publisher",fr:"Editeur"},text:{en:"Party who published the resource",fr:"Partie qui a publi\xe9 la ressource"}},resourceProvider:{title:{en:"Resource Provider",fr:"Fournisseur de ressources"},text:{en:"Party that supplies the resource",fr:"Partie qui fournit la ressource "}},rightsHolder:{title:{en:"Rights Holder",fr:"Ayant droit"},text:{en:"Party owning or managing rights over the resource ",fr:"Partie d\xe9tenant ou g\xe9rant des droits sur la ressource"}},sponsor:{title:{en:"Sponsor",fr:"Commanditaire"},text:{en:"Party who speaks for the resource ",fr:"Parti qui parle pour la ressource"}},stakeholder:{title:{en:"Stakeholder",fr:"Actionnaire"},text:{en:"Party who has an interest in the resource or the use of the resource ",fr:"Partie qui a un int\xe9r\xeat dans la ressource ou l'utilisation de la ressource"}}},nk={onGoing:{title:{en:"Ongoing",fr:"En cours"},text:{en:"Data is continually being updated. e.g satellite dataset that continues to be augmented",fr:"Les donn\xe9es sont continuellement mises \xe0 jour, par exemple un ensemble de donn\xe9es satellite qui continue d'\xeatre augment\xe9"}},historicalArchive:{title:{en:"Historical Archive",fr:"Archives historiques"},text:{en:"Data has been stored in an offline storage facility. use to indicate data are archived",fr:"Les donn\xe9es ont \xe9t\xe9 stock\xe9es dans une installation de stockage hors connexion. Utilisez pour indiquer que les donn\xe9es sont archiv\xe9es"}},completed:{title:{en:"Completed",fr:"Termin\xe9"},text:{en:"Production of the data has been completed \te.g. raw data that is not ongoing, completed model",fr:"La production des donn\xe9es a \xe9t\xe9 termin\xe9e, p. ex. donn\xe9es brutes qui ne sont pas en cours, mod\xe8le termin\xe9"}}},rk={heightPositive:{en:"Depth Positive",fr:"Profondeur positive"},depthPositive:{en:"Height Positive",fr:"Hauteur positive"}},ik={Book:{title:{en:"Book",fr:"Livre"},text:{en:"A medium for recording information in the form of writing or images, typically composed of many pages bound together and protected by a cover.",fr:"Support d'enregistrement d'informations sous forme d'\xe9crits ou d'images, g\xe9n\xe9ralement compos\xe9 de plusieurs pages reli\xe9es ensemble et prot\xe9g\xe9es par une couverture."},isoValue:"document"},DataCollectionSampling:{title:{en:"Data Collection (sampling)",fr:"Collecte de donn\xe9es (\xe9chantillonnage)"},text:{en:"sampling methods or protocols",fr:"m\xe9thodes ou protocoles d\u2019\xe9chantillonnage"},isoValue:"collectionSession"},Dataset:{title:{en:"Dataset",fr:"Base de donn\xe9es"},text:{en:"Data encoded in a defined structure.",fr:"Donn\xe9es cod\xe9es dans une structure d\xe9finie."},isoValue:"dataset"},Model:{title:{en:"Model",fr:"Mod\xe8le"},text:{en:"An abstract, conceptual, graphical, mathematical or visualization model that represents empirical objects, phenomena, or physical processes.",fr:"Mod\xe8le abstrait, conceptuel, graphique, math\xe9matique ou de visualisation qui repr\xe9sente des objets empiriques, des ph\xe9nom\xe8nes ou des processus physiques."},isoValue:"model"},Preprint:{title:{en:"Preprint",fr:"Pr\xe9impression"},text:{en:"A version of a scholarly or scientific paper that precedes formal peer review and publication in a peer - reviewed scholarly or scientific journal.",fr:"Version d'un article scientifique ou scientifique qui pr\xe9c\xe8de l'examen formel par les pairs et la publication dans une revue universitaire ou scientifique \xe0 comit\xe9 de lecture."},isoValue:"document"},Report:{title:{en:"Report",fr:"Rapport"},text:{en:"A document that presents information in an organized format for a specific audience and purpose.",fr:"Un document qui pr\xe9sente des informations dans un format organis\xe9 pour un public et un objectif sp\xe9cifiques."},isoValue:"document"},Software:{title:{en:"Software",fr:"Logiciel"},text:{en:"A computer program other than a computational notebook, in either source code(text) or compiled form.Use this type for general software components supporting scholarly research.Use the \u201cComputationalNotebook\u201d value for virtual notebooks.",fr:"Un programme informatique autre qu'un cahier de calcul, sous forme de code source (texte) ou sous forme compil\xe9e. Utilisez ce type pour les composants logiciels g\xe9n\xe9raux prenant en charge la recherche scientifique. Utilisez la valeur \xab ComputationalNotebook \xbb pour les blocs-notes virtuels."},isoValue:"software"},Text:{title:{en:"Text",fr:"Texte"},text:{en:"A resource consisting primarily of words for reading that is not covered by any other textual resource type in this list.",fr:"Une ressource compos\xe9e principalement de mots \xe0 lire qui n'est couverte par aucun autre type de ressource textuelle de cette liste."},isoValue:"document"},Other:{title:{en:"Other",fr:"Autre"},text:{en:"other",fr:"autre"},isoValue:"dataset"}},ok={IsCitedBy:{title:{en:"Is Cited By",fr:"Est cit\xe9 par"},text:{en:"A is cited by B",fr:"A est cit\xe9 par B"},isoValue:"crossReference"},Cites:{title:{en:"Cites",fr:"Cites"},text:{en:"A cites B",fr:"A cite B"},isoValue:"crossReference"},IsSupplementTo:{title:{en:"Is Supplement To",fr:"Est un suppl\xe9ment \xe0"},text:{en:"A is supplement to B",fr:"A est un compl\xe9ment \xe0 B"},isoValue:"crossReference"},IsSupplementedBy:{title:{en:"Is Supplemented By",fr:"Est compl\xe9t\xe9 par"},text:{en:"A is supplemented by B",fr:"A est compl\xe9t\xe9 par B"},isoValue:"crossReference"},IsContinuedBy:{title:{en:"Is Continued By",fr:"Est continu\xe9 par"},text:{en:"A is continued by B",fr:"A est continu\xe9 par B"},isoValue:"series"},Continues:{title:{en:"Continues",fr:"Continue"},text:{en:"A continues B",fr:"A continue B"},isoValue:"series"},IsDescribedBy:{title:{en:"Is Described By",fr:"Est d\xe9crit par"},text:{en:"A is described by B",fr:"A est d\xe9crit par B"},isoValue:"crossReference"},Describes:{title:{en:"Describes",fr:"D\xe9crit"},text:{en:"A describes B",fr:"A d\xe9crit B"},isoValue:"crossReference"},HasMetadata:{title:{en:"Has Metadata",fr:"Poss\xe8de des m\xe9tadonn\xe9es"},text:{en:"A has metadata B",fr:"A a des m\xe9tadonn\xe9es B"},isoValue:"crossReference"},IsMetadataFor:{title:{en:"Is Metadata For",fr:"Les m\xe9tadonn\xe9es sont-elles destin\xe9es"},text:{en:"A is metadata for B",fr:"A est une m\xe9tadonn\xe9e pour B"},isoValue:"crossReference"},HasVersion:{title:{en:"Has Version",fr:"A une version"},text:{en:"A has version B",fr:"A a la version B"},isoValue:"revisionOf"},IsVersionOf:{title:{en:"Is Version Of",fr:"Est la version de"},text:{en:"A is version of B",fr:"A est la version de B"},isoValue:"revisionOf"},IsNewVersionOf:{title:{en:"Is New Version Of",fr:"Est-ce une nouvelle version de"},text:{en:"A is new version of B",fr:"A est une nouvelle version de B"},isoValue:"revisionOf"},PreviousVersionOf:{title:{en:"Previous Version Of",fr:"Version pr\xe9c\xe9dente de"},text:{en:"A is previous version of B",fr:"A est la version pr\xe9c\xe9dente de B"},isoValue:"crossReference"},IsPartOf:{title:{en:"Is Part Of",fr:"Fait partie de"},text:{en:"A is part of B",fr:"A fait partie de B"},isoValue:"largerWorkCitation"},HasPart:{title:{en:"Has Part",fr:"A une partie"},text:{en:"A has part B",fr:"A a la partie B"},isoValue:"isComposedOf"},IsPublishedIn:{title:{en:"Is Published In",fr:"Est publi\xe9 dans"},text:{en:"A is published in B",fr:"A est publi\xe9 dans B"},isoValue:"largerWorkCitation"},IsReferencedBy:{title:{en:"Is Referenced By",fr:"Est r\xe9f\xe9renc\xe9 par"},text:{en:"A is referenced by B",fr:"A est r\xe9f\xe9renc\xe9 par B"},isoValue:"crossReference"},References:{title:{en:"References",fr:"Les r\xe9f\xe9rences"},text:{en:"A references B",fr:"A r\xe9f\xe9rences B"},isoValue:"crossReference"},IsDocumentedBy:{title:{en:"Is Documented By",fr:"Est document\xe9 par"},text:{en:"A is documented by B",fr:"A est document\xe9 par B"},isoValue:"crossReference"},Documents:{title:{en:"Documents",fr:"Documents"},text:{en:"A documents B",fr:"Un document B"},isoValue:"crossReference"},IsCompiledBy:{title:{en:"Is Compiled By",fr:"Est compil\xe9 par"},text:{en:"A is compiled by B",fr:"A est compil\xe9 par B"},isoValue:"dependency"},Compiles:{title:{en:"Compiles",fr:"Compile"},text:{en:"A compiles B",fr:"A compile B"},isoValue:"dependency"},IsVariantFormOf:{title:{en:"Is Variant Form Of",fr:"Est une forme variante de"},text:{en:"A is variant form of B",fr:"A est une variante de B"},isoValue:"crossReference"},IsOriginalFormOf:{title:{en:"Is Original Form Of",fr:"Est la forme originale de"},text:{en:"A is original form of B",fr:"A est la forme originale de B"},isoValue:"crossReference"},IsIdenticalTo:{title:{en:"Is Identical To",fr:"Est identique \xe0"},text:{en:"A is identical to B",fr:"A est identique \xe0 B"},isoValue:"crossReference"},IsReviewedBy:{title:{en:"Is Reviewed By",fr:"Est r\xe9vis\xe9 par"},text:{en:"A is reviewed by B",fr:"A est examin\xe9 par B"},isoValue:"crossReference"},Reviews:{title:{en:"Reviews",fr:"Commentaires"},text:{en:"A reviews B",fr:"A avis B"},isoValue:"crossReference"},IsDerivedFrom:{title:{en:"Is Derived From",fr:"D\xe9rive de"},text:{en:"A is derived from B",fr:"A est d\xe9riv\xe9 de B"},isoValue:"dependency"},IsSourceOf:{title:{en:"Is Source Of",fr:"est la source de"},text:{en:"A is source of B",fr:"A est la source de B"},isoValue:"dependency"},Requires:{title:{en:"Requires",fr:"A besoin"},text:{en:"A requires B",fr:"A n\xe9cessite B"},isoValue:"dependency"},IsRequiredBy:{title:{en:"Is Required By",fr:"Est requis par"},text:{en:"A is required by B",fr:"A est requis par B"},isoValue:"dependency"},IsObsoletedBy:{title:{en:"Is Obsoleted By",fr:"Est obsol\xe8te par"},text:{en:"A is obsoleted by B",fr:"A est obsol\xe8te par B"},isoValue:"crossReference"},Obsoletes:{title:{en:"Obsoletes",fr:"Obsol\xe8tes"},text:{en:"A obsoletes B",fr:"A rend obsol\xe8te B"},isoValue:"revisionOf"}},ak=["ARK","arXiv","bibcode","ca.cioos","DOI","EAN13","EISSN","Handle","IGSN","ISBN","ISSN","ISTC","LISSN","LSID","PMID","PURL","UPC","URL","URN","w3id"],sk=e=>{let{onChange:t,value:n=[],name:r,options:i,optionLabels:o=i,optionTooltips:a=[],disabled:s,labelSize:l=3}=e;return(0,Ap.jsx)(e_,{container:!0,direction:"row",children:i.map(((e,i)=>(0,Ap.jsx)(e_,{item:!0,xs:l,children:(0,Ap.jsx)(ms,{title:a[i]||"",children:(0,Ap.jsx)(AC,{disabled:s,control:(0,Ap.jsx)(QC,{value:e||[],name:r,checked:n.includes(e),onChange:e=>{const r=e.target.value,i=(o=r,(a=n).includes(o)?a.filter((e=>e!==o)):a.concat(o));var o,a;t(i)}}),label:(0,Ap.jsx)(Or,{children:o[i]})})})},i)))})};var lk=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.color,a=void 0===o?"default":o,s=e.component,l=void 0===s?"li":s,c=e.disableGutters,u=void 0!==c&&c,d=e.disableSticky,p=void 0!==d&&d,h=e.inset,f=void 0!==h&&h,m=(0,Yn.c)(e,["classes","className","color","component","disableGutters","disableSticky","inset"]);return i.createElement(l,(0,at.c)({className:(0,kn.c)(n.root,r,"default"!==a&&n["color".concat((0,Zn.c)(a))],f&&n.inset,!p&&n.sticky,!u&&n.gutters),ref:t},m))}));const ck=(0,Gn.c)((function(e){return{root:{boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:e.palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},colorPrimary:{color:e.palette.primary.main},colorInherit:{color:"inherit"},gutters:{paddingLeft:16,paddingRight:16},inset:{paddingLeft:72},sticky:{position:"sticky",top:0,zIndex:1,backgroundColor:"inherit"}}}),{name:"MuiListSubheader"})(lk),uk=(0,In.c)(i.createElement("path",{d:"M19 6.41L17.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"}),"Close"),dk=(0,In.c)(i.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function pk(e){return"undefined"!==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function hk(e,t){for(var n=0;n 0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignoreAccents,n=void 0===t||t,r=e.ignoreCase,i=void 0===r||r,o=e.limit,a=e.matchFrom,s=void 0===a?"any":a,l=e.stringify,c=e.trim,u=void 0!==c&&c;return function(e,t){var r=t.inputValue,a=t.getOptionLabel,c=u?r.trim():r;i&&(c=c.toLowerCase()),n&&(c=pk(c));var d=e.filter((function(e){var t=(l||a)(e);return i&&(t=t.toLowerCase()),n&&(t=pk(t)),"start"===s?0===t.indexOf(c):t.indexOf(c)>-1}));return"number"===typeof o?d.slice(0,o):d}}();function mk(e){var t=e.autoComplete,n=void 0!==t&&t,r=e.autoHighlight,o=void 0!==r&&r,a=e.autoSelect,s=void 0!==a&&a,l=e.blurOnSelect,c=void 0!==l&&l,u=e.clearOnBlur,d=void 0===u?!e.freeSolo:u,p=e.clearOnEscape,h=void 0!==p&&p,f=e.componentName,m=void 0===f?"useAutocomplete":f,g=e.debug,v=void 0!==g&&g,b=e.defaultValue,y=void 0===b?e.multiple?[]:null:b,_=e.disableClearable,x=void 0!==_&&_,w=e.disableCloseOnSelect,E=void 0!==w&&w,T=e.disabledItemsFocusable,C=void 0!==T&&T,k=e.disableListWrap,S=void 0!==k&&k,O=e.filterOptions,A=void 0===O?fk:O,j=e.filterSelectedOptions,P=void 0!==j&&j,I=e.freeSolo,L=void 0!==I&&I,R=e.getOptionDisabled,N=e.getOptionLabel,D=void 0===N?function(e){return e}:N,M=e.getOptionSelected,B=void 0===M?function(e,t){return e===t}:M,Q=e.groupBy,U=e.handleHomeEndKeys,F=void 0===U?!e.freeSolo:U,z=e.id,q=e.includeInputInList,H=void 0!==q&&q,W=e.inputValue,G=e.multiple,V=void 0!==G&&G,$=e.onChange,K=e.onClose,Y=e.onHighlightChange,Z=e.onInputChange,J=e.onOpen,X=e.open,ee=e.openOnFocus,te=void 0!==ee&&ee,ne=e.options,re=e.selectOnFocus,ie=void 0===re?!e.freeSolo:re,oe=e.value,ae=(0,us.c)(z),se=D;var le=i.useRef(!1),ce=i.useRef(!0),ue=i.useRef(null),de=i.useRef(null),pe=i.useState(null),he=pe[0],fe=pe[1],me=i.useState(-1),ge=me[0],ve=me[1],be=o?0:-1,ye=i.useRef(be),_e=(0,Ui.c)({controlled:oe,default:y,name:m}),xe=(0,jr.c)(_e,2),we=xe[0],Ee=xe[1],Te=(0,Ui.c)({controlled:W,default:"",name:m,state:"inputValue"}),Ce=(0,jr.c)(Te,2),ke=Ce[0],Se=Ce[1],Oe=i.useState(!1),Ae=Oe[0],je=Oe[1],Pe=(0,sr.c)((function(e,t){var n;if(V)n="";else if(null==t)n="";else{var r=se(t);n="string"===typeof r?r:""}ke!==n&&(Se(n),Z&&Z(e,n,"reset"))}));i.useEffect((function(){Pe(null,we)}),[we,Pe]);var Ie=(0,Ui.c)({controlled:X,default:!1,name:m,state:"open"}),Le=(0,jr.c)(Ie,2),Re=Le[0],Ne=Le[1],De=!V&&null!=we&&ke===se(we),Me=Re,Be=Me?A(ne.filter((function(e){return!P||!(V?we:[we]).some((function(t){return null!==t&&B(e,t)}))})),{inputValue:De?"":ke,getOptionLabel:se}):[],Qe=(0,sr.c)((function(e){-1===e?ue.current.focus():he.querySelector('[data-tag-index="'.concat(e,'"]')).focus()}));i.useEffect((function(){V&&ge>we.length-1&&(ve(-1),Qe(-1))}),[we,V,ge,Qe]);var Ue=(0,sr.c)((function(e){var t=e.event,n=e.index,r=e.reason,i=void 0===r?"auto":r;if(ye.current=n,-1===n?ue.current.removeAttribute("aria-activedescendant"):ue.current.setAttribute("aria-activedescendant","".concat(ae,"-option-").concat(n)),Y&&Y(t,-1===n?null:Be[n],i),de.current){var o=de.current.querySelector("[data-focus]");o&&o.removeAttribute("data-focus");var a=de.current.parentElement.querySelector('[role="listbox"]');if(a)if(-1!==n){var s=de.current.querySelector('[data-option-index="'.concat(n,'"]'));if(s&&(s.setAttribute("data-focus","true"),a.scrollHeight>a.clientHeight&&"mouse"!==i)){var l=s,c=a.clientHeight+a.scrollTop,u=l.offsetTop+l.offsetHeight;u>c?a.scrollTop=u-a.clientHeight:l.offsetTop-l.offsetHeight*(Q?1.3:0) 1?0:e:t>e?t===e+1&&H?-1:S||Math.abs(r)>1?e:0:t}(),o);if(Ue({index:l,reason:s,event:t}),n&&"reset"!==r)if(-1===l)ue.current.value=ke;else{var c=se(Be[l]);ue.current.value=c,0===c.toLowerCase().indexOf(ke.toLowerCase())&&ke.length>0&&ue.current.setSelectionRange(ke.length,c.length)}}})),ze=i.useCallback((function(){if(Me){var e=V?we[0]:we;if(0!==Be.length&&null!=e){if(de.current)if(P||null==e)ye.current>=Be.length-1?Ue({index:Be.length-1}):Ue({index:ye.current});else{var t=Be[ye.current];if(V&&t&&-1!==hk(we,(function(e){return B(t,e)})))return;var n=hk(Be,(function(t){return B(t,e)}));-1===n?Fe({diff:"reset"}):Ue({index:n})}}else Fe({diff:"reset"})}}),[0===Be.length,!V&&we,P,Fe,Ue,Me,ke,V]),qe=(0,sr.c)((function(e){(0,Br.c)(de,e),e&&ze()}));i.useEffect((function(){ze()}),[ze]);var He=function(e){Re||(Ne(!0),J&&J(e))},We=function(e,t){Re&&(Ne(!1),K&&K(e,t))},Ge=function(e,t,n,r){we!==t&&($&&$(e,t,n,r),Ee(t))},Ve=i.useRef(!1),$e=function(e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"options",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"select-option",i=t;if(V){var o=hk(i=Array.isArray(we)?we.slice():[],(function(e){return B(t,e)}));-1===o?i.push(t):"freeSolo"!==n&&(i.splice(o,1),r="remove-option")}Pe(e,i),Ge(e,i,r,{option:t}),E||We(e,r),(!0===c||"touch"===c&&Ve.current||"mouse"===c&&!Ve.current)&&ue.current.blur()};var Ke=function(e,t){if(V){We(e,"toggleInput");var n=ge;-1===ge?""===ke&&"previous"===t&&(n=we.length-1):((n+="next"===t?1:-1)<0&&(n=0),n===we.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;for(var n=e;;){if("next"===t&&n===we.length||"previous"===t&&-1===n)return-1;var r=he.querySelector('[data-tag-index="'.concat(n,'"]'));if(!r||r.hasAttribute("tabindex")&&!r.disabled&&"true"!==r.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),ve(n),Qe(n)}},Ye=function(e){le.current=!0,Se(""),Z&&Z(e,"","clear"),Ge(e,V?[]:null,"clear")},Ze=function(e){return function(t){switch(-1!==ge&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(ve(-1),Qe(-1)),t.key){case"Home":Me&&F&&(t.preventDefault(),Fe({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":Me&&F&&(t.preventDefault(),Fe({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),Fe({diff:-5,direction:"previous",reason:"keyboard",event:t}),He(t);break;case"PageDown":t.preventDefault(),Fe({diff:5,direction:"next",reason:"keyboard",event:t}),He(t);break;case"ArrowDown":t.preventDefault(),Fe({diff:1,direction:"next",reason:"keyboard",event:t}),He(t);break;case"ArrowUp":t.preventDefault(),Fe({diff:-1,direction:"previous",reason:"keyboard",event:t}),He(t);break;case"ArrowLeft":Ke(t,"previous");break;case"ArrowRight":Ke(t,"next");break;case"Enter":if(229===t.which)break;if(-1!==ye.current&&Me){var r=Be[ye.current],i=!!R&&R(r);if(t.preventDefault(),i)return;$e(t,r,"select-option"),n&&ue.current.setSelectionRange(ue.current.value.length,ue.current.value.length)}else L&&""!==ke&&!1===De&&(V&&t.preventDefault(),$e(t,ke,"create-option","freeSolo"));break;case"Escape":Me?(t.preventDefault(),t.stopPropagation(),We(t,"escape")):h&&(""!==ke||V&&we.length>0)&&(t.preventDefault(),t.stopPropagation(),Ye(t));break;case"Backspace":if(V&&""===ke&&we.length>0){var o=-1===ge?we.length-1:ge,a=we.slice();a.splice(o,1),Ge(t,a,"remove-option",{option:we[o]})}}e.onKeyDown&&e.onKeyDown(t)}},Je=function(e){je(!0),te&&!le.current&&He(e)},Xe=function(e){null===de.current||document.activeElement!==de.current.parentElement?(je(!1),ce.current=!0,le.current=!1,v&&""!==ke||(s&&-1!==ye.current&&Me?$e(e,Be[ye.current],"blur"):s&&L&&""!==ke?$e(e,ke,"blur","freeSolo"):d&&Pe(e,we),We(e,"blur"))):ue.current.focus()},et=function(e){var t=e.target.value;ke!==t&&(Se(t),Z&&Z(e,t,"input")),""===t?x||V||Ge(e,null,"clear"):He(e)},tt=function(e){Ue({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},nt=function(){Ve.current=!0},rt=function(e){var t=Number(e.currentTarget.getAttribute("data-option-index"));$e(e,Be[t],"select-option"),Ve.current=!1},it=function(e){return function(t){var n=we.slice();n.splice(e,1),Ge(t,n,"remove-option",{option:we[e]})}},ot=function(e){Re?We(e,"toggleInput"):He(e)},st=function(e){e.target.getAttribute("id")!==ae&&e.preventDefault()},lt=function(){ue.current.focus(),ie&&ce.current&&ue.current.selectionEnd-ue.current.selectionStart===0&&ue.current.select(),ce.current=!1},ct=function(e){""!==ke&&Re||ot(e)},ut=L&&ke.length>0;ut=ut||(V?we.length>0:null!==we);var dt=Be;if(Q){new Map;dt=Be.reduce((function(e,t,n){var r=Q(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e}),[])}return{getRootProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,at.c)({"aria-owns":Me?"".concat(ae,"-popup"):null,role:"combobox","aria-expanded":Me},e,{onKeyDown:Ze(e),onMouseDown:st,onClick:lt})},getInputLabelProps:function(){return{id:"".concat(ae,"-label"),htmlFor:ae}},getInputProps:function(){return{id:ae,value:ke,onBlur:Xe,onFocus:Je,onChange:et,onMouseDown:ct,"aria-activedescendant":Me?"":null,"aria-autocomplete":n?"both":"list","aria-controls":Me?"".concat(ae,"-popup"):null,autoComplete:"off",ref:ue,autoCapitalize:"none",spellCheck:"false"}},getClearProps:function(){return{tabIndex:-1,onClick:Ye}},getPopupIndicatorProps:function(){return{tabIndex:-1,onClick:ot}},getTagProps:function(e){var t=e.index;return{key:t,"data-tag-index":t,tabIndex:-1,onDelete:it(t)}},getListboxProps:function(){return{role:"listbox",id:"".concat(ae,"-popup"),"aria-labelledby":"".concat(ae,"-label"),ref:qe,onMouseDown:function(e){e.preventDefault()}}},getOptionProps:function(e){var t=e.index,n=e.option,r=(V?we:[we]).some((function(e){return null!=e&&B(n,e)})),i=!!R&&R(n);return{key:t,tabIndex:-1,role:"option",id:"".concat(ae,"-option-").concat(t),onMouseOver:tt,onClick:rt,onTouchStart:nt,"data-option-index":t,"aria-disabled":i,"aria-selected":r}},id:ae,inputValue:ke,value:we,dirty:ut,popupOpen:Me,focused:Ae||-1!==ge,anchorEl:he,setAnchorEl:fe,focusedTag:ge,groupedOptions:dt}}function gk(e){e.anchorEl,e.open;var t=(0,Yn.c)(e,["anchorEl","open"]);return i.createElement("div",t)}var vk=i.createElement(uk,{fontSize:"small"}),bk=i.createElement(dk,null),yk=i.forwardRef((function(e,t){e.autoComplete,e.autoHighlight,e.autoSelect,e.blurOnSelect;var n,r=e.ChipProps,o=e.classes,a=e.className,s=e.clearOnBlur,l=(void 0===s&&e.freeSolo,e.clearOnEscape,e.clearText),c=void 0===l?"Clear":l,u=e.closeIcon,d=void 0===u?vk:u,p=e.closeText,h=void 0===p?"Close":p,f=(e.debug,e.defaultValue),m=(void 0===f&&e.multiple,e.disableClearable),g=void 0!==m&&m,v=(e.disableCloseOnSelect,e.disabled),b=void 0!==v&&v,y=(e.disabledItemsFocusable,e.disableListWrap,e.disablePortal),_=void 0!==y&&y,x=(e.filterOptions,e.filterSelectedOptions,e.forcePopupIcon),w=void 0===x?"auto":x,E=e.freeSolo,T=void 0!==E&&E,C=e.fullWidth,k=void 0!==C&&C,S=e.getLimitTagsText,O=void 0===S?function(e){return"+".concat(e)}:S,A=(e.getOptionDisabled,e.getOptionLabel),j=void 0===A?function(e){return e}:A,P=(e.getOptionSelected,e.groupBy),I=e.handleHomeEndKeys,L=(void 0===I&&e.freeSolo,e.id,e.includeInputInList,e.inputValue,e.limitTags),R=void 0===L?-1:L,N=e.ListboxComponent,D=void 0===N?"ul":N,M=e.ListboxProps,B=e.loading,Q=void 0!==B&&B,U=e.loadingText,F=void 0===U?"Loading\u2026":U,z=e.multiple,q=void 0!==z&&z,H=e.noOptionsText,W=void 0===H?"No options":H,G=(e.onChange,e.onClose,e.onHighlightChange,e.onInputChange,e.onOpen,e.open,e.openOnFocus,e.openText),V=void 0===G?"Open":G,$=(e.options,e.PaperComponent),K=void 0===$?Xn:$,Y=e.PopperComponent,Z=void 0===Y?cs:Y,J=e.popupIcon,X=void 0===J?bk:J,ee=e.renderGroup,te=e.renderInput,ne=e.renderOption,re=e.renderTags,ie=e.selectOnFocus,oe=(void 0===ie&&e.freeSolo,e.size),ae=void 0===oe?"medium":oe,se=(e.value,(0,Yn.c)(e,["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","classes","className","clearOnBlur","clearOnEscape","clearText","closeIcon","closeText","debug","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","getOptionSelected","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","value"])),le=_?gk:Z,ce=mk((0,at.c)({},e,{componentName:"Autocomplete"})),ue=ce.getRootProps,de=ce.getInputProps,pe=ce.getInputLabelProps,he=ce.getPopupIndicatorProps,fe=ce.getClearProps,me=ce.getTagProps,ge=ce.getListboxProps,ve=ce.getOptionProps,be=ce.value,ye=ce.dirty,_e=ce.id,xe=ce.popupOpen,we=ce.focused,Ee=ce.focusedTag,Te=ce.anchorEl,Ce=ce.setAnchorEl,ke=ce.inputValue,Se=ce.groupedOptions;if(q&&be.length>0){var Oe=function(e){return(0,at.c)({className:(0,kn.c)(o.tag,"small"===ae&&o.tagSizeSmall),disabled:b},me(e))};n=re?re(be,Oe):be.map((function(e,t){return i.createElement(pC,(0,at.c)({label:j(e),size:ae},Oe({index:t}),r))}))}if(R>-1&&Array.isArray(n)){var Ae=n.length-R;!we&&Ae>0&&(n=n.splice(0,R)).push(i.createElement("span",{className:o.tag,key:n.length},O(Ae)))}var je=ee||function(e){return i.createElement("li",{key:e.key},i.createElement(ck,{className:o.groupLabel,component:"div"},e.group),i.createElement("ul",{className:o.groupUl},e.children))},Pe=ne||j,Ie=function(e,t){var n=ve({option:e,index:t});return i.createElement("li",(0,at.c)({},n,{className:o.option}),Pe(e,{selected:n["aria-selected"],inputValue:ke}))},Le=!g&&!b,Re=(!T||!0===w)&&!1!==w;return i.createElement(i.Fragment,null,i.createElement("div",(0,at.c)({ref:t,className:(0,kn.c)(o.root,a,we&&o.focused,k&&o.fullWidth,Le&&o.hasClearIcon,Re&&o.hasPopupIcon)},ue(se)),te({id:_e,disabled:b,fullWidth:!0,size:"small"===ae?"small":void 0,InputLabelProps:pe(),InputProps:{ref:Ce,className:o.inputRoot,startAdornment:n,endAdornment:i.createElement("div",{className:o.endAdornment},Le?i.createElement(Cr,(0,at.c)({},fe(),{"aria-label":c,title:c,className:(0,kn.c)(o.clearIndicator,ye&&o.clearIndicatorDirty)}),d):null,Re?i.createElement(Cr,(0,at.c)({},he(),{disabled:b,"aria-label":xe?h:V,title:xe?h:V,className:(0,kn.c)(o.popupIndicator,xe&&o.popupIndicatorOpen)}),X):null)},inputProps:(0,at.c)({className:(0,kn.c)(o.input,-1===Ee&&o.inputFocused),disabled:b},de())})),xe&&Te?i.createElement(le,{className:(0,kn.c)(o.popper,_&&o.popperDisablePortal),style:{width:Te?Te.clientWidth:null},role:"presentation",anchorEl:Te,open:!0},i.createElement(K,{className:o.paper},Q&&0===Se.length?i.createElement("div",{className:o.loading},F):null,0!==Se.length||T||Q?null:i.createElement("div",{className:o.noOptions},W),Se.length>0?i.createElement(D,(0,at.c)({className:o.listbox},ge(),M),Se.map((function(e,t){return P?je({key:e.key,group:e.group,children:e.options.map((function(t,n){return Ie(t,e.index+n)}))}):Ie(e,t)}))):null)):null)}));const _k=(0,Gn.c)((function(e){var t;return{root:{"&$focused $clearIndicatorDirty":{visibility:"visible"},"@media (pointer: fine)":{"&:hover $clearIndicatorDirty":{visibility:"visible"}}},fullWidth:{width:"100%"},focused:{},tag:{margin:3,maxWidth:"calc(100% - 6px)"},tagSizeSmall:{margin:2,maxWidth:"calc(100% - 4px)"},hasPopupIcon:{},hasClearIcon:{},inputRoot:{flexWrap:"wrap","$hasPopupIcon &, $hasClearIcon &":{paddingRight:30},"$hasPopupIcon$hasClearIcon &":{paddingRight:56},"& $input":{width:0,minWidth:30},'&[class*="MuiInput-root"]':{paddingBottom:1,"& $input":{padding:4},"& $input:first-child":{padding:"6px 0"}},'&[class*="MuiInput-root"][class*="MuiInput-marginDense"]':{"& $input":{padding:"4px 4px 5px"},"& $input:first-child":{padding:"3px 0 6px"}},'&[class*="MuiOutlinedInput-root"]':{padding:9,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9.5px 4px"},"& $input:first-child":{paddingLeft:6},"& $endAdornment":{right:9}},'&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]':{padding:6,"& $input":{padding:"4.5px 4px"}},'&[class*="MuiFilledInput-root"]':{paddingTop:19,paddingLeft:8,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9px 4px"},"& $endAdornment":{right:9}},'&[class*="MuiFilledInput-root"][class*="MuiFilledInput-marginDense"]':{paddingBottom:1,"& $input":{padding:"4.5px 4px"}}},input:{flexGrow:1,textOverflow:"ellipsis",opacity:0},inputFocused:{opacity:1},endAdornment:{position:"absolute",right:0,top:"calc(50% - 14px)"},clearIndicator:{marginRight:-2,padding:4,visibility:"hidden"},clearIndicatorDirty:{},popupIndicator:{padding:2,marginRight:-2},popupIndicatorOpen:{transform:"rotate(180deg)"},popper:{zIndex:e.zIndex.modal},popperDisablePortal:{position:"absolute"},paper:(0,at.c)({},e.typography.body1,{overflow:"hidden",margin:"4px 0"}),listbox:{listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto"},loading:{color:e.palette.text.secondary,padding:"14px 16px"},noOptions:{color:e.palette.text.secondary,padding:"14px 16px"},option:(t={minHeight:48,display:"flex",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16},(0,nr.c)(t,e.breakpoints.up("sm"),{minHeight:"auto"}),(0,nr.c)(t,'&[aria-selected="true"]',{backgroundColor:e.palette.action.selected}),(0,nr.c)(t,'&[data-focus="true"]',{backgroundColor:e.palette.action.hover}),(0,nr.c)(t,"&:active",{backgroundColor:e.palette.action.selected}),(0,nr.c)(t,'&[aria-disabled="true"]',{opacity:e.palette.action.disabledOpacity,pointerEvents:"none"}),t),groupLabel:{backgroundColor:e.palette.background.paper,top:-8},groupUl:{padding:0,"& $option":{paddingLeft:24}}}}),{name:"MuiAutocomplete"})(yk),xk=e=>{let{record:t,updateRecord:n,region:r}=e;const[o,a]=(0,i.useState)({}),[s,l]=(0,i.useState)(null),[c,u]=(0,i.useState)({}),[d,p]=(0,i.useState)(!0),h=t.userID;(0,i.useEffect)((()=>{let e=!0;t.recordID&&p(!1);return(async()=>{try{const t=await async function(e){const t=Bb(Cp);try{const n=xb(t,"".concat(e,"/users"));return(await Sb(n)).val()}catch(gh){throw new Error("Error fetching user emails for region ".concat(e,": ").concat(gh))}}(r);e&&a(t)}catch(gh){throw new Error("Error loading region users: ".concat(gh))}})(),()=>{e=!1}}),[r,t.recordID]),(0,i.useEffect)((()=>{const e={};Object.keys(t.sharedWith||{}).forEach((t=>{var n,r;const i=null===(n=o[t])||void 0===n||null===(r=n.userinfo)||void 0===r?void 0:r.displayName;i&&(e[t]={name:i})})),u(e)}),[t.sharedWith,o]);const f=Object.entries(o).map((e=>{var t;let[n,r]=e;return{label:null===(t=r.userinfo)||void 0===t?void 0:t.displayName,userID:n}})).filter((e=>e.label)).sort(((e,t)=>e.label.localeCompare(t.label)));return(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsxs)(Xn,{style:ZC,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,style:{margin:"10px"},children:[(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"To share editing access with another user, start typing their name and select from the suggestions."}),(0,Ap.jsx)(Ip,{children:"Pour partager l'acc\xe8s en modification avec un autre utilisateur, commencez \xe0 saisir son nom et s\xe9lectionnez parmi les suggestions."})]})}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:(0,Ap.jsx)("p",{children:"Please save the form before sharing access."})}),(0,Ap.jsx)(Ip,{children:(0,Ap.jsx)("p",{children:"Veuillez enregistrer le formulaire avant de partager l'acc\xe8s."})})]})})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{margin:"10px"},children:(0,Ap.jsxs)(e_,{container:!0,spacing:2,children:[(0,Ap.jsxs)(e_,{item:!0,xs:6,children:[(0,Ap.jsx)(_k,{id:"share-with-emails",options:f,getOptionLabel:e=>e.label,getOptionSelected:(e,t)=>e.userID===t.userID,value:s,onChange:(e,t)=>l(t),fullWidth:!0,filterSelectedOptions:!0,renderInput:e=>(0,Ap.jsx)(CC,{...e,label:(0,Ap.jsx)(Lp,{en:"Share with...",fr:"Partager avec..."}),variant:"outlined",style:{marginTop:"16px"}})}),(0,Ap.jsx)(c_,{disabled:d,startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>{s&&((e=>{const i={...t.sharedWith,[e]:!0};u(i),n("sharedWith")(i),(async()=>{try{await q_(e,t.recordID,h,r,!0)}catch(gh){throw new Error("Failed to update shared record: ".concat(gh))}})()})(s.userID),l(null))},style:{height:"46px",justifyContent:"center",marginTop:"15px"},children:(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Share Record"}),(0,Ap.jsx)(Ip,{children:"Partager l'enregistrement"})]})})})]}),(0,Ap.jsx)(e_,{item:!0,xs:6,style:{paddingLeft:"35px"},children:(0,Ap.jsxs)(QT,{style:{margin:"10px"},children:[(0,Ap.jsx)(Or,{style:{fontWeight:"bold"},children:Object.keys(c).length>0&&(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Users this record is shared with:"}),(0,Ap.jsx)(Ip,{children:"Utilisateurs avec lesquels cet enregistrement est partag\xe9\xa0:"})]})}),(0,Ap.jsx)(ki,{children:Object.entries(c).map(((e,i)=>{let[o,a]=e;return(0,Ap.jsxs)(ko,{children:[(0,Ap.jsx)(Yo,{primary:(0,Ap.jsx)(Or,{children:a.name})}),(0,Ap.jsx)(X_,{children:(0,Ap.jsx)(Cr,{"aria-label":"delete",style:{marginRight:"60px"},onClick:()=>(e=>{if(t.sharedWith&&t.sharedWith[e]){const i={...t.sharedWith};delete i[e],n("sharedWith")(i);const o=async()=>{try{await q_(e,t.recordID,h,r,!1)}catch(gh){throw new Error("Failed to unshare the record: ".concat(gh))}};o()}})(o),children:(0,Ap.jsx)(nx,{})})})]},i)}))})]})})]})})]})})},wk=An((()=>({formControl:{minWidth:200},selectEmpty:{}}))),Ek=e=>{let{value:t="",name:n,options:r,optionLabels:i,optionTooltips:o=[],onChange:a,disabled:s,label:l,fullWidth:c=!0}=e;const u=wk();return(0,Ap.jsx)(gC,{fullWidth:c,className:u.formControl,disabled:s,children:(0,Ap.jsxs)(wo,{className:u.selectEmpty,name:n,fullWidth:c,value:t,disabled:s,displayEmpty:!0,onChange:a,children:[(0,Ap.jsx)(Oo,{value:"",children:(0,Ap.jsx)(_C,{id:"demo-simple-select-label",children:(0,Ap.jsx)(Or,{children:l||(0,Ap.jsx)(Lp,{en:"Choose",fr:"Choisir"})})})}),r.map(((e,t)=>(0,Ap.jsx)(Oo,{value:e,children:(0,Ap.jsx)(ms,{enterDelay:1,title:o[t]?o[t]:"",children:(0,Ap.jsx)("div",{style:{width:"100%"},children:i[t]})})},e)))]})})},{DataCollectionSampling:Tk,...Ck}=ik,kk=e=>{let{disabled:t,record:n,updateRecord:r,handleUpdateRecord:o,userID:a}=e;const{language:s,region:l}=mn(),c=Cn[l],[u,d]=(0,i.useState)(!1),p=(0,i.useRef)(!1);return(0,i.useEffect)((()=>(p.current=!0,n.language||o("language")({target:{value:s}}),n.metadataScope||o("metadataScope")({target:{value:"Dataset"}}),()=>{p.current=!1})),[s]),(0,i.useEffect)((()=>{const e=!n.recordID;(a===n.userID||e)&&d(!0)}),[a,n.userID,n.recordID]),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(Xn,{style:ZC,children:[t&&(0,Ap.jsx)(KC,{style:{paddingBottom:"15px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:(0,Ap.jsx)("b",{children:"This form is locked because it has already been published, or you do not have access to edit it."})}),(0,Ap.jsx)(Ip,{children:(0,Ap.jsx)("b",{children:"Ce formulaire est verrouill\xe9 car il a d\xe9j\xe0 \xe9t\xe9 publi\xe9 ou vous n'avez pas acc\xe8s pour le modifier."})})]})}),(0,Ap.jsxs)(Or,{variant:"body1",children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:["Welcome to the ",c.title.en," Metadata Entry Tool, the first step in making your data discoverable and accessible through CIOOS. This information will be used to create a metadata record for your dataset that will allow it to be searchable through the"," ",c.catalogueTitle.en,". Please fill out each field with as much detail as possible. The metadata record will help describe this dataset for others to determine if it is relevant for their work and ensure it is interoperable with other databases and systems.",(0,Ap.jsx)("br",{}),(0,Ap.jsx)("br",{})," Questions regarding the form can be directed to"," "]}),(0,Ap.jsxs)(Ip,{children:["Bienvenue dans l\u2019outil de saisie de m\xe9tadonn\xe9es"," ",c.titleFrPossessive," qui constitue la premi\xe8re \xe9tape du processus de partage de vos donn\xe9es. Ces renseignements serviront \xe0 cr\xe9er le profil de m\xe9tadonn\xe9es de votre jeu de donn\xe9es. Ces m\xe9tadonn\xe9es facilitent l\u2019accessibilit\xe9 et la d\xe9couvrabilit\xe9 de vos donn\xe9es via le Catalogue de donn\xe9es ",c.catalogueTitle.fr,". Elles rendent \xe9galement vos jeux de donn\xe9es interop\xe9rables avec d\u2019autres syst\xe8mes de diffusion. Aussi, nous vous incitons fortement \xe0 remplir les champs requis de la fa\xe7on la plus exhaustive possible.",(0,Ap.jsx)("br",{}),(0,Ap.jsx)("br",{})," Les questions concernant le formulaire peuvent \xeatre adress\xe9es \xe0"," "]})]}),(0,Ap.jsx)("a",{href:"mailto:".concat(c.email),children:c.email}),"."]}),(0,Ap.jsxs)("ul",{children:[(0,Ap.jsx)("li",{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"You can save the form once you have filled out a title."}),(0,Ap.jsx)(Ip,{children:"D\xe8s que vous avez saisi un titre, vous pouvez enregistrer le formulaire."})]})}),(0,Ap.jsxs)("li",{children:[(0,Ap.jsxs)(Pp,{children:["All fields marked with a ",(0,Ap.jsx)(ek,{})," are mandatory."]}),(0,Ap.jsxs)(Ip,{children:["Tous les champs marqu\xe9s d'une \xe9toile ",(0,Ap.jsx)(ek,{})," sont obligatoires."]})]}),(0,Ap.jsx)("li",{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:["The form can be saved and completed over time by clicking the"," ",(0,Ap.jsx)(lC,{}),' icon in the bottom right corner. This icon will be greyed out until you have filled in the dataset title in the "Identification" section.']}),(0,Ap.jsxs)(Ip,{children:["Le formulaire peut \xeatre sauvegard\xe9 et compl\xe9t\xe9 ult\xe9rieurement en cliquant sur le bouton ",(0,Ap.jsx)(lC,{})," dans le coin inf\xe9rieur droit. Cet ic\xf4ne sera activ\xe9 par l\u2019ajout du titre du jeu de donn\xe9es dans la section \xab Identification des donn\xe9es \xbb."]})]})}),(0,Ap.jsx)("li",{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Some fields can have text in both French and English, though this is only required for the title and the abstract. There is a 'Translate' button that will automatically generate text in the other language. This translation is more accurate when there is more text to translate."}),(0,Ap.jsx)(Ip,{children:"Certains champs peuvent avoir du texte \xe0 la fois en fran\xe7ais et en anglais, toutefois seules les traductions du titre et du r\xe9sum\xe9 sont r\xe9ellement requises. Le bouton \xab Traduire\xbb g\xe9n\xe8re automatiquement du texte dans l'autre langue. Veuillez noter que plus il y a de texte \xe0 traduire et plus la traduction sera pr\xe9cise."})]})})]})]}),(0,Ap.jsxs)(Xn,{style:ZC,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"What is the dataset title? Required in English and French."}),(0,Ap.jsx)(Ip,{children:"Quel est le titre du jeu de donn\xe9es? Obligatoire dans les deux langues."})]}),(0,Ap.jsx)(ek,{passes:Mx(n,"title")}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:[(0,Ap.jsx)("p",{children:"Recommended title includes: What, Where, When."}),(0,Ap.jsxs)("p",{children:["Title should be precise enough so that the user will not have to open the dataset to understand its contents. Title should not have acronyms, special characters, or use specialized nomenclature. This will appear as the title that is shown for this dataset in the ",c.catalogueTitle.en,"."]})]}),(0,Ap.jsxs)(Ip,{children:[(0,Ap.jsx)("p",{children:"Le titre recommand\xe9 comprend : Quoi, O\xf9, Quand."}),(0,Ap.jsxs)("p",{children:["Le titre doit \xeatre suffisamment pr\xe9cis pour que l'utilisateur n'ait pas \xe0 ouvrir le ensemble de donn\xe9es pour comprendre son contenu. Le titre ne doit pas avoir des acronymes, des caract\xe8res sp\xe9ciaux ou utiliser une nomenclature sp\xe9cialis\xe9e. Ceci appara\xeetra comme titre de votre jeu de donn\xe9es dans le"," ",c.catalogueTitle.fr,"."]})]})]})})]}),(0,Ap.jsx)(qC,{name:"title",value:n.title,onChange:o("title"),disabled:t})]}),(0,Ap.jsxs)(Xn,{style:ZC,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"What is the resource type?"}),(0,Ap.jsx)(Ip,{children:"Quel est le type de ressource?"})]}),(0,Ap.jsx)(ek,{passes:Mx(n,"metadataScope")})]}),(0,Ap.jsx)(Ek,{value:n.metadataScope||"",onChange:e=>{var t;const n={target:{value:null===(t=ik[e.target.value])||void 0===t?void 0:t.isoValue}};o("metadataScopeIso")(n),o("metadataScope")(e)},options:Object.keys(Ck),optionLabels:Object.values(Ck).map((e=>{let{title:t}=e;return t[s]})),optionTooltips:Object.values(Ck).map((e=>{let{text:t}=e;return t[s]})),disabled:t,fullWidth:!1,style:{width:"200px"}})]}),(0,Ap.jsx)(Xn,{style:ZC,children:(0,Ap.jsxs)(gC,{children:[(0,Ap.jsxs)(KC,{style:{paddingBottom:"15px"},children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"What is the theme of this record?"}),(0,Ap.jsx)(Ip,{children:"Quel est le th\xe8me de ce disque?"})]}),(0,Ap.jsx)(ek,{passes:n.resourceType})]}),(0,Ap.jsx)(sk,{"aria-labelledby":"resource-type",name:"resource-type",value:n.resourceType||[],labelSize:6,defaultValue:"oceanographic",onChange:e=>{return t=e,Array.isArray(t)&&1===t.length&&t.includes("other")&&Array.isArray(n.eov)&&(n.eov.includes("other")?r("eov")(["other"]):r("eov")([...n.eov,"other"])),void r("resourceType")(t);var t},options:["oceanographic","biological","other"],optionLabels:["Oceanographic","Biological","Other"],disabled:t})]})}),(0,Ap.jsxs)(Xn,{style:ZC,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"What is the primary language of the dataset?"}),(0,Ap.jsx)(Ip,{children:"Quelle est la langue principale du jeu de donn\xe9es?"})]}),(0,Ap.jsx)(ek,{passes:Mx(n,"language")})]}),(0,Ap.jsx)(Ek,{value:n.language,onChange:o("language"),options:["en","fr"],optionLabels:["English","Fran\xe7ais"],disabled:t})]}),(0,Ap.jsx)(XC,{record:n,handleUpdateDatasetIdentifier:o("datasetIdentifier"),handleUpdateDoiCreationStatus:o("doiCreationStatus"),disabled:t}),u&&(0,Ap.jsx)(xk,{region:l,updateRecord:r,record:n})]})};var Sk=n(6968);const Ok=(0,In.c)(i.createElement("path",{d:"M19 6.41L17.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"}),"Clear");var Ak=n(7456),jk=n(8792),Pk=n(3764),Ik=n(2664);var Lk=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.collapsedHeight,s=e.collapsedSize,l=void 0===s?"0px":s,c=e.component,u=void 0===c?"div":c,d=e.disableStrictModeCompat,p=void 0!==d&&d,h=e.in,f=e.onEnter,m=e.onEntered,g=e.onEntering,v=e.onExit,b=e.onExited,y=e.onExiting,_=e.style,x=e.timeout,w=void 0===x?Ao.rV.standard:x,E=e.TransitionComponent,T=void 0===E?di:E,C=(0,Yn.c)(e,["children","classes","className","collapsedHeight","collapsedSize","component","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),k=Pn(),S=i.useRef(),O=i.useRef(null),A=i.useRef(),j="number"===typeof(a||l)?"".concat(a||l,"px"):a||l;i.useEffect((function(){return function(){clearTimeout(S.current)}}),[]);var P=k.unstable_strictMode&&!p,I=i.useRef(null),L=(0,ar.c)(t,P?I:void 0),R=function(e){return function(t,n){if(e){var r=P?[I.current,t]:[t,n],i=(0,jr.c)(r,2),o=i[0],a=i[1];void 0===a?e(o):e(o,a)}}},N=R((function(e,t){e.style.height=j,f&&f(e,t)})),D=R((function(e,t){var n=O.current?O.current.clientHeight:0,r=hi({style:_,timeout:w},{mode:"enter"}).duration;if("auto"===w){var i=k.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(i,"ms"),A.current=i}else e.style.transitionDuration="string"===typeof r?r:"".concat(r,"ms");e.style.height="".concat(n,"px"),g&&g(e,t)})),M=R((function(e,t){e.style.height="auto",m&&m(e,t)})),B=R((function(e){var t=O.current?O.current.clientHeight:0;e.style.height="".concat(t,"px"),v&&v(e)})),Q=R(b),U=R((function(e){var t=O.current?O.current.clientHeight:0,n=hi({style:_,timeout:w},{mode:"exit"}).duration;if("auto"===w){var r=k.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(r,"ms"),A.current=r}else e.style.transitionDuration="string"===typeof n?n:"".concat(n,"ms");e.style.height=j,y&&y(e)}));return i.createElement(T,(0,at.c)({in:h,onEnter:N,onEntered:M,onEntering:D,onExit:B,onExited:Q,onExiting:U,addEndListener:function(e,t){var n=P?e:t;"auto"===w&&(S.current=setTimeout(n,A.current||0))},nodeRef:P?I:void 0,timeout:"auto"===w?null:w},C),(function(e,t){return i.createElement(u,(0,at.c)({className:(0,kn.c)(r.root,r.container,o,{entered:r.entered,exited:!h&&"0px"===j&&r.hidden}[e]),style:(0,at.c)({minHeight:j},_),ref:L},t),i.createElement("div",{className:r.wrapper,ref:O},i.createElement("div",{className:r.wrapperInner},n)))}))}));Lk.muiSupportAuto=!0;const Rk=(0,Gn.c)((function(e){return{root:{height:0,overflow:"hidden",transition:e.transitions.create("height")},entered:{height:"auto",overflow:"visible"},hidden:{visibility:"hidden"},wrapper:{display:"flex"},wrapperInner:{width:"100%"}}}),{name:"MuiCollapse"})(Lk);const Nk=i.createContext({});var Dk=i.forwardRef((function(e,t){var n,r=e.children,o=e.classes,a=e.className,s=e.defaultExpanded,l=void 0!==s&&s,c=e.disabled,u=void 0!==c&&c,d=e.expanded,p=e.onChange,h=e.square,f=void 0!==h&&h,m=e.TransitionComponent,g=void 0===m?Rk:m,v=e.TransitionProps,b=(0,Yn.c)(e,["children","classes","className","defaultExpanded","disabled","expanded","onChange","square","TransitionComponent","TransitionProps"]),y=(0,Ui.c)({controlled:d,default:l,name:"Accordion",state:"expanded"}),_=(0,jr.c)(y,2),x=_[0],w=_[1],E=i.useCallback((function(e){w(!x),p&&p(e,!x)}),[x,p,w]),T=i.Children.toArray(r),C=(n=T,(0,Ak.c)(n)||(0,jk.c)(n)||(0,Pk.c)(n)||(0,Ik.c)()),k=C[0],S=C.slice(1),O=i.useMemo((function(){return{expanded:x,disabled:u,toggle:E}}),[x,u,E]);return i.createElement(Xn,(0,at.c)({className:(0,kn.c)(o.root,a,x&&o.expanded,u&&o.disabled,!f&&o.rounded),ref:t,square:f},b),i.createElement(Nk.Provider,{value:O},k),i.createElement(g,(0,at.c)({in:x,timeout:"auto"},v),i.createElement("div",{"aria-labelledby":k.props.id,id:k.props["aria-controls"],role:"region"},S)))}));const Mk=(0,Gn.c)((function(e){var t={duration:e.transitions.duration.shortest};return{root:{position:"relative",transition:e.transitions.create(["margin"],t),"&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:e.palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-child":{"&:before":{display:"none"}},"&$expanded":{margin:"16px 0","&:first-child":{marginTop:0},"&:last-child":{marginBottom:0},"&:before":{opacity:0}},"&$expanded + &":{"&:before":{display:"none"}},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},rounded:{borderRadius:0,"&:first-child":{borderTopLeftRadius:e.shape.borderRadius,borderTopRightRadius:e.shape.borderRadius},"&:last-child":{borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},expanded:{},disabled:{}}}),{name:"MuiAccordion"})(Dk);var Bk=i.forwardRef((function(e,t){var n=e.children,r=e.classes,o=e.className,a=e.expandIcon,s=e.focusVisibleClassName,l=e.IconButtonProps,c=void 0===l?{}:l,u=e.onClick,d=(0,Yn.c)(e,["children","classes","className","expandIcon","focusVisibleClassName","IconButtonProps","onClick"]),p=i.useContext(Nk),h=p.disabled,f=void 0!==h&&h,m=p.expanded,g=p.toggle;return i.createElement(Er,(0,at.c)({focusRipple:!1,disableRipple:!0,disabled:f,component:"div","aria-expanded":m,className:(0,kn.c)(r.root,o,f&&r.disabled,m&&r.expanded),focusVisibleClassName:(0,kn.c)(r.focusVisible,r.focused,s),onClick:function(e){g&&g(e),u&&u(e)},ref:t},d),i.createElement("div",{className:(0,kn.c)(r.content,m&&r.expanded)},n),a&&i.createElement(Cr,(0,at.c)({className:(0,kn.c)(r.expandIcon,m&&r.expanded),edge:"end",component:"div",tabIndex:null,role:null,"aria-hidden":!0},c),a))}));const Qk=(0,Gn.c)((function(e){var t={duration:e.transitions.duration.shortest};return{root:{display:"flex",minHeight:48,transition:e.transitions.create(["min-height","background-color"],t),padding:e.spacing(0,2),"&:hover:not($disabled)":{cursor:"pointer"},"&$expanded":{minHeight:64},"&$focused, &$focusVisible":{backgroundColor:e.palette.action.focus},"&$disabled":{opacity:e.palette.action.disabledOpacity}},expanded:{},focused:{},focusVisible:{},disabled:{},content:{display:"flex",flexGrow:1,transition:e.transitions.create(["margin"],t),margin:"12px 0","&$expanded":{margin:"20px 0"}},expandIcon:{transform:"rotate(0deg)",transition:e.transitions.create("transform",t),"&:hover":{backgroundColor:"transparent"},"&$expanded":{transform:"rotate(180deg)"}}}}),{name:"MuiAccordionSummary"})(Bk);var Uk=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=(0,Yn.c)(e,["classes","className"]);return i.createElement("div",(0,at.c)({className:(0,kn.c)(n.root,r),ref:t},o))}));const Fk=(0,Gn.c)((function(e){return{root:{display:"flex",padding:e.spacing(1,2,2)}}}),{name:"MuiAccordionDetails"})(Uk),zk=(0,In.c)(i.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),qk=e=>{var t;let{value:n,disabled:r,updateContact:o}=e;const[a,s]=(0,i.useState)(!1),{language:l}=mn(),c=Object.entries(tk).map((e=>{let[t,n]=e;return{key:t,...n}})),u=c.filter((e=>e.showProminently)),d=c.filter((e=>!e.showProminently)),p=d.map((e=>e.key)),h=(n.role||[]).filter((e=>p.includes(e))).length>0;return(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Appear in citation?"}),(0,Ap.jsx)(Ip,{children:"Apparaissent dans la citation?"})]}),(0,Ap.jsx)(QC,{name:"inCitation",checked:n.inCitation||!1,onChange:e=>{const{checked:t}=e.target;o("inCitation")(t)}})]}),(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"What is the role of this contact?"}),(0,Ap.jsx)(Ip,{children:"Quel est son r\xf4le?"})]}),(0,Ap.jsx)(ek,{passes:null===(t=n.role)||void 0===t?void 0:t.length}),(0,Ap.jsxs)($C,{children:[" ",(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Multiple roles can be selected for each contact. Expand the list below for additional role."}),(0,Ap.jsx)(Ip,{children:"Plusieurs r\xf4les peuvent \xeatre s\xe9lectionn\xe9s par personne. Si vous avez besoin de r\xf4les plus sp\xe9cifiques, vous pouvez \xe9tendre la liste. D\xe9veloppez la liste ci-dessous pour un r\xf4le suppl\xe9mentaire."})]})]})]}),(0,Ap.jsx)(sk,{value:n.role||[],onChange:o("role"),options:u.map((e=>e.key)),optionLabels:u.map((e=>e.title[l]+(e.required?"*":""))),disabled:r,optionTooltips:u.map((e=>e.text[l]))}),(0,Ap.jsxs)(Mk,{onChange:()=>s(!a),expanded:a||h,children:[(0,Ap.jsx)(Qk,{expandIcon:(0,Ap.jsx)(ms,{title:"Show/Hide more options",children:(0,Ap.jsx)(zk,{})}),"aria-controls":"panel1a-content",id:"panel1a-header",children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Show/Hide more role options"}),(0,Ap.jsx)(Ip,{children:"Afficher/masquer les r\xf4les"})]})}),(0,Ap.jsx)(Fk,{children:(0,Ap.jsx)(sk,{value:n.role||[],onChange:o("role"),options:d.map((e=>e.key)),optionLabels:d.map((e=>e.title[l])),disabled:r,optionTooltips:d.map((e=>e.text[l]))})})]})]})};const Hk=e=>{var t,n;let{value:r,showRolePicker:o,disabled:a,handleClear:s,updateContact:l,updateContactEvent:c,updateContactRor:u,updateContactOrcid:d}=e;const p=(0,i.useRef)(!1),h=Sx(r.orgEmail),f=Sx(r.indEmail),m=Ox(r.orgURL),g=!(null!==(t=r.givenNames)&&void 0!==t&&t.includes(",")),v=!(null!==(n=r.lastName)&&void 0!==n&&n.includes(",")),[b,y]=(0,i.useState)(r.orgRor),[_,x]=(0,i.useState)(""),[w]=VC(b,500),[E,T]=(0,i.useState)([]),[C,k]=(0,i.useState)(!1);return r={...j_(),...r},(0,i.useEffect)((()=>{var e;return p.current=!0,w&&((e=w).startsWith("http")&&!e.includes("ror.org")?p.current&&k(!1):fetch('https://api.ror.org/organizations?query="'.concat(e,'"')).then((e=>e.json())).then((e=>{p.current&&T(e.items),1===e.number_of_results&&u(e.items[0])})).then((()=>{p.current&&k(!1)}))),()=>{p.current=!1}}),[w]),(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:2,children:[(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(Or,{variant:"h6",children:iT(r)})}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[o&&(0,Ap.jsx)(qk,{value:r,updateContact:l,disabled:a}),(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:1,style:{marginTop:"10px"},children:[(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(KC,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Provide any information about the organization"}),(0,Ap.jsx)(Ip,{children:"Identification de l'organisation"})]})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{marginleft:"10px",height:"33px"},children:C?(0,Ap.jsx)(r_,{size:20}):(0,Ap.jsx)("div",{style:{height:"33px"}})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{marginleft:"10px"},children:(0,Ap.jsx)(_k,{inputValue:b,onInputChange:(e,t)=>{y(t),k(""!==t)},disabled:a,onChange:(e,t)=>{null!==t&&fetch("https://api.ror.org/organizations/".concat(t.id)).then((e=>e.json())).then((e=>{e.errors||u(e)})).then((()=>k(!1))).then((()=>y("")))},freeSolo:!0,filterOptions:e=>e,getOptionLabel:e=>e.name,options:E,fullWidth:!0,renderInput:e=>(0,Ap.jsx)(CC,{...e,label:(0,Ap.jsx)(Lp,{en:"Type to search Research Organization Registry (ROR)",fr:"Tapez pour rechercher le registre des organismes de recherche (ROR)\n"})})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{marginleft:"10px"},children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{active:!0,en:"ROR URL",fr:"URL ROR"}),InputLabelProps:{shrink:""!==r.orgRor},value:r.orgRor,disabled:!0,fullWidth:!0,InputProps:{endAdornment:r.orgRor&&(0,Ap.jsx)(SC,{position:"end",children:(0,Ap.jsx)(Cr,{onClick:()=>{s("orgRor")},children:(0,Ap.jsx)(Ok,{})})})}})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{marginleft:"10px"},children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"Organization name",fr:"Nom de l'organisation"}),value:r.orgName,onChange:c("orgName"),disabled:""!==r.orgRor||a,fullWidth:!0})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{helperText:!m&&(0,Ap.jsx)(Lp,{en:"Invalid URL",fr:"URL non valide"}),error:!m,label:(0,Ap.jsx)(Lp,{en:"URL",fr:"URL"}),value:r.orgURL,onChange:c("orgURL"),disabled:""!==r.orgRor||a,fullWidth:!0})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"Address",fr:"Adresse"}),value:r.orgAdress,onChange:c("orgAdress"),disabled:a,fullWidth:!0})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"City",fr:"Ville"}),value:r.orgCity,onChange:c("orgCity"),disabled:""!==r.orgRor||a,fullWidth:!0})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"Country",fr:"Pays"}),value:r.orgCountry,onChange:c("orgCountry"),disabled:""!==r.orgRor||a,fullWidth:!0})}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsx)(CC,{helperText:!h&&(0,Ap.jsx)(Lp,{en:"Invalid email",fr:"E-mail non valide"}),error:!h,label:(0,Ap.jsx)(Lp,{en:"Email",fr:"Courriel"}),value:r.orgEmail,onChange:c("orgEmail"),fullWidth:!0,disabled:a})," "]})]})]}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Provide any information about the individual"}),(0,Ap.jsx)(Ip,{children:"Identification de l'individu"})]})}),(0,Ap.jsx)(Or,{children:(0,Ap.jsxs)(c_,{href:"https://orcid.org/orcid-search/search",target:"_blank",rel:"noopener noreferrer",style:{marginTop:"10px",marginBottom:"10px"},children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"ORCID search "}),(0,Ap.jsx)(Ip,{children:"Rechercher ORCID "})]}),(0,Ap.jsx)(lx,{style:{verticalAlign:"middle"}})]})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{marginleft:"10px"},children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"Paste ORCID identifier here to populate personal data",fr:"Collez l'identifiant ORCID ici pour remplir les donn\xe9es personnelles"}),value:_,onChange:e=>{x(e.target.value);const t=e.target.value.match(/\w{4}-\w{4}-\w{4}-\w{4}/g);t&&fetch("https://pub.orcid.org/v3.0/".concat(t,"/record"),{headers:{accept:"application/json"}}).then((e=>e.json())).then((e=>d(e))).then((()=>{setTimeout((()=>x("")),100)}))},disabled:a,fullWidth:!0})}),(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:!0,children:r.givenNames&&r.lastName&&r.inCitation&&(0,Ap.jsxs)("div",{style:{marginBottom:"10px"},children:["This name will appear in the citation as:"," ",(0,Ap.jsx)("b",{children:(S=r.givenNames,O=r.lastName,S&&O?"".concat(O,", ").concat(function(e){return e.split(" ").filter((e=>e)).map((e=>"".concat(e[0].toUpperCase(),". "))).join(" ")}(S)):"")})]})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"ORCID URL",fr:"URL ORCID"}),InputLabelProps:{shrink:""!==r.indOrcid},value:r.indOrcid,InputProps:{endAdornment:r.indOrcid&&(0,Ap.jsx)(SC,{position:"end",children:(0,Ap.jsx)(Cr,{onClick:()=>{s("indOrcid")},children:(0,Ap.jsx)(Ok,{})})})},disabled:!0,fullWidth:!0})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"Given name(s)",fr:"Pr\xe9nom"}),value:r.givenNames,helperText:!g&&(0,Ap.jsx)(Lp,{en:"No commas allowed",fr:"Aucune virgule n'est autoris\xe9e"}),error:!g,onChange:c("givenNames"),disabled:a,fullWidth:!0})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"Last name",fr:"nom de famille"}),value:r.lastName,helperText:!v&&(0,Ap.jsx)(Lp,{en:"No commas allowed",fr:"Aucune virgule n'est autoris\xe9e"}),error:!v,onChange:c("lastName"),disabled:a,fullWidth:!0})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"Position",fr:"Poste occup\xe9"}),value:r.indPosition,onChange:c("indPosition"),disabled:a,fullWidth:!0})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{helperText:!f&&(0,Ap.jsx)(Lp,{en:"Invalid email",fr:"E-mail non valide"}),error:!f,label:(0,Ap.jsx)(Lp,{en:"Email",fr:"Courriel"}),value:r.indEmail,onChange:c("indEmail"),disabled:a,fullWidth:!0})})]})]})]});var S,O};var Wk=n(1480);const Gk=(0,In.c)(i.createElement("path",{d:"M20 9H4v2h16V9zM4 15h16v-2H4v2z"}),"DragHandle");var Vk=n(6248),$k=n.n(Vk);const Kk=e=>{let{items:t,updateItems:n,activeItem:r,setActiveItem:o,disabled:a,savedUserItems:s,saveItem:l,getBlankItem:c,fieldsNotSavedInFirebase:u,addNewItemText:d,addSavedItemLabel:p,leftListHeader:h,leftListEmptyHeader:f,itemTitle:m,itemValidator:g,uidFields:v}=e;const[b,y]=(0,i.useState)(t);x_(b,t)||y(t);const _=Object.values(s||{});return(0,Ap.jsx)(Xn,{style:ZC,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",justifyContent:"flex-start",children:[(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{margin:"10px"},children:(0,Ap.jsx)(Or,{children:t.length?h||(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Items in this record:"}),(0,Ap.jsx)(Ip,{children:"Articles dans cet enregistrement:"})]}):f||(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"There are no items in this record."}),(0,Ap.jsx)(Ip,{children:"Il n'y a aucun articles dans cet enregistrement."})]})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(ki,{children:(0,Ap.jsx)(Wk.Container,{dragHandleSelector:".drag-handle",lockAxis:"y",onDrop:e=>{let{removedIndex:t,addedIndex:i}=e;t===r?o(i):i<=r&&t>r&&o(r+1);const a=$k()(b,t,i);n(a)},children:t.map(((e,i)=>{var s;return(0,Ap.jsx)(Wk.Draggable,{children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>o(i),children:[(0,Ap.jsx)(Yo,{primary:(0,Ap.jsx)(Or,{style:{fontWeight:r===i?"bold":"",width:"80%"},children:m(e)||(0,Ap.jsx)(Lp,{en:"New item",fr:"Nouveau article"})})}),(0,Ap.jsxs)(X_,{children:[(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Duplicate entry",fr:"Duplicate entr\xe9e"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>function(e){const r=__(t[e]),i=(v||["id"]).find((e=>r[e]));r[i]+=" (Copy)",n(t.concat(r))}(i),edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(ox,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Remove from this record",fr:"Supprimer de cet enregistrement"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>{return e=i,n(t.filter(((t,n)=>n!==e))),void(t.length&&o(t.length-2));var e},edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(nx,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Add to saved items",fr:"Ajouter aux articles enregistr\xe9s"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>{const e=__(t[i]);u.forEach((t=>{delete e[t]})),e.contactID=l(e),y(t)},disabled:g&&g(e)||0===(null===(s=e.id)||void 0===s?void 0:s.length),edge:"end","aria-label":"clone",children:(0,Ap.jsx)(lC,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Drag to reorder",fr:"Faites glisser pour r\xe9organiser"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{className:"drag-handle",edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(Gk,{})})})})]})]},i)},i)}))})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{margin:"10px"},children:(0,Ap.jsx)(c_,{disabled:a,onClick:()=>(n(t.concat(c())),void o(t.length)),fullWidth:!0,style:{height:"56px",justifyContent:"emptyContact"},children:(0,Ap.jsx)(Or,{children:d||(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add new item"}),(0,Ap.jsx)(Ip,{children:"Ajouter un item"})]})})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,style:{margin:"10px"},children:(0,Ap.jsx)(Ek,{value:"",labelId:"add-existing",onChange:e=>{const r=e.target.value,{role:i,...a}=_[r];n(t.concat(__({...c(),...a}))),o(t.length)},optionLabels:_.map((e=>m(e))),options:_.map(((e,t)=>t)),disabled:!_.length||a,label:p||(0,Ap.jsx)(Lp,{en:"ADD SAVED ITEM",fr:"AJOUTER UN \xc9L\xc9MENT ENREGISTR\xc9"})})})]})})};Kk.defaultProps={fieldsNotSavedInFirebase:[]};const Yk=Kk,Zk=e=>{var t,n;let{disabled:r,record:o,userContacts:a,updateRecord:s,saveToContacts:l}=e;const{language:c,region:u}=mn(),{contacts:d=[]}=o,p=s("contacts"),[h,f]=(0,i.useState)(0);function m(e){return t=>{const n=[...d];n[h][e]=t,p(n)}}const g=(null===(t=o.title)||void 0===t?void 0:t[c])&&d.length&&o.created&&(null===(n=o.contacts)||void 0===n?void 0:n.some((e=>e.inCitation))),v=d[h];return(0,Ap.jsxs)(e_,{container:!0,spacing:3,children:[(0,Ap.jsx)(Xn,{style:ZC,children:(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:["Please enter at least one Metadata Custodian ",(0,Ap.jsx)("b",{children:"and"})," one Data Owner for this dataset that can work with"," ",Cn[u].title[c]," Staff to finalize this Metadata Record. You also must select at least one contact to appear in the citation. One contact can occupy multiple roles."]}),(0,Ap.jsxs)(Ip,{children:["Veuillez saisir au moins un D\xe9positaire des m\xe9tadonn\xe9es ET un propri\xe9taire des donn\xe9es de ce jeu. Ces personnes pourraient \xeatre appel\xe9es \xe0 collaborer avec le personnel",Cn[u].titleFrPossessive," pour finaliser la saisie des informations. Vous devez \xe9galement s\xe9lectionner au moins un contact pour appara\xeetre dans la citation. Un contact peut occuper plusieurs r\xf4les."]})]}),(0,Ap.jsx)(ek,{passes:Mx(o,"contacts")}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"It is important to include all individuals from the chain of attribution to ensure all involved parties are credited appropriately for their role in creating this dataset. Saved contacts can be selected from the list below."}),(0,Ap.jsx)(Ip,{children:"Il est important d'inclure toutes les personnes ayant travaill\xe9 sur le jeu de donn\xe9es afin de s'assurer que toutes les parties concern\xe9es soient cr\xe9dit\xe9es de fa\xe7on appropri\xe9e pour leur r\xf4le dans la cr\xe9ation de ce jeu de donn\xe9es. Les contacts sauvegard\xe9s peuvent \xeatre s\xe9lectionn\xe9s dans la liste ci-dessous."})]})})]})})}),g&&(0,Ap.jsxs)(Xn,{style:ZC,children:[(0,Ap.jsx)(KC,{children:(0,Ap.jsx)("div",{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:["This is how your record citation will look in the catalogue. To change the citation order, drag the"," ",(0,Ap.jsx)(Sk.c,{style:{verticalAlign:"middle"}})," symbol."]}),(0,Ap.jsxs)(Ip,{children:["Voici \xe0 quoi ressemblera votre citation dans le catalogue. Seuls les contacts dont la case \xabAuteur cit\xe9\xbb est coch\xe9e apparaissent. Seuls les r\xf4les \xe9toil\xe9s appara\xeetront dans la citation. Changer la commande, faites glisser le"," ",(0,Ap.jsx)(Sk.c,{style:{verticalAlign:"middle"}}),"."]})]})})}),(0,Ap.jsx)($C,{children:(0,Ap.jsx)(fx,{language:c,record:o})})]}),(0,Ap.jsxs)(e_,{container:!0,direction:"row",style:{marginLeft:"5px"},children:[(0,Ap.jsx)(e_,{item:!0,xs:5,children:(0,Ap.jsx)(Yk,{items:d,updateItems:p,setActiveItem:f,activeItem:h,disabled:r,savedUserItems:a,saveItem:l,itemTitle:iT,getBlankItem:j_,addSavedItemLabel:(0,Ap.jsx)(Lp,{en:"ADD SAVED CONTACT",fr:"AJOUTER UN CONTACT ENREGISTR\xc9"}),uidFields:["lastName","orgName"],itemValidator:e=>{var t,n,r;return!(null!==(t=e.orgName)&&void 0!==t&&t.length||null!==(n=e.givenNames)&&void 0!==n&&n.length||null!==(r=e.lastName)&&void 0!==r&&r.length)}})}),v&&(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(e_,{container:!0,direction:"column",children:(0,Ap.jsx)(Xn,{style:ZC,children:(0,Ap.jsx)(e_,{container:!0,direction:"column",spacing:3,children:(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(Hk,{showRolePicker:!0,value:v,handleClear:e=>m(e)(""),updateContactEvent:e=>function(e){return t=>{const n=[...d];n[h][e]=t.target.value,p(n)}}(e),updateContact:e=>m(e),updateContactRor:e=>function(e){const t=[...d];t[h].orgRor=e.id,t[h].orgName=e.name,t[h].orgURL=e.links.find((()=>!0))||"",t[h].orgCity=e.addresses.find((()=>!0)).city||"",t[h].orgCountry=e.country.country_name,p(t)}(e),updateContactOrcid:e=>function(e){const{name:t,emails:n}=e.person,r=n.email.length>0?n.email[0].email:"",i=t["family-name"]?t["family-name"].value:"",o=[...d];o[h].indOrcid=e["orcid-identifier"].uri,o[h].givenNames=t["given-names"].value,o[h].indEmail=r,o[h].lastName=i,p(o)}(e),disabled:r})})})})})})]})]})};var Jk=n(8024),Xk=n.n(Jk);const eS=e=>{var t,n;let{updateResources:r,resources:o,disabled:a}=e;const s=(0,i.useRef)(!1),{checkURLActive:l}=(0,i.useContext)(Fb),{language:c}=mn(),[u,d]=(0,i.useState)({}),p={url:"",name:"",description:{en:"",fr:""}},[h,f]=(0,i.useState)(0),[m,g]=(0,i.useState)(o),v=(0,i.useRef)({});(0,i.useEffect)((()=>(s.current=!0,o.forEach(((e,t)=>{e.url&&Ox(e.url)&&(v.current[t]||(v.current[t]=Xk()((async e=>{const t=await l(e.url);s.current&&d((n=>({...n,[e.url]:t.data})))}),500)),v.current[t](e))})),()=>{s.current=!1})),[o,l]),x_(m,o)||g(o);const b=(0,Ap.jsx)(Lp,{en:"Name",fr:"Titre"}),y=(0,Ap.jsx)(Lp,{en:"Description",fr:"Description"}),_=o.length>0&&o[h],x=_&&(!_.url||Ox(_.url));function w(e){return t=>{const n=[...o];n[h][e]=t.target.value,r(n)}}return(0,Ap.jsx)(Xn,{variant:"outlined",style:{padding:10},children:(0,Ap.jsxs)(e_,{container:!0,direction:"row",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:3,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:2,children:[o&&o.length>0&&(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(ki,{children:(0,Ap.jsx)(Wk.Container,{dragHandleSelector:".drag-handle",lockAxis:"y",onDrop:e=>{let{removedIndex:t,addedIndex:n}=e;t===h?f(n):n<=h&&t>h&&f(h+1);const i=$k()(m,t,n);r(i)},children:o.map(((e,t)=>{var n,i;return(0,Ap.jsx)(Wk.Draggable,{children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>f(t),children:[(0,Ap.jsx)(Yo,{primary:(0,Ap.jsxs)(Or,{style:{fontWeight:h===t?"bold":"",marginRight:"72px"},children:[t+1,". ",(null!==(n=e.name[c])&&void 0!==n?n:"").length<=50?null!==(i=e.name[c])&&void 0!==i?i:"":"".concat(e.name[c].substring(0,50),"...")]})}),(0,Ap.jsxs)(X_,{children:[(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Duplicate contact",fr:"Duplicate contact"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>function(e){var t,n;const i=__(o[e]);null!==(t=i.name)&&void 0!==t&&t.en&&(i.name.en+=" (Copy)"),null!==(n=i.name)&&void 0!==n&&n.fr&&(i.name.fr+=" (Copie)"),r(o.concat(i))}(t),edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(ox,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Remove from this record",fr:"Supprimer de cet enregistrement"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>function(e){r(o.filter(((t,n)=>n!==e))),o.length&&f(o.length-2)}(t),edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(nx,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Drag to reorder",fr:"Faites glisser pour r\xe9organiser"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{className:"drag-handle",edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(Gk,{})})})})]})]},t)},t)}))})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{disabled:a,startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>(r(o.concat(__(p))),void f(o.length)),style:{height:"56px",marginLeft:"10px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add resource"}),(0,Ap.jsx)(Ip,{children:"Ajouter une ressource"})]})})})]})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:_&&(0,Ap.jsx)(Xn,{variant:"outlined",style:{padding:10},children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:3,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter a name for the resource"}),(0,Ap.jsx)(Ip,{children:"Entrez un titre pour la ressource"})]}),(0,Ap.jsx)(ek,{passes:(null===(t=_.name)||void 0===t?void 0:t.en)||(null===(n=_.name)||void 0===n?void 0:n.fr)})]}),(0,Ap.jsx)(qC,{name:"name",label:b,value:_.name,onChange:w("name"),fullWidth:!0,disabled:a})]}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter the URL for the resource"}),(0,Ap.jsx)(Ip,{children:"Entrez l'URL de la ressource"})]}),(0,Ap.jsx)(ek,{passes:kx().isURL(_.url)}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:(0,Ap.jsx)("p",{children:"The link may be to a formal data resource on another repository or a link to a personal online drive (e.g. Google Drive)."})}),(0,Ap.jsx)(Ip,{children:(0,Ap.jsx)("p",{children:"Le lien peut \xeatre vers une ressource de donn\xe9es formelle sur un autre d\xe9p\xf4t de donn\xe9es ou un lien vers un disque personnel en ligne (par exemple Google Drive)."})})]})})]}),(0,Ap.jsx)(CC,{helperText:!x&&(0,Ap.jsx)(Lp,{en:"Invalid URL",fr:"URL non valide"})||_.url&&!1===u[_.url]&&(0,Ap.jsx)(Lp,{en:"URL is not active",fr:"L'URL n'est pas active"})||_.url&&!0===u[_.url]&&(0,Ap.jsx)(Lp,{en:"URL is active",fr:"L'URL est active"}),error:!x,label:"URL",value:_.url,onChange:w("url"),fullWidth:!0,disabled:a})]}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsx)(KC,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter a description of the resource"}),(0,Ap.jsx)(Ip,{children:"Entrez une description de la ressource"})]})})," ",(0,Ap.jsx)(qC,{name:"description",label:y,value:_.description,onChange:w("description"),disabled:a})]})]})})})]})})},tS={IsCitedBy:"crossReference",Cites:"crossReference",IsSupplementTo:"crossReference",IsSupplementedBy:"crossReference",IsContinuedBy:"series",Continues:"series",IsDescribedBy:"crossReference",Describes:"crossReference",HasMetadata:"crossReference",IsMetadataFor:"crossReference",HasVersion:"revisionOf",IsVersionOf:"revisionOf",IsNewVersionOf:"revisionOf",PreviousVersionOf:"crossReference",IsPartOf:"largerWorkCitation",HasPart:"isComposedOf",IsPublishedIn:"largerWorkCitation",IsReferencedBy:"crossReference",References:"crossReference",IsDocumentedBy:"crossReference",Documents:"crossReference",IsCompiledBy:"dependency",Compiles:"dependency",IsVariantFormOf:"crossReference",IsOriginalFormOf:"crossReference",IsIdenticalTo:"crossReference",IsReviewedBy:"crossReference",Reviews:"crossReference",IsDerivedFrom:"dependency",IsSourceOf:"dependency",Requires:"dependency",IsRequiredBy:"dependency",IsObsoletedBy:"crossReference",Obsoletes:"revisionOf"},nS=e=>{var t,n;let{updateResources:r,resources:o,disabled:a}=e;const s={title:{en:"",fr:""},authority:"",code:"",association_type:"",association_type_iso:""},{language:l}=mn(),[c,u]=(0,i.useState)(0),[d,p]=(0,i.useState)(o),h=o.length>0&&o[c];x_(d,o)||p(o);function f(e){return t=>{const n=[...o];n[c][e]=t.target.value,r(n)}}function m(e){return!e||(e=>!e||kx().isURL(e))(e)}return(0,Ap.jsx)(Xn,{variant:"outlined",style:{padding:10},children:(0,Ap.jsxs)(e_,{container:!0,direction:"row",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:3,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:2,children:[o&&o.length>0&&(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(ki,{children:(0,Ap.jsx)(Wk.Container,{dragHandleSelector:".drag-handle",lockAxis:"y",onDrop:e=>{let{removedIndex:t,addedIndex:n}=e;t===c?u(n):n<=c&&t>c&&u(c+1);const i=$k()(d,t,n);r(i)},children:o.map(((e,t)=>{var n,i;return(0,Ap.jsx)(Wk.Draggable,{children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>u(t),children:[(0,Ap.jsx)(Yo,{primary:(0,Ap.jsxs)(Or,{style:{fontWeight:c===t?"bold":"",marginRight:"72px"},children:[t+1,". ",(null!==(n=e.title[l])&&void 0!==n?n:"").length<=50?null!==(i=e.title[l])&&void 0!==i?i:"":"".concat(e.title[l].substring(0,50),"...")]})}),(0,Ap.jsxs)(X_,{children:[(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Duplicate contact",fr:"Duplicate contact"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>function(e){var t,n;const i=__(o[e]);null!==(t=i.title)&&void 0!==t&&t.en&&(i.title.en+=" (Copy)"),null!==(n=i.title)&&void 0!==n&&n.fr&&(i.title.fr+=" (Copie)"),r(o.concat(i))}(t),edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(ox,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Remove from this record",fr:"Supprimer de cet enregistrement"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>function(e){r(o.filter(((t,n)=>n!==e))),o.length&&u(o.length-2)}(t),edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(nx,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Drag to reorder",fr:"Faites glisser pour r\xe9organiser"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{className:"drag-handle",edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(Gk,{})})})})]})]},t)},t)}))})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{disabled:a,startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>(r(o.concat(__(s))),void u(o.length)),style:{height:"56px",marginLeft:"10px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add resource"}),(0,Ap.jsx)(Ip,{children:"Ajouter une ressource"})]})})})]})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:h&&(0,Ap.jsx)(Xn,{variant:"outlined",style:{padding:10},children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:3,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter the title of the related resource"}),(0,Ap.jsx)(Ip,{children:"Entrez le titre de l'\u0153uvre concern\xe9e"})]}),(0,Ap.jsx)(ek,{passes:(null===(t=h.title)||void 0===t?void 0:t.en)||(null===(n=h.title)||void 0===n?void 0:n.fr)})]})," ",(0,Ap.jsx)(qC,{name:"title",label:(0,Ap.jsx)(Lp,{en:"Title",fr:"Titre"}),value:h.title,onChange:f("title"),disabled:a,fullWidth:!0})]}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter the identifier for the related resource"}),(0,Ap.jsx)(Ip,{children:"Saisissez l'identifiant de l'\u0153uvre concern\xe9e"})]}),(0,Ap.jsx)(ek,{passes:h.code}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:(0,Ap.jsx)("p",{children:"The identifier may be to a resource, or metadata record on another repository or another record within CIOOS. A DOI or full URL are preferred."})}),(0,Ap.jsx)(Ip,{children:(0,Ap.jsx)("p",{children:"L'identifiant peut provenir d'une ressource ou d'un enregistrement de m\xe9tadonn\xe9es sur un autre r\xe9f\xe9rentiel ou un autre enregistrement dans CIOOS. Un DOI ou une URL compl\xe8te sont pr\xe9f\xe9r\xe9s."})})]})})]}),(0,Ap.jsx)(CC,{label:(0,Ap.jsx)(Lp,{en:"Identifier",fr:"identifiant"}),value:h.code,onChange:function(e){return t=>{const n=[...o];n[c][e]=t.target.value;const i=n[c].code;switch(!0){case m(n[c].code)&&/^http.?:\/\/doi\.org\//i.test(i):n[c].authority="DOI";break;case m(n[c].code):n[c].authority="URL";break;default:n[c].authority=""}r(n)}}("code"),fullWidth:!0,disabled:a})]}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter the identifier type"}),(0,Ap.jsx)(Ip,{children:"Entrez le type d'identifiant"})]}),(0,Ap.jsx)(ek,{passes:h.authority})]}),(0,Ap.jsx)(Ek,{value:h.authority,onChange:f("authority"),options:ak,optionLabels:ak,disabled:a,label:(0,Ap.jsx)(Lp,{en:"Identifier Type",fr:"Type d'identifiant"}),fullWidth:!1})]}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"What is the relation type?"}),(0,Ap.jsx)(Ip,{children:"Quel est le type de relation?"})]}),(0,Ap.jsx)(ek,{passes:h.association_type}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:[(0,Ap.jsx)("p",{children:"Specify the relationship from (A) the primary resource; to (B) the related resource. For example:"}),(0,Ap.jsxs)("ul",{children:[(0,Ap.jsx)("li",{children:"Use 'Is New Version Of' to indicate the primary resource described in this metadata record (A) is a new version of (B) the related resource."}),(0,Ap.jsx)("li",{children:"Use 'Is Part of' to indicate the primary resource (A) is a subset of (B) the related larger resource."}),(0,Ap.jsx)("li",{children:"Use 'Has Part' to indicate the primary resource (A) is the larger work that includes (B) the related resource."}),(0,Ap.jsx)("li",{children:"Use 'Cites' to indicate that (A) cites (B)."}),(0,Ap.jsx)("li",{children:"Use 'Is Cited by to indicate that (B) cites (A)"})]})]}),(0,Ap.jsxs)(Ip,{children:[(0,Ap.jsx)("p",{children:"Sp\xe9cifiez la relation \xe0 partir de (A) la ressource principale\xa0; \xe0 (B) la ressource associ\xe9e. Par exemple:"}),(0,Ap.jsxs)("ul",{children:[(0,Ap.jsx)("li",{children:'Utilisez "Est une nouvelle version de" pour indiquer que la ressource principale d\xe9crite dans cet enregistrement de m\xe9tadonn\xe9es (A) est une nouvelle version de (B) la ressource associ\xe9e.'}),(0,Ap.jsx)("li",{children:'Utilisez "Fait partie de" pour indiquer que la ressource principale (A) est un sous-ensemble de (B) la ressource plus grande associ\xe9e.'}),(0,Ap.jsx)("li",{children:'Utilisez "A une partie" pour indiquer que la ressource principale (A) est le travail le plus important qui comprend (B) la ressource associ\xe9e.'}),(0,Ap.jsx)("li",{children:'Utilisez "Cites" pour indiquer que (A) cite (B).'}),(0,Ap.jsx)("li",{children:'Utilisez "Est cit\xe9 par" pour indiquer que (B) cite (A)'})]})]})]})})]}),(0,Ap.jsx)(Ek,{value:h.association_type,onChange:e=>{const t=[...o];t[c].association_type_iso=tS[e.target.value],t[c].association_type=e.target.value,r(t)},options:Object.keys(ok),optionLabels:Object.values(ok).map((e=>{let{title:t}=e;return t[l]})),optionTooltips:Object.values(ok).map((e=>{let{text:t}=e;return t[l]})),disabled:a,label:(0,Ap.jsx)(Lp,{en:"Relation Type",fr:"Type de relation"}),fullWidth:!1})]})]})})})]})})},rS={title:"",authority:"",code:""},iS=e=>{var t,n;let{updateDocumentations:r,documentations:o=[],disabled:a,paperClass:s,language:l}=e;const[c,u]=(0,i.useState)(0);function d(e){return t=>{const n=[...o];n[c][e]=t.target.value,r(n)}}function p(e){return!e||(e=>!e||kx().isURL(e))(e)}const h=o.length>0&&o[c];return(0,Ap.jsxs)(e_,{container:!0,spacing:0,children:[(0,Ap.jsx)(e_,{item:!0,children:(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Additional Documentation:"}),(0,Ap.jsx)(Ip,{children:"Documentation Suppl\xe9mentaire:"})]}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"A citation to additional lineage documentation. This could be a publication that describes the whole process, dataset, or model."}),(0,Ap.jsx)(Ip,{children:"Une citation \xe0 une documentation suppl\xe9mentaire sur la lign\xe9e. Il peut s'agir d'une publication d\xe9crivant l'ensemble du processus, de l'ensemble de donn\xe9es ou du mod\xe8le."})]})})]})}),(0,Ap.jsxs)(e_,{container:!0,item:!0,direction:"row",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:4,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(ki,{children:o.map(((e,t)=>{var n,r;return(0,Ap.jsx)(ko,{button:!0,onClick:()=>u(t),children:(0,Ap.jsx)(Yo,{primary:(0,Ap.jsxs)(Or,{style:{fontWeight:c===t?"bold":""},children:[t+1,". ",(null!==(n=e.title[l])&&void 0!==n?n:"").length<=50?null!==(r=e.title[l])&&void 0!==r?r:"":"".concat(e.title[l].substring(0,50),"...")]})})},t)}))})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{disabled:a,startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>(r(o.concat(__(rS))),void u(o.length)),style:{height:"56px",marginLeft:"10px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add documentation"}),(0,Ap.jsx)(Ip,{children:"Ajouter un documentation"})]})})})]})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(e_,{container:!0,direction:"column",children:h&&(0,Ap.jsx)(Xn,{style:s,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:2,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Title"}),(0,Ap.jsx)(Ip,{children:"Titre"})]}),(0,Ap.jsx)(ek,{passes:(null===(t=h.title)||void 0===t?void 0:t.en)||(null===(n=h.title)||void 0===n?void 0:n.fr)}),(0,Ap.jsx)(qC,{value:h.title,onChange:d("title"),fullWidth:!0,disabled:a})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:"Identifier or URL",value:h.code,onChange:function(e){return t=>{const n=[...o];n[c][e]=t.target.value;const i=n[c].code;switch(!0){case p(n[c].code)&&/^http.?:\/\/doi\.org\//i.test(i):n[c].authority="DOI";break;case p(n[c].code):n[c].authority="URL";break;default:n[c].authority=""}r(n)}}("code"),fullWidth:!0,disabled:a})}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter the identifier type"}),(0,Ap.jsx)(Ip,{children:"Entrez le type d'identifiant"})]}),(null===h||void 0===h?void 0:h.code)&&(0,Ap.jsx)(ek,{passes:h.authority})]}),(0,Ap.jsx)(Ek,{value:h.authority,onChange:d("authority"),options:ak,optionLabels:ak,disabled:a,label:(0,Ap.jsx)(Lp,{en:"Identifier Type",fr:"Type d'identifiant"}),fullWidth:!1})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{startIcon:(0,Ap.jsx)(nx,{}),disabled:a,onClick:()=>(r(o.filter(((e,t)=>t!==c))),void(o.length&&u(o.length-2))),children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Remove documentation"}),(0,Ap.jsx)(Ip,{children:"Supprimer l'documentation"})]})})})]})})})})]})]})},oS={description:"",title:"",authority:"",code:""},aS=e=>{var t,n,r,o;let{updateSources:a,sources:s=[],disabled:l,paperClass:c,language:u}=e;const[d,p]=(0,i.useState)(0);function h(e){return t=>{const n=[...s];n[d][e]=t.target.value,a(n)}}function f(e){return!e||(e=>!e||kx().isURL(e))(e)}const m=s.length>0&&s[d];return(0,Ap.jsxs)(e_,{container:!0,spacing:0,children:[(0,Ap.jsx)(e_,{item:!0,children:(0,Ap.jsxs)(KC,{children:["Source:",(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Information about the input used in creating the resource specified by the scope. Provide citations to the input data. This is especially valuable for processed satellite data and model data. For model data, it is suggested to describe the model and its input, especially if their is no publication cited above to describe the model."}),(0,Ap.jsx)(Ip,{children:"Informations sur l'entr\xe9e utilis\xe9e lors de la cr\xe9ation de la ressource sp\xe9cifi\xe9e par la port\xe9e. Fournir citations aux donn\xe9es d\u2019entr\xe9e. Ceci est particuli\xe8rement utile pour les donn\xe9es satellitaires trait\xe9es et donn\xe9es du mod\xe8le. Pour les donn\xe9es de mod\xe8le, il est sugg\xe9r\xe9 de d\xe9crire le mod\xe8le et ses entr\xe9es, en particulier s'il n'y a pas de publication cit\xe9e ci-dessus pour d\xe9crire le mod\xe8le."})]})})]})}),(0,Ap.jsxs)(e_,{container:!0,item:!0,direction:"row",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:4,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(ki,{spacing:1,children:s.map(((e,t)=>{var n,r;return(0,Ap.jsx)(ko,{button:!0,onClick:()=>p(t),children:(0,Ap.jsx)(Yo,{primary:(0,Ap.jsxs)(Or,{style:{fontWeight:d===t?"bold":""},children:[t+1,". ",(null!==(n=e.title[u]||e.description[u])&&void 0!==n?n:"").length<=50?null!==(r=e.title[u]||e.description[u])&&void 0!==r?r:"":"".concat((e.title[u]||e.description[u]).substring(0,50),"...")]})})},t)}))})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{disabled:l,startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>(a(s.concat(__(oS))),void p(s.length)),style:{height:"56px",marginLeft:"10px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add source"}),(0,Ap.jsx)(Ip,{children:"Ajouter un source"})]})})})]})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(e_,{container:!0,direction:"column",children:m&&(0,Ap.jsx)(Xn,{style:c,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:2,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Description"}),(0,Ap.jsx)(Ip,{children:"Description"})]}),(0,Ap.jsx)(ek,{passes:(null===(t=m.description)||void 0===t?void 0:t.en)||(null===(n=m.description)||void 0===n?void 0:n.fr)}),(0,Ap.jsx)(qC,{value:m.description,onChange:h("description"),fullWidth:!0,disabled:l})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(Or,{variant:"body1",component:"div",style:{marginTop:"10px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Or link to reference documentation"}),(0,Ap.jsx)(Ip,{children:"Ou lien vers la documentation de r\xe9f\xe9rence"})]})})}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Title"}),(0,Ap.jsx)(Ip,{children:"Titre"})]}),(null===m||void 0===m?void 0:m.code)&&(0,Ap.jsx)(ek,{passes:(null===(r=m.title)||void 0===r?void 0:r.en)||(null===(o=m.title)||void 0===o?void 0:o.fr)}),(0,Ap.jsx)(qC,{value:m.title,onChange:h("title"),fullWidth:!0,disabled:l})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:"Identifier or URL",value:m.code,onChange:function(e){return t=>{const n=[...s];n[d][e]=t.target.value;const r=n[d].code;switch(!0){case f(n[d].code)&&/^http.?:\/\/doi\.org\//i.test(r):n[d].authority="DOI";break;case f(n[d].code):n[d].authority="URL";break;default:n[d].authority=""}a(n)}}("code"),fullWidth:!0,disabled:l})}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter the identifier type"}),(0,Ap.jsx)(Ip,{children:"Entrez le type d'identifiant"})]}),(null===m||void 0===m?void 0:m.code)&&(0,Ap.jsx)(ek,{passes:m.authority})]}),(0,Ap.jsx)(Ek,{value:m.authority,onChange:h("authority"),options:ak,optionLabels:ak,disabled:l,label:(0,Ap.jsx)(Lp,{en:"Identifier Type",fr:"Type d'identifiant"}),fullWidth:!1})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{startIcon:(0,Ap.jsx)(nx,{}),disabled:l,onClick:()=>(a(s.filter(((e,t)=>t!==d))),void(s.length&&p(s.length-2))),children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Remove source"}),(0,Ap.jsx)(Ip,{children:"Supprimer l'source"})]})})})]})})})})]})]})},sS={description:"",title:"",authority:"",code:""},lS=e=>{var t,n,r,o;let{updateSources:a,sources:s=[],disabled:l,paperClass:c,language:u}=e;const[d,p]=(0,i.useState)(0);function h(e){return t=>{const n=[...s];n[d][e]=t.target.value,a(n)}}function f(e){return!e||(e=>!e||kx().isURL(e))(e)}const m=s.length>0&&s[d];return(0,Ap.jsxs)(e_,{container:!0,spacing:0,children:[(0,Ap.jsx)(e_,{item:!0,children:(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Processing or Method Step:"}),(0,Ap.jsx)(Ip,{children:"\xc9tape de traitement ou de m\xe9thode:"})]}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"A general description of how the resource was developed or an event associated with the resource. This can be a summary of the workflow or steps to create the resource subsequent to initial data collection."}),(0,Ap.jsx)(Ip,{children:"Une description g\xe9n\xe9rale de la fa\xe7on dont la ressource a \xe9t\xe9 d\xe9velopp\xe9e ou d'un \xe9v\xe9nement associ\xe9 \xe0 la Ressource. Il peut s'agir d'un r\xe9sum\xe9 du flux de travail ou des \xe9tapes de cr\xe9ation ult\xe9rieure de la ressource. \xe0 la collecte initiale des donn\xe9es."})]})})]})}),(0,Ap.jsxs)(e_,{container:!0,item:!0,direction:"row",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:4,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(ki,{spacing:1,children:s.map(((e,t)=>{var n,r;return(0,Ap.jsx)(ko,{button:!0,onClick:()=>p(t),children:(0,Ap.jsx)(Yo,{primary:(0,Ap.jsxs)(Or,{style:{fontWeight:d===t?"bold":""},children:[t+1,". ",(null!==(n=e.title[u]||e.description[u])&&void 0!==n?n:"").length<=50?null!==(r=e.title[u]||e.description[u])&&void 0!==r?r:"":"".concat((e.title[u]||e.description[u]).substring(0,50),"...")]})})},t)}))})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{disabled:l,startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>(a(s.concat(__(sS))),void p(s.length)),style:{height:"56px",marginLeft:"10px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add Step"}),(0,Ap.jsx)(Ip,{children:"Ajouter une \xe9tape"})]})})})]})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(e_,{container:!0,direction:"column",children:m&&(0,Ap.jsx)(Xn,{style:c,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:2,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Description"}),(0,Ap.jsx)(Ip,{children:"Description"})]}),(0,Ap.jsx)(ek,{passes:(null===(t=m.description)||void 0===t?void 0:t.en)||(null===(n=m.description)||void 0===n?void 0:n.fr)}),(0,Ap.jsx)(qC,{value:m.description,onChange:h("description"),fullWidth:!0,disabled:l})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(Or,{variant:"body1",component:"div",style:{marginTop:"10px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Or link to reference documentation"}),(0,Ap.jsx)(Ip,{children:"Ou lien vers la documentation de r\xe9f\xe9rence"})]})})}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Title"}),(0,Ap.jsx)(Ip,{children:"Titre"})]}),(null===m||void 0===m?void 0:m.code)&&(0,Ap.jsx)(ek,{passes:(null===(r=m.title)||void 0===r?void 0:r.en)||(null===(o=m.title)||void 0===o?void 0:o.fr)}),(0,Ap.jsx)(qC,{value:m.title,onChange:h("title"),fullWidth:!0,disabled:l})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(CC,{label:"Identifier or URL",value:m.code,onChange:function(e){return t=>{const n=[...s];n[d][e]=t.target.value;const r=n[d].code;switch(!0){case f(n[d].code)&&/^http.?:\/\/doi\.org\//i.test(r):n[d].authority="DOI";break;case f(n[d].code):n[d].authority="URL";break;default:n[d].authority=""}a(n)}}("code"),fullWidth:!0,disabled:l})}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter the identifier type"}),(0,Ap.jsx)(Ip,{children:"Entrez le type d'identifiant"})]}),(null===m||void 0===m?void 0:m.code)&&(0,Ap.jsx)(ek,{passes:m.authority})]}),(0,Ap.jsx)(Ek,{value:m.authority,onChange:h("authority"),options:ak,optionLabels:ak,disabled:l,label:(0,Ap.jsx)(Lp,{en:"Identifier Type",fr:"Type d'identifiant"}),fullWidth:!1})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{startIcon:(0,Ap.jsx)(nx,{}),disabled:l,onClick:()=>(a(s.filter(((e,t)=>t!==d))),void(s.length&&p(s.length-2))),children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Remove step"}),(0,Ap.jsx)(Ip,{children:"Supprimer l'\xe9tape"})]})})})]})})})})]})]})},cS={statement:"",scope:"",additionalDocumentation:[],source:[],processingStep:[]},uS=e=>{var t,n;let{updateLineage:r,history:o,disabled:a,paperClass:s,language:l,metadataScope:c}=e;const[u,d]=(0,i.useState)(0),[p,h]=(0,i.useState)(o),f=Object.keys(ik).filter((e=>["DataCollectionSampling",c].includes(e))).reduce(((e,t)=>({...e,[t]:ik[t]})),{});function m(e){return t=>{const n=[...o];n[u][e]=t.target.value,r(n)}}function g(e){return t=>{const n=[...o];n[u][e]=t,r(n)}}if("string"===typeof o){const e=__(cS);""!==o&&(e.statement={en:o,fr:o}),r([__(e)])}x_(p,o)||h(o);const v=o.length>0&&o[u];return v&&!v.scope&&(v.scope=c),("string"===typeof o||o instanceof String)&&(o=[]),(0,Ap.jsx)(Xn,{variant:"outlined",style:{padding:10},children:(0,Ap.jsxs)(e_,{container:!0,direction:"row",spacing:1,children:[(0,Ap.jsx)(e_,{item:!0,xs:3,children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:2,children:[o&&o.length>0&&(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(ki,{children:(0,Ap.jsx)(Wk.Container,{dragHandleSelector:".drag-handle",lockAxis:"y",onDrop:e=>{let{removedIndex:t,addedIndex:n}=e;t===u?d(n):n<=u&&t>u&&d(u+1);const i=$k()(p,t,n);r(i)},children:o.map(((e,t)=>{var n,i;return(0,Ap.jsx)(Wk.Draggable,{children:(0,Ap.jsxs)(ko,{button:!0,onClick:()=>d(t),children:[(0,Ap.jsx)(Yo,{primary:(0,Ap.jsxs)(Or,{style:{fontWeight:u===t?"bold":"",marginRight:"72px"},children:[t+1,". ",(null!==(n=e.statement[l])&&void 0!==n?n:"").length<=50?null!==(i=e.statement[l])&&void 0!==i?i:"":"".concat(e.statement[l].substring(0,50),"...")]})}),(0,Ap.jsxs)(X_,{children:[(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Duplicate contact",fr:"Duplicate contact"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>function(e){var t,n;const i=__(o[e]);null!==(t=i.name)&&void 0!==t&&t.en&&(i.name.en+=" (Copy)"),null!==(n=i.name)&&void 0!==n&&n.fr&&(i.name.fr+=" (Copie)"),r(o.concat(i))}(t),edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(ox,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Remove from this record",fr:"Supprimer de cet enregistrement"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{onClick:()=>function(e){r(o.filter(((t,n)=>n!==e))),o.length&&d(o.length-2)}(t),edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(nx,{})})})}),(0,Ap.jsx)(ms,{title:(0,Ap.jsx)(Lp,{en:"Drag to reorder",fr:"Faites glisser pour r\xe9organiser"}),children:(0,Ap.jsx)("span",{children:(0,Ap.jsx)(Cr,{className:"drag-handle",edge:"end","aria-label":"clone",disabled:a,children:(0,Ap.jsx)(Gk,{})})})})]})]},t)},t)}))})})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(c_,{disabled:a,startIcon:(0,Ap.jsx)(u_,{}),onClick:()=>(r(o.concat(__(cS))),void d(o.length)),style:{height:"56px",marginLeft:"10px"},children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Add Lineage"}),(0,Ap.jsx)(Ip,{children:"Ajouter une lign\xe9e"})]})})})]})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:v&&(0,Ap.jsx)(Xn,{variant:"outlined",style:{padding:10},children:(0,Ap.jsxs)(e_,{container:!0,direction:"column",spacing:3,children:[(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Lineage Title"}),(0,Ap.jsx)(Ip,{children:"Titre de la lign\xe9e"})]}),(0,Ap.jsx)(ek,{passes:(null===(t=v.statement)||void 0===t?void 0:t.en)||(null===(n=v.statement)||void 0===n?void 0:n.fr)}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"General explanation of the lineage step or sampling methods. For detailed processing steps or methods use the processing and method step question"}),(0,Ap.jsx)(Ip,{children:"Explication g\xe9n\xe9rale de l'\xe9tape de lignage ou des m\xe9thodes d'\xe9chantillonnage. Pour des \xe9tapes ou des m\xe9thodes de traitement d\xe9taill\xe9es, utilisez la question sur les \xe9tapes de traitement et de m\xe9thode."})]})})]}),(0,Ap.jsx)(qC,{value:v.statement,onChange:m("statement"),fullWidth:!0,disabled:a})]}),(0,Ap.jsxs)(e_,{item:!0,xs:!0,children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Scope"}),(0,Ap.jsx)(Ip,{children:"Port\xe9e"})]}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Type of resource and/or extent to which the lineage information applies."}),(0,Ap.jsx)(Ip,{children:"Type de ressource et/ou mesure dans laquelle les informations sur la lign\xe9e s'appliquent."})]})})]}),(0,Ap.jsx)(Ek,{value:v.scope,onChange:e=>{var t;const n={target:{value:null===(t=ik[e.target.value])||void 0===t?void 0:t.isoValue}};m("scopeIso")(n),m("scope")(e)},options:Object.keys(f),optionLabels:Object.values(f).map((e=>{let{title:t}=e;return t[l]})),disabled:a,fullWidth:!0,label:(0,Ap.jsx)(Lp,{en:"Scope",fr:"???"})})]}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(iS,{documentations:v.additionalDocumentation,updateDocumentations:g("additionalDocumentation"),disabled:a,paperClass:s,language:l})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(aS,{sources:v.source,updateSources:g("source"),disabled:a,paperClass:s,language:l})}),(0,Ap.jsx)(e_,{item:!0,xs:!0,children:(0,Ap.jsx)(lS,{sources:v.processingStep,updateSources:g("processingStep"),disabled:a,paperClass:s,language:l})})]})})})]})})},dS=e=>{let{disabled:t,record:n,updateRecord:r}=e;const{language:o}=mn(),[a]=i.useState([n.distribution&&0===n.distribution.length,n.associated_resources&&0===n.associated_resources.length,n.history&&0===n.history.length]);return(0,Ap.jsxs)("div",{children:[(0,Ap.jsxs)(Mk,{defaultExpanded:a[0],style:{width:"90%",margin:20},children:[(0,Ap.jsx)(Qk,{expandIcon:(0,Ap.jsx)(FC.c,{}),"aria-controls":"panel1a-content",id:"panel1a-header",style:{backgroundColor:"#00000015"},children:(0,Ap.jsxs)(YC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Resource"}),(0,Ap.jsx)(Ip,{children:"La ressource"})]}),n.distribution&&n.distribution.length>0&&(0,Ap.jsx)(pC,{style:{marginLeft:10},label:n.distribution.length,variant:"outlined"})]})}),(0,Ap.jsx)(Fk,{children:(0,Ap.jsxs)(e_,{children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsx)(Pp,{children:'Enter one or more links to the primary resource described by this metadata record. Resources added here should not already have their own metadata record or digital object identifier, such resources should be added to the "Related Works" section.'}),(0,Ap.jsx)(Ip,{children:'Entrez un ou plusieurs liens vers la ressource principale d\xe9crite par cet enregistrement de m\xe9tadonn\xe9es. Les ressources ajout\xe9es ici ne doivent pas d\xe9j\xe0 avoir leur propre enregistrement de m\xe9tadonn\xe9es ou identifiant d\'objet num\xe9rique, ces ressources doivent \xeatre ajout\xe9es \xe0 la section "Travaux associ\xe9s".'}),(0,Ap.jsx)(ek,{passes:Mx(n,"distribution")}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:["Some examples of resources are:",(0,Ap.jsxs)("ul",{children:[(0,Ap.jsx)("li",{children:"Protocols or methods documents"}),(0,Ap.jsx)("li",{children:"CSV files"}),(0,Ap.jsx)("li",{children:"ERDDAP datasets"}),(0,Ap.jsx)("li",{children:"Images"}),(0,Ap.jsx)("li",{children:"Online forms to request access to the data"})]}),"A Resource URL that links to a compressed data package or folder is preferred. Otherwise, list primary resource first followed by supporting resources."]}),(0,Ap.jsxs)(Ip,{children:["Voici quelques exemples de ressources :",(0,Ap.jsxs)("ul",{children:[(0,Ap.jsx)("li",{children:"Documents de protocoles ou de m\xe9thodes"}),(0,Ap.jsx)("li",{children:"Fichiers CSV"}),(0,Ap.jsx)("li",{children:"Ensembles de donn\xe9es ERDDAP"}),(0,Ap.jsx)("li",{children:"Images"}),(0,Ap.jsx)("li",{children:"Formulaires en ligne pour demander l'acc\xe8s aux donn\xe9es"})]}),"Une URL de ressource qui renvoie \xe0 un package ou un dossier de donn\xe9es compress\xe9es est pr\xe9f\xe9rable. Sinon, r\xe9pertoriez d'abord la ressource principale, suivie des ressources de support."]})]})})]}),(0,Ap.jsx)(eS,{resources:n.distribution||[],updateResources:r("distribution"),language:o,disabled:t})]})})]}),(0,Ap.jsxs)(Mk,{defaultExpanded:a[1],style:{width:"90%",margin:20},children:[(0,Ap.jsx)(Qk,{expandIcon:(0,Ap.jsx)(FC.c,{}),"aria-controls":"panel2a-content",id:"panel2a-header",style:{backgroundColor:"#00000015"},children:(0,Ap.jsxs)(YC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Related Works"}),(0,Ap.jsx)(Ip,{children:"Travaux connexes"})]}),n.associated_resources&&n.associated_resources.length>0&&(0,Ap.jsx)(pC,{style:{marginLeft:10},label:n.associated_resources.length,variant:"outlined"})]})}),(0,Ap.jsx)(Fk,{children:(0,Ap.jsxs)(e_,{children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsx)(Pp,{children:"Enter links to other metadata records, publications or works that are related to the primary resources this metadata record describes."}),(0,Ap.jsx)(Ip,{children:"Entrez des liens vers d'autres enregistrements de m\xe9tadonn\xe9es, publications ou ouvrages qui sont li\xe9s aux ressources principales d\xe9crites par cet enregistrement de m\xe9tadonn\xe9es."}),(0,Ap.jsx)(ek,{passes:Mx(n,"associated_resources")}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsxs)(Pp,{children:["Related works may be:",(0,Ap.jsxs)("ul",{children:[(0,Ap.jsx)("li",{children:"Other datasets that are part of the same collection, project, or sampling protocol"}),(0,Ap.jsx)("li",{children:"Metadata records on other catalogues such as OBIS or FRDR that describe the same dataset"}),(0,Ap.jsx)("li",{children:"Any work that adds context to or describes the primary resource for which you are creating this metadata record for"})]})]}),(0,Ap.jsxs)(Ip,{children:["Les \u0153uvres connexes peuvent \xeatre :",(0,Ap.jsxs)("ul",{children:[(0,Ap.jsx)("li",{children:"Autres ensembles de donn\xe9es faisant partie de la m\xeame collection, du m\xeame projet ou du m\xeame protocole d'\xe9chantillonnage"}),(0,Ap.jsx)("li",{children:"Enregistrements de m\xe9tadonn\xe9es sur d'autres catalogues tels que OBIS ou FRDR qui d\xe9crivent le m\xeame ensemble de donn\xe9es"}),(0,Ap.jsx)("li",{children:"Tout travail qui ajoute du contexte ou d\xe9crit la ressource principale pour laquelle vous cr\xe9ez cet enregistrement de m\xe9tadonn\xe9es"})]})]})]})})]}),(0,Ap.jsx)(nS,{resources:n.associated_resources||[],updateResources:r("associated_resources"),language:o,disabled:t})]})})]}),(0,Ap.jsxs)(Mk,{defaultExpanded:a[2],style:{width:"90%",margin:20},children:[(0,Ap.jsx)(Qk,{expandIcon:(0,Ap.jsx)(FC.c,{}),"aria-controls":"panel3a-content",id:"panel3a-header",style:{backgroundColor:"#00000015"},children:(0,Ap.jsxs)(YC,{children:[(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Lineage"}),(0,Ap.jsx)(Ip,{children:"Lign\xe9e"})]}),n.history&&n.history.length>0&&(0,Ap.jsx)(pC,{style:{marginLeft:10},label:n.history.length,variant:"outlined"})]})}),(0,Ap.jsx)(Fk,{children:(0,Ap.jsxs)(e_,{children:[(0,Ap.jsxs)(KC,{children:[(0,Ap.jsx)(Pp,{children:"Data processing history (provenance) for the resource."}),(0,Ap.jsx)(Ip,{children:"Historique du traitement des donn\xe9es (provenance) pour la ressource."}),(0,Ap.jsx)(ek,{passes:Mx(n,"history")}),(0,Ap.jsx)($C,{children:(0,Ap.jsxs)(Lp,{children:[(0,Ap.jsx)(Pp,{children:"Enter Information about the events or source data used in constructing the data specified by the scope."}),(0,Ap.jsx)(Ip,{children:"Entrez des informations sur les \xe9v\xe9nements ou les donn\xe9es sources utilis\xe9es dans la construction des donn\xe9es sp\xe9cifi\xe9es par la port\xe9e."})]})})]}),(0,Ap.jsx)(uS,{history:n.history,updateLineage:r("history"),disabled:t,paperClass:ZC,language:o,metadataScope:n.metadataScope})]})})]})]})},pS=(0,In.c)(i.createElement("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3v7.12zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5z"}),"Update"),hS={Biogeochemical:{en:"Biogeochemical",fr:"Biog\xe9ochimie"},"Biology and Ecosystems":{en:"Biological and Ecosystem",fr:"Biologie et \xe9cosyst\xe8mes"},"Cross-disciplinary":{en:"Cross-disciplinary",fr:"Interdisciplinaire"},Physical:{en:"Physical",fr:"Physique"},Other:{en:"Other",fr:"Autre"}},fS=[{category:"Biogeochemical",value:"oxygen","label EN":"Oxygen","label FR":"Oxyg\xe8ne","definition EN":"The amount of dissolved oxygen in seawater.","definition FR":"Concentration d'oxyg\xe8ne dissous dans l'eau de mer",icon:"dissolved-oxygen.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17473"},{category:"Biogeochemical",value:"nutrients","label EN":"Nutrients","label FR":"Nutriments","definition EN":"The amount of inorganic nutrients in seawater","definition FR":"Concentration des nutriments inorganiques dissous dans l'eau de mer [NO\u2083, NO\u2082, PO\u2084, NH\u2084, Si(OH)\u2084]",icon:"nutrients.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17474"},{category:"Biogeochemical",value:"inorganicCarbon","label EN":"Inorganic carbon","label FR":"Carbone inorganique","definition EN":"Total amount of inorganic carbon dissolved in sea water [CO\u2082, HCO\u2083-, CO\u2083\xb2-]","definition FR":"Quantit\xe9 totale de carbone inorganique dissous dans l'eau de mer [CO\u2082, HCO\u2083-, CO\u2083\xb2-]",icon:"inorganic-carbon.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17475"},{category:"Biogeochemical",value:"dissolvedOrganicCarbon","label EN":"Dissolved organic carbon","label FR":"Carbone organique dissous","definition EN":"The amount of dissolved carbon dioxide in seawater","definition FR":"Concentration de carbone organique dissous dans l'eau de mer",icon:"dissolved-organic-carbon.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17480"},{category:"Physical",value:"seaSurfaceHeight","label EN":"Sea surface height","label FR":"Niveau de l'eau","definition EN":"The altitude of mean sea level relative to the Earth's geode.","definition FR":"Correspond au niveau d'eau mesur\xe9. Les niveaux sont variables en fonction des saisons et des \xe9v\xe8nements climatique",icon:"sea-level.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17465"},{category:"Physical",value:"seaIce","label EN":"Sea ice","label FR":"Glace de mer","definition EN":"The concentration of ice cover over a specified area and extent","definition FR":"La concentration en couverture de glace sur une zone et une \xe9tendue sp\xe9cifi\xe9es",icon:"sea-ice.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17464"},{category:"Physical",value:"seaState","label EN":"Sea state","label FR":"\xc9tat de la mer","definition EN":"Sea State is the characterization of wave and swell, typically in terms of height, wavelength, period, and directional wave energy flux.","definition FR":"L'\xe9tat de la mer est la caract\xe9risation des vagues et de la houle, g\xe9n\xe9ralement en termes de hauteur, de longueur d'onde, de p\xe9riode, et le flux d'\xe9nergie des ondes directionnelles",icon:"sea-state.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17462"},{category:"Physical",value:"seaSurfaceSalinity","label EN":"Sea surface salinity","label FR":"Salinit\xe9 de surface","definition EN":"The concentration of dissolved salts in surface seawater.","definition FR":"La concentration de sel dissous dans l'eau de mer de surface",icon:"salinity.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17470"},{category:"Physical",value:"seaSurfaceTemperature","label EN":"Sea surface temperature","label FR":"Temp\xe9rature de surface","definition EN":"The temperature of surface seawater.","definition FR":"La temp\xe9rature de l'eau de mer en surface",icon:"temperature.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17466"},{category:"Physical",value:"subSurfaceSalinity","label EN":"Subsurface salinity","label FR":"Salinit\xe9 sous la surface","definition EN":"The concentration of dissolved salts in subsurface seawater.","definition FR":"La concentration de sel dissous dans l'eau de mer sous la surface",icon:"salinity.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17471"},{category:"Physical",value:"subSurfaceTemperature","label EN":"Subsurface temperature","label FR":"Temp\xe9rature sous la surface","definition EN":"The temperature of subsurface seawater.","definition FR":"La temp\xe9rature de l'eau de mer sous la surface",icon:"temperature.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17467"},{category:"Physical",value:"surfaceCurrents","label EN":"Surface currents","label FR":"Courants de surface","definition EN":"The velocity of sea water in surface","definition FR":"Vitesse et d\xe9bit de l'eau en surface",icon:"currents.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17468"},{category:"Physical",value:"subSurfaceCurrents","label EN":"Subsurface currents","label FR":"Courants sous-marins","definition EN":"","definition FR":"",icon:"currents.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17469"},{category:"Other",value:"other","label EN":"Other","label FR":"Autre","definition EN":"All data that does not correspond to the current EOVs.","definition FR":"Toutes les donn\xe9es qui ne correspondent pas aux EOVs actuels.",icon:"eov_other.svg"},{category:"Biogeochemical",value:"transientTracers","label EN":"Transient tracers","label FR":"Traceurs transitoires","definition EN":"Transient tracers are man-made chemical compounds released to the atmosphere at known quantities that can be used in the ocean to quantify ventilation, transit time distribution and transport time-scales","definition FR":"Les traceurs transitoires sont des compos\xe9s chimiques artificiels rejet\xe9s dans l'atmosph\xe8re en quantit\xe9s connues qui peuvent \xeatre utilis\xe9s dans l'oc\xe9an pour quantifier la ventilation, la distribution des temps de transit et les \xe9chelles de temps de transport.",icon:"transient-tracers.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17476"},{category:"Biogeochemical",value:"particulateMatter","label EN":"Particulate matter","label FR":"Mati\xe8re particulaire","definition EN":"Total amount of particles (organic & inorganic) suspended in sea water","definition FR":"Quantit\xe9 totale de particules (organiques et inorganiques) en suspension dans l'eau de mer",icon:"particulate-matter.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17477"},{category:"Biogeochemical",value:"nitrousOxide","label EN":"Nitrous oxide","label FR":"Protoxyde d'azote","definition EN":"Nitrous oxide (N2O) is an important climate-relevant trace gas in the Earth\u2019s atmosphere. The ocean-including its coastal areassuch as continental shelves, estuaries and upwelling areas is a major source of N2O and contributesabout 30% to the atmospheric N2O budget.","definition FR":"Le protoxyde d'azote ou azote nitreux (N2O) est un important gaz traceur du climat dans l'atmosph\xe8re terrestre. L'oc\xe9an, y compris ses zones c\xf4ti\xe8res telles que les plateaux continentaux, les estuaires et les zones d'upwelling, est une source majeure de N2O. Elle contribue \xe0 environ 30 % du bilan atmosph\xe9rique en protoxyde d'azote.",icon:"nitrous-oxide.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17478"},{category:"Biogeochemical",value:"stableCarbonIsotopes","label EN":"Stable carbon isotopes","label FR":"Isotopes stables du carbone","definition EN":"The utility of carbon-13 isotope (\u03b413C, the carbon-13 to carbon-12 isotope ratio; 13C/12C) as a tracer of the ocean\u2019s carbon cycle.","definition FR":"L\u2019utilit\xe9 de l\u2019isotope du carbone-13 (\u03b413C, le rapport des isotopes du carbone-13 au carbone-12; 13C/12C) comme traceur du cycle du carbone de l\u2019oc\xe9an.",icon:"stable-carbon-isotopes.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17479"},{category:"Biology and Ecosystems",value:"phytoplanktonBiomassAndDiversity","label EN":"Phytoplankton biomass and diversity","label FR":"Biomasse et diversit\xe9 de phytoplancton","definition EN":"Characterization of the biological diversity of phytoplankton, their phenology, vertical distribution, and community composition, and their role in ocean biogeochemistry and ecosystem services.","definition FR":"Caract\xe9risation de la diversit\xe9 biologique du phytoplancton, de sa ph\xe9nologie, de sa distribution verticale et de sa composition communautaire, ainsi que le r\xf4le dans la biog\xe9ochimie des oc\xe9ans et les services \xe9cosyst\xe9miques.",icon:"phytoplankton.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17507"},{category:"Biology and Ecosystems",value:"zooplanktonBiomassAndDiversity","label EN":"Zooplankton biomass and diversity","label FR":"Biomasse et diversit\xe9 de zooplancton","definition EN":"Zooplankton diversity refers to the number of zooplankton species, taxonomic composition, or community structure within a region. Zooplankton diversity influences ecosystem health and productivity through trophic links.","definition FR":"La diversit\xe9 du zooplancton fait r\xe9f\xe9rence au nombre d'esp\xe8ces de zooplancton, \xe0 la composition taxonomique ou \xe0 la structure communautaire au sein d'une r\xe9gion. La diversit\xe9 du zooplancton influence la sant\xe9 et la productivit\xe9 de l'\xe9cosyst\xe8me par le biais de liens trophiques.",icon:"zooplankton.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17509"},{category:"Biology and Ecosystems",value:"fishAbundanceAndDistribution","label EN":"Fish abundance and distribution","label FR":"Abondance et distribution de poissons","definition EN":"Fish abundance describes the biomass or numbers of fish in the ocean. It can be reported in terms of species or taxonomic or functional groups (e.g., small pelagic fish, mesopelagic fish, and tunalike species) in an assemblage, population, stock or area, or globally","definition FR":"L'abondance des poissons d\xe9crit la biomasse ou le nombre de poissons dans l'oc\xe9an. Il peut \xeatre rapport\xe9 en termes d'esp\xe8ces ou de groupes taxonomiques ou fonctionnels (par exemple, petits poissons p\xe9lagiques, poissons m\xe9sop\xe9lagiques et esp\xe8ces tunal) dans un assemblage, une population, un stock ou une zone, ou \xe0 l'\xe9chelle mondiale",icon:"fish.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17510"},{category:"Biology and Ecosystems",value:"marineTurtlesBirdsMammalsAbundanceAndDistribution","label EN":"Marine turtles, birds, mammals abundance and distribution","label FR":"Abondance et distribution de tortues marines, oiseaux et mammif\xe8res","definition EN":"Abundance refers to the number of individuals (turtles, birds or marine mammals) within a population while distribution refers to\nthe geographic or spatial extent of habitats used by individuals in the population.","definition FR":"L'abondance se r\xe9f\xe8re au nombre d'individus (tortues, oiseaux ou mammif\xe8res marins) au sein d'une population tandis que la distribution se r\xe9f\xe8re \xe0\nl'\xe9tendue g\xe9ographique ou spatiale des habitats utilis\xe9s par les individus de la population.",icon:"birds-mammals.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17511"},{category:"Biology and Ecosystems",value:"hardCoralCoverAndComposition","label EN":"Hard coral cover and composition","label FR":"Composition et couverture des coraux durs","definition EN":"Live hard coral cover and the areal extent of a reef are the most important indicators of whether a reef is in a coral-dominated state or not; the composition and diversity of coral taxa is an important index of reef health; coral condition (e.g. bleaching, disease) gives fundamental information on the health of a reef; the size class structure (and recruitment) of hard corals gives fundamental information on the resilience, disturbance history and recovery potential of a reef.","definition FR":"La couverture de coraux durs vivants et l'\xe9tendue spatiale des r\xe9cifs sont les indicateurs les plus importants pour savoir si le r\xe9cif est ou non domin\xe9 par les coraux. La composition et la diversit\xe9 des taxons coralliens sont un indice important de la sant\xe9 du r\xe9cif ; l'\xe9tat des coraux (par exemple le blanchissement, les maladies) donne des informations fondamentales sur la sant\xe9 du r\xe9cif ; la structure des classes de taille (et le recrutement) des coraux durs donne des informations fondamentales sur la r\xe9silience, l'historique des perturbations et le potentiel de r\xe9cup\xe9ration du r\xe9cif.",icon:"birds-mammals.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17512"},{category:"Biology and Ecosystems",value:"seagrassCoverAndComposition","label EN":"Seagrass cover and composition","label FR":"Composition et couverture des herbiers marins","definition EN":"Characterization of seagrass beds according to species and their cover linked to a spatial distribution.","definition FR":"Caract\xe9risation des herbiers marins en fonction des esp\xe8ces et de leur couverture selon une distribution spatiale.",icon:"seagrass.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17513"},{category:"Biology and Ecosystems",value:"macroalgalCanopyCoverAndComposition","label EN":"Macroalgal canopy cover and composition","label FR":"Composition et couverture de la canop\xe9e de macroalgues","definition EN":"Characterization of macroalgal forest according to species and their cover linked to a spatial distribution.","definition FR":"Caract\xe9risation des macroalgues en fonction des esp\xe8ces et de leur couvert selon une distribution spatiale.",icon:"macroalgal-canopy.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17515"},{category:"Biology and Ecosystems",value:"invertebrateAbundanceAndDistribution","label EN":"Invertebrate abundance and distribution","label FR":"Abondance et distribution d'invert\xe9br\xe9s","definition EN":"The abundance of invertebrate species describes the biomass or number of individuals in an assemblage and according to a spatial distribution.","definition FR":"L'abondance d'esp\xe8ces invert\xe9br\xe9es d\xe9crit la biomasse ou le nombre d'individus dans un assemblage et selon une distribution spatiale.",icon:"invertebrates.svg",emerging:!0},{category:"Biology and Ecosystems",value:"microbeBiomassAndDiversity","label EN":"Microbe biomass and diversity","label FR":"Biomasse et diversit\xe9 microbienne","definition EN":"","definition FR":"",icon:"microbes.svg",emerging:!0},{category:"Cross-disciplinary",value:"oceanColour","label EN":"Ocean colour","label FR":"Couleur des oc\xe9ans","definition EN":'The term "ocean colour" refers to the result of absorption and scattering of spectral radiation emanating from the sun. Light interacts with water and suspended or dissolved matter and encompasses a multitude of biological, biogeochemical and ecological factors that form the colour of water.',"definition FR":"Le terme \xabcouleur de l'oc\xe9an\xbb se r\xe9f\xe8re au r\xe9sultat de l'absorption et de la diffusion du rayonnement spectral \xe9manant du soleil. La lumi\xe8re interagit avec l'eau et les mati\xe8res en suspension ou dissoutes et englobe une multitude de facteurs biologiques, biog\xe9ochimiques et \xe9cologiques qui forment la couleur de l'eau.",icon:"ocean-color.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=19959"},{category:"Cross-disciplinary",value:"oceanSound","label EN":"Ocean sound","label FR":"Paysage acoustique des oc\xe9ans","definition EN":"","definition FR":"",icon:"ocean-sound.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=22567"},{category:"Cross-disciplinary",value:"marineDebris","label EN":"Marine debris","label FR":"D\xe9bris marins","definition EN":"","definition FR":"",icon:"",emerging:!0,url:""},{category:"Physical",value:"oceanSurfaceHeatFlux","label EN":"Ocean surface heat flux","label FR":"Flux de chaleur oc\xe9anique de surface","definition EN":"Surface heat flux is the rate of heat exchange, per unit area, passing through the sea surface to the atmosphere. The net heat flux is the sum of the turbulent fluxes (latent and sensitive) and the radiative flux (short and long waves).","definition FR":"Le flux de chaleur de surface est le taux d'\xe9change de chaleur, par unit\xe9 de surface, traversant la surface de la mer jusqu'\xe0 l'atmosph\xe8re. Le flux de chaleur net est la somme des flux turbulents (latents et sensibles) et du flux radiatif (ondes courtes et longues).",icon:"ocean-surface-heat-flux.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17472"},{category:"Physical",value:"oceanSurfaceStress","label EN":"Ocean surface stress","label FR":"Contraintes sur la surface oc\xe9anique","definition EN":"Ocean stress is related to lower atmosphere drag and ocean surface dynamics. The magnitude of the stress influences the exchange of energy between the ocean and the atmosphere (evaporation, oxygen, carbon dioxide and other gases).","definition FR":"Le stress oc\xe9anique est li\xe9 \xe0 la train\xe9e de la basse atmosph\xe8re et \xe0 la dynamique de surface de l'oc\xe9an. L'ampleur du stress influence l'\xe9change d'\xe9nergie entre l'oc\xe9an et l'atmosph\xe8re (\xe9vaporation, oxyg\xe8ne, dioxyde de carbon et gaz autres).",icon:"sea-surface-stress.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=17463"},{category:"Physical",value:"oceanBottomPressure","label EN":"Ocean Bottom Pressure","label FR":"Pression au fond de l'oc\xe9an","definition EN":"Ocean bottom pressure is the total pressure resulting from the weight or mass of the column of seawater and the overlaying atmosphere.","definition FR":"La pression au fond de l'oc\xe9an est la pression totale r\xe9sultant du poids ou de la masse de la colonne d'eau de mer et de l'atmosph\xe8re qui la recouvre.",icon:"ocean-bottom-pressure.svg",url:"https://www.goosocean.org/index.php?option=com_oe&task=viewDocumentRecord&docID=32488"}];var mS=(0,i.createContext)(null),gS=function(e){var t=e.utils,n=e.children,r=e.locale,o=e.libInstance,a=(0,i.useMemo)((function(){return new t({locale:r,instance:o})}),[t,o,r]);return(0,i.createElement)(mS.Provider,{value:a,children:n})},vS=function(e){if(!e)throw new Error("Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports. Recommendation: use named imports from the module index.")};function bS(){var e=(0,i.useContext)(mS);return vS(e),e}var yS=i.forwardRef((function(e,t){var n=e.disableSpacing,r=void 0!==n&&n,o=e.classes,a=e.className,s=(0,Yn.c)(e,["disableSpacing","classes","className"]);return i.createElement("div",(0,at.c)({className:(0,kn.c)(o.root,a,!r&&o.spacing),ref:t},s))}));const _S=(0,Gn.c)({root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},spacing:{"& > :not(:first-child)":{marginLeft:8}}},{name:"MuiDialogActions"})(yS);var xS=i.forwardRef((function(e,t){var n=e.classes,r=e.className,o=e.dividers,a=void 0!==o&&o,s=(0,Yn.c)(e,["classes","className","dividers"]);return i.createElement("div",(0,at.c)({className:(0,kn.c)(n.root,r,a&&n.dividers),ref:t},s))}));const wS=(0,Gn.c)((function(e){return{root:{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"8px 24px","&:first-child":{paddingTop:20}},dividers:{padding:"16px 24px",borderTop:"1px solid ".concat(e.palette.divider),borderBottom:"1px solid ".concat(e.palette.divider)}}}),{name:"MuiDialogContent"})(xS);var ES={enter:Ao.rV.enteringScreen,exit:Ao.rV.leavingScreen},TS=i.forwardRef((function(e,t){var n=e.BackdropProps,r=e.children,o=e.classes,a=e.className,s=e.disableBackdropClick,l=void 0!==s&&s,c=e.disableEscapeKeyDown,u=void 0!==c&&c,d=e.fullScreen,p=void 0!==d&&d,h=e.fullWidth,f=void 0!==h&&h,m=e.maxWidth,g=void 0===m?"sm":m,v=e.onBackdropClick,b=e.onClose,y=e.onEnter,_=e.onEntered,x=e.onEntering,w=e.onEscapeKeyDown,E=e.onExit,T=e.onExited,C=e.onExiting,k=e.open,S=e.PaperComponent,O=void 0===S?Xn:S,A=e.PaperProps,j=void 0===A?{}:A,P=e.scroll,I=void 0===P?"paper":P,L=e.TransitionComponent,R=void 0===L?Lo:L,N=e.transitionDuration,D=void 0===N?ES:N,M=e.TransitionProps,B=e["aria-describedby"],Q=e["aria-labelledby"],U=(0,Yn.c)(e,["BackdropProps","children","classes","className","disableBackdropClick","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","onEnter","onEntered","onEntering","onEscapeKeyDown","onExit","onExited","onExiting","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps","aria-describedby","aria-labelledby"]),F=i.useRef();return i.createElement(ti,(0,at.c)({className:(0,kn.c)(o.root,a),BackdropComponent:No,BackdropProps:(0,at.c)({transitionDuration:D},n),closeAfterTransition:!0},l?{disableBackdropClick:l}:{},{disableEscapeKeyDown:u,onEscapeKeyDown:w,onClose:b,open:k,ref:t},U),i.createElement(R,(0,at.c)({appear:!0,in:k,timeout:D,onEnter:y,onEntering:x,onEntered:_,onExit:E,onExiting:C,onExited:T,role:"none presentation"},M),i.createElement("div",{className:(0,kn.c)(o.container,o["scroll".concat((0,Zn.c)(I))]),onMouseUp:function(e){e.target===e.currentTarget&&e.target===F.current&&(F.current=null,v&&v(e),!l&&b&&b(e,"backdropClick"))},onMouseDown:function(e){F.current=e.target}},i.createElement(O,(0,at.c)({elevation:24,role:"dialog","aria-describedby":B,"aria-labelledby":Q},j,{className:(0,kn.c)(o.paper,o["paperScroll".concat((0,Zn.c)(I))],o["paperWidth".concat((0,Zn.c)(String(g)))],j.className,p&&o.paperFullScreen,f&&o.paperFullWidth)}),r))))}));const CS=(0,Gn.c)((function(e){return{root:{"@media print":{position:"absolute !important"}},scrollPaper:{display:"flex",justifyContent:"center",alignItems:"center"},scrollBody:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}},container:{height:"100%","@media print":{height:"auto"},outline:0},paper:{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},paperScrollPaper:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},paperScrollBody:{display:"inline-block",verticalAlign:"middle",textAlign:"left"},paperWidthFalse:{maxWidth:"calc(100% - 64px)"},paperWidthXs:{maxWidth:Math.max(e.breakpoints.values.xs,444),"&$paperScrollBody":(0,nr.c)({},e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64),{maxWidth:"calc(100% - 64px)"})},paperWidthSm:{maxWidth:e.breakpoints.values.sm,"&$paperScrollBody":(0,nr.c)({},e.breakpoints.down(e.breakpoints.values.sm+64),{maxWidth:"calc(100% - 64px)"})},paperWidthMd:{maxWidth:e.breakpoints.values.md,"&$paperScrollBody":(0,nr.c)({},e.breakpoints.down(e.breakpoints.values.md+64),{maxWidth:"calc(100% - 64px)"})},paperWidthLg:{maxWidth:e.breakpoints.values.lg,"&$paperScrollBody":(0,nr.c)({},e.breakpoints.down(e.breakpoints.values.lg+64),{maxWidth:"calc(100% - 64px)"})},paperWidthXl:{maxWidth:e.breakpoints.values.xl,"&$paperScrollBody":(0,nr.c)({},e.breakpoints.down(e.breakpoints.values.xl+64),{maxWidth:"calc(100% - 64px)"})},paperFullWidth:{width:"calc(100% - 64px)"},paperFullScreen:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,"&$paperScrollBody":{margin:0,maxWidth:"100%"}}}}),{name:"MuiDialog"})(TS);function kS(e,t){return Array.isArray(t)?t.every((function(t){return-1!==e.indexOf(t)})):-1!==e.indexOf(t)}var SS=An((function(e){return{staticWrapperRoot:{overflow:"hidden",minWidth:310,display:"flex",flexDirection:"column",backgroundColor:e.palette.background.paper}}}),{name:"MuiPickersStaticWrapper"}),OS=function(e){var t=e.children,n=SS();return(0,i.createElement)("div",{className:n.staticWrapperRoot,children:t})},AS=function(e){var t=e.children,n=e.classes,r=e.onAccept,o=e.onDismiss,a=e.onClear,s=e.onSetToday,l=e.okLabel,c=e.cancelLabel,u=e.clearLabel,d=e.todayLabel,p=e.clearable,h=e.showTodayButton,f=(e.showTabs,e.wider),m=(0,Yn.c)(e,["children","classes","onAccept","onDismiss","onClear","onSetToday","okLabel","cancelLabel","clearLabel","todayLabel","clearable","showTodayButton","showTabs","wider"]);return(0,i.createElement)(CS,(0,at.c)({role:"dialog",onClose:o,classes:{paper:(0,kn.c)(n.dialogRoot,f&&n.dialogRootWider)}},m),(0,i.createElement)(wS,{children:t,className:n.dialog}),(0,i.createElement)(_S,{classes:{root:(0,kn.c)((p||h)&&n.withAdditionalAction)}},p&&(0,i.createElement)(c_,{color:"primary",onClick:a},u),h&&(0,i.createElement)(c_,{color:"primary",onClick:s},d),c&&(0,i.createElement)(c_,{color:"primary",onClick:o},c),l&&(0,i.createElement)(c_,{color:"primary",onClick:r},l)))};AS.displayName="ModalDialog";var jS={dialogRoot:{minWidth:310},dialogRootWider:{minWidth:325},dialog:{"&:first-child":{padding:0}},withAdditionalAction:{justifyContent:"flex-start","& > *:first-child":{marginRight:"auto"}}},PS=(0,Gn.c)(jS,{name:"MuiPickersModal"})(AS),IS="undefined"===typeof window?i.useEffect:i.useLayoutEffect;function LS(e,t){var n=t[e.key];n&&(n(),e.preventDefault())}function RS(e,t){var n=(0,i.useRef)(t);n.current=t,IS((function(){if(e){var t=function(e){LS(e,n.current)};return window.addEventListener("keydown",t),function(){window.removeEventListener("keydown",t)}}}),[e])}var NS=function(e){var t=e.open,n=e.children,r=e.okLabel,o=e.cancelLabel,a=e.clearLabel,s=e.todayLabel,l=e.showTodayButton,c=e.clearable,u=e.DialogProps,d=e.showTabs,p=e.wider,h=e.InputComponent,f=e.DateInputProps,m=e.onClear,g=e.onAccept,v=e.onDismiss,b=e.onSetToday,y=(0,Yn.c)(e,["open","children","okLabel","cancelLabel","clearLabel","todayLabel","showTodayButton","clearable","DialogProps","showTabs","wider","InputComponent","DateInputProps","onClear","onAccept","onDismiss","onSetToday"]);return RS(t,{Enter:g}),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(h,(0,at.c)({},y,f)),(0,i.createElement)(PS,(0,at.c)({wider:p,showTabs:d,open:t,onClear:m,onAccept:g,onDismiss:v,onSetToday:b,clearLabel:a,todayLabel:s,okLabel:r,cancelLabel:o,clearable:c,showTodayButton:l,children:n},u)))};NS.defaultProps={okLabel:"OK",cancelLabel:"Cancel",clearLabel:"Clear",todayLabel:"Today",clearable:!1,showTodayButton:!1};var DS=function(e){var t=e.open,n=(e.wider,e.children),r=e.PopoverProps,o=(e.onClear,e.onDismiss),a=(e.onSetToday,e.onAccept),s=(e.showTabs,e.DateInputProps),l=e.InputComponent,c=(0,Yn.c)(e,["open","wider","children","PopoverProps","onClear","onDismiss","onSetToday","onAccept","showTabs","DateInputProps","InputComponent"]),u=(0,i.useRef)();return RS(t,{Enter:a}),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(l,(0,at.c)({},c,s,{inputRef:u})),(0,i.createElement)(Ei,(0,at.c)({open:t,onClose:o,anchorEl:u.current,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:n},r)))};var MS=(0,i.createContext)(null),BS=function(e){var t=e.variant,n=(0,Yn.c)(e,["variant"]),r=function(e){switch(e){case"inline":return DS;case"static":return OS;default:return NS}}(t);return(0,i.createElement)(MS.Provider,{value:t||"dialog"},(0,i.createElement)(r,n))},QS=function(e){function t(t){var n;return(n=e.call(this,t)||this)._state=null,n._del=!1,n._handleChange=function(e){var t=n.state.value,r=e.target.value,i=e.target,o=r.length>t.length,a=n._del,s=t===n.props.format(r);n.setState({value:r,local:!0},(function(){var e=i.selectionStart,l=n.props.refuse||/[^\d]+/g,c=r.substr(0,e).replace(l,"");if(n._state={input:i,before:c,op:o,di:a&&s,del:a},n.props.replace&&n.props.replace(t)&&o&&!s){for(var u=-1,d=0;d!==c.length;++d)u=Math.max(u,r.toLowerCase().indexOf(c[d].toLowerCase(),u+1));var p=r.substr(u+1).replace(l,"")[0];u=r.indexOf(p,u+1),r=""+r.substr(0,u)+r.substr(u+1)}var h=n.props.format(r);t===h?n.setState({value:r}):n.props.onChange(h)}))},n._hKD=function(e){"Delete"===e.code&&(n._del=!0)},n._hKU=function(e){"Delete"===e.code&&(n._del=!1)},n.state={value:t.value,local:!0},n}(0,rt.c)(t,e),t.getDerivedStateFromProps=function(e,t){return{value:t.local?t.value:e.value,local:!1}};var n=t.prototype;return n.render=function(){var e=this._handleChange,t=this.state.value;return(0,this.props.children)({value:t,onChange:e})},n.componentWillUnmount=function(){document.removeEventListener("keydown",this._hKD),document.removeEventListener("keyup",this._hKU)},n.componentDidMount=function(){document.addEventListener("keydown",this._hKD),document.addEventListener("keyup",this._hKU)},n.componentDidUpdate=function(){var e=this._state;if(e){for(var t=this.state.value,n=-1,r=0;r!==e.before.length;++r)n=Math.max(n,t.toLowerCase().indexOf(e.before[r].toLowerCase(),n+1));if(this.props.replace&&(e.op||e.del&&!e.di))for(;t[n+1]&&(this.props.refuse||/[^\d]+/).test(t[n+1]);)n+=1;e.input.selectionStart=e.input.selectionEnd=n+1+(e.di?1:0)}this._state=null},t}(i.Component),US=n(4484);function FS(e,t){if(t&&("object"===(0,Pr.c)(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,ur.c)(e)}function zS(e){return zS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zS(e)}var qS=n(7796);function HS(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,qS.c)(e,t)}var WS=An((function(e){return{day:{width:36,height:36,fontSize:e.typography.caption.fontSize,margin:"0 2px",color:e.palette.text.primary,fontWeight:e.typography.fontWeightMedium,padding:0},hidden:{opacity:0,pointerEvents:"none"},current:{color:e.palette.primary.main,fontWeight:600},daySelected:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{backgroundColor:e.palette.primary.main}},dayDisabled:{pointerEvents:"none",color:e.palette.text.hint}}}),{name:"MuiPickersDay"}),GS=function(e){var t=e.children,n=e.disabled,r=e.hidden,o=e.current,a=e.selected,s=(0,Yn.c)(e,["children","disabled","hidden","current","selected"]),l=WS(),c=(0,kn.c)(l.day,r&&l.hidden,o&&l.current,a&&l.daySelected,n&&l.dayDisabled);return(0,i.createElement)(Cr,(0,at.c)({className:c,tabIndex:r||n?-1:0},s),(0,i.createElement)(Or,{variant:"body2",color:"inherit"},t))};GS.displayName="Day",GS.defaultProps={disabled:!1,hidden:!1,current:!1,selected:!1};const VS=GS;function $S(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var KS=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"===typeof n.className?n.className=$S(n.className,r):n.setAttribute("class",$S(n.className&&n.className.baseVal||"",r)));var n,r}))},YS=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i *":{position:"absolute",top:0,right:0,left:0}},"slideEnter-left":{willChange:"transform",transform:"translate(100%)"},"slideEnter-right":{willChange:"transform",transform:"translate(-100%)"},slideEnterActive:{transform:"translate(0%)",transition:t},slideExit:{transform:"translate(0%)"},"slideExitActiveLeft-left":{willChange:"transform",transform:"translate(-200%)",transition:t},"slideExitActiveLeft-right":{willChange:"transform",transform:"translate(200%)",transition:t}}}),{name:"MuiPickersSlideTransition"}),nO=function(e){var t=e.children,n=e.transKey,r=e.slideDirection,o=e.className,a=void 0===o?null:o,s=tO(),l={exit:s.slideExit,enterActive:s.slideEnterActive,enter:s["slideEnter-"+r],exitActive:s["slideExitActiveLeft-"+r]};return(0,i.createElement)(vr,{className:(0,kn.c)(s.transitionContainer,a),childFactory:function(e){return(0,i.cloneElement)(e,{classNames:l})}},(0,i.createElement)(ZS,{mountOnEnter:!0,unmountOnExit:!0,key:n+r,timeout:350,classNames:l,children:t}))},rO=An((function(e){return{switchHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:e.spacing(.5),marginBottom:e.spacing(1)},transitionContainer:{width:"100%",overflow:"hidden",height:23},iconButton:{zIndex:1,backgroundColor:e.palette.background.paper},daysHeader:{display:"flex",justifyContent:"center",alignItems:"center",maxHeight:16},dayLabel:{width:36,margin:"0 2px",textAlign:"center",color:e.palette.text.hint}}}),{name:"MuiPickersCalendarHeader"}),iO=function(e){var t=e.currentMonth,n=e.onMonthChange,r=e.leftArrowIcon,o=e.rightArrowIcon,a=e.leftArrowButtonProps,s=e.rightArrowButtonProps,l=e.disablePrevMonth,c=e.disableNextMonth,u=e.slideDirection,d=bS(),p=rO(),h="rtl"===Pn().direction;return(0,i.createElement)("div",null,(0,i.createElement)("div",{className:p.switchHeader},(0,i.createElement)(Cr,(0,at.c)({},a,{disabled:l,onClick:function(){return n(d.getPreviousMonth(t),"right")},className:p.iconButton}),h?o:r),(0,i.createElement)(nO,{slideDirection:u,transKey:t.toString(),className:p.transitionContainer},(0,i.createElement)(Or,{align:"center",variant:"body1"},d.getCalendarHeaderText(t))),(0,i.createElement)(Cr,(0,at.c)({},s,{disabled:c,onClick:function(){return n(d.getNextMonth(t),"left")},className:p.iconButton}),h?r:o)),(0,i.createElement)("div",{className:p.daysHeader},d.getWeekdays().map((function(e,t){return(0,i.createElement)(Or,{key:t,variant:"caption",className:p.dayLabel},e)}))))};iO.displayName="CalendarHeader",iO.defaultProps={leftArrowIcon:(0,i.createElement)((function(e){return i.createElement(US.c,e,i.createElement("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),i.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}))}),null),rightArrowIcon:(0,i.createElement)((function(e){return i.createElement(US.c,e,i.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),i.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}))}),null),disablePrevMonth:!1,disableNextMonth:!1};var oO=function(e){var t=e.onKeyDown;return(0,i.useEffect)((function(){return window.addEventListener("keydown",t),function(){window.removeEventListener("keydown",t)}}),[t]),null},aO=function(e){function t(){var e,n;zr(this,t);for(var r=arguments.length,o=new Array(r),a=0;a 1&&void 0!==arguments[1])||arguments[1],r=n.props,i=r.date,o=r.utils;n.props.onChange(o.mergeDateAndTime(e,i),t)},n.moveToDay=function(e){var t=n.props.utils;e&&!n.shouldDisableDate(e)&&(t.getMonth(e)!==t.getMonth(n.state.currentMonth)&&n.handleChangeMonth(t.startOfMonth(e),"left"),n.handleDaySelect(e,!1))},n.handleKeyDown=function(e){var t=n.props,r=t.theme,i=t.date,o=t.utils;LS(e,{ArrowUp:function(){return n.moveToDay(o.addDays(i,-7))},ArrowDown:function(){return n.moveToDay(o.addDays(i,7))},ArrowLeft:function(){return n.moveToDay(o.addDays(i,"ltr"===r.direction?-1:1))},ArrowRight:function(){return n.moveToDay(o.addDays(i,"ltr"===r.direction?1:-1))}})},n.renderWeeks=function(){var e=n.props,t=e.utils,r=e.classes;return t.getWeekArray(n.state.currentMonth).map((function(e){return(0,i.createElement)("div",{key:"week-".concat(e[0].toString()),className:r.week},n.renderDays(e))}))},n.renderDays=function(e){var t=n.props,r=t.date,o=t.renderDay,a=t.utils,s=a.date(),l=a.startOfDay(r),c=a.getMonth(n.state.currentMonth);return e.map((function(e){var t=n.shouldDisableDate(e),r=a.getMonth(e)===c,u=(0,i.createElement)(VS,{disabled:t,current:a.isSameDay(e,s),hidden:!r,selected:a.isSameDay(l,e)},a.getDayText(e));return o&&(u=o(e,l,r,u)),(0,i.createElement)(eO,{value:e,key:e.toString(),disabled:t,dayInCurrentMonth:r,onSelect:n.handleDaySelect},u)}))},n}return HS(t,e),(0,qr.c)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.date,n=e.minDate,r=e.maxDate,i=e.utils,o=e.disablePast,a=e.disableFuture;if(this.shouldDisableDate(t)){var s=function(e){var t=e.date,n=e.utils,r=e.minDate,i=e.maxDate,o=e.disableFuture,a=e.disablePast,s=e.shouldDisableDate,l=n.startOfDay(n.date());a&&n.isBefore(r,l)&&(r=l),o&&n.isAfter(i,l)&&(i=l);var c=t,u=t;for(n.isBefore(t,r)&&(c=n.date(r),u=null),n.isAfter(t,i)&&(u&&(u=n.date(i)),c=null);c||u;){if(c&&n.isAfter(c,i)&&(c=null),u&&n.isBefore(u,r)&&(u=null),c){if(!s(c))return c;c=n.addDays(c,1)}if(u){if(!s(u))return u;u=n.addDays(u,-1)}}return n.date()}({date:t,utils:i,minDate:i.date(n),maxDate:i.date(r),disablePast:Boolean(o),disableFuture:Boolean(a),shouldDisableDate:this.shouldDisableDate});this.handleDaySelect(s,!1)}}},{key:"render",value:function(){var e=this.state,t=e.currentMonth,n=e.slideDirection,r=this.props,o=r.classes,a=r.allowKeyboardControl,s=r.leftArrowButtonProps,l=r.leftArrowIcon,c=r.rightArrowButtonProps,u=r.rightArrowIcon,d=r.loadingIndicator,p=d||(0,i.createElement)(r_,null);return(0,i.createElement)(i.Fragment,null,a&&"static"!==this.context&&(0,i.createElement)(oO,{onKeyDown:this.handleKeyDown}),(0,i.createElement)(iO,{currentMonth:t,slideDirection:n,onMonthChange:this.handleChangeMonth,leftArrowIcon:l,leftArrowButtonProps:s,rightArrowIcon:u,rightArrowButtonProps:c,disablePrevMonth:this.shouldDisablePrevMonth(),disableNextMonth:this.shouldDisableNextMonth()}),(0,i.createElement)(nO,{slideDirection:n,transKey:t.toString(),className:o.transitionContainer},(0,i.createElement)(i.Fragment,null,this.state.loadingQueue>0&&(0,i.createElement)("div",{className:o.progressContainer},p)||(0,i.createElement)("div",null,this.renderWeeks()))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.utils,r=e.date;if(!n.isEqual(r,t.lastDate)){var i=n.getMonth(r),o=t.lastDate||r,a=n.getMonth(o);return{lastDate:r,currentMonth:e.utils.startOfMonth(r),slideDirection:i===a?t.slideDirection:n.isAfterDay(r,o)?"left":"right"}}return null}}]),t}(i.Component);aO.contextType=MS,aO.defaultProps={minDate:new Date("1900-01-01"),maxDate:new Date("2100-01-01"),disablePast:!1,disableFuture:!1,allowKeyboardControl:!0};var sO,lO=(0,Gn.c)((function(e){return{transitionContainer:{minHeight:216,marginTop:e.spacing(1.5)},progressContainer:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},week:{display:"flex",justifyContent:"center"}}}),{name:"MuiPickersCalendar",withTheme:!0})(function(e){var t=function(t){var n=bS();return(0,i.createElement)(e,(0,at.c)({utils:n},t))};return t.displayName="WithUtils(".concat(e.displayName||e.name,")"),t}(aO));!function(e){e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds"}(sO||(sO={}));var cO=sO,uO=function(e){function t(){var e,n;zr(this,t);for(var r=arguments.length,i=new Array(r),o=0;o 12&&(o-=360),{height:r?"26%":"40%",transform:"rotateZ(".concat(o,"deg)")}},n}return HS(t,e),(0,qr.c)(t,[{key:"render",value:function(){var e=this.props,t=e.classes,n=e.hasSelected;return(0,i.createElement)("div",{style:this.getAngleStyle(),className:(0,kn.c)(t.pointer,this.state.toAnimateTransform&&t.animateTransform)},(0,i.createElement)("div",{className:(0,kn.c)(t.thumb,n&&t.noPoint)}))}}]),t}(i.Component);uO.getDerivedStateFromProps=function(e,t){return e.type!==t.previousType?{toAnimateTransform:!0,previousType:e.type}:{toAnimateTransform:!1,previousType:e.type}};var dO=(0,Gn.c)((function(e){return{pointer:{width:2,backgroundColor:e.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},animateTransform:{transition:e.transitions.create(["transform","height"])},thumb:{width:4,height:4,backgroundColor:e.palette.primary.contrastText,borderRadius:"100%",position:"absolute",top:-21,left:-15,border:"14px solid ".concat(e.palette.primary.main),boxSizing:"content-box"},noPoint:{backgroundColor:e.palette.primary.main}}}),{name:"MuiPickersClockPointer"})(uO),pO={x:130,y:130},hO=pO.x-pO.x,fO=0-pO.y,mO=function(e,t,n){var r=t-pO.x,i=n-pO.y,o=Math.atan2(hO,fO)-Math.atan2(r,i),a=57.29577951308232*o;a=Math.round(a/e)*e,a%=360;var s=Math.floor(a/e)||0,l=Math.pow(r,2)+Math.pow(i,2);return{value:s,distance:Math.sqrt(l)}},gO=function(e){function t(){var e,n;zr(this,t);for(var r=arguments.length,i=new Array(r),o=0;o 1&&void 0!==arguments[1]&&arguments[1],n=e.offsetX,r=e.offsetY;if("undefined"===typeof n){var i=e.target.getBoundingClientRect();n=e.changedTouches[0].clientX-i.left,r=e.changedTouches[0].clientY-i.top}var o=this.props.type===cO.SECONDS||this.props.type===cO.MINUTES?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=mO(6*n,e,t).value;return r*n%60}(n,r,this.props.minutesStep):function(e,t,n){var r=mO(30,e,t),i=r.value,o=r.distance;return i=i||12,n?i%=12:o<90&&(i+=12,i%=24),i}(n,r,Boolean(this.props.ampm));this.props.onChange(o,t)}},{key:"render",value:function(){var e=this.props,t=e.classes,n=e.value,r=e.children,o=e.type,a=!e.ampm&&o===cO.HOURS&&(n<1||n>12);return(0,i.createElement)("div",{className:t.container},(0,i.createElement)("div",{className:t.clock},(0,i.createElement)("div",{role:"menu",tabIndex:-1,className:t.squareMask,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd,onMouseUp:this.handleMouseUp,onMouseMove:this.handleMove}),(0,i.createElement)("div",{className:t.pin}),(0,i.createElement)(dO,{type:o,value:n,isInner:a,hasSelected:this.hasSelected()}),r))}}]),t}(i.Component);gO.defaultProps={ampm:!1,minutesStep:1};var vO=(0,Gn.c)((function(e){return{container:{display:"flex",justifyContent:"center",alignItems:"flex-end",margin:"".concat(e.spacing(2),"px 0 ").concat(e.spacing(1),"px")},clock:{backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:260,width:260,position:"relative",pointerEvents:"none"},squareMask:{width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:"none",touchActions:"none",userSelect:"none","&:active":{cursor:"move"}},pin:{width:6,height:6,borderRadius:"50%",backgroundColor:e.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}}}),{name:"MuiPickersClock"})(gO),bO={0:[0,40],1:[55,19.6],2:[94.4,59.5],3:[109,114],4:[94.4,168.5],5:[54.5,208.4],6:[0,223],7:[-54.5,208.4],8:[-94.4,168.5],9:[-109,114],10:[-94.4,59.5],11:[-54.5,19.6],12:[0,5],13:[36.9,49.9],14:[64,77],15:[74,114],16:[64,151],17:[37,178],18:[0,188],19:[-37,178],20:[-64,151],21:[-74,114],22:[-64,77],23:[-37,50]},yO=An((function(e){var t=e.spacing(4);return{clockNumber:{width:t,height:32,userSelect:"none",position:"absolute",left:"calc((100% - ".concat("number"===typeof t?"".concat(t,"px"):t,") / 2)"),display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:"light"===e.palette.type?e.palette.text.primary:e.palette.text.hint},clockNumberSelected:{color:e.palette.primary.contrastText}}}),{name:"MuiPickersClockNumber"}),_O=function(e){var t=e.selected,n=e.label,r=e.index,o=e.isInner,a=yO(),s=(0,kn.c)(a.clockNumber,t&&a.clockNumberSelected),l=(0,i.useMemo)((function(){var e=bO[r];return{transform:"translate(".concat(e[0],"px, ").concat(e[1],"px")}}),[r]);return(0,i.createElement)(Or,{component:"span",className:s,variant:o?"body2":"body1",style:l,children:n})},xO=function(e){for(var t=e.ampm,n=e.utils,r=e.date,o=n.getHours(r),a=[],s=t?12:23,l=function(e){return t?12===e?12===o||0===o:o===e||o-12===e:o===e},c=t?1:0;c<=s;c+=1){var u=c.toString();0===c&&(u="00");var d={index:c,label:n.formatNumber(u),selected:l(c),isInner:!t&&(0===c||c>12)};a.push((0,i.createElement)(_O,(0,at.c)({key:c},d)))}return a},wO=function(e){var t=e.value,n=e.utils.formatNumber;return[(0,i.createElement)(_O,{label:n("00"),selected:0===t,index:12,key:12}),(0,i.createElement)(_O,{label:n("05"),selected:5===t,index:1,key:1}),(0,i.createElement)(_O,{label:n("10"),selected:10===t,index:2,key:2}),(0,i.createElement)(_O,{label:n("15"),selected:15===t,index:3,key:3}),(0,i.createElement)(_O,{label:n("20"),selected:20===t,index:4,key:4}),(0,i.createElement)(_O,{label:n("25"),selected:25===t,index:5,key:5}),(0,i.createElement)(_O,{label:n("30"),selected:30===t,index:6,key:6}),(0,i.createElement)(_O,{label:n("35"),selected:35===t,index:7,key:7}),(0,i.createElement)(_O,{label:n("40"),selected:40===t,index:8,key:8}),(0,i.createElement)(_O,{label:n("45"),selected:45===t,index:9,key:9}),(0,i.createElement)(_O,{label:n("50"),selected:50===t,index:10,key:10}),(0,i.createElement)(_O,{label:n("55"),selected:55===t,index:11,key:11})]},EO=function(e){var t=e.type,n=e.onHourChange,r=e.onMinutesChange,o=e.onSecondsChange,a=e.ampm,s=e.date,l=e.minutesStep,c=bS(),u=(0,i.useMemo)((function(){switch(t){case cO.HOURS:return{value:c.getHours(s),children:xO({date:s,utils:c,ampm:Boolean(a)}),onChange:function(e,t){var r=function(e,t){return t.getHours(e)>=12?"pm":"am"}(s,c),i=function(e,t,n,r){if(n&&(r.getHours(e)>=12?"pm":"am")!==t){var i="am"===t?r.getHours(e)-12:r.getHours(e)+12;return r.setHours(e,i)}return e}(c.setHours(s,e),r,Boolean(a),c);n(i,t)}};case cO.MINUTES:var e=c.getMinutes(s);return{value:e,children:wO({value:e,utils:c}),onChange:function(e,t){var n=c.setMinutes(s,e);r(n,t)}};case cO.SECONDS:var i=c.getSeconds(s);return{value:i,children:wO({value:i,utils:c}),onChange:function(e,t){var n=c.setSeconds(s,e);o(n,t)}};default:throw new Error("You must provide the type for TimePickerView")}}),[a,s,n,r,o,t,c]);return(0,i.createElement)(vO,(0,at.c)({type:t,ampm:a,minutesStep:l},u))};EO.displayName="TimePickerView",EO.defaultProps={ampm:!0,minutesStep:1};(0,i.memo)(EO);function TO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(0,it.oneOfType)([it.object,it.string,it.number,(0,it.instanceOf)(Date)]),(0,it.oneOf)(["year","month","day"]);var CO={minDate:new Date("1900-01-01"),maxDate:new Date("2100-01-01"),invalidDateMessage:"Invalid Date Format",minDateMessage:"Date should not be before minimal date",maxDateMessage:"Date should not be after maximal date",allowKeyboardControl:!0};!function(e){for(var t=1;t 1&&void 0!==arguments[1])||arguments[1];x(e),t&&n?w(e):"inline"!==u&&"static"!==u||(s(e),a&&a(e))}}}),[w,n,a,s,_,u]),C=JO(c,d,e);(0,i.useEffect)((function(){l&&l(C,c)}),[l,C,c]);var k=KO(g,v,d,null===c,e),S={pickerProps:T,inputProps:(0,i.useMemo)((function(){return{inputValue:k,validationError:C,openPicker:function(){return!o&&!r&&f(!0)}}}),[r,k,o,f,C]),wrapperProps:E};return(0,i.useDebugValue)(S),S}function iA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oA(e){for(var t=1;t 1?"s":"")+" required, but only "+t.length+" present")}function gA(e){mA(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,Pr.c)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"===typeof e||"[object Number]"===t?new Date(e):("string"!==typeof e&&"[object String]"!==t||"undefined"===typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function vA(e,t){mA(2,arguments);var n=gA(e),r=fA(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function bA(e,t){mA(2,arguments);var n=gA(e),r=fA(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());return o.setMonth(n.getMonth()+r+1,0),i>=o.getDate()?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function yA(e,t){return mA(2,arguments),bA(e,12*fA(t))}function _A(e){mA(1,arguments);var t=gA(e);return t.setHours(23,59,59,999),t}pA.defaultProps=uA,hA.defaultProps=uA;var xA={};function wA(){return xA}function EA(e,t){var n,r,i,o,a,s,l,c;mA(1,arguments);var u=wA(),d=fA(null!==(n=null!==(r=null!==(i=null!==(o=null===t||void 0===t?void 0:t.weekStartsOn)&&void 0!==o?o:null===t||void 0===t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==i?i:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=gA(e),h=p.getDay(),f=6+(h =i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}var AA=6048e5;function jA(e){mA(1,arguments);var t=gA(e),n=SA(t).getTime()-function(e){mA(1,arguments);var t=OA(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),SA(n)}(t).getTime();return Math.round(n/AA)+1}function PA(e,t){var n,r,i,o,a,s,l,c;mA(1,arguments);var u=wA(),d=fA(null!==(n=null!==(r=null!==(i=null!==(o=null===t||void 0===t?void 0:t.weekStartsOn)&&void 0!==o?o:null===t||void 0===t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==i?i:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=gA(e),h=p.getUTCDay(),f=(h =1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var f=new Date(0);f.setUTCFullYear(d+1,0,h),f.setUTCHours(0,0,0,0);var m=PA(f,t),g=new Date(0);g.setUTCFullYear(d,0,h),g.setUTCHours(0,0,0,0);var v=PA(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}var LA=6048e5;function RA(e,t){mA(1,arguments);var n=gA(e),r=PA(n,t).getTime()-function(e,t){var n,r,i,o,a,s,l,c;mA(1,arguments);var u=wA(),d=fA(null!==(n=null!==(r=null!==(i=null!==(o=null===t||void 0===t?void 0:t.firstWeekContainsDate)&&void 0!==o?o:null===t||void 0===t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==i?i:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),p=IA(e,t),h=new Date(0);return h.setUTCFullYear(p,0,d),h.setUTCHours(0,0,0,0),PA(h,t)}(n,t).getTime();return Math.round(r/LA)+1}function NA(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length 0?n:1-n;return NA("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):NA(n+1,2)},d:function(e,t){return NA(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return NA(e.getUTCHours()%12||12,t.length)},H:function(e,t){return NA(e.getUTCHours(),t.length)},m:function(e,t){return NA(e.getUTCMinutes(),t.length)},s:function(e,t){return NA(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return NA(Math.floor(r*Math.pow(10,n-3)),t.length)}};const MA=DA;var BA="midnight",QA="noon",UA="morning",FA="afternoon",zA="evening",qA="night",HA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return MA.y(e,t)},Y:function(e,t,n,r){var i=IA(e,r),o=i>0?i:1-i;return"YY"===t?NA(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):NA(o,t.length)},R:function(e,t){return NA(OA(e),t.length)},u:function(e,t){return NA(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return NA(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return NA(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return MA.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return NA(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=RA(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):NA(i,t.length)},I:function(e,t,n){var r=jA(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):NA(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):MA.d(e,t)},D:function(e,t,n){var r=function(e){mA(1,arguments);var t=gA(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):NA(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return NA(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return NA(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return NA(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,i=e.getUTCHours();switch(r=12===i?QA:0===i?BA:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,i=e.getUTCHours();switch(r=i>=17?zA:i>=12?FA:i>=4?UA:qA,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return MA.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):MA.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):NA(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):NA(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):MA.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):MA.s(e,t)},S:function(e,t){return MA.S(e,t)},X:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return GA(i);case"XXXX":case"XX":return VA(i);default:return VA(i,":")}},x:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return GA(i);case"xxxx":case"xx":return VA(i);default:return VA(i,":")}},O:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+WA(i,":");default:return"GMT"+VA(i,":")}},z:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+WA(i,":");default:return"GMT"+VA(i,":")}},t:function(e,t,n,r){var i=r._originalDate||e;return NA(Math.floor(i.getTime()/1e3),t.length)},T:function(e,t,n,r){return NA((r._originalDate||e).getTime(),t.length)}};function WA(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=t||"";return n+String(i)+a+NA(o,2)}function GA(e,t){return e%60===0?(e>0?"-":"+")+NA(Math.abs(e)/60,2):VA(e,t)}function VA(e,t){var n=t||"",r=e>0?"-":"+",i=Math.abs(e);return r+NA(Math.floor(i/60),2)+n+NA(i%60,2)}const $A=HA;var KA=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},YA=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},ZA={p:YA,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return KA(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",KA(i,t)).replace("{{time}}",YA(o,t))}};const JA=ZA;function XA(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}var ej=["D","DD"],tj=["YY","YYYY"];function nj(e){return-1!==ej.indexOf(e)}function rj(e){return-1!==tj.indexOf(e)}function ij(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var oj={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};const aj=function(e,t,n){var r,i=oj[e];return r="string"===typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!==n&&void 0!==n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function sj(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const lj={date:sj({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:sj({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:sj({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})};var cj={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};const uj=function(e,t,n,r){return cj[e]};function dj(e){return function(t,n){var r;if("formatting"===(null!==n&&void 0!==n&&n.context?String(n.context):"standalone")&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,o=null!==n&&void 0!==n&&n.width?String(n.width):i;r=e.formattingValues[o]||e.formattingValues[i]}else{var a=e.defaultWidth,s=null!==n&&void 0!==n&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const pj={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:dj({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:dj({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:dj({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:dj({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:dj({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function hj(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var a,s=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(var n=0;n 1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(fj.matchPattern);if(!n)return null;var r=n[0],i=e.match(fj.parsePattern);if(!i)return null;var o=fj.valueCallback?fj.valueCallback(i[0]):i[0];return{value:o=t.valueCallback?t.valueCallback(o):o,rest:e.slice(r.length)}}),era:hj({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:hj({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:hj({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:hj({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:hj({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};const gj={code:"en-US",formatDistance:aj,formatLong:lj,formatRelative:uj,localize:pj,match:mj,options:{weekStartsOn:0,firstWeekContainsDate:1}};var vj=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bj=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yj=/^'([^]*?)'?$/,_j=/''/g,xj=/[a-zA-Z]/;function wj(e,t,n){var r,i,o,a,s,l,c,u,d,p,h,f,m,g,v,b,y,_;mA(2,arguments);var x=String(t),w=wA(),E=null!==(r=null!==(i=null===n||void 0===n?void 0:n.locale)&&void 0!==i?i:w.locale)&&void 0!==r?r:gj,T=fA(null!==(o=null!==(a=null!==(s=null!==(l=null===n||void 0===n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null===n||void 0===n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==s?s:w.firstWeekContainsDate)&&void 0!==a?a:null===(d=w.locale)||void 0===d||null===(p=d.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==o?o:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=fA(null!==(h=null!==(f=null!==(m=null!==(g=null===n||void 0===n?void 0:n.weekStartsOn)&&void 0!==g?g:null===n||void 0===n||null===(v=n.locale)||void 0===v||null===(b=v.options)||void 0===b?void 0:b.weekStartsOn)&&void 0!==m?m:w.weekStartsOn)&&void 0!==f?f:null===(y=w.locale)||void 0===y||null===(_=y.options)||void 0===_?void 0:_.weekStartsOn)&&void 0!==h?h:0);if(!(C>=0&&C<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var k=gA(e);if(!CA(k))throw new RangeError("Invalid time value");var S=kA(k,XA(k)),O={firstWeekContainsDate:T,weekStartsOn:C,locale:E,_originalDate:k};return x.match(bj).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,JA[t])(e,E.formatLong):e})).join("").match(vj).map((function(r){if("''"===r)return"'";var i=r[0];if("'"===i)return function(e){var t=e.match(yj);if(!t)return e;return t[1].replace(_j,"'")}(r);var o=$A[i];if(o)return null!==n&&void 0!==n&&n.useAdditionalWeekYearTokens||!rj(r)||ij(r,t,String(e)),null!==n&&void 0!==n&&n.useAdditionalDayOfYearTokens||!nj(r)||ij(r,t,String(e)),o(S,r,E.localize,O);if(i.match(xj))throw new RangeError("Format string contains an unescaped latin alphabet character `"+i+"`");return r})).join("")}function Ej(e,t){mA(2,arguments);var n=gA(e),r=gA(t);return n.getTime()>r.getTime()}function Tj(e,t){mA(2,arguments);var n=gA(e),r=gA(t);return n.getTime() =e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Oj(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function Aj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Aj=function(){return!!e})()}function jj(e){var t=Aj();return function(){var n,r=zS(e);if(t){var i=zS(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return FS(this,n)}}var Pj=function(){function e(){zr(this,e),(0,nr.c)(this,"priority",void 0),(0,nr.c)(this,"subPriority",0)}return(0,qr.c)(e,[{key:"validate",value:function(e,t){return!0}}]),e}(),Ij=function(e){HS(n,e);var t=jj(n);function n(e,r,i,o,a){var s;return zr(this,n),(s=t.call(this)).value=e,s.validateValue=r,s.setValue=i,s.priority=o,a&&(s.subPriority=a),s}return(0,qr.c)(n,[{key:"validate",value:function(e,t){return this.validateValue(e,this.value,t)}},{key:"set",value:function(e,t,n){return this.setValue(e,t,this.value,n)}}]),n}(Pj),Lj=function(e){HS(n,e);var t=jj(n);function n(){var e;zr(this,n);for(var r=arguments.length,i=new Array(r),o=0;o 0,i=r?t:1-t;if(i<=50)n=e||100;else{var o=i+50;n=e+100*Math.floor(o/100)-(e>=o%100?100:0)}return r?n:1-n}function fP(e){return e%400===0||e%4===0&&e%100!==0}var mP=function(e){HS(n,e);var t=jj(n);function n(){var e;zr(this,n);for(var r=arguments.length,i=new Array(r),o=0;o