@openmrs/esm-stock-management-app 3.2.2-pre.1777 → 3.2.2-pre.1781
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/6168.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
(globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([["6168"],{7581(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},5238(e){e.exports=function(e,t,n){var r=t.prototype,a=function(e){var t=e.date,a=e.utc,o={};if(!(null===t||t instanceof Date||t instanceof Array||r.$utils().u(t)||"Object"!==t.constructor.name)){if(!Object.keys(t).length)return new Date;var i=a?n.utc():n();Object.keys(t).forEach(function(e){var n;o["date"===(n=r.$utils().p(e))?"day":n]=t[e]});var s=o.day||(o.year||o.month>=0?1:i.date()),l=o.year||i.year(),u=o.month>=0?o.month:o.year||o.day?0:i.month(),c=o.hour||0,d=o.minute||0,m=o.second||0,p=o.millisecond||0;return a?new Date(Date.UTC(l,u,s,c,d,m,p)):new Date(l,u,s,c,d,m,p)}return t},o=r.parse;r.parse=function(e){e.date=a.bind(this)(e),o.bind(this)(e)};var i=r.set,s=r.add,l=r.subtract,u=function(e,t,n,r){void 0===r&&(r=1);var a=Object.keys(t),o=this;return a.forEach(function(n){o=e.bind(o)(t[n]*r,n)}),o};r.set=function(e,t){return t=void 0===t?e:t,"Object"===e.constructor.name?u.bind(this)(function(e,t){return i.bind(this)(t,e)},t,e):i.bind(this)(e,t)},r.add=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t):s.bind(this)(e,t)},r.subtract=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t,-1):l.bind(this)(e,t)}}},3826(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,a,o){var i=a.prototype;o.utc=function(e){var t={date:e,utc:!0,args:arguments};return new a(t)},i.utc=function(t){var n=o(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},i.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=i.parse;i.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=i.init;i.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=i.utcOffset;i.utcOffset=function(r,a){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?u.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var a=(""+r[0]).match(n)||["-",0,0],o=a[0],i=60*a[1]+ +a[2];return 0===i?0:"+"===o?i:-i}(r)))return this;var i=16>=Math.abs(r)?60*r:r,s=this;if(a)return s.$offset=i,s.$u=0===r,s;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(i+l,e)).$offset=i,s.$x.$localOffset=l}else s=this.utc();return s};var c=i.format;i.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},i.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var d=i.toDate;i.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var m=i.diff;i.diff=function(e,t,n){if(e&&this.$u===e.$u)return m.call(this,e,t,n);var r=this.local(),a=o(e).local();return m.call(r,a,t,n)}}}()},2849(e){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(e){if(!e||"[object Object]"!==n.call(e)||e.nodeType||e.setInterval)return!1;var r,a=t.call(e,"constructor"),o=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)}e.exports=function e(){var t,n,a,o,i,s,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&"function"!=typeof l&&(l={});u<c;u++)if(null!=(t=arguments[u]))for(n in t)a=l[n],l!==(o=t[n])&&(d&&o&&(r(o)||(i=Array.isArray(o)))?(i?(i=!1,s=a&&Array.isArray(a)?a:[]):s=a&&r(a)?a:{},l[n]=e(d,s,o)):void 0!==o&&(l[n]=o));return l}},6767(e,t,n){!function(t){"use strict";var r=n(6974);function a(e){return function(t,n){return"object"==typeof t&&(n=t,t=null),null==t&&(t=new Date().toString()),n||(n={}),e.call(this,t,n)}}var o=e.exports={generate:a(function(e,t){return new r(e,t)})};t&&(t.fn.geopattern=a(function(e,n){return this.each(function(){var r=t(this).attr("data-title-sha");r&&(n=t.extend({hash:r},n));var a=o.generate(e,n);t(this).css("background-image",a.toDataUrl())})}))}("u">typeof jQuery?jQuery:null)},2467(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,r){return t+t+n+n+r+r});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+["r","g","b"].map(function(t){return("0"+e[t].toString(16)).slice(-2)}).join("")},rgb2hsl:function(e){var t,n,r=e.r,a=e.g,o=e.b,i=Math.max(r/=255,a/=255,o/=255),s=Math.min(r,a,o),l=(i+s)/2;if(i===s)t=n=0;else{var u=i-s;switch(n=l>.5?u/(2-i-s):u/(i+s),i){case r:t=(a-o)/u+6*(a<o);break;case a:t=(o-r)/u+2;break;case o:t=(r-a)/u+4}t/=6}return{h:t,s:n,l:l}},hsl2rgb:function(e){function t(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n,r,a,o=e.h,i=e.s,s=e.l;if(0===i)n=r=a=s;else{var l=s<.5?s*(1+i):s+i-s*i,u=2*s-l;n=t(u,l,o+1/3),r=t(u,l,o),a=t(u,l,o-1/3)}return{r:Math.round(255*n),g:Math.round(255*r),b:Math.round(255*a)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},6974(e,t,n){"use strict";var r=n(2849),a=n(2467),o=n(6743),i=n(8502),s={baseColor:"#933c3c"},l=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],u="#000";function c(e,t,n){return parseInt(e.substr(t,n||1),16)}function d(e,t,n,r,a){return(parseFloat(e)-t)*(a-r)/(n-t)+r}function m(e){return e%2==0?"#ddd":"#222"}function p(e){return d(e,0,15,.02,.15)}var f=e.exports=function(e,t){return this.opts=r({},s,t),this.hash=t.hash||o(e),this.svg=new i,this.generateBackground(),this.generatePattern(),this};function h(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function g(e){return[0,0,e,e,0,e,0,0].join(",")}function y(e,t,n,r,a){var o=g(r),i=p(a[0]),s=m(a[0]),l={stroke:u,"stroke-opacity":.02,"fill-opacity":i,fill:s};e.polyline(o,l).transform({translate:[t+r,n],scale:[-1,1]}),e.polyline(o,l).transform({translate:[t+r,n+2*r],scale:[1,-1]}),l={stroke:u,"stroke-opacity":.02,"fill-opacity":i=p(a[1]),fill:s=m(a[1])},e.polyline(o,l).transform({translate:[t+r,n+2*r],scale:[-1,-1]}),e.polyline(o,l).transform({translate:[t+r,n],scale:[1,1]})}function v(e,t,n,r,a){var o=p(a),i=m(a),s=g(r),l={stroke:u,"stroke-opacity":.02,"fill-opacity":o,fill:i};e.polyline(s,l).transform({translate:[t,n+r],scale:[1,-1]}),e.polyline(s,l).transform({translate:[t+2*r,n+r],scale:[-1,-1]}),e.polyline(s,l).transform({translate:[t,n+r],scale:[1,1]}),e.polyline(s,l).transform({translate:[t+2*r,n+r],scale:[-1,1]})}f.prototype.toSvg=function(){return this.svg.toString()},f.prototype.toString=function(){return this.toSvg()},f.prototype.toBase64=function(){var e=this.toSvg();return"u">typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},f.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},f.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},f.prototype.generateBackground=function(){var e,t,n,r;this.opts.color?n=a.hex2rgb(this.opts.color):(t=d(c(this.hash,14,3),0,4095,0,359),r=c(this.hash,17),(e=a.rgb2hsl(a.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,r%2==0?e.s=Math.min(1,(100*e.s+r)/100):e.s=Math.max(0,(100*e.s-r)/100),n=a.hsl2rgb(e)),this.color=a.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:a.rgb2rgbString(n)})},f.prototype.generatePattern=function(){var e=this.opts.generator;if(e){if(0>l.indexOf(e))throw Error("The generator "+e+" does not exist.")}else e=l[c(this.hash,20)];return this["geo"+e.slice(0,1).toUpperCase()+e.slice(1)]()},f.prototype.geoHexagons=function(){var e,t,n,r,a,o,i,s,l,f=d(c(this.hash,0),0,15,8,60),h=f*Math.sqrt(3),g=2*f,y=(s=f/2,[0,l=Math.sin(60*Math.PI/180)*f,s,0,s+f,0,2*f,l,s+f,2*l,s,2*l,0,l].join(","));for(this.svg.setWidth(3*g+3*f),this.svg.setHeight(6*h),t=0,i=0;i<6;i++)for(o=0;o<6;o++)a=c(this.hash,t),e=o%2==0?i*h:i*h+h/2,n=p(a),r={fill:m(a),"fill-opacity":n,stroke:u,"stroke-opacity":.02},this.svg.polyline(y,r).transform({translate:[o*f*1.5-g/2,e-h/2]}),0===o&&this.svg.polyline(y,r).transform({translate:[6*f*1.5-g/2,e-h/2]}),0===i&&(e=o%2==0?6*h:6*h+h/2,this.svg.polyline(y,r).transform({translate:[o*f*1.5-g/2,e-h/2]})),0===o&&0===i&&this.svg.polyline(y,r).transform({translate:[6*f*1.5-g/2,5*h+h/2]}),t++},f.prototype.geoSineWaves=function(){var e,t,n,r,a,o,i,s=Math.floor(d(c(this.hash,0),0,15,100,400)),l=Math.floor(d(c(this.hash,1),0,15,30,100)),u=Math.floor(d(c(this.hash,2),0,15,3,30));for(this.svg.setWidth(s),this.svg.setHeight(36*u),t=0;t<36;t++)n=p(o=c(this.hash,t)),e=m(o),i=s/4*.7,a={fill:"none",stroke:e,opacity:n,"stroke-width":""+u+"px"},r="M0 "+l+" C "+i+" 0, "+(s/2-i)+" 0, "+s/2+" "+l+" S "+(s-i)+" "+2*l+", "+s+" "+l+" S "+(1.5*s-i)+" 0, "+1.5*s+", "+l,this.svg.path(r,a).transform({translate:[-s/4,u*t-1.5*l]}),this.svg.path(r,a).transform({translate:[-s/4,u*t-1.5*l+36*u]})},f.prototype.geoChevrons=function(){var e,t,n,r,a,o,i,s=d(c(this.hash,0),0,15,30,80),l=d(c(this.hash,0),0,15,30,80),f=(e=.66*l,[[0,0,s/2,l-e,s/2,l,0,e,0,0],[s/2,l-e,s,0,s,e,s/2,l,s/2,l-e]].map(function(e){return e.join(",")}));for(this.svg.setWidth(6*s),this.svg.setHeight(6*l*.66),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(a=c(this.hash,t)),r={stroke:u,"stroke-opacity":.02,fill:m(a),"fill-opacity":n,"stroke-width":1},this.svg.group(r).transform({translate:[o*s,i*l*.66-l/2]}).polyline(f).end(),0===i&&this.svg.group(r).transform({translate:[o*s,6*l*.66-l/2]}).polyline(f).end(),t+=1},f.prototype.geoPlusSigns=function(){var e,t,n,r,a,o,i,s,l=d(c(this.hash,0),0,15,10,25),f=3*l,g=h(l);for(this.svg.setWidth(12*l),this.svg.setHeight(12*l),n=0,s=0;s<6;s++)for(i=0;i<6;i++)r=p(o=c(this.hash,n)),t=m(o),e=+(s%2!=0),a={fill:t,stroke:u,"stroke-opacity":.02,"fill-opacity":r},this.svg.group(a).transform({translate:[i*f-i*l+e*l-l,s*f-s*l-f/2]}).rect(g).end(),0===i&&this.svg.group(a).transform({translate:[4*f-i*l+e*l-l,s*f-s*l-f/2]}).rect(g).end(),0===s&&this.svg.group(a).transform({translate:[i*f-i*l+e*l-l,4*f-s*l-f/2]}).rect(g).end(),0===i&&0===s&&this.svg.group(a).transform({translate:[4*f-i*l+e*l-l,4*f-s*l-f/2]}).rect(g).end(),n++},f.prototype.geoXes=function(){var e,t,n,r,a,o,i,s=d(c(this.hash,0),0,15,10,25),l=h(s),u=3*s*.943;for(this.svg.setWidth(3*u),this.svg.setHeight(3*u),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(a=c(this.hash,t)),e=o%2==0?i*u-.5*u:i*u-.5*u+u/4,r={fill:m(a),opacity:n},this.svg.group(r).transform({translate:[o*u/2-u/2,e-i*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&this.svg.group(r).transform({translate:[6*u/2-u/2,e-i*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===i&&(e=o%2==0?6*u-u/2:6*u-u/2+u/4,this.svg.group(r).transform({translate:[o*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end()),5===i&&this.svg.group(r).transform({translate:[o*u/2-u/2,e-11*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&0===i&&this.svg.group(r).transform({translate:[6*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),t++},f.prototype.geoOverlappingCircles=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*i),this.svg.setHeight(6*i),e=0,o=0;o<6;o++)for(a=0;a<6;a++)t=p(r=c(this.hash,e)),n={fill:m(r),opacity:t},this.svg.circle(a*i,o*i,i,n),0===a&&this.svg.circle(6*i,o*i,i,n),0===o&&this.svg.circle(a*i,6*i,i,n),0===a&&0===o&&this.svg.circle(6*i,6*i,i,n),e++},f.prototype.geoOctogons=function(){var e,t,n,r,a,o,i,s=d(c(this.hash,0),0,15,10,60),l=[e=.33*s,0,s-e,0,s,e,s,s-e,s-e,s,e,s,0,s-e,0,e,e,0].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),n=0,i=0;i<6;i++)for(o=0;o<6;o++)r=p(a=c(this.hash,n)),t=m(a),this.svg.polyline(l,{fill:t,"fill-opacity":r,stroke:u,"stroke-opacity":.02}).transform({translate:[o*s,i*s]}),n+=1},f.prototype.geoSquares=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*i),this.svg.setHeight(6*i),t=0,o=0;o<6;o++)for(a=0;a<6;a++)n=p(r=c(this.hash,t)),e=m(r),this.svg.rect(a*i,o*i,i,i,{fill:e,"fill-opacity":n,stroke:u,"stroke-opacity":.02}),t+=1},f.prototype.geoConcentricCircles=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,10,60),s=i/5;for(this.svg.setWidth((i+s)*6),this.svg.setHeight((i+s)*6),t=0,o=0;o<6;o++)for(a=0;a<6;a++)n=p(r=c(this.hash,t)),e=m(r),this.svg.circle(a*i+a*s+(i+s)/2,o*i+o*s+(i+s)/2,i/2,{fill:"none",stroke:e,opacity:n,"stroke-width":s+"px"}),n=p(r=c(this.hash,39-t)),e=m(r),this.svg.circle(a*i+a*s+(i+s)/2,o*i+o*s+(i+s)/2,i/4,{fill:e,"fill-opacity":n}),t+=1},f.prototype.geoOverlappingRings=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,10,60),s=i/4;for(this.svg.setWidth(6*i),this.svg.setHeight(6*i),e=0,o=0;o<6;o++)for(a=0;a<6;a++)t=p(r=c(this.hash,e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":s+"px"},this.svg.circle(a*i,o*i,i-s/2,n),0===a&&this.svg.circle(6*i,o*i,i-s/2,n),0===o&&this.svg.circle(a*i,6*i,i-s/2,n),0===a&&0===o&&this.svg.circle(6*i,6*i,i-s/2,n),e+=1},f.prototype.geoTriangles=function(){var e,t,n,r,a,o,i,s,l=d(c(this.hash,0),0,15,15,80),f=l/2*Math.sqrt(3),h=[s=l/2,0,l,f,0,f,s,0].join(",");for(this.svg.setWidth(3*l),this.svg.setHeight(6*f),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=p(a=c(this.hash,e)),r={fill:m(a),"fill-opacity":t,stroke:u,"stroke-opacity":.02},n=i%2==0?180*(o%2==0):180*(o%2!=0),this.svg.polyline(h,r).transform({translate:[o*l*.5-l/2,f*i],rotate:[n,l/2,f/2]}),0===o&&this.svg.polyline(h,r).transform({translate:[6*l*.5-l/2,f*i],rotate:[n,l/2,f/2]}),e+=1},f.prototype.geoDiamonds=function(){var e,t,n,r,a,o,i,s=d(c(this.hash,0),0,15,10,50),l=d(c(this.hash,1),0,15,10,50),f=[s/2,0,s,l/2,s/2,l,0,l/2].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(3*l),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(a=c(this.hash,t)),r={fill:m(a),"fill-opacity":n,stroke:u,"stroke-opacity":.02},e=i%2==0?0:s/2,this.svg.polyline(f,r).transform({translate:[o*s-s/2+e,l/2*i-l/2]}),0===o&&this.svg.polyline(f,r).transform({translate:[6*s-s/2+e,l/2*i-l/2]}),0===i&&this.svg.polyline(f,r).transform({translate:[o*s-s/2+e,l/2*6-l/2]}),0===o&&0===i&&this.svg.polyline(f,r).transform({translate:[6*s-s/2+e,l/2*6-l/2]}),t+=1},f.prototype.geoNestedSquares=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,4,12),s=7*i;for(this.svg.setWidth((s+i)*6+6*i),this.svg.setHeight((s+i)*6+6*i),e=0,o=0;o<6;o++)for(a=0;a<6;a++)t=p(r=c(this.hash,e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":i+"px"},this.svg.rect(a*s+a*i*2+i/2,o*s+o*i*2+i/2,s,s,n),t=p(r=c(this.hash,39-e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":i+"px"},this.svg.rect(a*s+a*i*2+i/2+2*i,o*s+o*i*2+i/2+2*i,3*i,3*i,n),e+=1},f.prototype.geoMosaicSquares=function(){var e,t,n,r=d(c(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*r),this.svg.setHeight(8*r),e=0,n=0;n<4;n++)for(t=0;t<4;t++)t%2==0?n%2==0?v(this.svg,t*r*2,n*r*2,r,c(this.hash,e)):y(this.svg,t*r*2,n*r*2,r,[c(this.hash,e),c(this.hash,e+1)]):n%2==0?y(this.svg,t*r*2,n*r*2,r,[c(this.hash,e),c(this.hash,e+1)]):v(this.svg,t*r*2,n*r*2,r,c(this.hash,e)),e+=1},f.prototype.geoPlaid=function(){var e,t,n,r,a,o,i=0,s=0;for(t=0;t<36;)i+=c(this.hash,t)+5,n=p(o=c(this.hash,t+1)),e=m(o),r=o+5,this.svg.rect(0,i,"100%",r,{opacity:n,fill:e}),i+=r,t+=2;for(t=0;t<36;)s+=c(this.hash,t)+5,n=p(o=c(this.hash,t+1)),e=m(o),a=o+5,this.svg.rect(s,0,a,"100%",{opacity:n,fill:e}),s+=a,t+=2;this.svg.setWidth(s),this.svg.setHeight(i)},f.prototype.geoTessellation=function(){var e,t,n,r,a=d(c(this.hash,0),0,15,5,40),o=a*Math.sqrt(3),i=2*a,s=a/2*Math.sqrt(3),l=[0,0,s,a/2,0,a,0,0].join(","),f=3*a+2*s,h=2*o+2*a;for(this.svg.setWidth(f),this.svg.setHeight(h),e=0;e<20;e++)switch(t=p(r=c(this.hash,e)),n={stroke:u,"stroke-opacity":.02,fill:m(r),"fill-opacity":t,"stroke-width":1},e){case 0:this.svg.rect(-a/2,-a/2,a,a,n),this.svg.rect(f-a/2,-a/2,a,a,n),this.svg.rect(-a/2,h-a/2,a,a,n),this.svg.rect(f-a/2,h-a/2,a,a,n);break;case 1:this.svg.rect(i/2+s,o/2,a,a,n);break;case 2:this.svg.rect(-a/2,h/2-a/2,a,a,n),this.svg.rect(f-a/2,h/2-a/2,a,a,n);break;case 3:this.svg.rect(i/2+s,1.5*o+a,a,a,n);break;case 4:this.svg.polyline(l,n).transform({translate:[a/2,-a/2],rotate:[0,a/2,s/2]}),this.svg.polyline(l,n).transform({translate:[a/2,h- -a/2],rotate:[0,a/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(l,n).transform({translate:[f-a/2,-a/2],rotate:[0,a/2,s/2],scale:[-1,1]}),this.svg.polyline(l,n).transform({translate:[f-a/2,h+a/2],rotate:[0,a/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(l,n).transform({translate:[f/2+a/2,o/2]});break;case 7:this.svg.polyline(l,n).transform({translate:[f-f/2-a/2,o/2],scale:[-1,1]});break;case 8:this.svg.polyline(l,n).transform({translate:[f/2+a/2,h-o/2],scale:[1,-1]});break;case 9:this.svg.polyline(l,n).transform({translate:[f-f/2-a/2,h-o/2],scale:[-1,-1]});break;case 10:this.svg.polyline(l,n).transform({translate:[a/2,h/2-a/2]});break;case 11:this.svg.polyline(l,n).transform({translate:[f-a/2,h/2-a/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,a,a,n).transform({translate:[a/2,a/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,a,a,n).transform({scale:[-1,1],translate:[-f+a/2,a/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,a,a,n).transform({translate:[a/2,h/2-a/2-a],rotate:[30,0,a]});break;case 15:this.svg.rect(0,0,a,a,n).transform({scale:[-1,1],translate:[-f+a/2,h/2-a/2-a],rotate:[30,0,a]});break;case 16:this.svg.rect(0,0,a,a,n).transform({scale:[1,-1],translate:[a/2,-h+h/2-a/2-a],rotate:[30,0,a]});break;case 17:this.svg.rect(0,0,a,a,n).transform({scale:[-1,-1],translate:[-f+a/2,-h+h/2-a/2-a],rotate:[30,0,a]});break;case 18:this.svg.rect(0,0,a,a,n).transform({scale:[1,-1],translate:[a/2,-h+a/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,a,a,n).transform({scale:[-1,-1],translate:[-f+a/2,-h+a/2],rotate:[-30,0,0]})}}},6743(e){"use strict";function t(){var e=0x67452301,t=0xefcdab89,n=0x98badcfe,r=0x10325476,a=0xc3d2e1f0,o=new Uint32Array(80),i=0,s=24,l=0;function u(){for(var s,l,u=16;u<80;u++){var c=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=c<<1|c>>>31}var d=e,m=t,p=n,f=r,h=a;for(u=0;u<80;u++){u<20?(s=f^m&(p^f),l=0x5a827999):u<40?(s=m^p^f,l=0x6ed9eba1):u<60?(s=m&p|f&(m|p),l=0x8f1bbcdc):(s=m^p^f,l=0xca62c1d6);var g=(d<<5|d>>>27)+s+h+l+(0|o[u]);h=f,f=p,p=m<<30|m>>>2,m=d,d=g}for(u=0,e=e+d|0,t=t+m|0,n=n+p|0,r=r+f|0,a=a+h|0,i=0;u<16;u++)o[u]=0}function c(e){o[i]|=(255&e)<<s,s?s-=8:(i++,s=24),16===i&&u()}function d(e){for(var t="",n=28;n>=0;n-=4)t+=(e>>n&15).toString(16);return t}return{update:function(e){if("string"==typeof e){var t=e.length;l+=8*t;for(var n=0;n<t;n++)c(e.charCodeAt(n));return}var r=e.length;l+=8*r;for(var a=0;a<r;a++)c(e[a])},digest:function(){c(128),(i>14||14===i&&s<24)&&u(),i=14,s=24,c(0),c(0),c(l>0xffffffffff?l/0x10000000000:0),c(l>0xffffffff?l/0x100000000:0);for(var o=24;o>=0;o-=8)c(l>>o);return d(e)+d(t)+d(n)+d(r)+d(a)}}}e.exports=function(e){if(void 0===e)return t();var n=t();return n.update(e),n.digest()}},8502(e,t,n){"use strict";var r=n(2849),a=n(6541);function o(){return this.width=100,this.height=100,this.svg=a("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}e.exports=o,o.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},o.prototype.end=function(){return this.context.pop(),this},o.prototype.currentNode=function(){var e=this.currentContext();return e.lastChild||e},o.prototype.transform=function(e){return this.currentNode().setAttribute("transform",Object.keys(e).map(function(t){return t+"("+e[t].join(",")+")"}).join(" ")),this},o.prototype.setAttributes=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})},o.prototype.setWidth=function(e){this.svg.setAttribute("width",Math.floor(e))},o.prototype.setHeight=function(e){this.svg.setAttribute("height",Math.floor(e))},o.prototype.toString=function(){return this.svg.toString()},o.prototype.rect=function(e,t,n,o,i){var s=this;if(Array.isArray(e))return e.forEach(function(e){s.rect.apply(s,e.concat(i))}),this;var l=a("rect");return this.currentContext().appendChild(l),this.setAttributes(l,r({x:e,y:t,width:n,height:o},i)),this},o.prototype.circle=function(e,t,n,o){var i=a("circle");return this.currentContext().appendChild(i),this.setAttributes(i,r({cx:e,cy:t,r:n},o)),this},o.prototype.path=function(e,t){var n=a("path");return this.currentContext().appendChild(n),this.setAttributes(n,r({d:e},t)),this},o.prototype.polyline=function(e,t){var n=this;if(Array.isArray(e))return e.forEach(function(e){n.polyline(e,t)}),this;var o=a("polyline");return this.currentContext().appendChild(o),this.setAttributes(o,r({points:e},t)),this},o.prototype.group=function(e){var t=a("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,r({},e)),this}},6541(e){"use strict";var t=e.exports=function(e){return this instanceof t?(this.tagName=e,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new t(e)};t.prototype.appendChild=function(e){return this.children.push(e),this.lastChild=e,this},t.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this},t.prototype.toString=function(){var e=this;return["<",e.tagName,Object.keys(e.attributes).map(function(t){return[" ",t,'="',e.attributes[t],'"'].join("")}).join(""),">",e.children.map(function(e){return e.toString()}).join(""),"</",e.tagName,">"].join("")}},8067(e,t){"use strict";t.pathToRegexp=function(e,t={}){let{delimiter:u="/",end:c=!0,sensitive:d=!1,trailing:m=!0}=t,p=[],f=[];for(let c of function e(t,n){if(Array.isArray(t))for(let r of t)e(r,n);else n.push(t);return n}(e,[])){let e="object"==typeof c?c:function(e,t={}){let{encodePath:i=n}=t,u=[...e],c=[],d=0,m=0;function p(){let t="";if(r.test(u[d]))do t+=u[d++];while(a.test(u[d]));else if('"'===u[d]){let n=d;for(;d++<u.length;){if('"'===u[d]){d++,n=0;break}"\\"===u[d]&&d++,t+=u[d]}if(n)throw new l(`Unterminated quote at index ${n}`,e)}if(!t)throw new l(`Missing parameter name at index ${d}`,e);return t}for(;d<u.length;){let e=u[d],t=o[e];t?c.push({type:t,index:d++,value:e}):"\\"===e?c.push({type:"escape",index:d++,value:u[d++]}):":"===e?c.push({type:"param",index:d++,value:p()}):"*"===e?c.push({type:"wildcard",index:d++,value:p()}):c.push({type:"char",index:d++,value:e})}return c.push({type:"end",index:d,value:""}),new s(function t(n){let r=[];for(;;){let a=c[m++];if(a.type===n)break;if("char"===a.type||"escape"===a.type){let e=a.value,t=c[m];for(;"char"===t.type||"escape"===t.type;)e+=t.value,t=c[++m];r.push({type:"text",value:i(e)});continue}if("param"===a.type||"wildcard"===a.type){r.push({type:a.type,name:a.value});continue}if("{"===a.type){r.push({type:"group",tokens:t("}")});continue}throw new l(`Unexpected ${a.type} at index ${a.index}, expected ${n}`,e)}return r}("end"),e)}(c,t);for(let t of function* e(t,n,r){if(n===t.length)return yield r;let a=t[n];if("group"===a.type)for(let o of e(a.tokens,0,r.slice()))yield*e(t,n+1,o);else r.push(a);yield*e(t,n+1,r)}(e.tokens,0,[]))f.push(function(e,t,n,r){let a="",o="",s=!0;for(let d of e){if("text"===d.type){a+=i(d.value),o+=d.value,s||(s=d.value.includes(t));continue}if("param"===d.type||"wildcard"===d.type){var u,c;if(!s&&!o)throw new l(`Missing text before "${d.name}" ${d.type}`,r);"param"===d.type?a+=`(${u=t,(c=s?"":o).length<2?u.length<2?`[^${i(u+c)}]`:`(?:(?!${i(u)})[^${i(c)}])`:u.length<2?`(?:(?!${i(c)})[^${i(u)}])`:`(?:(?!${i(c)}|${i(u)})[\\s\\S])`}+)`:a+="([\\s\\S]+)",n.push(d),o="",s=!1;continue}}return a}(t,u,p,e.originalPath))}let h=`^(?:${f.join("|")})`;return m&&(h+=`(?:${i(u)}$)?`),{regexp:new RegExp(h+=c?"$":`(?=${i(u)}|$)`,d?"":"i"),keys:p}};let n=e=>e,r=/^[$_\p{ID_Start}]$/u,a=/^[$\u200c\u200d\p{ID_Continue}]$/u,o={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function i(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class s{constructor(e,t){this.tokens=e,this.originalPath=t}}class l extends TypeError{constructor(e,t){let n=e;t&&(n+=`: ${t}`),super(n+="; visit https://git.new/pathToRegexpError for info"),this.originalPath=t}}},5338(e,t,n){"use strict";var r=n(5747);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},3904(e,t,n){"use strict";let r=Symbol("SemVer ANY");class a{static get ANY(){return r}constructor(e,t){if(t=o(t),e instanceof a)if(!!t.loose===e.loose)return e;else e=e.value;u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?i[s.COMPARATORLOOSE]:i[s.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof a))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=a;let o=n(8587),{safeRe:i,t:s}=n(9718),l=n(2111),u=n(7272),c=n(3908),d=n(8311)},8311(e,t,n){"use strict";let r=/\s+/g;class a{constructor(e,t){if(t=i(t),e instanceof a)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new a(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(r," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!y(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+e,n=o.get(t);if(n)return n;let r=this.options.loose,a=r?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];l("hyphen replace",e=e.replace(a,T(this.options.includePrerelease))),l("comparator trim",e=e.replace(c[d.COMPARATORTRIM],m)),l("tilde trim",e=e.replace(c[d.TILDETRIM],p)),l("caret trim",e=e.replace(c[d.CARETTRIM],f));let i=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>R(e,this.options));r&&(i=i.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE])))),l("range list",i);let u=new Map;for(let e of i.map(e=>new s(e,this.options))){if(y(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let v=[...u.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof a))throw TypeError("a Range is required");return this.set.some(n=>b(n,t)&&e.set.some(e=>b(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if($(this.set[t],e,this.options))return!0;return!1}}e.exports=a;let o=new(n(8794)),i=n(8587),s=n(3904),l=n(7272),u=n(3908),{safeRe:c,t:d,comparatorTrimReplace:m,tildeTrimReplace:p,caretTrimReplace:f}=n(9718),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=n(6874),y=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let n=!0,r=e.slice(),a=r.pop();for(;n&&r.length;)n=r.every(e=>a.intersects(e,t)),a=r.pop();return n},w=(e,t)=>(l("comp",e=e.replace(c[d.BUILD],""),t),l("caret",e=_(e,t)),l("tildes",e=x(e,t)),l("xrange",e=S(e,t)),l("stars",e=P(e,t)),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map(e=>D(e,t)).join(" "),D=(e,t)=>{let n=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(n,(t,n,r,a,o)=>{let i;return l("tilde",e,t,n,r,a,o),E(n)?i="":E(r)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:E(a)?i=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(l("replaceTilde pr",o),i=`>=${n}.${r}.${a}-${o} <${n}.${+r+1}.0-0`):i=`>=${n}.${r}.${a} <${n}.${+r+1}.0-0`,l("tilde return",i),i})},_=(e,t)=>e.trim().split(/\s+/).map(e=>k(e,t)).join(" "),k=(e,t)=>{l("caret",e,t);let n=t.loose?c[d.CARETLOOSE]:c[d.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,a,o,i)=>{let s;return l("caret",e,t,n,a,o,i),E(n)?s="":E(a)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:E(o)?s="0"===n?`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),s="0"===n?"0"===a?`>=${n}.${a}.${o}-${i} <${n}.${a}.${+o+1}-0`:`>=${n}.${a}.${o}-${i} <${n}.${+a+1}.0-0`:`>=${n}.${a}.${o}-${i} <${+n+1}.0.0-0`):(l("no pr"),s="0"===n?"0"===a?`>=${n}.${a}.${o}${r} <${n}.${a}.${+o+1}-0`:`>=${n}.${a}.${o}${r} <${n}.${+a+1}.0-0`:`>=${n}.${a}.${o} <${+n+1}.0.0-0`),l("caret return",s),s})},S=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>C(e,t)).join(" ")),C=(e,t)=>{e=e.trim();let n=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(n,(n,r,a,o,i,s)=>{l("xRange",e,n,r,a,o,i,s);let u=E(a),c=u||E(o),d=c||E(i);return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(o=0),i=0,">"===r?(r=">=",c?(a=+a+1,o=0):o=+o+1,i=0):"<="===r&&(r="<",c?a=+a+1:o=+o+1),"<"===r&&(s="-0"),n=`${r+a}.${o}.${i}${s}`):c?n=`>=${a}.0.0${s} <${+a+1}.0.0-0`:d&&(n=`>=${a}.${o}.0${s} <${a}.${+o+1}.0-0`),l("xRange return",n),n})},P=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),R=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),T=e=>(t,n,r,a,o,i,s,l,u,c,d,m)=>(n=E(r)?"":E(a)?`>=${r}.0.0${e?"-0":""}`:E(o)?`>=${r}.${a}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`,l=E(u)?"":E(c)?`<${+u+1}.0.0-0`:E(d)?`<${u}.${+c+1}.0-0`:m?`<=${u}.${c}.${d}-${m}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`,`${n} ${l}`.trim()),$=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},3908(e,t,n){"use strict";let r=n(7272),{MAX_LENGTH:a,MAX_SAFE_INTEGER:o}=n(6874),{safeRe:i,t:s}=n(9718),l=n(8587),{compareIdentifiers:u}=n(1123);class c{constructor(e,t){if(t=l(t),e instanceof c)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>a)throw TypeError(`version is longer than ${a} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[s.LOOSE]:i[s.FULL]);if(!n)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<o)return t}return e}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof c||(e=new c(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],a=e.prerelease[t];if(r("prerelease compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return -1;else if(n===a)continue;else return u(n,a)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{let n=this.build[t],a=e.build[t];if(r("build compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return -1;else if(n===a)continue;else return u(n,a)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?i[s.PRERELEASELOOSE]:i[s.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(n);if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},2111(e,t,n){"use strict";let r=n(4641),a=n(3999),o=n(5580),i=n(4089),s=n(7059),l=n(5200);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,u);case"!=":return a(e,n,u);case">":return o(e,n,u);case">=":return i(e,n,u);case"<":return s(e,n,u);case"<=":return l(e,n,u);default:throw TypeError(`Invalid operator: ${t}`)}}},560(e,t,n){"use strict";let r=n(3908);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},4641(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>0===r(e,t,n)},5580(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>r(e,t,n)>0},4089(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>r(e,t,n)>=0},7059(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>0>r(e,t,n)},5200(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>0>=r(e,t,n)},3999(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>0!==r(e,t,n)},7638(e,t,n){"use strict";let r=n(8311);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},6874(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7272(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},1123(e){"use strict";let t=/^[0-9]+$/,n=(e,n)=>{if("number"==typeof e&&"number"==typeof n)return e===n?0:e<n?-1:1;let r=t.test(e),a=t.test(n);return r&&a&&(e*=1,n*=1),e===n?0:r&&!a?-1:a&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8587(e){"use strict";let t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},9718(e,t,n){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=n(6874),i=n(7272),s=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={},m=0,p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[p,a]],h=(e,t,n)=>{let r=(e=>{for(let[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),a=m++;i(e,a,t),d[e]=a,u[a]=t,c[a]=r,s[a]=new RegExp(t,n?"g":void 0),l[a]=new RegExp(r,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),h("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${p}+`),h("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),h("FULL",`^${u[d.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),h("LOOSE",`^${u[d.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),h("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),h("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?`+"(?:$|[^\\d])"),h("COERCERTL",u[d.COERCE],!0),h("COERCERTLFULL",u[d.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},6942(e){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(e=r(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var a="";for(var o in e)t.call(e,o)&&e[o]&&(a=r(a,o));return a}(o)))}return e}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()},5947(e,t,n){"use strict";let r,a,o,i,s,l,u,c,d,m;n.r(t),n.d(t,{GenderUnknownIcon:()=>dD,evaluateAsNumber:()=>i0,getImportMapOverrideMap:()=>oY,StockManagementPictogram:()=>xo,ChemistryIcon:()=>da,BabyIcon:()=>c2,DashboardExtension:()=>mD,openmrsComponentDecorator:()=>ui,tryRegisterExtension:()=>cD,pictogramIds:()=>EW,ActivityIcon:()=>cJ,compile:()=>i3,removeRouteMapOverride:()=>iy,TableBatchActions:()=>cB,getAsyncLifecycle:()=>ul,subscribeOpenmrsEvent:()=>iR,PasswordIcon:()=>dG,Assessment2Pictogram:()=>EG,CloseIcon:()=>dc,setupRouteMapOverrides:()=>iw,getWorkspaceGroupRegistration:()=>lf,registerWorkspace:()=>lc,useFeatureFlag:()=>uB,reset:()=>lt,LabOrderIcon:()=>dN,VisitMode:()=>iI,useLocations:()=>u9,getLifecycle:()=>us,formatDatetime:()=>b9,getVisitsForPatient:()=>iW,formatPartialDate:()=>b2,CustomOverflowMenu:()=>cG,LocationIcon:()=>dI,GroupIcon:()=>dk,createUseStore:()=>lB,VisitStatus:()=>ij,getSessionLocation:()=>o_,getCurrentImportMap:()=>o9,usePatient:()=>ca,useRenderableExtensions:()=>ci,getOpenedWindowIndexByWorkspace:()=>lv,setLeftNav:()=>lr,clearHistory:()=>or,clearConfigErrors:()=>nI,formatTime:()=>b5,isDevEnabled:()=>oN,closeWorkspaceGroup2:()=>Df,getCurrentRouteMap:()=>id,ConfigurableLink:()=>lN,sessionStore:()=>op,setSessionLocale:()=>oS,subscribeSnackbarShown:()=>_,getLoggedInUser:()=>oD,GenderMaleIcon:()=>dE,getExtensionSlotConfigFromStore:()=>tJ,evaluateAsNumberAsync:()=>i1,getImportMapDefaultMap:()=>oG,unregisterExtensionRendering:()=>s$,implementerToolsConfigStore:()=>nt,Type:()=>tM,InPatientPictogram:()=>E2,cleanupObsoleteFeatureFlags:()=>sg,getAttachmentsUrl:()=>i_,showSnackbar:()=>xb,PatientBannerActionsMenu:()=>Ej,PatientSearchPictogram:()=>E8,DocumentAttachmentIcon:()=>df,Snackbar:()=>xf,CardiologyPictogram:()=>EY,ImageMedicalIcon:()=>dP,ActionableNotificationComponent:()=>Et,DiagnosisTags:()=>wV,iconIds:()=>cq,PatientsPictogram:()=>E7,interpolateUrl:()=>a6,setupHistory:()=>oe,subscribeToastShown:()=>D,detachAll:()=>s5,convertToLocaleCalendar:()=>b8,DocumentIcon:()=>dp,configInternalStore:()=>tz,ActionMenuButton2:()=>DT,setupDynamicOfflineDataHandler:()=>D1,makeUrl:()=>oc,oneOf:()=>nU,selectPreferredName:()=>E_,launchWorkspaceGroup:()=>function e(t,n){let r=lf(t),{state:a,onWorkspaceGroupLaunch:o,workspaceGroupCleanup:i,workspaceToLaunch:s}=n,l=function(){return xF}();if(l.getState().openWorkspaces.length){let r=l.getState().workspaceGroup;r?xC(r?.name,()=>{e(t,n)}):xW(()=>{e(t,n)})}else l.setState(e=>({...e,workspaceGroup:{name:t,members:r.members,cleanup:i}})),xZ(t,a),o?.(),s&&xR(s.name,s.additionalProps??{})},MobileCheckIcon:()=>dV,createErrorHandler:()=>C,parseDate:()=>bJ,getAttachmentByUuid:()=>ix,LeftNavMenu:()=>wG,getExtensionRegistration:()=>s4,ShoppingCartAddItemIcon:()=>mw,ReferralOrderIcon:()=>dQ,ReportIcon:()=>d1,dispatchToastShown:()=>w,getImportMapNextPageMap:()=>oZ,registerExtension:()=>s2,setupOfflineSync:()=>D0,DownloadIcon:()=>dh,useConnectivity:()=>D5,provide:()=>nf,ShoppingCartArrowDownIcon:()=>d8,featureFlagsStore:()=>sf,promptBeforeClosing:()=>xO,jsep:()=>iz,GeriatricsPictogram:()=>E1,SearchIcon:()=>d3,reportError:()=>S,slugify:()=>o3,isOmrsDateToday:()=>bZ,getExtensionStore:()=>sO,BloodBankPictogram:()=>EZ,TriagePictogram:()=>xs,Workspace2:()=>D_,refetchCurrentUser:()=>ow,CheckmarkOutlineIcon:()=>dr,registerExtensionSlot:()=>le,AllergiesIcon:()=>mg,ArrowDownIcon:()=>cQ,useOpenmrsInfinite:()=>uY,getExtensionConfigFromExtensionSlotStore:()=>t1,OpenmrsDatePicker:()=>wF,getExtensionConfigFromStore:()=>t0,getDynamicOfflineDataEntries:()=>D4,getLocaleDisplayName:()=>bp,messageOmrsServiceWorker:()=>D3,navigate:()=>a9,launchWorkspace2:()=>Dh,getGroupByWindowName:()=>ly,CustomOverflowMenuItem:()=>cZ,isUrl:()=>nV,CaretDownIcon:()=>c5,ArrowLeftIcon:()=>c0,FacilityPictogram:()=>E0,ViewOffIcon:()=>mp,updateInternalExtensionStore:()=>sk,dispatchActionableNotificationShown:()=>v,resetRouteMapOverrides:()=>iv,formatDurationBetween:()=>wi,defaultVisitCustomRepresentation:()=>iM,getBreadcrumbsFor:()=>nJ,useOpenmrsPagination:()=>uU,Pagination:()=>Eb,CheckmarkFilledIcon:()=>dn,clearCurrentUser:()=>oE,showModal:()=>w9,ChevronUpIcon:()=>du,saveVisit:()=>iV,useAttachments:()=>uk,Pictogram:()=>xm,useExtensionSlot:()=>lK,ChevronDownIcon:()=>di,OpenmrsDateRangePicker:()=>wB,deleteAttachmentPermanently:()=>iS,getVisitTypes:()=>iA,OverflowMenuHorizontalIcon:()=>dz,EventScheduleIcon:()=>dv,getSessionStore:()=>ov,ActionMenu:()=>Di,ProcedureOrderIcon:()=>dJ,preloadImport:()=>o5,registerWorkspaceWindows2:()=>lw,useOnVisible:()=>u7,setSessionLocation:()=>ok,userHasAccess:()=>ox,ChartAverageIcon:()=>de,getFeatureFlag:()=>sy,UserAvatarIcon:()=>mu,renderExtension:()=>lR,useFhirInfinite:()=>u0,toVisitTypeObject:()=>iO,useSession:()=>cs,EmergencyDepartmentPictogram:()=>EQ,Notification:()=>w7,dispatchSnackbarShown:()=>b,navigateAndLaunchWorkspace:()=>xT,formatDate:()=>b3,workspace2StoreActions:()=>Dv,SwitcherIcon:()=>d5,esmStyleGuideSchema:()=>cM,getImportMapDisabledOverrides:()=>oq,useAssignedExtensionIds:()=>uD,CaretRightIcon:()=>c8,evaluateAsType:()=>i4,PageHeader:()=>Ey,TranslateIcon:()=>mo,setUserProperties:()=>oC,MovementIcon:()=>dH,renderInlineNotifications:()=>El,subscribePrecacheStaticDependencies:()=>D6,PaymentsDeskPictogram:()=>xe,usePrimaryIdentifierCode:()=>co,useLayoutType:()=>u4,getCurrentUser:()=>oy,XrayPictogram:()=>xl,CaretUpIcon:()=>c7,renderActionableNotifications:()=>Ec,OpenmrsAppContext:()=>uv,setupModals:()=>w5,getDefaultsFromConfigSchema:()=>function e(t){let n={};for(let r of Object.keys(t))if(DZ(t[r])&&t[r].hasOwnProperty("_default"))n[r]=t[r]._default;else{if(r.startsWith("_"))continue;DZ(t[r])?n[r]=e(t[r]):n[r]=t[r]}return n},subscribeTo:()=>U,recordConfigDerivationError:()=>t7,useAbortController:()=>uw,Extension:()=>lA,getFhirServerPaginationHandlers:()=>uK,useConnectedExtensions:()=>uT,registerApp:()=>ck,HospitalBedIcon:()=>dC,useExtensionInternalStore:()=>uM,configExtensionStore:()=>tG,getSynchronizationItems:()=>D2,getExtensionSlotsConfigStore:()=>tY,registerExtensionRendering:()=>sT,RenderIfValueIsTruthy:()=>ub,registerFeatureFlag:()=>sh,useFhirFetchAll:()=>uQ,restBaseUrl:()=>os,CalendarHeatMapIcon:()=>c3,getWorkspaceRegistration:()=>lp,isImportMapOverrideDisabled:()=>oJ,resetConfigSystem:()=>nj,getExtensionInternalStore:()=>sD,registerGlobalStore:()=>B,evaluateAsBoolean:()=>iX,PatientBannerPatientInfo:()=>EA,addRouteMapOverride:()=>ig,getDefaultCalendar:()=>b1,SettingsIcon:()=>d6,DrugOrderIcon:()=>dg,ProgramsIcon:()=>dX,useAssignedExtensions:()=>lz,CloseFilledIcon:()=>dd,canAccessStorage:()=>DG,registerDefaultCalendar:()=>b0,TreeViewAltIcon:()=>ms,OverflowMenuVerticalIcon:()=>dK,clearConfigDerivationError:()=>ne,getConfigStore:()=>tZ,registerWorkspaceGroup:()=>ld,InformationSquareIcon:()=>d$,EmptyCard:()=>wH,ChevronLeftIcon:()=>ds,RadiologyIcon:()=>mb,useCandidateExtensions:()=>u_,renderToasts:()=>x_,isDesktop:()=>u2,integrateBreakpoints:()=>cT,RegistrationPictogram:()=>xr,CardHeader:()=>cA,getExtensionRegistrationFrom:()=>s1,InformationIcon:()=>dR,TrashCanIcon:()=>mi,useShallowStableValue:()=>lI,useOpenmrsSWR:()=>ce,Assessment1Pictogram:()=>EK,finishRegisteringAllApps:()=>cS,importDynamic:()=>o6,useFhirPagination:()=>uz,useVisitContextStore:()=>ch,ArrowUpIcon:()=>c4,showActionableNotification:()=>Ed,useForceUpdate:()=>uV,useVisit:()=>cg,updateWorkspaceWindowState:()=>xV,PatientBannerPatientIdentifiers:()=>ET,WorkspaceNotification:()=>x5,TransferPictogram:()=>xi,usePagination:()=>ct,Breakpoint:()=>cC,PatientBannerToggleContactDetailsButton:()=>D$,CloseOutlineIcon:()=>dm,ObstetricsPictogram:()=>E9,parseDateInput:()=>we,getConfig:()=>ng,attach:()=>s3,getLocale:()=>bf,ActionMenuButton:()=>xQ,isUrlWithTemplateParameters:()=>nB,useEmrConfiguration:()=>uI,useLeftNav:()=>u3,ToolsIcon:()=>ma,ErrorState:()=>wz,detach:()=>s6,setCurrentVisit:()=>iB,ConditionsIcon:()=>mv,SaveIcon:()=>d2,useWorkspaces:()=>xH,resetWorkspaceStore:()=>xG,useConfig:()=>uR,validator:()=>tL,CalendarIcon:()=>c6,getHistory:()=>ot,StickyNoteAddIcon:()=>d7,useWorkspace2Store:()=>Db,getPatientName:()=>Ew,getVisitStore:()=>iF,getCoreTranslation:()=>a3,registerModuleWithConfigSystem:()=>nc,registerModuleLoad:()=>nd,getBreadcrumbs:()=>nZ,extractVariableNames:()=>sd,translateFrom:()=>a2,useStoreWithActions:()=>lF,EditIcon:()=>dy,getCandidateExtensions:()=>s7,shallowEqual:()=>R,subscribeNotificationShown:()=>E,MaximizeIcon:()=>dM,promptForClosingWorkspaces:()=>Dy,WarningIcon:()=>mh,closeAllWorkspaces:()=>xW,fhirBaseUrl:()=>ol,matchLocale:()=>DK,registerBreadcrumb:()=>nK,usePatientPhoto:()=>EF,EventsIcon:()=>db,createGlobalStore:()=>F,workspaceStore:()=>xF,subscribeToFeatureFlag:()=>sv,useExtensionStore:()=>uF,closeWorkspace:()=>xj,createAttachment:()=>ik,useLeftNavStore:()=>u6,TableIcon:()=>mn,Icon:()=>mx,InformationFilledIcon:()=>dT,getCurrentPageMap:()=>oK,LaboratoryPictogram:()=>E3,temporaryConfigStore:()=>tK,getPromptBeforeClosingFcn:()=>xN,toDateObjectStrict:()=>bY,defineConfigSchema:()=>nu,filterBreadcrumbs:()=>nq,invalidateImplementerToolsConfig:()=>t9,PatientBannerContactDetails:()=>DM,getAssignedExtensions:()=>s8,PatientPhoto:()=>EU,MaterialOrderIcon:()=>dj,MicroscopeIcon:()=>dB,visitTypesUrl:()=>iN,scheduleRecomputation:()=>sM,PharmacyPictogram:()=>xt,AttachmentIcon:()=>my,MoneyIcon:()=>dU,getAttachments:()=>iD,getWorkspaceGroupStore:()=>xZ,PageHeaderContent:()=>Ev,MedicationIcon:()=>dL,PrinterIcon:()=>dq,PatientListsPictogram:()=>xc,useAppContext:()=>uE,isOpenmrsRoutes:()=>ie,AppointmentsAltPictogram:()=>Ez,GenericOrderTypeIcon:()=>d_,batchExtensionUpdates:()=>sI,useExtensionSlotStore:()=>lW,ViewIcon:()=>mf,formattedName:()=>ED,sessionEndpoint:()=>ou,duration:()=>wa,resetImportMapOverrides:()=>o0,TableOfContentsIcon:()=>mt,CaretLeftIcon:()=>c9,getTranslationOverrides:()=>ny,isVersionSatisfied:()=>DJ,EmptyCardIllustration:()=>wW,PenIcon:()=>dY,getWorkspaceStore:()=>xB,validators:()=>nW,setupImportMapOverrides:()=>o2,showToast:()=>xk,useDefineAppContext:()=>uy,verifyTotpCode:()=>oP,getGlobalStore:()=>V,useOnClickOutside:()=>u8,getWindowByWorkspaceName:()=>lg,ArrowRightIcon:()=>c1,loadLifeCycles:()=>cw,registerBreadcrumbs:()=>nG,MotherIcon:()=>dW,fetchCurrentPatient:()=>iC,Toast:()=>xw,MessageQueueIcon:()=>dF,TwoFactorAuthenticationIcon:()=>ml,Pharmacy2Pictogram:()=>xn,goBackInHistory:()=>on,GroupAccessIcon:()=>dS,getExtensionRenderingsStore:()=>s_,setImplementerToolsConfigRecomputer:()=>t5,getAsyncExtensionLifecycle:()=>uc,setupApiModule:()=>oI,renderLoadingSpinner:()=>DL,WorkspaceContainer:()=>Ds,showNotification:()=>Eu,getModalRegistration:()=>ls,ListCheckedIcon:()=>dA,ResponsiveWrapper:()=>xp,GynaecologyPictogram:()=>E4,ShoppingCartIcon:()=>d9,getRouteMapNextPageMap:()=>ip,MetadataExportPictogram:()=>E5,updateVisit:()=>iU,backendDependencies:()=>oA,MaybePictogram:()=>xd,createParcelMounter:()=>lC,openmrsFetch:()=>od,useStore:()=>lL,isOpenmrsAppRoutes:()=>o7,HomePictogram:()=>xu,DentistryPictogram:()=>EJ,ServiceQueuesPictogram:()=>xa,toLanguageTag:()=>bm,launchWorkspace:()=>xR,setFeatureFlag:()=>sb,DigitalTrustPictogram:()=>EX,NumericObservation:()=>Eh,attachmentUrl:()=>iE,interpolateString:()=>a5,inRange:()=>nF,useExtensionSlotMeta:()=>uL,AppointmentsPictogram:()=>EH,renderSnackbars:()=>xv,getRegisteredWorkspace2Names:()=>DE,logout:()=>oR,toLocationObject:()=>iT,ChartLineIcon:()=>dt,UserHasAccess:()=>cl,evaluateAsBooleanAsync:()=>iQ,changeWorkspaceContext:()=>xM,createDashboard:()=>m_,getLocations:()=>i$,useExtensionContext:()=>uj,canCloseWorkspaceWithoutPrompting:()=>xS,getExtensionsConfigStore:()=>tX,getRouteMapDefaultMap:()=>im,age:()=>ES,isOmrsDateStrict:()=>bG,registerWorkspaceGroups2:()=>lb,usePaginationInfo:()=>cn,evaluateAsync:()=>iJ,useOpenmrsFetchAll:()=>uJ,removeImportMapOverride:()=>oQ,showWorkspacePrompts:()=>xz,useVisitTypes:()=>cv,ageAsDuration:()=>Ek,getExtensionNameFromId:()=>s0,renderParcel:()=>lS,useWorkspace2Context:()=>Dw,ResetIcon:()=>d4,RenewIcon:()=>d0,subscribeActionableNotificationShown:()=>x,ErrorCard:()=>wK,GenderFemaleIcon:()=>dw,enableImportMapOverride:()=>o1,retry:()=>DX,ComponentContext:()=>lO,ExtensionSlot:()=>lZ,unsetLeftNav:()=>la,addImportMapOverride:()=>oX,MaybeIcon:()=>mE,useCustomOverflowMenu:()=>cK,PedestrianFamilyIcon:()=>dZ,cancelPrompt:()=>xA,CtScanPictogram:()=>Eq,dispatchNotificationShown:()=>y,leftNavStore:()=>ln,OpenmrsFetchError:()=>om,UserFollowIcon:()=>mc,launchWorkspaceGroup2:()=>Dp,ChevronRightIcon:()=>dl,UserXrayIcon:()=>md,GenderOtherIcon:()=>dx,formatDuration:()=>b7,toOmrsIsoString:()=>bq,Labs2Pictogram:()=>E6,workspace2Store:()=>lh,setUserLanguage:()=>ob,useBodyScrollLock:()=>uS,getExtensionConfig:()=>tQ,SyringeIcon:()=>me,LocationPicker:()=>wZ,useDebounce:()=>u$,TimeIcon:()=>mr,getExtensionSlotConfig:()=>tq,AddIcon:()=>cX,getRouteMapOverrideMap:()=>ih,processConfig:()=>nv,InventoryManagementIcon:()=>dO,registerWorkspaces2:()=>lE,UserIcon:()=>mm,formatPatientName:()=>Ex,fireOpenmrsEvent:()=>iP,registerModal:()=>li,registerTranslationNamespace:()=>nm,displayName:()=>EE,evaluate:()=>iq,defineExtensionConfigSchema:()=>np,renderWorkspaceWindowsAndMenu:()=>DH,getSyncLifecycle:()=>uu,evaluateAsTypeAsync:()=>i2});let p="openmrs:notification-shown",f="openmrs:actionable-notification-shown",h="openmrs:toast-shown",g="openmrs:snack-bar-shown";function y(e){window.dispatchEvent(new CustomEvent(p,{detail:e}))}function v(e){window.dispatchEvent(new CustomEvent(f,{detail:e}))}function b(e){window.dispatchEvent(new CustomEvent(g,{detail:e}))}function w(e){window.dispatchEvent(new CustomEvent(h,{detail:e}))}function E(e){let t=t=>e(t.detail);return window.addEventListener(p,t),()=>window.removeEventListener(p,t)}function x(e){let t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}function D(e){let t=t=>e(t.detail);return window.addEventListener(h,t),()=>window.removeEventListener(h,t)}function _(e){let t=t=>e(t.detail);return window.addEventListener(g,t),()=>window.removeEventListener(g,t)}function k(e,t){return e instanceof Error?e.message||t:"string"==typeof e&&e.trim().length>0?e:t}function S(e){let t=P(e);setTimeout(()=>{throw t})}function C(){let e=Error();return t=>{let n=P(t);n.stack+=`
|
|
1
|
+
(globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([["6168"],{7581(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},5238(e){e.exports=function(e,t,n){var r=t.prototype,a=function(e){var t=e.date,a=e.utc,o={};if(!(null===t||t instanceof Date||t instanceof Array||r.$utils().u(t)||"Object"!==t.constructor.name)){if(!Object.keys(t).length)return new Date;var i=a?n.utc():n();Object.keys(t).forEach(function(e){var n;o["date"===(n=r.$utils().p(e))?"day":n]=t[e]});var s=o.day||(o.year||o.month>=0?1:i.date()),l=o.year||i.year(),u=o.month>=0?o.month:o.year||o.day?0:i.month(),c=o.hour||0,d=o.minute||0,m=o.second||0,p=o.millisecond||0;return a?new Date(Date.UTC(l,u,s,c,d,m,p)):new Date(l,u,s,c,d,m,p)}return t},o=r.parse;r.parse=function(e){e.date=a.bind(this)(e),o.bind(this)(e)};var i=r.set,s=r.add,l=r.subtract,u=function(e,t,n,r){void 0===r&&(r=1);var a=Object.keys(t),o=this;return a.forEach(function(n){o=e.bind(o)(t[n]*r,n)}),o};r.set=function(e,t){return t=void 0===t?e:t,"Object"===e.constructor.name?u.bind(this)(function(e,t){return i.bind(this)(t,e)},t,e):i.bind(this)(e,t)},r.add=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t):s.bind(this)(e,t)},r.subtract=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t,-1):l.bind(this)(e,t)}}},3826(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,a,o){var i=a.prototype;o.utc=function(e){var t={date:e,utc:!0,args:arguments};return new a(t)},i.utc=function(t){var n=o(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},i.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=i.parse;i.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=i.init;i.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=i.utcOffset;i.utcOffset=function(r,a){var o=this.$utils().u;if(o(r))return this.$u?0:o(this.$offset)?u.call(this):this.$offset;if("string"==typeof r&&null===(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var a=(""+r[0]).match(n)||["-",0,0],o=a[0],i=60*a[1]+ +a[2];return 0===i?0:"+"===o?i:-i}(r)))return this;var i=16>=Math.abs(r)?60*r:r,s=this;if(a)return s.$offset=i,s.$u=0===r,s;if(0!==r){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(i+l,e)).$offset=i,s.$x.$localOffset=l}else s=this.utc();return s};var c=i.format;i.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},i.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var d=i.toDate;i.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var m=i.diff;i.diff=function(e,t,n){if(e&&this.$u===e.$u)return m.call(this,e,t,n);var r=this.local(),a=o(e).local();return m.call(r,a,t,n)}}}()},2849(e){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(e){if(!e||"[object Object]"!==n.call(e)||e.nodeType||e.setInterval)return!1;var r,a=t.call(e,"constructor"),o=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)}e.exports=function e(){var t,n,a,o,i,s,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&"function"!=typeof l&&(l={});u<c;u++)if(null!=(t=arguments[u]))for(n in t)a=l[n],l!==(o=t[n])&&(d&&o&&(r(o)||(i=Array.isArray(o)))?(i?(i=!1,s=a&&Array.isArray(a)?a:[]):s=a&&r(a)?a:{},l[n]=e(d,s,o)):void 0!==o&&(l[n]=o));return l}},6767(e,t,n){!function(t){"use strict";var r=n(6974);function a(e){return function(t,n){return"object"==typeof t&&(n=t,t=null),null==t&&(t=new Date().toString()),n||(n={}),e.call(this,t,n)}}var o=e.exports={generate:a(function(e,t){return new r(e,t)})};t&&(t.fn.geopattern=a(function(e,n){return this.each(function(){var r=t(this).attr("data-title-sha");r&&(n=t.extend({hash:r},n));var a=o.generate(e,n);t(this).css("background-image",a.toDataUrl())})}))}("u">typeof jQuery?jQuery:null)},2467(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,r){return t+t+n+n+r+r});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+["r","g","b"].map(function(t){return("0"+e[t].toString(16)).slice(-2)}).join("")},rgb2hsl:function(e){var t,n,r=e.r,a=e.g,o=e.b,i=Math.max(r/=255,a/=255,o/=255),s=Math.min(r,a,o),l=(i+s)/2;if(i===s)t=n=0;else{var u=i-s;switch(n=l>.5?u/(2-i-s):u/(i+s),i){case r:t=(a-o)/u+6*(a<o);break;case a:t=(o-r)/u+2;break;case o:t=(r-a)/u+4}t/=6}return{h:t,s:n,l:l}},hsl2rgb:function(e){function t(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var n,r,a,o=e.h,i=e.s,s=e.l;if(0===i)n=r=a=s;else{var l=s<.5?s*(1+i):s+i-s*i,u=2*s-l;n=t(u,l,o+1/3),r=t(u,l,o),a=t(u,l,o-1/3)}return{r:Math.round(255*n),g:Math.round(255*r),b:Math.round(255*a)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},6974(e,t,n){"use strict";var r=n(2849),a=n(2467),o=n(6743),i=n(8502),s={baseColor:"#933c3c"},l=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],u="#000";function c(e,t,n){return parseInt(e.substr(t,n||1),16)}function d(e,t,n,r,a){return(parseFloat(e)-t)*(a-r)/(n-t)+r}function m(e){return e%2==0?"#ddd":"#222"}function p(e){return d(e,0,15,.02,.15)}var f=e.exports=function(e,t){return this.opts=r({},s,t),this.hash=t.hash||o(e),this.svg=new i,this.generateBackground(),this.generatePattern(),this};function h(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function g(e){return[0,0,e,e,0,e,0,0].join(",")}function y(e,t,n,r,a){var o=g(r),i=p(a[0]),s=m(a[0]),l={stroke:u,"stroke-opacity":.02,"fill-opacity":i,fill:s};e.polyline(o,l).transform({translate:[t+r,n],scale:[-1,1]}),e.polyline(o,l).transform({translate:[t+r,n+2*r],scale:[1,-1]}),l={stroke:u,"stroke-opacity":.02,"fill-opacity":i=p(a[1]),fill:s=m(a[1])},e.polyline(o,l).transform({translate:[t+r,n+2*r],scale:[-1,-1]}),e.polyline(o,l).transform({translate:[t+r,n],scale:[1,1]})}function v(e,t,n,r,a){var o=p(a),i=m(a),s=g(r),l={stroke:u,"stroke-opacity":.02,"fill-opacity":o,fill:i};e.polyline(s,l).transform({translate:[t,n+r],scale:[1,-1]}),e.polyline(s,l).transform({translate:[t+2*r,n+r],scale:[-1,-1]}),e.polyline(s,l).transform({translate:[t,n+r],scale:[1,1]}),e.polyline(s,l).transform({translate:[t+2*r,n+r],scale:[-1,1]})}f.prototype.toSvg=function(){return this.svg.toString()},f.prototype.toString=function(){return this.toSvg()},f.prototype.toBase64=function(){var e=this.toSvg();return"u">typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},f.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},f.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},f.prototype.generateBackground=function(){var e,t,n,r;this.opts.color?n=a.hex2rgb(this.opts.color):(t=d(c(this.hash,14,3),0,4095,0,359),r=c(this.hash,17),(e=a.rgb2hsl(a.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,r%2==0?e.s=Math.min(1,(100*e.s+r)/100):e.s=Math.max(0,(100*e.s-r)/100),n=a.hsl2rgb(e)),this.color=a.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:a.rgb2rgbString(n)})},f.prototype.generatePattern=function(){var e=this.opts.generator;if(e){if(0>l.indexOf(e))throw Error("The generator "+e+" does not exist.")}else e=l[c(this.hash,20)];return this["geo"+e.slice(0,1).toUpperCase()+e.slice(1)]()},f.prototype.geoHexagons=function(){var e,t,n,r,a,o,i,s,l,f=d(c(this.hash,0),0,15,8,60),h=f*Math.sqrt(3),g=2*f,y=(s=f/2,[0,l=Math.sin(60*Math.PI/180)*f,s,0,s+f,0,2*f,l,s+f,2*l,s,2*l,0,l].join(","));for(this.svg.setWidth(3*g+3*f),this.svg.setHeight(6*h),t=0,i=0;i<6;i++)for(o=0;o<6;o++)a=c(this.hash,t),e=o%2==0?i*h:i*h+h/2,n=p(a),r={fill:m(a),"fill-opacity":n,stroke:u,"stroke-opacity":.02},this.svg.polyline(y,r).transform({translate:[o*f*1.5-g/2,e-h/2]}),0===o&&this.svg.polyline(y,r).transform({translate:[6*f*1.5-g/2,e-h/2]}),0===i&&(e=o%2==0?6*h:6*h+h/2,this.svg.polyline(y,r).transform({translate:[o*f*1.5-g/2,e-h/2]})),0===o&&0===i&&this.svg.polyline(y,r).transform({translate:[6*f*1.5-g/2,5*h+h/2]}),t++},f.prototype.geoSineWaves=function(){var e,t,n,r,a,o,i,s=Math.floor(d(c(this.hash,0),0,15,100,400)),l=Math.floor(d(c(this.hash,1),0,15,30,100)),u=Math.floor(d(c(this.hash,2),0,15,3,30));for(this.svg.setWidth(s),this.svg.setHeight(36*u),t=0;t<36;t++)n=p(o=c(this.hash,t)),e=m(o),i=s/4*.7,a={fill:"none",stroke:e,opacity:n,"stroke-width":""+u+"px"},r="M0 "+l+" C "+i+" 0, "+(s/2-i)+" 0, "+s/2+" "+l+" S "+(s-i)+" "+2*l+", "+s+" "+l+" S "+(1.5*s-i)+" 0, "+1.5*s+", "+l,this.svg.path(r,a).transform({translate:[-s/4,u*t-1.5*l]}),this.svg.path(r,a).transform({translate:[-s/4,u*t-1.5*l+36*u]})},f.prototype.geoChevrons=function(){var e,t,n,r,a,o,i,s=d(c(this.hash,0),0,15,30,80),l=d(c(this.hash,0),0,15,30,80),f=(e=.66*l,[[0,0,s/2,l-e,s/2,l,0,e,0,0],[s/2,l-e,s,0,s,e,s/2,l,s/2,l-e]].map(function(e){return e.join(",")}));for(this.svg.setWidth(6*s),this.svg.setHeight(6*l*.66),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(a=c(this.hash,t)),r={stroke:u,"stroke-opacity":.02,fill:m(a),"fill-opacity":n,"stroke-width":1},this.svg.group(r).transform({translate:[o*s,i*l*.66-l/2]}).polyline(f).end(),0===i&&this.svg.group(r).transform({translate:[o*s,6*l*.66-l/2]}).polyline(f).end(),t+=1},f.prototype.geoPlusSigns=function(){var e,t,n,r,a,o,i,s,l=d(c(this.hash,0),0,15,10,25),f=3*l,g=h(l);for(this.svg.setWidth(12*l),this.svg.setHeight(12*l),n=0,s=0;s<6;s++)for(i=0;i<6;i++)r=p(o=c(this.hash,n)),t=m(o),e=+(s%2!=0),a={fill:t,stroke:u,"stroke-opacity":.02,"fill-opacity":r},this.svg.group(a).transform({translate:[i*f-i*l+e*l-l,s*f-s*l-f/2]}).rect(g).end(),0===i&&this.svg.group(a).transform({translate:[4*f-i*l+e*l-l,s*f-s*l-f/2]}).rect(g).end(),0===s&&this.svg.group(a).transform({translate:[i*f-i*l+e*l-l,4*f-s*l-f/2]}).rect(g).end(),0===i&&0===s&&this.svg.group(a).transform({translate:[4*f-i*l+e*l-l,4*f-s*l-f/2]}).rect(g).end(),n++},f.prototype.geoXes=function(){var e,t,n,r,a,o,i,s=d(c(this.hash,0),0,15,10,25),l=h(s),u=3*s*.943;for(this.svg.setWidth(3*u),this.svg.setHeight(3*u),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(a=c(this.hash,t)),e=o%2==0?i*u-.5*u:i*u-.5*u+u/4,r={fill:m(a),opacity:n},this.svg.group(r).transform({translate:[o*u/2-u/2,e-i*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&this.svg.group(r).transform({translate:[6*u/2-u/2,e-i*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===i&&(e=o%2==0?6*u-u/2:6*u-u/2+u/4,this.svg.group(r).transform({translate:[o*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end()),5===i&&this.svg.group(r).transform({translate:[o*u/2-u/2,e-11*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&0===i&&this.svg.group(r).transform({translate:[6*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),t++},f.prototype.geoOverlappingCircles=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*i),this.svg.setHeight(6*i),e=0,o=0;o<6;o++)for(a=0;a<6;a++)t=p(r=c(this.hash,e)),n={fill:m(r),opacity:t},this.svg.circle(a*i,o*i,i,n),0===a&&this.svg.circle(6*i,o*i,i,n),0===o&&this.svg.circle(a*i,6*i,i,n),0===a&&0===o&&this.svg.circle(6*i,6*i,i,n),e++},f.prototype.geoOctogons=function(){var e,t,n,r,a,o,i,s=d(c(this.hash,0),0,15,10,60),l=[e=.33*s,0,s-e,0,s,e,s,s-e,s-e,s,e,s,0,s-e,0,e,e,0].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),n=0,i=0;i<6;i++)for(o=0;o<6;o++)r=p(a=c(this.hash,n)),t=m(a),this.svg.polyline(l,{fill:t,"fill-opacity":r,stroke:u,"stroke-opacity":.02}).transform({translate:[o*s,i*s]}),n+=1},f.prototype.geoSquares=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*i),this.svg.setHeight(6*i),t=0,o=0;o<6;o++)for(a=0;a<6;a++)n=p(r=c(this.hash,t)),e=m(r),this.svg.rect(a*i,o*i,i,i,{fill:e,"fill-opacity":n,stroke:u,"stroke-opacity":.02}),t+=1},f.prototype.geoConcentricCircles=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,10,60),s=i/5;for(this.svg.setWidth((i+s)*6),this.svg.setHeight((i+s)*6),t=0,o=0;o<6;o++)for(a=0;a<6;a++)n=p(r=c(this.hash,t)),e=m(r),this.svg.circle(a*i+a*s+(i+s)/2,o*i+o*s+(i+s)/2,i/2,{fill:"none",stroke:e,opacity:n,"stroke-width":s+"px"}),n=p(r=c(this.hash,39-t)),e=m(r),this.svg.circle(a*i+a*s+(i+s)/2,o*i+o*s+(i+s)/2,i/4,{fill:e,"fill-opacity":n}),t+=1},f.prototype.geoOverlappingRings=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,10,60),s=i/4;for(this.svg.setWidth(6*i),this.svg.setHeight(6*i),e=0,o=0;o<6;o++)for(a=0;a<6;a++)t=p(r=c(this.hash,e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":s+"px"},this.svg.circle(a*i,o*i,i-s/2,n),0===a&&this.svg.circle(6*i,o*i,i-s/2,n),0===o&&this.svg.circle(a*i,6*i,i-s/2,n),0===a&&0===o&&this.svg.circle(6*i,6*i,i-s/2,n),e+=1},f.prototype.geoTriangles=function(){var e,t,n,r,a,o,i,s,l=d(c(this.hash,0),0,15,15,80),f=l/2*Math.sqrt(3),h=[s=l/2,0,l,f,0,f,s,0].join(",");for(this.svg.setWidth(3*l),this.svg.setHeight(6*f),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=p(a=c(this.hash,e)),r={fill:m(a),"fill-opacity":t,stroke:u,"stroke-opacity":.02},n=i%2==0?180*(o%2==0):180*(o%2!=0),this.svg.polyline(h,r).transform({translate:[o*l*.5-l/2,f*i],rotate:[n,l/2,f/2]}),0===o&&this.svg.polyline(h,r).transform({translate:[6*l*.5-l/2,f*i],rotate:[n,l/2,f/2]}),e+=1},f.prototype.geoDiamonds=function(){var e,t,n,r,a,o,i,s=d(c(this.hash,0),0,15,10,50),l=d(c(this.hash,1),0,15,10,50),f=[s/2,0,s,l/2,s/2,l,0,l/2].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(3*l),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=p(a=c(this.hash,t)),r={fill:m(a),"fill-opacity":n,stroke:u,"stroke-opacity":.02},e=i%2==0?0:s/2,this.svg.polyline(f,r).transform({translate:[o*s-s/2+e,l/2*i-l/2]}),0===o&&this.svg.polyline(f,r).transform({translate:[6*s-s/2+e,l/2*i-l/2]}),0===i&&this.svg.polyline(f,r).transform({translate:[o*s-s/2+e,l/2*6-l/2]}),0===o&&0===i&&this.svg.polyline(f,r).transform({translate:[6*s-s/2+e,l/2*6-l/2]}),t+=1},f.prototype.geoNestedSquares=function(){var e,t,n,r,a,o,i=d(c(this.hash,0),0,15,4,12),s=7*i;for(this.svg.setWidth((s+i)*6+6*i),this.svg.setHeight((s+i)*6+6*i),e=0,o=0;o<6;o++)for(a=0;a<6;a++)t=p(r=c(this.hash,e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":i+"px"},this.svg.rect(a*s+a*i*2+i/2,o*s+o*i*2+i/2,s,s,n),t=p(r=c(this.hash,39-e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":i+"px"},this.svg.rect(a*s+a*i*2+i/2+2*i,o*s+o*i*2+i/2+2*i,3*i,3*i,n),e+=1},f.prototype.geoMosaicSquares=function(){var e,t,n,r=d(c(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*r),this.svg.setHeight(8*r),e=0,n=0;n<4;n++)for(t=0;t<4;t++)t%2==0?n%2==0?v(this.svg,t*r*2,n*r*2,r,c(this.hash,e)):y(this.svg,t*r*2,n*r*2,r,[c(this.hash,e),c(this.hash,e+1)]):n%2==0?y(this.svg,t*r*2,n*r*2,r,[c(this.hash,e),c(this.hash,e+1)]):v(this.svg,t*r*2,n*r*2,r,c(this.hash,e)),e+=1},f.prototype.geoPlaid=function(){var e,t,n,r,a,o,i=0,s=0;for(t=0;t<36;)i+=c(this.hash,t)+5,n=p(o=c(this.hash,t+1)),e=m(o),r=o+5,this.svg.rect(0,i,"100%",r,{opacity:n,fill:e}),i+=r,t+=2;for(t=0;t<36;)s+=c(this.hash,t)+5,n=p(o=c(this.hash,t+1)),e=m(o),a=o+5,this.svg.rect(s,0,a,"100%",{opacity:n,fill:e}),s+=a,t+=2;this.svg.setWidth(s),this.svg.setHeight(i)},f.prototype.geoTessellation=function(){var e,t,n,r,a=d(c(this.hash,0),0,15,5,40),o=a*Math.sqrt(3),i=2*a,s=a/2*Math.sqrt(3),l=[0,0,s,a/2,0,a,0,0].join(","),f=3*a+2*s,h=2*o+2*a;for(this.svg.setWidth(f),this.svg.setHeight(h),e=0;e<20;e++)switch(t=p(r=c(this.hash,e)),n={stroke:u,"stroke-opacity":.02,fill:m(r),"fill-opacity":t,"stroke-width":1},e){case 0:this.svg.rect(-a/2,-a/2,a,a,n),this.svg.rect(f-a/2,-a/2,a,a,n),this.svg.rect(-a/2,h-a/2,a,a,n),this.svg.rect(f-a/2,h-a/2,a,a,n);break;case 1:this.svg.rect(i/2+s,o/2,a,a,n);break;case 2:this.svg.rect(-a/2,h/2-a/2,a,a,n),this.svg.rect(f-a/2,h/2-a/2,a,a,n);break;case 3:this.svg.rect(i/2+s,1.5*o+a,a,a,n);break;case 4:this.svg.polyline(l,n).transform({translate:[a/2,-a/2],rotate:[0,a/2,s/2]}),this.svg.polyline(l,n).transform({translate:[a/2,h- -a/2],rotate:[0,a/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(l,n).transform({translate:[f-a/2,-a/2],rotate:[0,a/2,s/2],scale:[-1,1]}),this.svg.polyline(l,n).transform({translate:[f-a/2,h+a/2],rotate:[0,a/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(l,n).transform({translate:[f/2+a/2,o/2]});break;case 7:this.svg.polyline(l,n).transform({translate:[f-f/2-a/2,o/2],scale:[-1,1]});break;case 8:this.svg.polyline(l,n).transform({translate:[f/2+a/2,h-o/2],scale:[1,-1]});break;case 9:this.svg.polyline(l,n).transform({translate:[f-f/2-a/2,h-o/2],scale:[-1,-1]});break;case 10:this.svg.polyline(l,n).transform({translate:[a/2,h/2-a/2]});break;case 11:this.svg.polyline(l,n).transform({translate:[f-a/2,h/2-a/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,a,a,n).transform({translate:[a/2,a/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,a,a,n).transform({scale:[-1,1],translate:[-f+a/2,a/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,a,a,n).transform({translate:[a/2,h/2-a/2-a],rotate:[30,0,a]});break;case 15:this.svg.rect(0,0,a,a,n).transform({scale:[-1,1],translate:[-f+a/2,h/2-a/2-a],rotate:[30,0,a]});break;case 16:this.svg.rect(0,0,a,a,n).transform({scale:[1,-1],translate:[a/2,-h+h/2-a/2-a],rotate:[30,0,a]});break;case 17:this.svg.rect(0,0,a,a,n).transform({scale:[-1,-1],translate:[-f+a/2,-h+h/2-a/2-a],rotate:[30,0,a]});break;case 18:this.svg.rect(0,0,a,a,n).transform({scale:[1,-1],translate:[a/2,-h+a/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,a,a,n).transform({scale:[-1,-1],translate:[-f+a/2,-h+a/2],rotate:[-30,0,0]})}}},6743(e){"use strict";function t(){var e=0x67452301,t=0xefcdab89,n=0x98badcfe,r=0x10325476,a=0xc3d2e1f0,o=new Uint32Array(80),i=0,s=24,l=0;function u(){for(var s,l,u=16;u<80;u++){var c=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=c<<1|c>>>31}var d=e,m=t,p=n,f=r,h=a;for(u=0;u<80;u++){u<20?(s=f^m&(p^f),l=0x5a827999):u<40?(s=m^p^f,l=0x6ed9eba1):u<60?(s=m&p|f&(m|p),l=0x8f1bbcdc):(s=m^p^f,l=0xca62c1d6);var g=(d<<5|d>>>27)+s+h+l+(0|o[u]);h=f,f=p,p=m<<30|m>>>2,m=d,d=g}for(u=0,e=e+d|0,t=t+m|0,n=n+p|0,r=r+f|0,a=a+h|0,i=0;u<16;u++)o[u]=0}function c(e){o[i]|=(255&e)<<s,s?s-=8:(i++,s=24),16===i&&u()}function d(e){for(var t="",n=28;n>=0;n-=4)t+=(e>>n&15).toString(16);return t}return{update:function(e){if("string"==typeof e){var t=e.length;l+=8*t;for(var n=0;n<t;n++)c(e.charCodeAt(n));return}var r=e.length;l+=8*r;for(var a=0;a<r;a++)c(e[a])},digest:function(){c(128),(i>14||14===i&&s<24)&&u(),i=14,s=24,c(0),c(0),c(l>0xffffffffff?l/0x10000000000:0),c(l>0xffffffff?l/0x100000000:0);for(var o=24;o>=0;o-=8)c(l>>o);return d(e)+d(t)+d(n)+d(r)+d(a)}}}e.exports=function(e){if(void 0===e)return t();var n=t();return n.update(e),n.digest()}},8502(e,t,n){"use strict";var r=n(2849),a=n(6541);function o(){return this.width=100,this.height=100,this.svg=a("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}e.exports=o,o.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},o.prototype.end=function(){return this.context.pop(),this},o.prototype.currentNode=function(){var e=this.currentContext();return e.lastChild||e},o.prototype.transform=function(e){return this.currentNode().setAttribute("transform",Object.keys(e).map(function(t){return t+"("+e[t].join(",")+")"}).join(" ")),this},o.prototype.setAttributes=function(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})},o.prototype.setWidth=function(e){this.svg.setAttribute("width",Math.floor(e))},o.prototype.setHeight=function(e){this.svg.setAttribute("height",Math.floor(e))},o.prototype.toString=function(){return this.svg.toString()},o.prototype.rect=function(e,t,n,o,i){var s=this;if(Array.isArray(e))return e.forEach(function(e){s.rect.apply(s,e.concat(i))}),this;var l=a("rect");return this.currentContext().appendChild(l),this.setAttributes(l,r({x:e,y:t,width:n,height:o},i)),this},o.prototype.circle=function(e,t,n,o){var i=a("circle");return this.currentContext().appendChild(i),this.setAttributes(i,r({cx:e,cy:t,r:n},o)),this},o.prototype.path=function(e,t){var n=a("path");return this.currentContext().appendChild(n),this.setAttributes(n,r({d:e},t)),this},o.prototype.polyline=function(e,t){var n=this;if(Array.isArray(e))return e.forEach(function(e){n.polyline(e,t)}),this;var o=a("polyline");return this.currentContext().appendChild(o),this.setAttributes(o,r({points:e},t)),this},o.prototype.group=function(e){var t=a("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,r({},e)),this}},6541(e){"use strict";var t=e.exports=function(e){return this instanceof t?(this.tagName=e,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new t(e)};t.prototype.appendChild=function(e){return this.children.push(e),this.lastChild=e,this},t.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this},t.prototype.toString=function(){var e=this;return["<",e.tagName,Object.keys(e.attributes).map(function(t){return[" ",t,'="',e.attributes[t],'"'].join("")}).join(""),">",e.children.map(function(e){return e.toString()}).join(""),"</",e.tagName,">"].join("")}},8067(e,t){"use strict";t.pathToRegexp=function(e,t={}){let{delimiter:u="/",end:c=!0,sensitive:d=!1,trailing:m=!0}=t,p=[],f=[];for(let c of function e(t,n){if(Array.isArray(t))for(let r of t)e(r,n);else n.push(t);return n}(e,[])){let e="object"==typeof c?c:function(e,t={}){let{encodePath:i=n}=t,u=[...e],c=[],d=0,m=0;function p(){let t="";if(r.test(u[d]))do t+=u[d++];while(a.test(u[d]));else if('"'===u[d]){let n=d;for(;d++<u.length;){if('"'===u[d]){d++,n=0;break}"\\"===u[d]&&d++,t+=u[d]}if(n)throw new l(`Unterminated quote at index ${n}`,e)}if(!t)throw new l(`Missing parameter name at index ${d}`,e);return t}for(;d<u.length;){let e=u[d],t=o[e];t?c.push({type:t,index:d++,value:e}):"\\"===e?c.push({type:"escape",index:d++,value:u[d++]}):":"===e?c.push({type:"param",index:d++,value:p()}):"*"===e?c.push({type:"wildcard",index:d++,value:p()}):c.push({type:"char",index:d++,value:e})}return c.push({type:"end",index:d,value:""}),new s(function t(n){let r=[];for(;;){let a=c[m++];if(a.type===n)break;if("char"===a.type||"escape"===a.type){let e=a.value,t=c[m];for(;"char"===t.type||"escape"===t.type;)e+=t.value,t=c[++m];r.push({type:"text",value:i(e)});continue}if("param"===a.type||"wildcard"===a.type){r.push({type:a.type,name:a.value});continue}if("{"===a.type){r.push({type:"group",tokens:t("}")});continue}throw new l(`Unexpected ${a.type} at index ${a.index}, expected ${n}`,e)}return r}("end"),e)}(c,t);for(let t of function* e(t,n,r){if(n===t.length)return yield r;let a=t[n];if("group"===a.type)for(let o of e(a.tokens,0,r.slice()))yield*e(t,n+1,o);else r.push(a);yield*e(t,n+1,r)}(e.tokens,0,[]))f.push(function(e,t,n,r){let a="",o="",s=!0;for(let d of e){if("text"===d.type){a+=i(d.value),o+=d.value,s||(s=d.value.includes(t));continue}if("param"===d.type||"wildcard"===d.type){var u,c;if(!s&&!o)throw new l(`Missing text before "${d.name}" ${d.type}`,r);"param"===d.type?a+=`(${u=t,(c=s?"":o).length<2?u.length<2?`[^${i(u+c)}]`:`(?:(?!${i(u)})[^${i(c)}])`:u.length<2?`(?:(?!${i(c)})[^${i(u)}])`:`(?:(?!${i(c)}|${i(u)})[\\s\\S])`}+)`:a+="([\\s\\S]+)",n.push(d),o="",s=!1;continue}}return a}(t,u,p,e.originalPath))}let h=`^(?:${f.join("|")})`;return m&&(h+=`(?:${i(u)}$)?`),{regexp:new RegExp(h+=c?"$":`(?=${i(u)}|$)`,d?"":"i"),keys:p}};let n=e=>e,r=/^[$_\p{ID_Start}]$/u,a=/^[$\u200c\u200d\p{ID_Continue}]$/u,o={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function i(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class s{constructor(e,t){this.tokens=e,this.originalPath=t}}class l extends TypeError{constructor(e,t){let n=e;t&&(n+=`: ${t}`),super(n+="; visit https://git.new/pathToRegexpError for info"),this.originalPath=t}}},5338(e,t,n){"use strict";var r=n(5747);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},3904(e,t,n){"use strict";let r=Symbol("SemVer ANY");class a{static get ANY(){return r}constructor(e,t){if(t=o(t),e instanceof a)if(!!t.loose===e.loose)return e;else e=e.value;u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?i[s.COMPARATORLOOSE]:i[s.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof a))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=a;let o=n(8587),{safeRe:i,t:s}=n(9718),l=n(2111),u=n(7272),c=n(3908),d=n(8311)},8311(e,t,n){"use strict";let r=/\s+/g;class a{constructor(e,t){if(t=i(t),e instanceof a)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new a(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(r," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!y(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+e,n=o.get(t);if(n)return n;let r=this.options.loose,a=r?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];l("hyphen replace",e=e.replace(a,T(this.options.includePrerelease))),l("comparator trim",e=e.replace(c[d.COMPARATORTRIM],m)),l("tilde trim",e=e.replace(c[d.TILDETRIM],p)),l("caret trim",e=e.replace(c[d.CARETTRIM],f));let i=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>R(e,this.options));r&&(i=i.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE])))),l("range list",i);let u=new Map;for(let e of i.map(e=>new s(e,this.options))){if(y(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let v=[...u.values()];return o.set(t,v),v}intersects(e,t){if(!(e instanceof a))throw TypeError("a Range is required");return this.set.some(n=>b(n,t)&&e.set.some(e=>b(e,t)&&n.every(n=>e.every(e=>n.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if($(this.set[t],e,this.options))return!0;return!1}}e.exports=a;let o=new(n(8794)),i=n(8587),s=n(3904),l=n(7272),u=n(3908),{safeRe:c,t:d,comparatorTrimReplace:m,tildeTrimReplace:p,caretTrimReplace:f}=n(9718),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=n(6874),y=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let n=!0,r=e.slice(),a=r.pop();for(;n&&r.length;)n=r.every(e=>a.intersects(e,t)),a=r.pop();return n},w=(e,t)=>(l("comp",e=e.replace(c[d.BUILD],""),t),l("caret",e=_(e,t)),l("tildes",e=x(e,t)),l("xrange",e=S(e,t)),l("stars",e=P(e,t)),e),E=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map(e=>D(e,t)).join(" "),D=(e,t)=>{let n=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(n,(t,n,r,a,o)=>{let i;return l("tilde",e,t,n,r,a,o),E(n)?i="":E(r)?i=`>=${n}.0.0 <${+n+1}.0.0-0`:E(a)?i=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(l("replaceTilde pr",o),i=`>=${n}.${r}.${a}-${o} <${n}.${+r+1}.0-0`):i=`>=${n}.${r}.${a} <${n}.${+r+1}.0-0`,l("tilde return",i),i})},_=(e,t)=>e.trim().split(/\s+/).map(e=>k(e,t)).join(" "),k=(e,t)=>{l("caret",e,t);let n=t.loose?c[d.CARETLOOSE]:c[d.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,a,o,i)=>{let s;return l("caret",e,t,n,a,o,i),E(n)?s="":E(a)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:E(o)?s="0"===n?`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:i?(l("replaceCaret pr",i),s="0"===n?"0"===a?`>=${n}.${a}.${o}-${i} <${n}.${a}.${+o+1}-0`:`>=${n}.${a}.${o}-${i} <${n}.${+a+1}.0-0`:`>=${n}.${a}.${o}-${i} <${+n+1}.0.0-0`):(l("no pr"),s="0"===n?"0"===a?`>=${n}.${a}.${o}${r} <${n}.${a}.${+o+1}-0`:`>=${n}.${a}.${o}${r} <${n}.${+a+1}.0-0`:`>=${n}.${a}.${o} <${+n+1}.0.0-0`),l("caret return",s),s})},S=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>C(e,t)).join(" ")),C=(e,t)=>{e=e.trim();let n=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(n,(n,r,a,o,i,s)=>{l("xRange",e,n,r,a,o,i,s);let u=E(a),c=u||E(o),d=c||E(i);return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(c&&(o=0),i=0,">"===r?(r=">=",c?(a=+a+1,o=0):o=+o+1,i=0):"<="===r&&(r="<",c?a=+a+1:o=+o+1),"<"===r&&(s="-0"),n=`${r+a}.${o}.${i}${s}`):c?n=`>=${a}.0.0${s} <${+a+1}.0.0-0`:d&&(n=`>=${a}.${o}.0${s} <${a}.${+o+1}.0-0`),l("xRange return",n),n})},P=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),R=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),T=e=>(t,n,r,a,o,i,s,l,u,c,d,m)=>(n=E(r)?"":E(a)?`>=${r}.0.0${e?"-0":""}`:E(o)?`>=${r}.${a}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`,l=E(u)?"":E(c)?`<${+u+1}.0.0-0`:E(d)?`<${u}.${+c+1}.0-0`:m?`<=${u}.${c}.${d}-${m}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`,`${n} ${l}`.trim()),$=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(l(e[n].semver),e[n].semver!==s.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},3908(e,t,n){"use strict";let r=n(7272),{MAX_LENGTH:a,MAX_SAFE_INTEGER:o}=n(6874),{safeRe:i,t:s}=n(9718),l=n(8587),{compareIdentifiers:u}=n(1123);class c{constructor(e,t){if(t=l(t),e instanceof c)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>a)throw TypeError(`version is longer than ${a} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?i[s.LOOSE]:i[s.FULL]);if(!n)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<o)return t}return e}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(r("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof c||(e=new c(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],a=e.prerelease[t];if(r("prerelease compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return -1;else if(n===a)continue;else return u(n,a)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{let n=this.build[t],a=e.build[t];if(r("build compare",t,n,a),void 0===n&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===n)return -1;else if(n===a)continue;else return u(n,a)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?i[s.PRERELEASELOOSE]:i[s.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(n);if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},2111(e,t,n){"use strict";let r=n(4641),a=n(3999),o=n(5580),i=n(4089),s=n(7059),l=n(5200);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,u);case"!=":return a(e,n,u);case">":return o(e,n,u);case">=":return i(e,n,u);case"<":return s(e,n,u);case"<=":return l(e,n,u);default:throw TypeError(`Invalid operator: ${t}`)}}},560(e,t,n){"use strict";let r=n(3908);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},4641(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>0===r(e,t,n)},5580(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>r(e,t,n)>0},4089(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>r(e,t,n)>=0},7059(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>0>r(e,t,n)},5200(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>0>=r(e,t,n)},3999(e,t,n){"use strict";let r=n(560);e.exports=(e,t,n)=>0!==r(e,t,n)},7638(e,t,n){"use strict";let r=n(8311);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},6874(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7272(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},1123(e){"use strict";let t=/^[0-9]+$/,n=(e,n)=>{if("number"==typeof e&&"number"==typeof n)return e===n?0:e<n?-1:1;let r=t.test(e),a=t.test(n);return r&&a&&(e*=1,n*=1),e===n?0:r&&!a?-1:a&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8587(e){"use strict";let t=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:n},9718(e,t,n){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=n(6874),i=n(7272),s=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={},m=0,p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[p,a]],h=(e,t,n)=>{let r=(e=>{for(let[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),a=m++;i(e,a,t),d[e]=a,u[a]=t,c[a]=r,s[a]=new RegExp(t,n?"g":void 0),l[a]=new RegExp(r,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),h("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${p}+`),h("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),h("FULL",`^${u[d.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),h("LOOSE",`^${u[d.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),h("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),h("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?`+"(?:$|[^\\d])"),h("COERCERTL",u[d.COERCE],!0),h("COERCERTLFULL",u[d.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},6942(e){!function(){"use strict";var t={}.hasOwnProperty;function n(){for(var e="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(e=r(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var a="";for(var o in e)t.call(e,o)&&e[o]&&(a=r(a,o));return a}(o)))}return e}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()},5947(e,t,n){"use strict";let r,a,o,i,s,l,u,c,d,m,p;n.r(t),n.d(t,{GenderUnknownIcon:()=>d_,evaluateAsNumber:()=>i1,getImportMapOverrideMap:()=>oq,StockManagementPictogram:()=>xi,ChemistryIcon:()=>di,BabyIcon:()=>c3,DashboardExtension:()=>m_,openmrsComponentDecorator:()=>us,tryRegisterExtension:()=>c_,pictogramIds:()=>EH,ActivityIcon:()=>cX,compile:()=>i6,removeRouteMapOverride:()=>iv,TableBatchActions:()=>cV,getAsyncLifecycle:()=>uu,subscribeOpenmrsEvent:()=>iT,PasswordIcon:()=>dZ,Assessment2Pictogram:()=>EZ,CloseIcon:()=>dd,setupRouteMapOverrides:()=>iE,getWorkspaceGroupRegistration:()=>lh,registerWorkspace:()=>ld,useFeatureFlag:()=>uV,reset:()=>ln,LabOrderIcon:()=>dA,VisitMode:()=>ij,useLocations:()=>u8,getLifecycle:()=>ul,formatDatetime:()=>b8,getVisitsForPatient:()=>iH,formatPartialDate:()=>b3,CustomOverflowMenu:()=>cZ,LocationIcon:()=>dj,GroupIcon:()=>dS,createUseStore:()=>lV,VisitStatus:()=>iM,getSessionLocation:()=>ok,getCurrentImportMap:()=>o8,usePatient:()=>co,useRenderableExtensions:()=>cs,getOpenedWindowIndexByWorkspace:()=>lb,setLeftNav:()=>la,clearHistory:()=>oa,clearConfigErrors:()=>nj,formatTime:()=>b9,isDevEnabled:()=>oA,closeWorkspaceGroup2:()=>Dh,getCurrentRouteMap:()=>im,ConfigurableLink:()=>lA,sessionStore:()=>of,setSessionLocale:()=>oC,subscribeSnackbarShown:()=>k,getLoggedInUser:()=>o_,GenderMaleIcon:()=>dx,getExtensionSlotConfigFromStore:()=>tX,evaluateAsNumberAsync:()=>i4,getImportMapDefaultMap:()=>oZ,unregisterExtensionRendering:()=>sO,implementerToolsConfigStore:()=>nn,Type:()=>tL,InPatientPictogram:()=>E3,cleanupObsoleteFeatureFlags:()=>sy,getAttachmentsUrl:()=>ik,showSnackbar:()=>xw,PatientBannerActionsMenu:()=>EM,PatientSearchPictogram:()=>E7,DocumentAttachmentIcon:()=>dh,Snackbar:()=>xh,CardiologyPictogram:()=>Eq,ImageMedicalIcon:()=>dR,ActionableNotificationComponent:()=>En,DiagnosisTags:()=>wU,iconIds:()=>cJ,PatientsPictogram:()=>xe,interpolateUrl:()=>a5,setupHistory:()=>ot,subscribeToastShown:()=>_,detachAll:()=>s9,convertToLocaleCalendar:()=>b7,DocumentIcon:()=>df,configInternalStore:()=>tK,ActionMenuButton2:()=>D$,setupDynamicOfflineDataHandler:()=>D4,makeUrl:()=>od,oneOf:()=>nW,selectPreferredName:()=>Ek,launchWorkspaceGroup:()=>function e(t,n){let r=lh(t),{state:a,onWorkspaceGroupLaunch:o,workspaceGroupCleanup:i,workspaceToLaunch:s}=n,l=function(){return xB}();if(l.getState().openWorkspaces.length){let r=l.getState().workspaceGroup;r?xP(r?.name,()=>{e(t,n)}):xH(()=>{e(t,n)})}else l.setState(e=>({...e,workspaceGroup:{name:t,members:r.members,cleanup:i}})),xY(t,a),o?.(),s&&xT(s.name,s.additionalProps??{})},MobileCheckIcon:()=>dU,createErrorHandler:()=>P,parseDate:()=>bX,getAttachmentByUuid:()=>iD,LeftNavMenu:()=>wZ,getExtensionRegistration:()=>s2,ShoppingCartAddItemIcon:()=>mE,ReferralOrderIcon:()=>d0,ReportIcon:()=>d4,dispatchToastShown:()=>E,getImportMapNextPageMap:()=>oY,registerExtension:()=>s3,setupOfflineSync:()=>D1,DownloadIcon:()=>dg,useConnectivity:()=>D9,provide:()=>nh,ShoppingCartArrowDownIcon:()=>d7,featureFlagsStore:()=>sh,promptBeforeClosing:()=>xN,jsep:()=>iK,GeriatricsPictogram:()=>E4,SearchIcon:()=>d6,reportError:()=>C,slugify:()=>o6,isOmrsDateToday:()=>bY,getExtensionStore:()=>sN,BloodBankPictogram:()=>EY,TriagePictogram:()=>xl,Workspace2:()=>Dk,refetchCurrentUser:()=>oE,CheckmarkOutlineIcon:()=>da,registerExtensionSlot:()=>lt,AllergiesIcon:()=>my,ArrowDownIcon:()=>c0,useOpenmrsInfinite:()=>uq,getExtensionConfigFromExtensionSlotStore:()=>t4,OpenmrsDatePicker:()=>wB,getExtensionConfigFromStore:()=>t1,getDynamicOfflineDataEntries:()=>D2,getLocaleDisplayName:()=>bf,messageOmrsServiceWorker:()=>D6,navigate:()=>a8,launchWorkspace2:()=>Dg,getGroupByWindowName:()=>lv,CustomOverflowMenuItem:()=>cY,isUrl:()=>nU,CaretDownIcon:()=>c9,ArrowLeftIcon:()=>c1,FacilityPictogram:()=>E1,ViewOffIcon:()=>mf,updateInternalExtensionStore:()=>sS,dispatchActionableNotificationShown:()=>b,resetRouteMapOverrides:()=>ib,formatDurationBetween:()=>ws,defaultVisitCustomRepresentation:()=>iL,getBreadcrumbsFor:()=>nX,useOpenmrsPagination:()=>uW,Pagination:()=>Ew,CheckmarkFilledIcon:()=>dr,clearCurrentUser:()=>ox,showModal:()=>w8,ChevronUpIcon:()=>dc,saveVisit:()=>iU,useAttachments:()=>uS,Pictogram:()=>xp,useExtensionSlot:()=>lG,ChevronDownIcon:()=>ds,OpenmrsDateRangePicker:()=>wV,deleteAttachmentPermanently:()=>iC,getVisitTypes:()=>iI,OverflowMenuHorizontalIcon:()=>dK,EventScheduleIcon:()=>db,getSessionStore:()=>ob,ActionMenu:()=>Ds,ProcedureOrderIcon:()=>dX,preloadImport:()=>o9,registerWorkspaceWindows2:()=>lE,useOnVisible:()=>ce,setSessionLocation:()=>oS,userHasAccess:()=>oD,ChartAverageIcon:()=>dt,getFeatureFlag:()=>sv,UserAvatarIcon:()=>mc,renderExtension:()=>lT,useFhirInfinite:()=>u1,toVisitTypeObject:()=>iN,useSession:()=>cl,EmergencyDepartmentPictogram:()=>E0,Notification:()=>Ee,dispatchSnackbarShown:()=>w,navigateAndLaunchWorkspace:()=>x$,formatDate:()=>b6,workspace2StoreActions:()=>Db,SwitcherIcon:()=>d9,esmStyleGuideSchema:()=>cL,getImportMapDisabledOverrides:()=>oJ,useAssignedExtensionIds:()=>u_,CaretRightIcon:()=>c7,evaluateAsType:()=>i2,PageHeader:()=>Ev,TranslateIcon:()=>mi,setUserProperties:()=>oP,MovementIcon:()=>dz,renderInlineNotifications:()=>Eu,subscribePrecacheStaticDependencies:()=>D5,PaymentsDeskPictogram:()=>xt,usePrimaryIdentifierCode:()=>ci,useLayoutType:()=>u2,getCurrentUser:()=>ov,XrayPictogram:()=>xu,CaretUpIcon:()=>de,renderActionableNotifications:()=>Ed,OpenmrsAppContext:()=>ub,setupModals:()=>w9,getDefaultsFromConfigSchema:()=>function e(t){let n={};for(let r of Object.keys(t))if(DY(t[r])&&t[r].hasOwnProperty("_default"))n[r]=t[r]._default;else{if(r.startsWith("_"))continue;DY(t[r])?n[r]=e(t[r]):n[r]=t[r]}return n},subscribeTo:()=>W,recordConfigDerivationError:()=>ne,useAbortController:()=>uE,Extension:()=>lI,getFhirServerPaginationHandlers:()=>uG,useConnectedExtensions:()=>u$,registerApp:()=>cS,HospitalBedIcon:()=>dP,useExtensionInternalStore:()=>uL,configExtensionStore:()=>tZ,getSynchronizationItems:()=>D3,getExtensionSlotsConfigStore:()=>tq,registerExtensionRendering:()=>s$,RenderIfValueIsTruthy:()=>uw,registerFeatureFlag:()=>sg,useFhirFetchAll:()=>u0,restBaseUrl:()=>ol,CalendarHeatMapIcon:()=>c6,getWorkspaceRegistration:()=>lf,isImportMapOverrideDisabled:()=>oX,resetConfigSystem:()=>nM,getExtensionInternalStore:()=>s_,registerGlobalStore:()=>V,evaluateAsBoolean:()=>iQ,PatientBannerPatientInfo:()=>EI,addRouteMapOverride:()=>iy,getDefaultCalendar:()=>b4,SettingsIcon:()=>d5,DrugOrderIcon:()=>dy,ProgramsIcon:()=>dQ,useAssignedExtensions:()=>lK,CloseFilledIcon:()=>dm,canAccessStorage:()=>DZ,registerDefaultCalendar:()=>b1,TreeViewAltIcon:()=>ml,OverflowMenuVerticalIcon:()=>dG,clearConfigDerivationError:()=>nt,getConfigStore:()=>tY,registerWorkspaceGroup:()=>lm,InformationSquareIcon:()=>dO,EmptyCard:()=>wz,ChevronLeftIcon:()=>dl,RadiologyIcon:()=>mw,useCandidateExtensions:()=>uk,renderToasts:()=>xk,isDesktop:()=>u3,integrateBreakpoints:()=>c$,RegistrationPictogram:()=>xa,CardHeader:()=>cI,getExtensionRegistrationFrom:()=>s4,InformationIcon:()=>dT,TrashCanIcon:()=>ms,useShallowStableValue:()=>lj,useOpenmrsSWR:()=>ct,Assessment1Pictogram:()=>EG,finishRegisteringAllApps:()=>cC,importDynamic:()=>o5,useFhirPagination:()=>uK,useVisitContextStore:()=>cg,ArrowUpIcon:()=>c2,showActionableNotification:()=>Em,useForceUpdate:()=>uU,useVisit:()=>cy,updateWorkspaceWindowState:()=>xU,PatientBannerPatientIdentifiers:()=>E$,WorkspaceNotification:()=>x9,TransferPictogram:()=>xs,usePagination:()=>cn,Breakpoint:()=>cP,PatientBannerToggleContactDetailsButton:()=>DO,CloseOutlineIcon:()=>dp,ObstetricsPictogram:()=>E8,parseDateInput:()=>wt,getConfig:()=>ny,attach:()=>s6,getLocale:()=>bh,ActionMenuButton:()=>x0,isUrlWithTemplateParameters:()=>nV,useEmrConfiguration:()=>uj,useLeftNav:()=>u6,ToolsIcon:()=>mo,ErrorState:()=>wK,detach:()=>s5,setCurrentVisit:()=>iV,ConditionsIcon:()=>mb,SaveIcon:()=>d3,useWorkspaces:()=>xz,resetWorkspaceStore:()=>xZ,useConfig:()=>uT,validator:()=>tF,CalendarIcon:()=>c5,getHistory:()=>on,StickyNoteAddIcon:()=>me,useWorkspace2Store:()=>Dw,getPatientName:()=>EE,getVisitStore:()=>iB,getCoreTranslation:()=>a6,registerModuleWithConfigSystem:()=>nd,registerModuleLoad:()=>nm,getBreadcrumbs:()=>nY,extractVariableNames:()=>sm,translateFrom:()=>a3,useStoreWithActions:()=>lB,EditIcon:()=>dv,getCandidateExtensions:()=>le,shallowEqual:()=>T,subscribeNotificationShown:()=>x,MaximizeIcon:()=>dL,promptForClosingWorkspaces:()=>Dv,WarningIcon:()=>mg,closeAllWorkspaces:()=>xH,fhirBaseUrl:()=>ou,matchLocale:()=>DG,registerBreadcrumb:()=>nG,usePatientPhoto:()=>EB,EventsIcon:()=>dw,createGlobalStore:()=>B,workspaceStore:()=>xB,subscribeToFeatureFlag:()=>sb,useExtensionStore:()=>uB,closeWorkspace:()=>xM,createAttachment:()=>iS,useLeftNavStore:()=>u5,TableIcon:()=>mr,Icon:()=>mD,InformationFilledIcon:()=>d$,getCurrentPageMap:()=>oG,LaboratoryPictogram:()=>E6,temporaryConfigStore:()=>tG,getPromptBeforeClosingFcn:()=>xA,toDateObjectStrict:()=>bq,defineConfigSchema:()=>nc,filterBreadcrumbs:()=>nJ,invalidateImplementerToolsConfig:()=>t8,PatientBannerContactDetails:()=>DL,getAssignedExtensions:()=>s7,PatientPhoto:()=>EW,MaterialOrderIcon:()=>dM,MicroscopeIcon:()=>dV,visitTypesUrl:()=>iA,scheduleRecomputation:()=>sL,PharmacyPictogram:()=>xn,AttachmentIcon:()=>mv,MoneyIcon:()=>dW,getAttachments:()=>i_,getWorkspaceGroupStore:()=>xY,PageHeaderContent:()=>Eb,MedicationIcon:()=>dF,PrinterIcon:()=>dJ,PatientListsPictogram:()=>xd,useAppContext:()=>ux,isOpenmrsRoutes:()=>it,AppointmentsAltPictogram:()=>EK,GenericOrderTypeIcon:()=>dk,batchExtensionUpdates:()=>sj,useExtensionSlotStore:()=>lH,ViewIcon:()=>mh,formattedName:()=>E_,sessionEndpoint:()=>oc,duration:()=>wo,resetImportMapOverrides:()=>o1,TableOfContentsIcon:()=>mn,CaretLeftIcon:()=>c8,getTranslationOverrides:()=>nv,isVersionSatisfied:()=>DX,EmptyCardIllustration:()=>wH,PenIcon:()=>dq,getWorkspaceStore:()=>xV,validators:()=>nH,setupImportMapOverrides:()=>o3,showToast:()=>xS,useDefineAppContext:()=>uv,verifyTotpCode:()=>oR,getGlobalStore:()=>U,useOnClickOutside:()=>u7,getWindowByWorkspaceName:()=>ly,ArrowRightIcon:()=>c4,loadLifeCycles:()=>cE,registerBreadcrumbs:()=>nZ,MotherIcon:()=>dH,fetchCurrentPatient:()=>iP,Toast:()=>xE,MessageQueueIcon:()=>dB,TwoFactorAuthenticationIcon:()=>mu,Pharmacy2Pictogram:()=>xr,goBackInHistory:()=>or,GroupAccessIcon:()=>dC,getExtensionRenderingsStore:()=>sk,setImplementerToolsConfigRecomputer:()=>t9,getAsyncExtensionLifecycle:()=>ud,setupApiModule:()=>oj,renderLoadingSpinner:()=>DF,WorkspaceContainer:()=>Dl,showNotification:()=>Ec,getModalRegistration:()=>ll,ListCheckedIcon:()=>dI,ResponsiveWrapper:()=>xf,GynaecologyPictogram:()=>E2,ShoppingCartIcon:()=>d8,getRouteMapNextPageMap:()=>ih,MetadataExportPictogram:()=>E9,updateVisit:()=>iW,backendDependencies:()=>oI,MaybePictogram:()=>xm,createParcelMounter:()=>lP,openmrsFetch:()=>om,useStore:()=>lF,isOpenmrsAppRoutes:()=>ie,HomePictogram:()=>xc,DentistryPictogram:()=>EX,ServiceQueuesPictogram:()=>xo,toLanguageTag:()=>bp,launchWorkspace:()=>xT,setFeatureFlag:()=>sw,DigitalTrustPictogram:()=>EQ,NumericObservation:()=>Eg,attachmentUrl:()=>ix,interpolateString:()=>a9,inRange:()=>nB,useExtensionSlotMeta:()=>uF,AppointmentsPictogram:()=>Ez,renderSnackbars:()=>xb,getRegisteredWorkspace2Names:()=>Dx,logout:()=>oT,toLocationObject:()=>i$,ChartLineIcon:()=>dn,UserHasAccess:()=>cu,evaluateAsBooleanAsync:()=>i0,changeWorkspaceContext:()=>xL,createDashboard:()=>mk,getLocations:()=>iO,useExtensionContext:()=>uM,canCloseWorkspaceWithoutPrompting:()=>xC,getExtensionsConfigStore:()=>tQ,getRouteMapDefaultMap:()=>ip,age:()=>EC,isOmrsDateStrict:()=>bZ,registerWorkspaceGroups2:()=>lw,usePaginationInfo:()=>cr,evaluateAsync:()=>iX,useOpenmrsFetchAll:()=>uX,removeImportMapOverride:()=>o0,showWorkspacePrompts:()=>xK,useVisitTypes:()=>cb,ageAsDuration:()=>ES,getExtensionNameFromId:()=>s1,renderParcel:()=>lC,useWorkspace2Context:()=>DE,ResetIcon:()=>d2,RenewIcon:()=>d1,subscribeActionableNotificationShown:()=>D,ErrorCard:()=>wG,GenderFemaleIcon:()=>dE,enableImportMapOverride:()=>o4,retry:()=>DQ,ComponentContext:()=>lN,ExtensionSlot:()=>lY,unsetLeftNav:()=>lo,addImportMapOverride:()=>oQ,MaybeIcon:()=>mx,useCustomOverflowMenu:()=>cG,PedestrianFamilyIcon:()=>dY,cancelPrompt:()=>xI,CtScanPictogram:()=>EJ,dispatchNotificationShown:()=>v,leftNavStore:()=>lr,OpenmrsFetchError:()=>op,UserFollowIcon:()=>md,launchWorkspaceGroup2:()=>Df,ChevronRightIcon:()=>du,UserXrayIcon:()=>mm,GenderOtherIcon:()=>dD,formatDuration:()=>we,toOmrsIsoString:()=>bJ,Labs2Pictogram:()=>E5,workspace2Store:()=>lg,setUserLanguage:()=>ow,useBodyScrollLock:()=>uC,getExtensionConfig:()=>t0,SyringeIcon:()=>mt,LocationPicker:()=>wY,useDebounce:()=>uO,TimeIcon:()=>ma,getExtensionSlotConfig:()=>tJ,AddIcon:()=>cQ,getRouteMapOverrideMap:()=>ig,processConfig:()=>nb,InventoryManagementIcon:()=>dN,registerWorkspaces2:()=>lx,UserIcon:()=>mp,formatPatientName:()=>ED,fireOpenmrsEvent:()=>iR,registerModal:()=>ls,registerTranslationNamespace:()=>np,displayName:()=>Ex,evaluate:()=>iJ,defineExtensionConfigSchema:()=>nf,renderWorkspaceWindowsAndMenu:()=>Dz,getSyncLifecycle:()=>uc,evaluateAsTypeAsync:()=>i3});let f="openmrs:notification-shown",h="openmrs:actionable-notification-shown",g="openmrs:toast-shown",y="openmrs:snack-bar-shown";function v(e){window.dispatchEvent(new CustomEvent(f,{detail:e}))}function b(e){window.dispatchEvent(new CustomEvent(h,{detail:e}))}function w(e){window.dispatchEvent(new CustomEvent(y,{detail:e}))}function E(e){window.dispatchEvent(new CustomEvent(g,{detail:e}))}function x(e){let t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}function D(e){let t=t=>e(t.detail);return window.addEventListener(h,t),()=>window.removeEventListener(h,t)}function _(e){let t=t=>e(t.detail);return window.addEventListener(g,t),()=>window.removeEventListener(g,t)}function k(e){let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}function S(e,t){return e instanceof Error?e.message||t:"string"==typeof e&&e.trim().length>0?e:t}function C(e){let t=R(e);setTimeout(()=>{throw t})}function P(){let e=Error();return t=>{let n=R(t);n.stack+=`
|
|
2
2
|
Async stacktrace:
|
|
3
|
-
${e.stack}`,S(t)}}function P(e){let t;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t=`Object thrown as error: ${JSON.stringify(e)}`}catch(n){t=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(t)}if(void 0===e)return Error("'undefined' was thrown as an error");return Error(e.toString())}function R(e,t){if(e===t||Object.is(e,t))return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}function T(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;let a=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(r=n.getItem(e))?r:null;return o instanceof Promise?o.then(a):a(o)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}window.onerror=function(e,t,n,r,a){return console.error("Unexpected error: ",a??e),w({description:k(a??e,"Oops! An unexpected error occurred."),kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),w({description:k(e.reason,"Oops! An unhandled promise rejection occurred."),kind:"error",title:"Error"})};let $=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>$(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>$(t)(e)}}},O=e=>{let t,n=new Set,r=(e,r)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,o={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(r,a,o);return o},N=e=>e?O(e):O;function A(){try{return"u">typeof process&&("true"===process.env.VITEST||void 0!==process.env.JEST_WORKER_ID)||"u">typeof globalThis&&("__vitest_worker__"in globalThis||"__jest__"in globalThis)}catch{return!1}}let I={},j=Symbol.for("openmrs.esm-state.instanceCount"),M=globalThis,L=(M[j]??0)+1;function F(e,t,n="none"){let r=I[e];if(r)return r.active?A()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):r.value.setState(t,!0),r.active=!0,r.value;{let r=W(e,t,n);return I[e]={value:r,active:!0},r}}function B(e,t){let n=I[e];return n?(n.active?A()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value=t,n.active=!0,n.value):(I[e]={value:t,active:!0},t)}function V(e,t,n="none"){let r=I[e];if(!r){let r=W(e,t??{},n);return I[e]={value:r,active:!1},r}return r.value}function U(...e){let[t,n,r]=e,a=void 0===r?n:r,o=void 0===r?e=>e:n,i=o(t.getState());return a(i),t.subscribe(e=>{let t=o(e);R(i,t)||(i=t,a(t))})}function W(e,t,n){return"sessionStorage"===n?N()(((e,t)=>{if("getStorage"in t||"serialize"in t||"deserialize"in t)return console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),(n,r,a)=>{let o,i,s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,u=new Set,c=new Set;try{o=s.getStorage()}catch(e){}if(!o)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)},r,a);let d=$(s.serialize),m=()=>{let e,t=d({state:s.partialize({...r()}),version:s.version}).then(e=>o.setItem(s.name,e)).catch(t=>{e=t});if(e)throw e;return t},p=a.setState;a.setState=(e,t)=>{p(e,t),m()};let f=e((...e)=>{n(...e),m()},r,a),h=()=>{var e;if(!o)return;l=!1,u.forEach(e=>e(r()));let t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,r()))||void 0;return $(o.getItem.bind(o))(s.name).then(e=>{if(e)return s.deserialize(e)}).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return e.state;else{if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return n(i=s.merge(e,null!=(t=r())?t:f),!0),m()}).then(()=>{null==t||t(i,void 0),l=!0,c.forEach(e=>e(i))}).catch(e=>{null==t||t(void 0,e)})};return a.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(o=e.getStorage())},clearStorage:()=>{null==o||o.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},h(),i||f};return(n,r,a)=>{let o,i={storage:T(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,l=new Set,u=new Set,c=i.storage;if(!c)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)},r,a);let d=()=>{let e=i.partialize({...r()});return c.setItem(i.name,{state:e,version:i.version})},m=a.setState;a.setState=(e,t)=>{m(e,t),d()};let p=e((...e)=>{n(...e),d()},r,a);a.getInitialState=()=>p;let f=()=>{var e,t;if(!c)return;s=!1,l.forEach(e=>{var t;return e(null!=(t=r())?t:p)});let a=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=r())?e:p))||void 0;return $(c.getItem.bind(c))(i.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===i.version)return[!1,e.state];else{if(i.migrate)return[!0,i.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;let[a,s]=e;if(n(o=i.merge(s,null!=(t=r())?t:p),!0),a)return d()}).then(()=>{null==a||a(o,void 0),o=r(),s=!0,u.forEach(e=>e(o))}).catch(e=>{null==a||a(void 0,e)})};return a.persist={setOptions:e=>{i={...i,...e},e.storage&&(c=e.storage)},clearStorage:()=>{null==c||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},i.skipHydration||f(),o||p}})(()=>t,{name:e,storage:T(()=>sessionStorage)})):N()(()=>t)}M[j]=L,L>1&&!A()&&console.error(`Detected ${L} copies of @openmrs/esm-framework running on this page. Each copy keeps its own store registry, so stores, configuration and extension state are not shared between them. This usually means a frontend module loaded its own bundled framework instead of the one the app shell provides.`),globalThis.setTimeout?.(()=>{"u">typeof window&&"development"===window.spaEnv&&(window.stores=I)},1e3);let H=function(e){return void 0===e};var z,K,G,Z,Y,q,J,X,Q=n(8348),ee=(0,n(367).A)(Object.getPrototypeOf,Object),et=n(3098),en=Object.prototype,er=Function.prototype.toString,ea=en.hasOwnProperty,eo=er.call(Object);let ei=function(e){if(!(0,et.A)(e)||"[object Object]"!=(0,Q.A)(e))return!1;var t=ee(e);if(null===t)return!0;var n=ea.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&er.call(n)==eo};var es=n(13),el=n(8983),eu=function(){try{var e=(0,el.A)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();let ec=function(e,t,n){"__proto__"==t&&eu?eu(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var ed=n(6984);let em=function(e,t,n){(void 0===n||(0,ed.A)(e[t],n))&&(void 0!==n||t in e)||ec(e,t,n)},ep=function(e,t,n){for(var r=-1,a=Object(e),o=n(e),i=o.length;i--;){var s=o[++r];if(!1===t(a[s],s,a))break}return e};var ef=n(1917),eh="object"==typeof exports&&exports&&!exports.nodeType&&exports,eg=eh&&"object"==typeof module&&module&&!module.nodeType&&module,ey=eg&&eg.exports===eh?ef.A.Buffer:void 0,ev=ey?ey.allocUnsafe:void 0;let eb=function(e,t){if(t)return e.slice();var n=e.length,r=ev?ev(n):new e.constructor(n);return e.copy(r),r};var ew=n(3988);let eE=function(e){var t=new e.constructor(e.byteLength);return new ew.A(t).set(new ew.A(e)),t},ex=function(e,t){var n=t?eE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},eD=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var e_=n(3149),ek=Object.create,eS=function(){function e(){}return function(t){if(!(0,e_.A)(t))return{};if(ek)return ek(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),eC=n(7271);let eP=function(e){return"function"!=typeof e.constructor||(0,eC.A)(e)?{}:eS(ee(e))};var eR=n(18),eT=n(2049),e$=n(8446),eO=n(2873),eN=n(9610),eA=n(9415);let eI=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var ej=Object.prototype.hasOwnProperty;let eM=function(e,t,n){var r=e[t];ej.call(e,t)&&(0,ed.A)(r,n)&&(void 0!==n||t in e)||ec(e,t,n)},eL=function(e,t,n,r){var a=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),a?ec(n,s,l):eM(n,s,l)}return n};var eF=n(1463);let eB=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var eV=Object.prototype.hasOwnProperty;let eU=function(e){if(!(0,e_.A)(e))return eB(e);var t=(0,eC.A)(e),n=[];for(var r in e)"constructor"==r&&(t||!eV.call(e,r))||n.push(r);return n},eW=function(e){return(0,e$.A)(e)?(0,eF.A)(e,!0):eU(e)},eH=function(e,t,n,r,a,o,i){var s=eI(e,n),l=eI(t,n),u=i.get(l);if(u)return void em(e,n,u);var c=o?o(s,l,n+"",e,t,i):void 0,d=void 0===c;if(d){var m=(0,eT.A)(l),p=!m&&(0,eO.A)(l),f=!m&&!p&&(0,eA.A)(l);(c=l,m||p||f)?(0,eT.A)(s)?c=s:(0,et.A)(s)&&(0,e$.A)(s)?c=eD(s):p?(d=!1,c=eb(l,!0)):f?(d=!1,c=ex(l,!0)):c=[]:ei(l)||(0,eR.A)(l)?(c=s,(0,eR.A)(s))?c=eL(s,eW(s)):(!(0,e_.A)(s)||(0,eN.A)(s))&&(c=eP(l)):d=!1}d&&(i.set(l,c),a(c,l,r,o,i),i.delete(l)),em(e,n,c)},ez=function e(t,n,r,a,o){t!==n&&ep(n,function(i,s){if(o||(o=new es.A),(0,e_.A)(i))eH(t,n,s,r,e,a,o);else{var l=a?a(eI(t,s),i,s+"",t,n,o):void 0;void 0===l&&(l=i),em(t,s,l)}},eW)};var eK=n(9008);let eG=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var eZ=Math.max;let eY=function(e,t,n){return t=eZ(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=eZ(r.length-t,0),i=Array(o);++a<o;)i[a]=r[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=r[a];return s[t]=n(i),eG(e,this,s)}};var eq=eu?function(e,t){return eu(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:eK.A,eJ=Date.now,eX=(z=0,K=0,function(){var e=eJ(),t=16-(e-K);if(K=e,t>0){if(++z>=800)return arguments[0]}else z=0;return eq.apply(void 0,arguments)}),eQ=n(5353);let e0=function(e,t,n){if(!(0,e_.A)(n))return!1;var r=typeof t;return("number"==r?!!((0,e$.A)(n)&&(0,eQ.A)(t,n.length)):"string"==r&&t in n)&&(0,ed.A)(n[t],e)},e1=function(e){var t;return eX(eY(t=function(t,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,i=a>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&e0(n[0],n[1],i)&&(o=a<3?void 0:o,a=1),t=Object(t);++r<a;){var s=n[r];s&&e(t,s,r,o)}return t},void 0,eK.A),t+"")};var e4=e1(function(e,t,n,r){ez(e,t,n,r)}),e2=n(421);let e3=function(e,t){return(0,e2.A)(e,t)};var e6=n(5572);let e5=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};var e9=n(7422),e8=n(4247),e7=n(6912),te=n(3153),tt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)(0,e7.A)(t,(0,e8.A)(e)),e=ee(e);return t}:te.A,tn=n(9042),tr=n(3831);let ta=function(e){return(0,tr.A)(e,eW,tt)};var to=n(3231),ti=Object.prototype.hasOwnProperty;let ts=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ti.call(e,"index")&&(n.index=e.index,n.input=e.input),n},tl=function(e,t){var n=t?eE(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var tu=/\w*$/;let tc=function(e){var t=new e.constructor(e.source,tu.exec(e));return t.lastIndex=e.lastIndex,t};var td=n(241),tm=td.A?td.A.prototype:void 0,tp=tm?tm.valueOf:void 0;let tf=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return eE(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return tl(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ex(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return tc(e);case"[object Symbol]":return tp?Object(tp.call(e)):{}}};var th=n(2789),tg=n(4841),ty=tg.A&&tg.A.isMap,tv=ty?(0,th.A)(ty):function(e){return(0,et.A)(e)&&"[object Map]"==(0,to.A)(e)},tb=tg.A&&tg.A.isSet,tw=tb?(0,th.A)(tb):function(e){return(0,et.A)(e)&&"[object Set]"==(0,to.A)(e)},tE="[object Arguments]",tx="[object Function]",tD="[object Object]",t_={};t_[tE]=t_["[object Array]"]=t_["[object ArrayBuffer]"]=t_["[object DataView]"]=t_["[object Boolean]"]=t_["[object Date]"]=t_["[object Float32Array]"]=t_["[object Float64Array]"]=t_["[object Int8Array]"]=t_["[object Int16Array]"]=t_["[object Int32Array]"]=t_["[object Map]"]=t_["[object Number]"]=t_[tD]=t_["[object RegExp]"]=t_["[object Set]"]=t_["[object String]"]=t_["[object Symbol]"]=t_["[object Uint8Array]"]=t_["[object Uint8ClampedArray]"]=t_["[object Uint16Array]"]=t_["[object Uint32Array]"]=!0,t_["[object Error]"]=t_[tx]=t_["[object WeakMap]"]=!1;let tk=function e(t,n,r,a,o,i){var s,l=1&n,u=2&n,c=4&n;if(r&&(s=o?r(t,a,o,i):r(t)),void 0!==s)return s;if(!(0,e_.A)(t))return t;var d=(0,eT.A)(t);if(d){if(s=ts(t),!l)return eD(t,s)}else{var m,p,f,h,g=(0,to.A)(t),y=g==tx||"[object GeneratorFunction]"==g;if((0,eO.A)(t))return eb(t,l);if(g==tD||g==tE||y&&!o){if(s=u||y?{}:eP(t),!l)return u?(p=(m=s)&&eL(t,eW(t),m),eL(t,tt(t),p)):(h=(f=s)&&eL(t,(0,e9.A)(t),f),eL(t,(0,e8.A)(t),h))}else{if(!t_[g])return o?t:{};s=tf(t,g,l)}}i||(i=new es.A);var v=i.get(t);if(v)return v;i.set(t,s),tw(t)?t.forEach(function(a){s.add(e(a,n,r,a,t,i))}):tv(t)&&t.forEach(function(a,o){s.set(o,e(a,n,r,o,t,i))});var b=c?u?ta:tn.A:u?eW:e9.A,w=d?void 0:b(t);return e5(w||t,function(a,o){w&&(a=t[o=a]),eM(s,o,e(a,n,r,o,t,i))}),s};var tS=n(4548);let tC=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var tP=n(6318),tR=n(7688),tT=n(901);let t$=function(e,t){var n,r;return t=(0,tS.A)(t,e),n=e,null==(e=(r=t).length<2?n:(0,tP.A)(n,(0,tR.A)(r,0,-1)))||delete e[(0,tT.A)(tC(t))]},tO=function(e){return ei(e)?void 0:e};var tN=td.A?td.A.isConcatSpreadable:void 0;let tA=function(e){return(0,eT.A)(e)||(0,eR.A)(e)||!!(tN&&e&&e[tN])},tI=function e(t,n,r,a,o){var i=-1,s=t.length;for(r||(r=tA),o||(o=[]);++i<s;){var l=t[i];n>0&&r(l)?n>1?e(l,n-1,r,a,o):(0,e7.A)(o,l):a||(o[o.length]=l)}return o};var tj=eX(eY(G=function(e,t){var n={};if(null==e)return n;var r=!1;t=(0,e6.A)(t,function(t){return t=(0,tS.A)(t,e),r||(r=t.length>1),t}),eL(e,ta(e),n),r&&(n=tk(n,7,tO));for(var a=t.length;a--;)t$(n,t[a]);return n},void 0,function(e){return(null==e?0:e.length)?tI(e,1):[]}),G+""),tM=((Z={}).Array="Array",Z.Boolean="Boolean",Z.ConceptUuid="ConceptUuid",Z.Number="Number",Z.Object="Object",Z.String="String",Z.UUID="UUID",Z.PersonAttributeTypeUuid="PersonAttributeTypeUuid",Z.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",Z);function tL(e,t){return n=>{if(!e(n))if("function"==typeof t)return t(n);else return t}}let tF=tL(e=>Array.isArray(e),"must be an array"),tB=tL(e=>"boolean"==typeof e,"must be a boolean"),tV=tL(e=>"number"==typeof e,"must be a number"),tU=tL(e=>"string"==typeof e,"must be a string"),tW=tL(e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,"must be an object (not an array or null)"),tH=tL(e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e),"must be a valid UUID or a 36-character hexadecimal string"),tz=F("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),tK=F("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});tK.subscribe(e=>{var t=e.config;try{localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}catch(e){}});let tG=F("config-store-of-extension-state",{mountedExtensions:[]});function tZ(e){return V(`config-module-${e}`,{config:null,loaded:!1,translationOverridesLoaded:!1})}function tY(){return V("config-extension-slots",{slots:{}})}function tq(e){return tJ(tY().getState(),e)}function tJ(e,t){return e.slots[t]??{loaded:!1,config:{}}}function tX(){return V("config-extensions",{configs:{}})}function tQ(e,t){if("string"!=typeof e||"string"!=typeof t||"__proto__"===e||"__proto__"===t||"constructor"===e||"constructor"===t||"prototype"===e||"prototype"===t)throw Error("Attempted to call `getExtensionConfig()` with invalid argument");let n=tX(),r=n=>n.configs[e]?.[t];return{getInitialState:()=>r(n.getInitialState()),getState:()=>r(n.getState())??{loaded:!1,config:null},subscribe:e=>n.subscribe((t,n)=>{let a=r(t),o=r(n);R(a,o)||e(a,o)})}}function t0(e,t,n){return e.configs[t]?.[n]??{loaded:!1,config:null}}function t1(e,t,n){return e.configure?.[n]??null}let t4=N()(()=>({config:{}})),t2=0,t3=!0,t6=!1;function t5(e){r=e}function t9(){t3=!0,t2>0&&t8()}function t8(){if(t3&&r&&!t6){t6=!0,t3=!1;try{r()}catch(e){t3=!0,t7(e),console.error("Failed to derive the implementer tools config",e)}finally{t6=!1}}}function t7(e){t4.setState({derivationError:e instanceof Error?e.message:String(e)})}function ne(){t4.getState().derivationError&&t4.setState({derivationError:void 0})}let nt=B("config-implementer-tools",{...t4,getState:()=>(0===t2&&t8(),t4.getState()),setState:(...e)=>(t3=!1,t4.setState(...e)),subscribe(e){t2++,t8();let t=t4.subscribe(e),n=!1;return()=>{!n&&(n=!0,t2--),t()}}});function nn(e,t){if(Array.isArray(t))return t}function nr(e,t){return e4({},e,t,nn)}let na=[];function no(){let e=tz.getState(),t=tK.getState(),n=tG.getState();!function(e,t){for(let n of Object.keys(e.schemas)){let r,a=tZ(n),o=e.schemas[n],i=!!e.moduleLoaded[n],s=nl.get(n);if(s&&s.schema===o&&s.moduleLoaded===i&&s.providedConfigs===e.providedConfigs&&s.temporaryConfig===t.config)r=s.state;else{let a=i?function(e,t,n){let r=t.schemas[e],a=n_(e,nx(t,n));nS(r,a,e);let o=nT(r,a);return nC(r,o,e),delete o.extensionSlots,o}(n,e,t):function(e,t,n){let r=nT(nL,n_(e,nx(t,n)));return nC(nL,r,e),delete r.extensionSlots,r}(n,e,t);r={translationOverridesLoaded:!0,loaded:i,config:a},nl.set(n,{schema:o,moduleLoaded:i,providedConfigs:e.providedConfigs,temporaryConfig:t.config,state:r})}let l=a.getState();l.loaded===r.loaded&&l.translationOverridesLoaded===r.translationOverridesLoaded&&e3(l.config,r.config)||a.setState(r)}}(e,t);let r=function(e,t){let n=nk(nx(e,t)),r=Object.keys(n).reduce((e,t)=>(n[t]?.extensionSlots&&(e[t]=n[t]?.extensionSlots),e),{});var a=r;for(let[e,t]of Object.entries(a))for(let[n,r]of Object.entries(t))!function(e,t,n){let r=`${t}.extensionSlots.${n}`,a=`Extension slot config '${r}'`,o=Object.keys(e).filter(e=>!["add","remove","order","configure"].includes(e));o.length&&nA(r,a+`' contains invalid keys '${o.join("', '")}'`),!e.add||Array.isArray(e.add)&&e.add.every(e=>"string"==typeof e)||nA(r,a+".add' is invalid. Must be an array of strings (extension IDs)"),!e.remove||Array.isArray(e.remove)&&e.remove.every(e=>"string"==typeof e)||nA(r,a+".remove' is invalid. Must be an array of strings (extension IDs)"),!e.order||Array.isArray(e.order)&&e.order.every(e=>"string"==typeof e)||nA(r,a+".order' is invalid. Must be an array of strings (extension IDs)"),e.configure&&!nO(e.configure)&&nA(r,a+".configure' is invalid. Must be an object with extension IDs for keys")}(r,e,n);let o={},i={};for(let e of Object.values(r))for(let[t,n]of Object.entries(e))o[t]=n,n.configure&&(i[t]??(i[t]=[])).push(n.configure);for(let[e,t]of Object.entries(i)){let n=1===t.length?t[0]:nk(t);o[e].configure!==n&&(o[e]={...o[e],configure:n})}return o}(e,t);(function(e){let t=tY(),n=t.getState().slots,r={},a=!1;for(let[t,o]of Object.entries(e)){let e=n[t];e?.loaded&&e3(e.config,o)?r[t]=e:(r[t]={loaded:!0,config:o},a=!0)}(a||Object.keys(n).length!==Object.keys(r).length)&&t.setState({slots:r})})(r),function(e,t,n,r){let a=tX(),o=a.getState().configs,i={},s=!1,l=0;for(let a of t.mountedExtensions){let t=function(e,t,n,r,a,o,i){let s=function(e){let[t]=e.split("#");return t}(r),l=a.schemas[s],u=JSON.stringify([n,r,e,t]),c=nb.get(u);if(c&&c.extensionSchema===l&&c.extensionModuleSchema===a.schemas[t]&&c.providedConfigs===a.providedConfigs&&c.temporaryConfig===o.config)return c.config;let d=l?s:t,m=nx(a,o),p=i?.configure?.[r]??{},f=n_(e,m),h=f?.extensionSlots?.[n]?.configure?.[r]??{},g=nk([n_(d,m),p,h]),y=l??a.schemas[t];nS(y,g,d);let v=nT(y,g);return nC(y,v,d),delete v.extensionSlots,nb.set(u,{extensionSchema:l,extensionModuleSchema:a.schemas[t],providedConfigs:a.providedConfigs,temporaryConfig:o.config,config:v}),v}(a.slotModuleName,a.extensionModuleName,a.slotName,a.extensionId,e,n,r[a.slotName]),u=o[a.slotName]?.[a.extensionId],c=u?.loaded&&e3(u.config,t)?u:{config:t,loaded:!0};c!==u&&(s=!0),i[a.slotName]||(i[a.slotName]={}),i[a.slotName][a.extensionId]=c,l++}for(let[e,t]of Object.entries(i)){let n=o[e];n&&Object.keys(n).length===Object.keys(t).length&&Object.entries(t).every(([e,t])=>n[e]===t)&&(i[e]=n)}s||(s=Object.keys(o).length!==Object.keys(i).length||Object.values(o).reduce((e,t)=>e+Object.keys(t).length,0)!==l),s&&a.setState({configs:i})}(e,n,t,r),t9()}function ni(){r=()=>{var e,t;let n,r;return e=tz.getState(),t=tK.getState(),n=nt.getState(),r={config:function(e,t){let n=function(e){let t={};for(let[n,r]of Object.entries(e)){let e=nE.get(n);if(e&&e.schema===r)t[n]=e.annotated;else{let e=function e(t){return t.hasOwnProperty("_default")?{...t,_value:t._default,_source:"default"}:nO(t)?Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{}):{}}(tk(r,5));nE.set(n,{schema:r,annotated:e}),t[n]=e}}return t}(e.schemas),r=[...e.providedConfigs.map(e=>[e.config,e.source]),[t.config,"temporary config"]],a=new Set(Object.keys(n));for(let[e]of r)for(let t of Object.keys(e))a.add(t);let o={};for(let e of a){let t=n[e],a=r.map(([t])=>t[e]),i=r.map(([,e])=>e),s=nw.get(e);if(s&&s.annotatedSchema===t&&s.configSlices.length===a.length&&s.configSlices.every((e,t)=>e===a[t])&&s.sources.every((e,t)=>e===i[t])){o[e]=s.result;continue}let l=t??{};r.forEach(([,e],t)=>{let n=a[t];void 0!==n&&(l=nr(l,function e(t,n){return nO(t)?Object.keys(t).reduce((r,a)=>(r[a]=e(t[a],n),r),{}):{_value:t,_source:n}}(n,e)))}),nw.set(e,{annotatedSchema:t,configSlices:a,sources:i,result:l}),o[e]=l}return o}(e,t)},void(e3(n.config,r.config)||nt.setState(r))},no(),na.push(tz.subscribe(ns),tK.subscribe(ns),tG.subscribe(ns))}function ns(){ne();try{no()}catch(e){t7(e),console.error("Failed to recompute the configuration",e)}}ni();let nl=new Map;function nu(e,t){nD(e,t);let n=nr(t,nL);tz.setState(t=>({...t,schemas:{...t.schemas,[e]:n},moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function nc(e){tz.setState(t=>({...t,schemas:{...t.schemas,[e]:nL}}))}function nd(e){tz.setState(t=>({...t,moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function nm(e){tz.setState(t=>({...t,schemas:{...t.schemas,[e]:nM}}))}function np(e,t){nD(e,t);let n=nr(t,nL);tz.getState().schemas[e]&&console.error(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),tz.setState(t=>({...t,schemas:{...t.schemas,[e]:n}}))}function nf(e,t="provided"){tz.setState(n=>({...n,providedConfigs:[...n.providedConfigs,{source:t,config:e}]}))}function nh(e,t,n){return new Promise(r=>{let a,o=!1;function i(e){!o&&t(e)&&(o=!0,r(n(e)),a?.())}i(e.getState()),o||(a=e.subscribe(i))})}function ng(e){return nh(tZ(e),e=>!!(e.loaded&&e.config),e=>tj(e.config,["Display conditions","Translation overrides"]))}function ny(e,t,n){let r=[nh(tZ(e),e=>!!(e.translationOverridesLoaded&&e.config),e=>e.config["Translation overrides"]??{})];return t&&n&&r.push(nh(tQ(t,n),e=>!!(e.loaded&&e.config),e=>e.config["Translation overrides"]??{})),Promise.all(r)}function nv(e,t,n){nS(e,t,n);let r=nT(e,t);return nC(e,r,n),r}let nb=new Map,nw=new Map,nE=new Map;function nx(e,t){return[...e.providedConfigs.map(e=>e.config),t.config]}function nD(e,t,n=""){let r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(let a of Object.keys(t).filter(e=>!e.startsWith("_"))){let o=n+(n&&".")+a,i=t[a];if("Display conditions"===o&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===o&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!nO(i)){console.error(`${e} has bad config schema definition for key '${o}'. ${r}`);continue}i.hasOwnProperty("_default")||nD(e,i,o);let s=i._elements;if(n$(s)&&nD(e,s,o+"._elements"),i._validators)for(let t of i._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${o}' ${r}.
|
|
3
|
+
${e.stack}`,C(t)}}function R(e){let t;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t=`Object thrown as error: ${JSON.stringify(e)}`}catch(n){t=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(t)}if(void 0===e)return Error("'undefined' was thrown as an error");return Error(e.toString())}function T(e,t){if(e===t||Object.is(e,t))return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);return n.length===r.length&&n.every(n=>e[n]===t[n])}function $(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;let a=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(r=n.getItem(e))?r:null;return o instanceof Promise?o.then(a):a(o)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}window.onerror=function(e,t,n,r,a){return console.error("Unexpected error: ",a??e),E({description:S(a??e,"Oops! An unexpected error occurred."),kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),E({description:S(e.reason,"Oops! An unhandled promise rejection occurred."),kind:"error",title:"Error"})};let O=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>O(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>O(t)(e)}}},N=e=>{let t,n=new Set,r=(e,r)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,o={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(r,a,o);return o},A=e=>e?N(e):N;function I(){try{return"u">typeof process&&("true"===process.env.VITEST||void 0!==process.env.JEST_WORKER_ID)||"u">typeof globalThis&&("__vitest_worker__"in globalThis||"__jest__"in globalThis)}catch{return!1}}let j={},M=Symbol.for("openmrs.esm-state.instanceCount"),L=globalThis,F=(L[M]??0)+1;function B(e,t,n="none"){let r=j[e];if(r)return r.active?I()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):r.value.setState(t,!0),r.active=!0,r.value;{let r=H(e,t,n);return j[e]={value:r,active:!0},r}}function V(e,t){let n=j[e];return n?(n.active?I()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value=t,n.active=!0,n.value):(j[e]={value:t,active:!0},t)}function U(e,t,n="none"){let r=j[e];if(!r){let r=H(e,t??{},n);return j[e]={value:r,active:!1},r}return r.value}function W(...e){let[t,n,r]=e,a=void 0===r?n:r,o=void 0===r?e=>e:n,i=o(t.getState());return a(i),t.subscribe(e=>{let t=o(e);T(i,t)||(i=t,a(t))})}function H(e,t,n){return"sessionStorage"===n?A()(((e,t)=>{if("getStorage"in t||"serialize"in t||"deserialize"in t)return console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),(n,r,a)=>{let o,i,s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,u=new Set,c=new Set;try{o=s.getStorage()}catch(e){}if(!o)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)},r,a);let d=O(s.serialize),m=()=>{let e,t=d({state:s.partialize({...r()}),version:s.version}).then(e=>o.setItem(s.name,e)).catch(t=>{e=t});if(e)throw e;return t},p=a.setState;a.setState=(e,t)=>{p(e,t),m()};let f=e((...e)=>{n(...e),m()},r,a),h=()=>{var e;if(!o)return;l=!1,u.forEach(e=>e(r()));let t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,r()))||void 0;return O(o.getItem.bind(o))(s.name).then(e=>{if(e)return s.deserialize(e)}).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return e.state;else{if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return n(i=s.merge(e,null!=(t=r())?t:f),!0),m()}).then(()=>{null==t||t(i,void 0),l=!0,c.forEach(e=>e(i))}).catch(e=>{null==t||t(void 0,e)})};return a.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(o=e.getStorage())},clearStorage:()=>{null==o||o.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},h(),i||f};return(n,r,a)=>{let o,i={storage:$(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,l=new Set,u=new Set,c=i.storage;if(!c)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)},r,a);let d=()=>{let e=i.partialize({...r()});return c.setItem(i.name,{state:e,version:i.version})},m=a.setState;a.setState=(e,t)=>{m(e,t),d()};let p=e((...e)=>{n(...e),d()},r,a);a.getInitialState=()=>p;let f=()=>{var e,t;if(!c)return;s=!1,l.forEach(e=>{var t;return e(null!=(t=r())?t:p)});let a=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=r())?e:p))||void 0;return O(c.getItem.bind(c))(i.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===i.version)return[!1,e.state];else{if(i.migrate)return[!0,i.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;let[a,s]=e;if(n(o=i.merge(s,null!=(t=r())?t:p),!0),a)return d()}).then(()=>{null==a||a(o,void 0),o=r(),s=!0,u.forEach(e=>e(o))}).catch(e=>{null==a||a(void 0,e)})};return a.persist={setOptions:e=>{i={...i,...e},e.storage&&(c=e.storage)},clearStorage:()=>{null==c||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},i.skipHydration||f(),o||p}})(()=>t,{name:e,storage:$(()=>sessionStorage)})):A()(()=>t)}L[M]=F,F>1&&!I()&&console.error(`Detected ${F} copies of @openmrs/esm-framework running on this page. Each copy keeps its own store registry, so stores, configuration and extension state are not shared between them. This usually means a frontend module loaded its own bundled framework instead of the one the app shell provides.`),globalThis.setTimeout?.(()=>{"u">typeof window&&"development"===window.spaEnv&&(window.stores=j)},1e3);let z=function(e){return void 0===e};var K,G,Z,Y,q,J,X,Q,ee=n(8348),et=(0,n(367).A)(Object.getPrototypeOf,Object),en=n(3098),er=Object.prototype,ea=Function.prototype.toString,eo=er.hasOwnProperty,ei=ea.call(Object);let es=function(e){if(!(0,en.A)(e)||"[object Object]"!=(0,ee.A)(e))return!1;var t=et(e);if(null===t)return!0;var n=eo.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ea.call(n)==ei};var el=n(13),eu=n(8983),ec=function(){try{var e=(0,eu.A)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();let ed=function(e,t,n){"__proto__"==t&&ec?ec(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var em=n(6984);let ep=function(e,t,n){(void 0===n||(0,em.A)(e[t],n))&&(void 0!==n||t in e)||ed(e,t,n)},ef=function(e,t,n){for(var r=-1,a=Object(e),o=n(e),i=o.length;i--;){var s=o[++r];if(!1===t(a[s],s,a))break}return e};var eh=n(1917),eg="object"==typeof exports&&exports&&!exports.nodeType&&exports,ey=eg&&"object"==typeof module&&module&&!module.nodeType&&module,ev=ey&&ey.exports===eg?eh.A.Buffer:void 0,eb=ev?ev.allocUnsafe:void 0;let ew=function(e,t){if(t)return e.slice();var n=e.length,r=eb?eb(n):new e.constructor(n);return e.copy(r),r};var eE=n(3988);let ex=function(e){var t=new e.constructor(e.byteLength);return new eE.A(t).set(new eE.A(e)),t},eD=function(e,t){var n=t?ex(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},e_=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var ek=n(3149),eS=Object.create,eC=function(){function e(){}return function(t){if(!(0,ek.A)(t))return{};if(eS)return eS(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),eP=n(7271);let eR=function(e){return"function"!=typeof e.constructor||(0,eP.A)(e)?{}:eC(et(e))};var eT=n(18),e$=n(2049),eO=n(8446),eN=n(2873),eA=n(9610),eI=n(9415);let ej=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var eM=Object.prototype.hasOwnProperty;let eL=function(e,t,n){var r=e[t];eM.call(e,t)&&(0,em.A)(r,n)&&(void 0!==n||t in e)||ed(e,t,n)},eF=function(e,t,n,r){var a=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),a?ed(n,s,l):eL(n,s,l)}return n};var eB=n(1463);let eV=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var eU=Object.prototype.hasOwnProperty;let eW=function(e){if(!(0,ek.A)(e))return eV(e);var t=(0,eP.A)(e),n=[];for(var r in e)"constructor"==r&&(t||!eU.call(e,r))||n.push(r);return n},eH=function(e){return(0,eO.A)(e)?(0,eB.A)(e,!0):eW(e)},ez=function(e,t,n,r,a,o,i){var s=ej(e,n),l=ej(t,n),u=i.get(l);if(u)return void ep(e,n,u);var c=o?o(s,l,n+"",e,t,i):void 0,d=void 0===c;if(d){var m=(0,e$.A)(l),p=!m&&(0,eN.A)(l),f=!m&&!p&&(0,eI.A)(l);(c=l,m||p||f)?(0,e$.A)(s)?c=s:(0,en.A)(s)&&(0,eO.A)(s)?c=e_(s):p?(d=!1,c=ew(l,!0)):f?(d=!1,c=eD(l,!0)):c=[]:es(l)||(0,eT.A)(l)?(c=s,(0,eT.A)(s))?c=eF(s,eH(s)):(!(0,ek.A)(s)||(0,eA.A)(s))&&(c=eR(l)):d=!1}d&&(i.set(l,c),a(c,l,r,o,i),i.delete(l)),ep(e,n,c)},eK=function e(t,n,r,a,o){t!==n&&ef(n,function(i,s){if(o||(o=new el.A),(0,ek.A)(i))ez(t,n,s,r,e,a,o);else{var l=a?a(ej(t,s),i,s+"",t,n,o):void 0;void 0===l&&(l=i),ep(t,s,l)}},eH)};var eG=n(9008);let eZ=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var eY=Math.max;let eq=function(e,t,n){return t=eY(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=eY(r.length-t,0),i=Array(o);++a<o;)i[a]=r[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=r[a];return s[t]=n(i),eZ(e,this,s)}};var eJ=ec?function(e,t){return ec(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:eG.A,eX=Date.now,eQ=(K=0,G=0,function(){var e=eX(),t=16-(e-G);if(G=e,t>0){if(++K>=800)return arguments[0]}else K=0;return eJ.apply(void 0,arguments)}),e0=n(5353);let e1=function(e,t,n){if(!(0,ek.A)(n))return!1;var r=typeof t;return("number"==r?!!((0,eO.A)(n)&&(0,e0.A)(t,n.length)):"string"==r&&t in n)&&(0,em.A)(n[t],e)},e4=function(e){var t;return eQ(eq(t=function(t,n){var r=-1,a=n.length,o=a>1?n[a-1]:void 0,i=a>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,i&&e1(n[0],n[1],i)&&(o=a<3?void 0:o,a=1),t=Object(t);++r<a;){var s=n[r];s&&e(t,s,r,o)}return t},void 0,eG.A),t+"")};var e2=e4(function(e,t,n,r){eK(e,t,n,r)}),e3=n(421);let e6=function(e,t){return(0,e3.A)(e,t)};var e5=n(5572);let e9=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e};var e8=n(7422),e7=n(4247),te=n(6912),tt=n(3153),tn=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)(0,te.A)(t,(0,e7.A)(e)),e=et(e);return t}:tt.A,tr=n(9042),ta=n(3831);let to=function(e){return(0,ta.A)(e,eH,tn)};var ti=n(3231),ts=Object.prototype.hasOwnProperty;let tl=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ts.call(e,"index")&&(n.index=e.index,n.input=e.input),n},tu=function(e,t){var n=t?ex(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var tc=/\w*$/;let td=function(e){var t=new e.constructor(e.source,tc.exec(e));return t.lastIndex=e.lastIndex,t};var tm=n(241),tp=tm.A?tm.A.prototype:void 0,tf=tp?tp.valueOf:void 0;let th=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return ex(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return tu(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return eD(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return td(e);case"[object Symbol]":return tf?Object(tf.call(e)):{}}};var tg=n(2789),ty=n(4841),tv=ty.A&&ty.A.isMap,tb=tv?(0,tg.A)(tv):function(e){return(0,en.A)(e)&&"[object Map]"==(0,ti.A)(e)},tw=ty.A&&ty.A.isSet,tE=tw?(0,tg.A)(tw):function(e){return(0,en.A)(e)&&"[object Set]"==(0,ti.A)(e)},tx="[object Arguments]",tD="[object Function]",t_="[object Object]",tk={};tk[tx]=tk["[object Array]"]=tk["[object ArrayBuffer]"]=tk["[object DataView]"]=tk["[object Boolean]"]=tk["[object Date]"]=tk["[object Float32Array]"]=tk["[object Float64Array]"]=tk["[object Int8Array]"]=tk["[object Int16Array]"]=tk["[object Int32Array]"]=tk["[object Map]"]=tk["[object Number]"]=tk[t_]=tk["[object RegExp]"]=tk["[object Set]"]=tk["[object String]"]=tk["[object Symbol]"]=tk["[object Uint8Array]"]=tk["[object Uint8ClampedArray]"]=tk["[object Uint16Array]"]=tk["[object Uint32Array]"]=!0,tk["[object Error]"]=tk[tD]=tk["[object WeakMap]"]=!1;let tS=function e(t,n,r,a,o,i){var s,l=1&n,u=2&n,c=4&n;if(r&&(s=o?r(t,a,o,i):r(t)),void 0!==s)return s;if(!(0,ek.A)(t))return t;var d=(0,e$.A)(t);if(d){if(s=tl(t),!l)return e_(t,s)}else{var m,p,f,h,g=(0,ti.A)(t),y=g==tD||"[object GeneratorFunction]"==g;if((0,eN.A)(t))return ew(t,l);if(g==t_||g==tx||y&&!o){if(s=u||y?{}:eR(t),!l)return u?(p=(m=s)&&eF(t,eH(t),m),eF(t,tn(t),p)):(h=(f=s)&&eF(t,(0,e8.A)(t),f),eF(t,(0,e7.A)(t),h))}else{if(!tk[g])return o?t:{};s=th(t,g,l)}}i||(i=new el.A);var v=i.get(t);if(v)return v;i.set(t,s),tE(t)?t.forEach(function(a){s.add(e(a,n,r,a,t,i))}):tb(t)&&t.forEach(function(a,o){s.set(o,e(a,n,r,o,t,i))});var b=c?u?to:tr.A:u?eH:e8.A,w=d?void 0:b(t);return e9(w||t,function(a,o){w&&(a=t[o=a]),eL(s,o,e(a,n,r,o,t,i))}),s};var tC=n(4548);let tP=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var tR=n(6318),tT=n(7688),t$=n(901);let tO=function(e,t){var n,r;return t=(0,tC.A)(t,e),n=e,null==(e=(r=t).length<2?n:(0,tR.A)(n,(0,tT.A)(r,0,-1)))||delete e[(0,t$.A)(tP(t))]},tN=function(e){return es(e)?void 0:e};var tA=tm.A?tm.A.isConcatSpreadable:void 0;let tI=function(e){return(0,e$.A)(e)||(0,eT.A)(e)||!!(tA&&e&&e[tA])},tj=function e(t,n,r,a,o){var i=-1,s=t.length;for(r||(r=tI),o||(o=[]);++i<s;){var l=t[i];n>0&&r(l)?n>1?e(l,n-1,r,a,o):(0,te.A)(o,l):a||(o[o.length]=l)}return o};var tM=eQ(eq(Z=function(e,t){var n={};if(null==e)return n;var r=!1;t=(0,e5.A)(t,function(t){return t=(0,tC.A)(t,e),r||(r=t.length>1),t}),eF(e,to(e),n),r&&(n=tS(n,7,tN));for(var a=t.length;a--;)tO(n,t[a]);return n},void 0,function(e){return(null==e?0:e.length)?tj(e,1):[]}),Z+""),tL=((Y={}).Array="Array",Y.Boolean="Boolean",Y.ConceptUuid="ConceptUuid",Y.Number="Number",Y.Object="Object",Y.String="String",Y.UUID="UUID",Y.PersonAttributeTypeUuid="PersonAttributeTypeUuid",Y.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",Y);function tF(e,t){return n=>{if(!e(n))if("function"==typeof t)return t(n);else return t}}let tB=tF(e=>Array.isArray(e),"must be an array"),tV=tF(e=>"boolean"==typeof e,"must be a boolean"),tU=tF(e=>"number"==typeof e,"must be a number"),tW=tF(e=>"string"==typeof e,"must be a string"),tH=tF(e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,"must be an object (not an array or null)"),tz=tF(e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e),"must be a valid UUID or a 36-character hexadecimal string"),tK=B("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),tG=B("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});tG.subscribe(e=>{var t=e.config;try{localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}catch(e){}});let tZ=B("config-store-of-extension-state",{mountedExtensions:[]});function tY(e){return U(`config-module-${e}`,{config:null,loaded:!1,translationOverridesLoaded:!1})}function tq(){return U("config-extension-slots",{slots:{}})}function tJ(e){return tX(tq().getState(),e)}function tX(e,t){return e.slots[t]??{loaded:!1,config:{}}}function tQ(){return U("config-extensions",{configs:{}})}function t0(e,t){if("string"!=typeof e||"string"!=typeof t||"__proto__"===e||"__proto__"===t||"constructor"===e||"constructor"===t||"prototype"===e||"prototype"===t)throw Error("Attempted to call `getExtensionConfig()` with invalid argument");let n=tQ(),r=n=>n.configs[e]?.[t];return{getInitialState:()=>r(n.getInitialState()),getState:()=>r(n.getState())??{loaded:!1,config:null},subscribe:e=>n.subscribe((t,n)=>{let a=r(t),o=r(n);T(a,o)||e(a,o)})}}function t1(e,t,n){return e.configs[t]?.[n]??{loaded:!1,config:null}}function t4(e,t,n){return e.configure?.[n]??null}let t2=A()(()=>({config:{}})),t3=0,t6=!0,t5=!1;function t9(e){r=e}function t8(){t6=!0,t3>0&&t7()}function t7(){if(t6&&r&&!t5){t5=!0,t6=!1;try{r()}catch(e){t6=!0,ne(e),console.error("Failed to derive the implementer tools config",e)}finally{t5=!1}}}function ne(e){t2.setState({derivationError:e instanceof Error?e.message:String(e)})}function nt(){t2.getState().derivationError&&t2.setState({derivationError:void 0})}let nn=V("config-implementer-tools",{...t2,getState:()=>(0===t3&&t7(),t2.getState()),setState:(...e)=>(t6=!1,t2.setState(...e)),subscribe(e){t3++,t7();let t=t2.subscribe(e),n=!1;return()=>{!n&&(n=!0,t3--),t()}}});function nr(e,t){if(Array.isArray(t))return t}function na(e,t){return e2({},e,t,nr)}let no=[];function ni(){let e=tK.getState(),t=tG.getState(),n=tZ.getState();!function(e,t){for(let n of Object.keys(e.schemas)){let r,a=tY(n),o=e.schemas[n],i=!!e.moduleLoaded[n],s=nu.get(n);if(s&&s.schema===o&&s.moduleLoaded===i&&s.providedConfigs===e.providedConfigs&&s.temporaryConfig===t.config)r=s.state;else{let a=i?function(e,t,n){let r=t.schemas[e],a=nk(e,nD(t,n));nC(r,a,e);let o=n$(r,a);return nP(r,o,e),delete o.extensionSlots,o}(n,e,t):function(e,t,n){let r=n$(nF,nk(e,nD(t,n)));return nP(nF,r,e),delete r.extensionSlots,r}(n,e,t);r={translationOverridesLoaded:!0,loaded:i,config:a},nu.set(n,{schema:o,moduleLoaded:i,providedConfigs:e.providedConfigs,temporaryConfig:t.config,state:r})}let l=a.getState();l.loaded===r.loaded&&l.translationOverridesLoaded===r.translationOverridesLoaded&&e6(l.config,r.config)||a.setState(r)}}(e,t);let r=function(e,t){let n=nS(nD(e,t)),r=Object.keys(n).reduce((e,t)=>(n[t]?.extensionSlots&&(e[t]=n[t]?.extensionSlots),e),{});var a=r;for(let[e,t]of Object.entries(a))for(let[n,r]of Object.entries(t))!function(e,t,n){let r=`${t}.extensionSlots.${n}`,a=`Extension slot config '${r}'`,o=Object.keys(e).filter(e=>!["add","remove","order","configure"].includes(e));o.length&&nI(r,a+`' contains invalid keys '${o.join("', '")}'`),!e.add||Array.isArray(e.add)&&e.add.every(e=>"string"==typeof e)||nI(r,a+".add' is invalid. Must be an array of strings (extension IDs)"),!e.remove||Array.isArray(e.remove)&&e.remove.every(e=>"string"==typeof e)||nI(r,a+".remove' is invalid. Must be an array of strings (extension IDs)"),!e.order||Array.isArray(e.order)&&e.order.every(e=>"string"==typeof e)||nI(r,a+".order' is invalid. Must be an array of strings (extension IDs)"),e.configure&&!nN(e.configure)&&nI(r,a+".configure' is invalid. Must be an object with extension IDs for keys")}(r,e,n);let o={},i={};for(let e of Object.values(r))for(let[t,n]of Object.entries(e))o[t]=n,n.configure&&(i[t]??(i[t]=[])).push(n.configure);for(let[e,t]of Object.entries(i)){let n=1===t.length?t[0]:nS(t);o[e].configure!==n&&(o[e]={...o[e],configure:n})}return o}(e,t);(function(e){let t=tq(),n=t.getState().slots,r={},a=!1;for(let[t,o]of Object.entries(e)){let e=n[t];e?.loaded&&e6(e.config,o)?r[t]=e:(r[t]={loaded:!0,config:o},a=!0)}(a||Object.keys(n).length!==Object.keys(r).length)&&t.setState({slots:r})})(r),function(e,t,n,r){let a=tQ(),o=a.getState().configs,i={},s=!1,l=0;for(let a of t.mountedExtensions){let t=function(e,t,n,r,a,o,i){let s=function(e){let[t]=e.split("#");return t}(r),l=a.schemas[s],u=JSON.stringify([n,r,e,t]),c=nw.get(u);if(c&&c.extensionSchema===l&&c.extensionModuleSchema===a.schemas[t]&&c.providedConfigs===a.providedConfigs&&c.temporaryConfig===o.config)return c.config;let d=l?s:t,m=nD(a,o),p=i?.configure?.[r]??{},f=nk(e,m),h=f?.extensionSlots?.[n]?.configure?.[r]??{},g=nS([nk(d,m),p,h]),y=l??a.schemas[t];nC(y,g,d);let v=n$(y,g);return nP(y,v,d),delete v.extensionSlots,nw.set(u,{extensionSchema:l,extensionModuleSchema:a.schemas[t],providedConfigs:a.providedConfigs,temporaryConfig:o.config,config:v}),v}(a.slotModuleName,a.extensionModuleName,a.slotName,a.extensionId,e,n,r[a.slotName]),u=o[a.slotName]?.[a.extensionId],c=u?.loaded&&e6(u.config,t)?u:{config:t,loaded:!0};c!==u&&(s=!0),i[a.slotName]||(i[a.slotName]={}),i[a.slotName][a.extensionId]=c,l++}for(let[e,t]of Object.entries(i)){let n=o[e];n&&Object.keys(n).length===Object.keys(t).length&&Object.entries(t).every(([e,t])=>n[e]===t)&&(i[e]=n)}s||(s=Object.keys(o).length!==Object.keys(i).length||Object.values(o).reduce((e,t)=>e+Object.keys(t).length,0)!==l),s&&a.setState({configs:i})}(e,n,t,r),t8()}function ns(){r=()=>{var e,t;let n,r;return e=tK.getState(),t=tG.getState(),n=nn.getState(),r={config:function(e,t){let n=function(e){let t={};for(let[n,r]of Object.entries(e)){let e=nx.get(n);if(e&&e.schema===r)t[n]=e.annotated;else{let e=function e(t){return t.hasOwnProperty("_default")?{...t,_value:t._default,_source:"default"}:nN(t)?Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{}):{}}(tS(r,5));nx.set(n,{schema:r,annotated:e}),t[n]=e}}return t}(e.schemas),r=[...e.providedConfigs.map(e=>[e.config,e.source]),[t.config,"temporary config"]],a=new Set(Object.keys(n));for(let[e]of r)for(let t of Object.keys(e))a.add(t);let o={};for(let e of a){let t=n[e],a=r.map(([t])=>t[e]),i=r.map(([,e])=>e),s=nE.get(e);if(s&&s.annotatedSchema===t&&s.configSlices.length===a.length&&s.configSlices.every((e,t)=>e===a[t])&&s.sources.every((e,t)=>e===i[t])){o[e]=s.result;continue}let l=t??{};r.forEach(([,e],t)=>{let n=a[t];void 0!==n&&(l=na(l,function e(t,n){return nN(t)?Object.keys(t).reduce((r,a)=>(r[a]=e(t[a],n),r),{}):{_value:t,_source:n}}(n,e)))}),nE.set(e,{annotatedSchema:t,configSlices:a,sources:i,result:l}),o[e]=l}return o}(e,t)},void(e6(n.config,r.config)||nn.setState(r))},ni(),no.push(tK.subscribe(nl),tG.subscribe(nl),tZ.subscribe(nl))}function nl(){nt();try{ni()}catch(e){ne(e),console.error("Failed to recompute the configuration",e)}}ns();let nu=new Map;function nc(e,t){n_(e,t);let n=na(t,nF);tK.setState(t=>({...t,schemas:{...t.schemas,[e]:n},moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function nd(e){tK.setState(t=>({...t,schemas:{...t.schemas,[e]:nF}}))}function nm(e){tK.setState(t=>({...t,moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function np(e){tK.setState(t=>({...t,schemas:{...t.schemas,[e]:nL}}))}function nf(e,t){n_(e,t);let n=na(t,nF);tK.getState().schemas[e]&&console.error(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),tK.setState(t=>({...t,schemas:{...t.schemas,[e]:n}}))}function nh(e,t="provided"){tK.setState(n=>({...n,providedConfigs:[...n.providedConfigs,{source:t,config:e}]}))}function ng(e,t,n){return new Promise(r=>{let a,o=!1;function i(e){!o&&t(e)&&(o=!0,r(n(e)),a?.())}i(e.getState()),o||(a=e.subscribe(i))})}function ny(e){return ng(tY(e),e=>!!(e.loaded&&e.config),e=>tM(e.config,["Display conditions","Translation overrides"]))}function nv(e,t,n){let r=[ng(tY(e),e=>!!(e.translationOverridesLoaded&&e.config),e=>e.config["Translation overrides"]??{})];return t&&n&&r.push(ng(t0(t,n),e=>!!(e.loaded&&e.config),e=>e.config["Translation overrides"]??{})),Promise.all(r)}function nb(e,t,n){nC(e,t,n);let r=n$(e,t);return nP(e,r,n),r}let nw=new Map,nE=new Map,nx=new Map;function nD(e,t){return[...e.providedConfigs.map(e=>e.config),t.config]}function n_(e,t,n=""){let r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(let a of Object.keys(t).filter(e=>!e.startsWith("_"))){let o=n+(n&&".")+a,i=t[a];if("Display conditions"===o&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===o&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!nN(i)){console.error(`${e} has bad config schema definition for key '${o}'. ${r}`);continue}i.hasOwnProperty("_default")||n_(e,i,o);let s=i._elements;if(nO(s)&&n_(e,s,o+"._elements"),i._validators)for(let t of i._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${o}' ${r}.
|
|
4
4
|
|
|
5
|
-
If you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);let l=i._type;l&&!Object.values(
|
|
5
|
+
If you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);let l=i._type;l&&!Object.values(tL).includes(l)&&console.error(`${e} has invalid type for key '${o}' ${r}.
|
|
6
6
|
|
|
7
|
-
If you're the maintainer: the allowed types are ${Object.values(
|
|
7
|
+
If you're the maintainer: the allowed types are ${Object.values(tL).join(", ")}. Received '${l}'`),Object.keys(i).every(e=>["_description","_validators","_elements","_type"].includes(e))&&!n.includes("._elements")&&console.error(`${e} has bad config schema definition for key '${o}'. ${r}.
|
|
8
8
|
|
|
9
|
-
If you're the maintainer: all config elements must have a default. Received ${JSON.stringify(i)}`),s&&l&&![
|
|
9
|
+
If you're the maintainer: all config elements must have a default. Received ${JSON.stringify(i)}`),s&&l&&![tL.Array,tL.Object].includes(l)&&console.error(`${e} has bad config schema definition for key '${o}'. ${r}.
|
|
10
10
|
|
|
11
|
-
If you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(l)}`)}}function
|
|
12
|
-
${t}`)}return r}let nT=(e,t)=>{let n=structuredClone(t);if(!e)return n;for(let t of Object.keys(e)){let r=n[t],a=e[t];if(a&&(a.hasOwnProperty("_type")||a.hasOwnProperty("_default"))){n.hasOwnProperty(t)||(n[t]=a._default);let e=a._elements;if(r&&n$(e)){if(a._type===tM.Array&&Array.isArray(r)){let a=r.map(t=>nT(e,t));n[t]=a}else if(a._type===tM.Object)for(let t of Object.keys(r))r[t]=nT(e,r[t])}}else if(nO(a)){let e=r??{};nO(e)&&(n[t]=nT(a,e))}}return n};function n$(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function nO(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let nN=new Set;function nA(e,t){let n=`${e}:::${t}`;nN||(nN=new Set),nN.has(n)||(console.error(t),nN.add(n))}function nI(e){e?nN.forEach(t=>{t.startsWith(e)&&nN.delete(t)}):nN.clear()}function nj(){na.forEach(e=>e()),na.length=0,nl.clear(),nb.clear(),nE.clear(),nw.clear(),ni()}let nM={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:tM.Object,_default:{},_validators:[tL(e=>Object.keys(e).every(e=>/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)),e=>{let t=Object.keys(e).filter(e=>!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e));return`The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ${t.join(", ")}.`})]}},nL={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:tM.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:tM.String,_default:void 0}},...nM},nF=(e,t)=>tL(n=>e<=n&&n<=t,`must be between ${e} and ${t}`),nB=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return tL(e=>{if(!e||"string"!=typeof e)return!1;let n=/\${(.*?)}/g,r=n.exec(e);for(;r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},nV=nB([]),nU=e=>tL(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),nW={inRange:nF,isUrl:nV,isUrlWithTemplateParameters:nB,oneOf:nU};var nH=n(8067);let nz=F("breadcrumbs",[]);function nK(e){return nG([e])}function nG(e){let t=[...nZ(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,nH.pathToRegexp)(e.matcher).regexp:(0,nH.pathToRegexp)(e.path).regexp,settings:e}))];nz.setState(t,!0)}function nZ(){return nz.getState()}function nY(e,t){if(t)return function(e,t){let[n]=e.filter(e=>e.matcher.test(t));return n}(e,t)||function(e,t){let n=t.split("/");for(;n.length>1;){n.pop();let t=nY(e,n.join("/"));if(t)return t}}(e,t)}function nq(e,t){if(e.length>0){let n=nY(e,t);if(n){let t=[n],r=nY(e,n.settings.parent);for(;void 0!==r;)t.push(r),r=nY(e,r.settings.parent);return t.reverse()}}return[]}function nJ(e){return nq(nZ(),e)}var nX=Object.freeze({__proto__:null,get start(){return am},get ensureJQuerySupport(){return rJ},get setBootstrapMaxTime(){return rO},get setMountMaxTime(){return rN},get setUnmountMaxTime(){return rA},get setUnloadMaxTime(){return rI},get registerApplication(){return r8},get unregisterApplication(){return ae},get getMountedApps(){return r3},get getAppStatus(){return r5},get unloadApplication(){return at},get checkActivityFunctions(){return r7},get getAppNames(){return r6},get pathToActiveWhen(){return aa},get navigateToUrl(){return rU},get patchHistoryApi(){return rZ},get triggerAppChange(){return al},get addErrorHandler(){return n2},get removeErrorHandler(){return n3},get mountRootParcel(){return rC},get NOT_LOADED(){return n9},get LOADING_SOURCE_CODE(){return n8},get NOT_BOOTSTRAPPED(){return n7},get BOOTSTRAPPING(){return re},get NOT_MOUNTED(){return rt},get MOUNTING(){return rn},get UPDATING(){return ra},get LOAD_ERROR(){return rs},get MOUNTED(){return rr},get UNLOADING(){return ri},get UNMOUNTING(){return ro},get SKIP_BECAUSE_BROKEN(){return rl}}),nQ=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,n0=!function(){try{var e=new nQ("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?"u">typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}:nQ;let n1=[];function n4(e,t,n){let r=n5(e,t,n);n1.length?n1.forEach(e=>e(r)):setTimeout(()=>{throw r})}function n2(e){if("function"!=typeof e)throw Error(n6(28,!1));n1.push(e)}function n3(e){if("function"!=typeof e)throw Error(n6(29,!1));let t=!1;return n1=n1.filter(n=>{let r=n===e;return t=t||r,!r}),t}function n6(e,t,...n){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${n.length?`&arg=${n.join("&arg=")}`:""}`}function n5(e,t,n){let r,a=`${rp(t)} '${rd(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=a+e.message}catch(e){}r=e}else{console.warn(n6(30,!1,t.status,rd(t)));try{r=Error(a+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=rd(t),t.status=n,r}let n9="NOT_LOADED",n8="LOADING_SOURCE_CODE",n7="NOT_BOOTSTRAPPED",re="BOOTSTRAPPING",rt="NOT_MOUNTED",rn="MOUNTING",rr="MOUNTED",ra="UPDATING",ro="UNMOUNTING",ri="UNLOADING",rs="LOAD_ERROR",rl="SKIP_BECAUSE_BROKEN";function ru(e){return e.status===rr}function rc(e){try{return e.activeWhen(window.location)}catch(t){return n4(t,e,rl),!1}}function rd(e){return e.name}function rm(e){return!!e.unmountThisParcel}function rp(e){return rm(e)?"parcel":"application"}function rf(){for(let e=arguments.length-1;e>0;e--)for(let t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function rh(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function rg(e){return e&&("function"==typeof e||Array.isArray(e)&&!rh(e,e=>"function"!=typeof e))}function ry(e,t){let n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[()=>Promise.resolve()]);let r=rp(e),a=rd(e);return function(e){return n.reduce((n,o,i)=>n.then(()=>{let n=o(e);return rv(n)?n:Promise.reject(n6(15,!1,r,a,t,i))}),Promise.resolve())}}function rv(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let rb=[];function rw(e,t){return Promise.resolve().then(()=>e.status!==n7?e:(e.status=re,e.bootstrap?rj(e,"bootstrap").then(n).catch(n=>{if(t)throw n5(n,e,rl);return n4(n,e,rl),e}):Promise.resolve().then(n)));function n(){return e.status=rt,e}}function rE(e,t){return Promise.resolve().then(()=>{if(e.status!==rr)return e;return e.status=ro,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(n,r=>n().then(()=>{let n=Error(r.message);if(t)throw n5(n,e,rl);n4(n,e,rl)})).then(()=>e);function n(){return rj(e,"unmount").then(()=>{e.status=rt},n=>{if(t)throw n5(n,e,rl);n4(n,e,rl)})}})}let rx=!1,rD=!1;function r_(e,t){return Promise.resolve().then(()=>e.status!==rt?e:(rx||(window.dispatchEvent(new n0("single-spa:before-first-mount")),rx=!0),e.status=rn,rj(e,"mount").then(()=>(e.status=rr,rD||(window.dispatchEvent(new n0("single-spa:first-mount")),rD=!0),e)).catch(n=>{return e.status=rr,rE(e,!0).then(r,r);function r(){if(t)throw n5(n,e,rl);return n4(n,e,rl),e}})))}let rk=0,rS={parcels:{}};function rC(){return rP.apply(rS,arguments)}function rP(e,t){let n,r,a,o=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(n6(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(n6(3,!1,typeof e.name));let i=rk++,s=e.name||`parcel-${i}`;if("object"!=typeof t)throw Error(n6(4,!1,s,typeof t));if(!t.domElement)throw Error(n6(5,!1,s));let l="function"==typeof e,u=l?e:()=>Promise.resolve(e),c={id:i,parcels:{},status:l?n8:n7,customProps:t,parentName:rd(o),unmountThisParcel:()=>p.then(()=>{if(c.status!==rr)throw Error(n6(6,!1,s,c.status));return rE(c,!0)}).then(e=>(c.parentName&&delete o.parcels[c.id],e)).then(e=>(r(e),e)).catch(e=>{throw c.status=rl,a(e),e})};o.parcels[i]=c;let d=u();if(!d||"function"!=typeof d.then)throw Error(n6(7,!1));let m=(d=d.then(e=>{if(!e)throw Error(n6(8,!1));if(s=e.name||`parcel-${i}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!rg(e.bootstrap))throw Error(n6(9,!1,s));if(!rg(e.mount))throw Error(n6(10,!1,s));if(!rg(e.unmount))throw Error(n6(11,!1,s));if(e.update&&!rg(e.update))throw Error(n6(12,!1,s));let t=ry(e,"bootstrap"),r=ry(e,"mount"),a=ry(e,"unmount");c.status=n7,c.name=s,c.bootstrap=t,c.mount=r,c.unmount=a,c.timeouts=rM(e.timeouts),e.update&&(c.update=ry(e,"update"),n.update=function(e){return c.customProps=e,rR(Promise.resolve().then(()=>{if(c.status!==rr)throw Error(n6(32,!1,rd(c)));return c.status=ra,rj(c,"update").then(()=>(c.status=rr,c)).catch(e=>{throw n5(e,c,rl)})}))})})).then(()=>rw(c,!0)),p=m.then(()=>r_(c,!0)),f=new Promise((e,t)=>{r=e,a=t});return n={mount:()=>rR(Promise.resolve().then(()=>{if(c.status!==rt)throw Error(n6(13,!1,s,c.status));return o.parcels[i]=c,r_(c)})),unmount:()=>rR(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:rR(d),bootstrapPromise:rR(m),mountPromise:rR(p),unmountPromise:rR(f)}}function rR(e){return e.then(()=>null)}function rT(e){let t=rd(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(n6(40,!1),t,n));let r=rf({},n,{name:t,mountParcel:rP.bind(e),singleSpa:nX});return rm(e)&&(r.unmountSelf=e.unmountThisParcel),r}let r$={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function rO(e,t,n){if("number"!=typeof e||e<=0)throw Error(n6(16,!1));r$.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rN(e,t,n){if("number"!=typeof e||e<=0)throw Error(n6(17,!1));r$.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rA(e,t,n){if("number"!=typeof e||e<=0)throw Error(n6(18,!1));r$.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rI(e,t,n){if("number"!=typeof e||e<=0)throw Error(n6(19,!1));r$.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rj(e,t){let n=e.timeouts[t],r=n.warningMillis,a=rp(e);return new Promise((o,i)=>{let s=!1,l=!1;e[t](rT(e)).then(e=>{s=!0,o(e)}).catch(e=>{s=!0,i(e)}),setTimeout(()=>c(1),r),setTimeout(()=>c(!0),n.millis);let u=n6(31,!1,t,a,rd(e),n.millis);function c(e){s||(!0===e?(l=!0,n.dieOnTimeout?i(Error(u)):console.error(u)):!l&&(console.warn(u),e*r+r<n.millis&&setTimeout(()=>c(e+1),r)))}})}function rM(e){let t={};for(let n in r$)t[n]=rf({},r$[n],e&&e[n]||{});return t}function rL(e){return Promise.resolve().then(()=>{let t,n;return e.loadPromise?e.loadPromise:e.status!==n9&&e.status!==rs?e:(e.status=n8,e.loadPromise=Promise.resolve().then(()=>{let r=e.loadApp(rT(e));if(!rv(r))throw n=!0,Error(n6(33,!1,rd(e)));return r.then(n=>{let r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!rg(t.bootstrap)&&(r=35),rg(t.mount)||(r=36),rg(t.unmount)||(r=37);let a=rp(t);if(r){let n;try{n=JSON.stringify(t)}catch(e){}return console.error(n6(r,!1,a,rd(e),n),t),n4(void 0,e,rl),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=rf({},e.devtools.overlays,t.devtools.overlays)),e.status=n7,e.bootstrap=ry(t,"bootstrap"),e.mount=ry(t,"mount"),e.unmount=ry(t,"unmount"),e.unload=ry(t,"unload"),e.timeouts=rM(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let r;return delete e.loadPromise,n?r=rl:(r=rs,e.loadErrorTime=(new Date).getTime()),n4(t,e,r),e}))})}let rF="u">typeof window,rB={hashchange:[],popstate:[]},rV=["hashchange","popstate"];function rU(e){let t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(n6(14,!1));t=e.currentTarget.href,e.preventDefault()}let n=rY(window.location.href),r=rY(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function rW(e){if(e){let t=e[0].type;rV.indexOf(t)>=0&&rB[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function rH(){au([],arguments)}function rz(e,t){return function(){let n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return a&&n===o||window.dispatchEvent(function(e,t){let n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}}let rK=null,rG=!1;function rZ(e){if(rG)throw Error(n6(43,!1));a=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,rG=!0,rK=window.history.replaceState,window.addEventListener("hashchange",rH),window.addEventListener("popstate",rH);let t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&rV.indexOf(e)>=0)||rh(rB[e],e=>e===n))return t.apply(this,arguments);rB[e].push(n)},window.removeEventListener=function(e,t){return"function"==typeof t&&rV.indexOf(e)>=0&&(rB[e]=rB[e].filter(e=>e!==t)),n.apply(this,arguments)},window.history.pushState=rz(window.history.pushState,"pushState"),window.history.replaceState=rz(rK,"replaceState")}function rY(e){let t=document.createElement("a");return t.href=e,t}rF&&(window.singleSpaNavigate?console.warn(n6(41,!1)):window.singleSpaNavigate=rU);let rq=!1;function rJ(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!rq){let t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return rX.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return rX.call(this,n,window.removeEventListener,e,t,arguments)},rq=!0}}function rX(e,t,n,r,a){return"string"!=typeof n?e.apply(this,a):(n.split(/\s+/).forEach(e=>{rV.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))}),""===n.trim()?this:e.apply(this,a))}let rQ={};function r0(e){return Promise.resolve().then(()=>{let t=rQ[rd(e)];if(!t)return e;if(e.status===n9)return r1(e,t),e;if(e.status===ri)return t.promise.then(()=>e);if(e.status!==rt&&e.status!==rs)return e;let n=e.status===rs?Promise.resolve():rj(e,"unload");return e.status=ri,n.then(()=>(r1(e,t),e)).catch(n=>(delete rQ[rd(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,n4(n,e,rl),t.reject(n),e))})}function r1(e,t){delete rQ[rd(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=n9,t.resolve()}function r4(e,t,n,r){rQ[rd(e)]={app:e,resolve:n,reject:r},Object.defineProperty(rQ[rd(e)],"promise",{get:t})}let r2=[];function r3(){return r2.filter(ru).map(rd)}function r6(){return r2.map(rd)}function r5(e){let t=rh(r2,t=>rd(t)===e);return t?t.status:null}let r9=!1;function r8(e,t,n,r){var a,o;let i,s,l=(i={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(n6(39,!1));let t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((e,n)=>t.indexOf(n)>=0?e:e.concat(n),[]);if(0!==n.length)throw Error(n6(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(n6(20,!1));let r=e=>"string"==typeof e||"function"==typeof e;if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(n6(24,!1));if(!ar(e.customProps))throw Error(n6(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(n6(20,!1));if(!t)throw Error(n6(23,!1));if("function"!=typeof n)throw Error(n6(24,!1));if(!ar(r))throw Error(n6(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(a=i.loadApp)?()=>Promise.resolve(a):a,i.customProps=i.customProps||{},s=(s=Array.isArray(o=i.activeWhen)?o:[o]).map(e=>"function"==typeof e?e:aa(e)),i.activeWhen=e=>s.some(t=>t(e)),i);if(ad||r9||(r9=!0,setTimeout(()=>{ad||console.warn(n6(1,!1))},5e3)),-1!==r6().indexOf(l.name))throw Error(n6(21,!1,l.name));r2.push(rf({loadErrorTime:null,status:n9,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),rF&&(rJ(),au())}function r7(e=window.location){return r2.filter(t=>t.activeWhen(e)).map(rd)}function ae(e){if(0===r2.filter(t=>rd(t)===e).length)throw Error(n6(25,!1,e));return(rF?at(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=r2.map(rd).indexOf(e);r2.splice(t,1)})}function at(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(n6(26,!1));let n=rh(r2,t=>rd(t)===e);if(!n)throw Error(n6(27,!1,e));let r=rQ[rd(n)];if(t&&t.waitForUnmount){if(r)return r.promise;{let e=new Promise((t,r)=>{r4(n,()=>e,t,r)});return e}}{let e;return r?(e=r.promise,an(n,r.resolve,r.reject)):e=new Promise((t,r)=>{r4(n,()=>e,t,r),an(n,t,r)}),e}}function an(e,t,n){Promise.resolve().then(()=>{if(rh(r7(),t=>t===rd(e)))return al()}).then(()=>rE(e).then(r0).then(()=>{t(),setTimeout(()=>{au()})})).catch(n)}function ar(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function aa(e,t){let n=function(e,t){let n=0,r=!1,a="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let n=e[t],a=r&&"/"===n;(!r&&":"===n||a)&&o(t)}return o(e.length),RegExp(a,"i");function o(o){let i=e.slice(n,o).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(a+=r?"[^/]+/?":i,o===e.length)if(r)t&&(a+="$");else{let e=t?"":".*";a="/"===a.charAt(a.length-1)?`${a}${e}$`:`${a}(/${e})?(#.*)?$`}r=!r,n=o}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}let ao=!1,ai=[],as=rF&&window.location.href;function al(){return au()}function au(e=[],t,n=!1){let r,a,o,i,s;if(ao)return new Promise((e,n)=>{ai.push({resolve:e,reject:n,eventArguments:t})});let{appsToUnload:l,appsToUnmount:u,appsToLoad:c,appsToMount:d}=(r=[],a=[],o=[],i=[],s=(new Date).getTime(),r2.forEach(e=>{let t=e.status!==rl&&rc(e);switch(e.status){case rs:t&&s-e.loadErrorTime>=200&&o.push(e);break;case n9:case n8:t&&o.push(e);break;case n7:case rt:!t&&rQ[rd(e)]?r.push(e):t&&i.push(e);break;case rr:t||a.push(e)}}),{appsToUnload:r,appsToUnmount:a,appsToLoad:o,appsToMount:i}),m,p=[],f=as,h=as=window.location.href;return ad?(ao=!0,m=l.concat(c,u,d),Promise.resolve().then(()=>(w(0===m.length?"before-no-app-change":"before-app-change",b(!0)),w("before-routing-event",b(!0,{cancelNavigation:g})),Promise.all(p).then(n=>{if(n.some(e=>e))return rK.call(window.history,history.state,"",f.substring(location.origin.length)),as=location.href,ao=!1,au(e,t,!0);let r=l.map(r0),a=Promise.all(u.map(rE).map(e=>e.then(r0)).concat(r));a.then(()=>{w("before-mount-routing-event",b(!0))},e=>{throw e});let o=c.map(e=>rL(e).then(e=>ac(e,a))),i=d.filter(e=>0>c.indexOf(e)).map(e=>ac(e,a));return a.catch(e=>{throw v(),e}).then(()=>(v(),Promise.all(o.concat(i)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(y).then(()=>{},e=>{throw e})))})))):(m=c,Promise.resolve().then(()=>Promise.all(c.map(rL)).then(v).then(()=>[]).catch(e=>{throw v(),e}).finally(()=>{})));function g(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);p.push(t.catch(e=>(console.warn(Error(n6(42,!1))),console.warn(e),!1)))}function y(){let t=r3();e.forEach(e=>e.resolve(t));try{w(0===m.length?"no-app-change":"app-change",b()),w("routing-event",b())}catch(e){setTimeout(()=>{throw e})}if(ao=!1,ai.length>0){let e=ai;ai=[],au(e)}return t}function v(){n||(e.forEach(e=>{rW(e.eventArguments)}),rW(t))}function b(e=!1,n){let r={},a={[rr]:[],[rt]:[],[n9]:[],[rl]:[]};e?(c.concat(d).forEach((e,t)=>{i(e,rr)}),l.forEach(e=>{i(e,n9)}),u.forEach(e=>{i(e,rt)})):m.forEach(e=>{i(e)});let o={detail:{newAppStatuses:r,appsByNewStatus:a,totalAppChanges:m.length,originalEvent:null==t?void 0:t[0],oldUrl:f,newUrl:h}};return n&&rf(o.detail,n),o;function i(e,t){let n=rd(e);t=t||r5(n),r[n]=t,(a[t]=a[t]||[]).push(n)}}function w(e,t){n||window.dispatchEvent(new n0(`single-spa:${e}`,t))}}function ac(e,t){return rc(e)?rw(e).then(e=>t.then(()=>rc(e)?r_(e):e)):t.then(()=>e)}let ad=!1;function am(e){ad=!0,rF&&(rZ(e),au())}rF&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...r2]},reroute:au,NOT_LOADED:n9,toLoadPromise:rL,toBootstrapPromise:rw,unregisterApplication:ae,getProfilerData:function(){return rb}});let ap={address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",discardUnsavedChangesPromptBodyMultiple:"{{count}} workspaces have unsaved changes. Closing them will discard the changes:",discardUnsavedChangesPromptBodySingle:"<strong>{{workspaceTitle}}</strong> has unsaved changes. Closing it will discard them.",discardUnsavedChangesPromptTitle:"Discard unsaved changes?",keepEditing:"Keep editing",abnormalValue:"Abnormal value",actions:"Actions",actionableNotification:"Actionable notification",address:"Address",age:"Age",batchActionItemSelected:"{{totalSelected}} item selected",batchActionsItemsSelected:"{{totalSelected}} items selected",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",closesActionableNotification:"Close actionable notification",closeSnackbar:"Close snackbar",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",discardChanges:"Discard changes",edit:"Edit",emptyStateText:"There are no {{displayText}} to display",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",errorLoadingLoginLocations:"Unable to load login locations. Please try again or contact support if the problem persists.",female:"Female",leftNavigation:"Left navigation",loading:"Loading",localVersion:"Local Build",male:"Male",navigateNonHttp:"Could not navigate to the requested page as it is not a safe URL",noResultsToDisplay:"No results to display",notAvailable:"Not available",other:"Other",paginationItemsCount:"{{pageItemsCount}} / {{totalItems}} items",paginationOfPages:"of {{count}} pages",patientAvatarAlt:"Avatar for {{patientName}}",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",patientPhotoAlt:"Profile photo of {{patientName}}",patientPhotoPlaceholder:"Photo placeholder for {{patientName}}",prereleaseVersion:"Prerelease",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",recordNewEntry:"Record {{displayText}}",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",searchForLocation:"Search for a location",seeAll:"See all",seeMoreLists:"See {{count}} more lists",selectAll:"Select all",sex:"Sex",showLess:"Show less",showMore:"Show more",snackbarNotification:"Snackbar notification",toggleDevTools:"Toggle dev tools",unknown:"Unknown",yearAbbreviation:"yr",yearsAbbreviation:"yrs"},af=e=>"string"==typeof e,ah=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ag=e=>null==e?"":""+e,ay=/###/g,av=e=>e&&e.indexOf("###")>-1?e.replace(ay,"."):e,ab=e=>!e||af(e),aw=(e,t,n)=>{let r=af(t)?t.split("."):t,a=0;for(;a<r.length-1;){if(ab(e))return{};let t=av(r[a]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++a}return ab(e)?{}:{obj:e,k:av(r[a])}},aE=(e,t,n)=>{let{obj:r,k:a}=aw(e,t,Object);if(void 0!==r||1===t.length){r[a]=n;return}let o=t[t.length-1],i=t.slice(0,t.length-1),s=aw(e,i,Object);for(;void 0===s.obj&&i.length;)o=`${i[i.length-1]}.${o}`,s=aw(e,i=i.slice(0,i.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},ax=(e,t)=>{let{obj:n,k:r}=aw(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},aD=(e,t,n)=>{for(let r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?af(e[r])||e[r]instanceof String||af(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):aD(e[r],t[r],n):e[r]=t[r]);return e};var a_={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};let ak=e=>af(e)?e.replace(/[&<>"'\/]/g,e=>a_[e]):e,aS=[" ",",","?","!",";"],aC=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),aP=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let r=t.split(n),a=e;for(let e=0;e<r.length;){let t;if(!a||"object"!=typeof a)return;let o="";for(let i=e;i<r.length;++i)if(i!==e&&(o+=n),o+=r[i],void 0!==(t=a[o])){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<r.length-1)continue;e+=i-e+1;break}a=t}return a},aR=e=>e?.replace("_","-"),aT={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class a${constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||aT,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(af(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new a$(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new a$(this.logger,e)}}var aO=new a$;class aN{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n.apply(n,[e,...t])})}}class aA extends aN{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let a,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):af(n)&&o?a.push(...n.split(o)):a.push(n)));let s=ax(this.data,a);return(!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&af(n))?aP(this.data?.[e]?.[t],n,o):s}addResource(e,t,n,r,a={silent:!1}){let o=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,i=[e,t];n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=e.split("."),r=t,t=i[1]),this.addNamespaces(t),aE(this.data,i,r),a.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(af(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,a,o={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),r=n,n=t,t=i[1]),this.addNamespaces(t);let s=ax(this.data,i)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?aD(s,n,a):s={...s,...n},aE(this.data,i,s),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var aI={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,a)??t}),t}};let aj=Symbol("i18next/PATH_KEY");function aM(e,t){let n,r,a,{[aj]:o}=e((r=[],(a=Object.create(null)).get=(e,t)=>(n?.revoke?.(),t===aj)?r:(r.push(t),(n=Proxy.revocable(e,a)).proxy),Proxy.revocable(Object.create(null),a).proxy));return o.join(t?.keySeparator??".")}let aL={},aF=e=>!af(e)&&"boolean"!=typeof e&&"number"!=typeof e;class aB extends aN{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=aO.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(null==e)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let a=aF(r.res);return!1!==n.returnObjects||!a}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,i=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let r=aS.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let a=aC.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),o=!a.test(e);if(!o){let t=e.indexOf(n);t>0&&!a.test(e.substring(0,t))&&(o=!0)}return o})(e,n,r);if(o&&!i){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:af(a)?[a]:a};let o=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(o[0])>-1)&&(a=o.shift()),e=o.join(r)}return{key:e,namespaces:af(a)?[a]:a}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=aM(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);let a=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:i,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1],u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?a?{res:`${l}${u}${i}`,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${u}${i}`:a?{res:i,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:i;let m=this.resolve(e,r),p=m?.res,f=m?.usedKey||i,h=m?.exactUsedKey||i,g=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==r.count&&!af(r.count),b=aB.hasDefaultValue(r),w=v?this.pluralResolver.getSuffix(c,r.count,r):"",E=r.ordinal&&v?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",x=v&&!r.ordinal&&0===r.count,D=x&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${E}`]||r.defaultValue,_=p;y&&!p&&b&&(_=D);let k=aF(_),S=Object.prototype.toString.apply(_);if(y&&_&&k&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(S)&&!(af(g)&&Array.isArray(_))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,_,{...r,ns:s}):`key '${i} (${this.language})' returned an object instead of string.`;return a?(m.res=e,m.usedParams=this.getUsedParamsDetails(r),m):e}if(o){let e=Array.isArray(_),t=e?[]:{},n=e?h:f;for(let e in _)if(Object.prototype.hasOwnProperty.call(_,e)){let a=`${n}${o}${e}`;b&&!p?t[e]=this.translate(a,{...r,defaultValue:aF(D)?D[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(a,{...r,joinArrays:!1,ns:s}),t[e]===a&&(t[e]=_[e])}p=t}}else if(y&&af(g)&&Array.isArray(p))(p=p.join(g))&&(p=this.extendTranslation(p,e,r,n));else{let t=!1,a=!1;!this.isValidLookup(p)&&b&&(t=!0,p=D),this.isValidLookup(p)||(a=!0,p=i);let s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:p,d=b&&D!==p&&this.options.updateMissing;if(a||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,i,d?D:p),o){let e=this.resolve(i,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);let n=(e,t,n)=>{let a=b&&n!==p?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,a,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,a,d,r),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,r);x&&r[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],i+t,r[`defaultValue${t}`]||D)})}):n(e,i,D))}p=this.extendTranslation(p,e,r,m,n),a&&p===i&&this.options.appendNamespaceToMissingKey&&(p=`${l}${u}${i}`),(a||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${i}`:i,t?p:void 0,r))}return a?(m.res=p,m.usedParams=this.getUsedParamsDetails(r),m):p}extendTranslation(e,t,n,r,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let o;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let i=af(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(i){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!af(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),i){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>a?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let o=n.postProcess||this.options.postProcess,i=af(o)?[o]:o;return null!=e&&i?.length&&!1!==n.applyPostProcessor&&(e=aI.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,a,o,i;return af(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),l=s.key;r=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==t.count&&!af(t.count),d=c&&!t.ordinal&&0===t.count,m=void 0!==t.context&&(af(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(i=e,!aL[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(i)&&(aL[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{let i;if(this.isValidLookup(n))return;o=r;let s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,r,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(a)&&s.push(l+e.replace(a,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+n)),m){let r=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(r),c&&(t.ordinal&&0===e.indexOf(a)&&s.push(r+e.replace(a,this.options.pluralSeparator)),s.push(r+e),d&&s.push(r+n))}}for(;i=s.pop();)this.isValidLookup(n)||(a=i,n=this.getResource(r,e,i,t))}))})}),{res:n,usedKey:r,exactUsedKey:a,usedLng:o,usedNS:i}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=e.replace&&!af(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}class aV{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=aO.create("languageUtils")}getScriptPartFromCode(e){if(!(e=aR(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=aR(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(af(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(0>e.indexOf("-")&&0>r.indexOf("-"))&&(e.indexOf("-")>0&&0>r.indexOf("-")&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),af(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],a=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return af(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):af(e)&&a(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&a(this.formatLanguageCode(e))}),r}}let aU={zero:0,one:1,two:2,few:3,many:4,other:5},aW={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class aH{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=aO.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n,r=aR("dev"===e?"en":e),a=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{n=new Intl.PluralRules(r,{type:a})}catch(a){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),aW;if(!e.match(/-|_/))return aW;let r=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(r,t)}return this.pluralRulesCache[o]=n,n}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>aU[e]-aU[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let az=(e,t,n,r=".",a=!0)=>{let o,i=void 0!==(o=ax(e,n))?o:ax(t,n);return!i&&a&&af(n)&&void 0===(i=aP(e,n,r))&&(i=aP(t,n,r)),i};class aK{constructor(e={}){this.logger=aO.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:a,prefixEscaped:o,suffix:i,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:f,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:ak,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):o||"{{",this.suffix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):m||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=h||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let a,o,i,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(0>e.indexOf(this.formatSeparator)){let a=az(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(a,void 0,n,{...r,...t,interpolationkey:e}):a}let a=e.split(this.formatSeparator),o=a.shift().trim(),i=a.join(this.formatSeparator).trim();return this.format(az(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...r,...t,interpolationkey:o})};this.resetRegExp();let u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(i=0;a=t.regex.exec(e);){let n=a[1].trim();if(void 0===(o=l(n)))if("function"==typeof u){let t=u(e,a,r);o=af(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else if(c){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o="";else af(o)||this.useRawValueToEscape||(o=ag(o));let s=t.safeValue(o);if(e=e.replace(a[0],s),c?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=a[0].length):t.regex.lastIndex=0,++i>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,a,o,i=(e,t)=>{let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),a=`{${r[1]}`;e=r[0];let i=(a=this.interpolate(a,o)).match(/'/g),s=a.match(/"/g);((i?.length??0)%2!=0||s)&&s.length%2==0||(a=a.replace(/'/g,'"'));try{o=JSON.parse(a),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${a}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];(o=(o={...n}).replace&&!af(o.replace)?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),(a=t(i.call(this,r[1].trim(),o),o))&&r[0]===e&&!af(a))return a;af(a)||(a=ag(a)),a||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),a=""),s.length&&(a=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),a.trim())),e=e.replace(r[0],a),this.regexp.lastIndex=0}return e}}let aG=e=>{let t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});let i=r+JSON.stringify(o),s=t[i];return s||(s=e(aR(r),a),t[i]=s),s(n)}},aZ=e=>(t,n,r)=>e(aR(n),r)(t);class aY{constructor(e={}){this.logger=aO.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let n=t.cacheInBuiltFormats?aG:aZ;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=aG(t)}format(e,t,n,r={}){let a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&0>a[0].indexOf(")")&&a.find(e=>e.indexOf(")")>-1)){let e=a.findIndex(e=>e.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,e)].join(this.formatSeparator)}return a.reduce((e,t)=>{let{formatName:a,formatOptions:o}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let a=r[1].substring(0,r[1].length-1);"currency"===t&&0>a.indexOf(":")?n.currency||(n.currency=a.trim()):"relativetime"===t&&0>a.indexOf(":")?n.range||(n.range=a.trim()):a.split(";").forEach(e=>{if(e){let[t,...r]=e.split(":"),a=r.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=a),"false"===a&&(n[o]=!1),"true"===a&&(n[o]=!0),isNaN(a)||(n[o]=parseInt(a,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[a]){let t=e;try{let i=r?.formatParams?.[r.interpolationkey]||{},s=i.locale||i.lng||r.locale||r.lng||n;t=this.formats[a](e,s,{...o,...r,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e},e)}}class aq extends aN{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=aO.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let a={},o={},i={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===o[i]&&(o[i]=!0):(this.state[i]=1,r=!1,void 0===o[i]&&(o[i]=!0),void 0===a[i]&&(a[i]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(i[e]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split("|"),a=r[0],o=r[1];t&&this.emit("failedLoading",a,o,t),!t&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let i={};this.queue.forEach(n=>{((e,t,n,r)=>{let{obj:a,k:o}=aw(e,t,Object);a[o]=a[o]||[],a[o].push(n)})(n.loaded,[a],o),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{i[e]||(i[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:a,callback:o});this.readingCalls++;let i=(i,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*a,o)},a):o(i,s)},s=this.backend[n].bind(this.backend);if(2===s.length){try{let n=s(e,t);n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}return}return s(e,t,i)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();af(e)&&(e=this.languageUtils.toResolveHierarchy(e)),af(t)&&(t=[t]);let a=this.queueLoad(e,t,n,r);if(!a.toLoad.length)return a.pending.length||r(),null;a.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){let n=e.split("|"),r=n[0],a=n[1];this.read(r,a,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${t}loading namespace ${a} for language ${r} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${r}`,o),this.loaded(e,n,o)})}saveMissing(e,t,n,r,a,o={},i=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let s={...o,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let a;(a=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof a.then?a.then(e=>i(null,e)).catch(i):i(null,a)}catch(e){i(e)}else l(e,t,n,r,i,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}let aJ=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),af(e[1])&&(t.defaultValue=e[1]),af(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),aX=e=>(af(e.ns)&&(e.ns=[e.ns]),af(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),af(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),aQ=()=>{};class a0 extends aN{constructor(e={},t){if(super(),this.options=aX(e),this.services={},this.logger=aO,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(af(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let n=aJ();this.options={...n,...this.options,...aX(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?aO.init(r(this.modules.logger),this.options):aO.init(null,this.options),e=this.modules.formatter?this.modules.formatter:aY;let t=new aV(this.options);this.store=new aA(this.options.resources,this.options);let a=this.services;a.logger=aO,a.resourceStore=this.store,a.languageUtils=t,a.pluralResolver=new aH(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(a.formatter=r(e),a.formatter.init&&a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new aK(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new aq(r(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(a.languageDetector=r(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=r(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new aB(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=aQ),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let a=ah(),o=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),a}loadResources(e,t=aQ){let n=t,r=af(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=ah();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=aQ),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&aI.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=ah();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(a,o)=>{o?this.isLanguageChangingTo===e&&(r(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(a,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);let n=af(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(af(t)?[t]:t);o&&(this.language||r(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{a(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,n){let r=(e,t,...a)=>{let o,i;(o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(a)):{...t}).lng=o.lng||r.lng,o.lngs=o.lngs||r.lngs,o.ns=o.ns||r.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||r.keyPrefix);let s=this.options.keySeparator||".";return o.keyPrefix&&Array.isArray(e)?i=e.map(e=>("function"==typeof e&&(e=aM(e,{...this.options,...t})),`${o.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=aM(e,{...this.options,...t})),i=o.keyPrefix?`${o.keyPrefix}${s}${e}`:e),this.t(i,o)};return af(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let o=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,o);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!r||o(a,e)))}loadNamespaces(e,t){let n=ah();return this.options.ns?(af(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=ah();af(e)&&(e=[e]);let r=this.options.preload||[],a=e.filter(e=>0>r.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return a.length?(this.options.preload=r.concat(a),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new aV(aJ());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new a0(e,t)}cloneInstance(e={},t=aQ){let n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},a=new a0(r);return(void 0!==e.debug||void 0!==e.prefix)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n&&(a.store=new aA(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),r),a.services.resourceStore=a.store),a.translator=new aB(a.services,r),a.translator.on("*",(e,...t)=>{a.emit(e,...t)}),a.init(r,t),a.translator.options=r,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let a1=a0.createInstance();a1.createInstance=a0.createInstance,a1.createInstance,a1.dir,a1.init,a1.loadResources,a1.reloadResources,a1.use,a1.changeLanguage,a1.getFixedT,a1.t,a1.exists,a1.setDefaultNamespace,a1.hasLoadedNamespace,a1.loadNamespaces,a1.loadLanguages;let a4=a1.default||a1;function a2(e,t,n,r){return a4.t(t,{ns:e,defaultValue:n,...r})}function a3(e,t,n){return ap[e]?a2("core",e,t??ap[e],n):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}function a6(e,t){let n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=a5(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:n,...t});return e.startsWith("//")?r:r.replace(/^\/\//,"/")}function a5(e,t){return Object.keys(t).reduce((e,n)=>e.split("${"+n+"}").join(t[n]),e)}function a9({to:e,templateParams:t}){let n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=a6(e,t).replace(window.location.origin,""),a=new URL(r,window.location.origin);if("http:"!=a.protocol&&"https:"!=a.protocol)throw console.error(`Received request to navigate to non-http URL: ${a.toString()}`),Error(a3("navigateNonHttp"));r.startsWith(n)?rU(r):window.location.assign(r)}a4.on("initialized",function(){window.i18next.loadNamespaces(["core"])});let a8="openmrs:history";function a7(e){let t=JSON.parse(sessionStorage.getItem(a8)??"[]")||[];t.push(e),t.length>50&&(t=t.slice(-50)),sessionStorage.setItem(a8,JSON.stringify(t))}function oe(){0===JSON.parse(sessionStorage.getItem(a8)??"[]").length&&document.referrer&&a7(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let t=ot();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(t[t.length-1]=window.location.href,sessionStorage.setItem(a8,JSON.stringify(t))):!e.detail.originalEvent?.singleSpa&&t.includes(window.location.href)?on({toUrl:window.location.href}):t[t.length-1]!==window.location.href&&a7(window.location.href)})}function ot(){return JSON.parse(sessionStorage.getItem(a8)??"[]")}function on({toUrl:e}){let t=ot(),n=t.lastIndexOf(e);if(-1!=n){let e=t.slice(0,n+1);a9({to:t[n]}),sessionStorage.setItem(a8,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function or(){sessionStorage.removeItem(a8)}let oa="${openmrsSpaBase}/login",oo={redirectAuthFailure:{enabled:{_type:tM.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:tM.String,_default:oa,_validators:[nW.isUrl],_description:"The url to which users will be redirected when they are logged out. If set to blank, the `location` header from the response will be used."},errors:{_type:tM.Array,_default:[401],_elements:{_type:tM.Number,_validators:[nW.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:tM.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}},followRedirects:{_type:tM.Boolean,_default:!0,_description:"Whether openmrsFetch should support redirects returned from the backend"}};function oi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let os="/ws/rest/v1",ol="/ws/fhir2/R4",ou=`${os}/session`;function oc(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function od(e,t={}){if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");let n=oc(e);t.headers||(t.headers={}),ei(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept;let r=!1;try{let e=new URL(n,window.location.href),t=new URL(oc(os),window.location.href),a=e.pathname.replace(/\/{2,}/g,"/"),o=t.pathname.replace(/\/{2,}/g,"/");r=e.origin===t.origin&&(a===o||a.startsWith(`${o}/`))}catch{}if(r){let e=!1;for(let[n,r]of Object.entries(t.headers))"disable-www-authenticate"===n.toLowerCase()&&(void 0===r?delete t.headers[n]:e=!0);e||(t.headers["Disable-WWW-Authenticate"]="true")}if(e.startsWith(ol)){let e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}let a=Error();return window.fetch(n,t).then(async e=>{let{redirectAuthFailure:r,followRedirects:o}=await ng("@openmrs/esm-api");if(e.ok){let t=e.headers.get("location");return(o&&t&&(n===oc(ou)||204===e.status)&&a9({to:t}),204===e.status)?(e.data=null,e):e.clone().text().then(t=>{try{t&&(e.data=JSON.parse(t))}catch(e){}return e})}return(n===oc(ou)&&403===e.status||r.enabled&&r.errors.includes(e.status))&&(or(),a9({to:r.url||e.headers.get("location")||oa}),!0!==t.rejectAuthFailure)?r.resolvePromise?Promise.resolve():new Promise(()=>{}):e.clone().text().then(t=>{let r=t;try{r=JSON.parse(t)}catch(e){}throw new om(n,e,r,a)},()=>{throw new om(n,e,null,a)})})}class om extends Error{constructor(e,t,n,r){super(),oi(this,"response",void 0),oi(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:
|
|
11
|
+
If you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(l)}`)}}function nk(e,t){return nS(t.map(({[e]:t})=>t).filter(e=>!!e))}function nS(e){return e.reduce((e,t)=>e2(e,t,nr),{})}function nC(e,t,n=""){for(let r of Object.keys(t)){let a=t[r],o=n+"."+r,i=e[r];if(!e.hasOwnProperty(r)){("extensionSlots"!==r||""===n)&&nI(o,`Unknown config key '${o}' provided. Ignoring.`);continue}(function e(t,n,r){nR(r,t._type,n),nN(n)?t._type===tL.Object?function(t,n,r){if(t._elements)for(let a of Object.keys(n)){let o=n[a];e(t._elements,o,`${r}.${a}`)}}(t,n,r):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||nC(t,n,r):t._type===tL.Array&&function(t,n,r){if(nR(r,tL.Array,n)){if(nO(t._elements))for(let a=0;a<n.length;a++)e(t._elements,n[a],`${r}[${a}]`);for(let e=0;e<n.length;e++)nR(`${r}[${e}]`,t._elements?._type,n[e])}}(t,n,r)})(i,a,o)}}function nP(e,t,n=""){if(e){if(t!==e._default&&nT(n,e._validators,t),nN(t))for(let r of Object.keys(t)){let a=t[r],o=n+"."+r,i=e[r];e._type===tL.Object&&e._elements?nP(e._elements,a,o):nP(i,a,o)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)nP(e._elements,t[r],`${n}[${r}]`)}}function nR(e,t,n){return!t||nT(e,[{Array:tB,Boolean:tV,ConceptUuid:tz,Number:tU,Object:tH,String:tW,UUID:tz,PersonAttributeTypeUuid:tz,PatientIdentifierTypeUuid:tz}[t]],n)}function nT(e,t,n){let r=!0;if(t)try{for(let a of t){let t=a(n);if("string"==typeof t){let a="object"==typeof n?`Invalid configuration for ${e}: ${t}`:`Invalid configuration value ${n} for ${e}: ${t}`;nI(e,a),r=!1}}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error
|
|
12
|
+
${t}`)}return r}let n$=(e,t)=>{let n=structuredClone(t);if(!e)return n;for(let t of Object.keys(e)){let r=n[t],a=e[t];if(a&&(a.hasOwnProperty("_type")||a.hasOwnProperty("_default"))){n.hasOwnProperty(t)||(n[t]=a._default);let e=a._elements;if(r&&nO(e)){if(a._type===tL.Array&&Array.isArray(r)){let a=r.map(t=>n$(e,t));n[t]=a}else if(a._type===tL.Object)for(let t of Object.keys(r))r[t]=n$(e,r[t])}}else if(nN(a)){let e=r??{};nN(e)&&(n[t]=n$(a,e))}}return n};function nO(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function nN(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let nA=new Set;function nI(e,t){let n=`${e}:::${t}`;nA||(nA=new Set),nA.has(n)||(console.error(t),nA.add(n))}function nj(e){e?nA.forEach(t=>{t.startsWith(e)&&nA.delete(t)}):nA.clear()}function nM(){no.forEach(e=>e()),no.length=0,nu.clear(),nw.clear(),nx.clear(),nE.clear(),ns()}let nL={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:tL.Object,_default:{},_validators:[tF(e=>Object.keys(e).every(e=>/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)),e=>{let t=Object.keys(e).filter(e=>!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e));return`The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ${t.join(", ")}.`})]}},nF={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:tL.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:tL.String,_default:void 0}},...nL},nB=(e,t)=>tF(n=>e<=n&&n<=t,`must be between ${e} and ${t}`),nV=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return tF(e=>{if(!e||"string"!=typeof e)return!1;let n=/\${(.*?)}/g,r=n.exec(e);for(;r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},nU=nV([]),nW=e=>tF(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),nH={inRange:nB,isUrl:nU,isUrlWithTemplateParameters:nV,oneOf:nW};var nz=n(8067);let nK=B("breadcrumbs",[]);function nG(e){return nZ([e])}function nZ(e){let t=[...nY(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,nz.pathToRegexp)(e.matcher).regexp:(0,nz.pathToRegexp)(e.path).regexp,settings:e}))];nK.setState(t,!0)}function nY(){return nK.getState()}function nq(e,t){if(t)return function(e,t){let[n]=e.filter(e=>e.matcher.test(t));return n}(e,t)||function(e,t){let n=t.split("/");for(;n.length>1;){n.pop();let t=nq(e,n.join("/"));if(t)return t}}(e,t)}function nJ(e,t){if(e.length>0){let n=nq(e,t);if(n){let t=[n],r=nq(e,n.settings.parent);for(;void 0!==r;)t.push(r),r=nq(e,r.settings.parent);return t.reverse()}}return[]}function nX(e){return nJ(nY(),e)}var nQ=Object.freeze({__proto__:null,get start(){return ap},get ensureJQuerySupport(){return rX},get setBootstrapMaxTime(){return rN},get setMountMaxTime(){return rA},get setUnmountMaxTime(){return rI},get setUnloadMaxTime(){return rj},get registerApplication(){return r7},get unregisterApplication(){return at},get getMountedApps(){return r6},get getAppStatus(){return r9},get unloadApplication(){return an},get checkActivityFunctions(){return ae},get getAppNames(){return r5},get pathToActiveWhen(){return ao},get navigateToUrl(){return rW},get patchHistoryApi(){return rY},get triggerAppChange(){return au},get addErrorHandler(){return n3},get removeErrorHandler(){return n6},get mountRootParcel(){return rP},get NOT_LOADED(){return n8},get LOADING_SOURCE_CODE(){return n7},get NOT_BOOTSTRAPPED(){return re},get BOOTSTRAPPING(){return rt},get NOT_MOUNTED(){return rn},get MOUNTING(){return rr},get UPDATING(){return ro},get LOAD_ERROR(){return rl},get MOUNTED(){return ra},get UNLOADING(){return rs},get UNMOUNTING(){return ri},get SKIP_BECAUSE_BROKEN(){return ru}}),n0=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,n1=!function(){try{var e=new n0("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?"u">typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}:n0;let n4=[];function n2(e,t,n){let r=n9(e,t,n);n4.length?n4.forEach(e=>e(r)):setTimeout(()=>{throw r})}function n3(e){if("function"!=typeof e)throw Error(n5(28,!1));n4.push(e)}function n6(e){if("function"!=typeof e)throw Error(n5(29,!1));let t=!1;return n4=n4.filter(n=>{let r=n===e;return t=t||r,!r}),t}function n5(e,t,...n){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${n.length?`&arg=${n.join("&arg=")}`:""}`}function n9(e,t,n){let r,a=`${rf(t)} '${rm(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=a+e.message}catch(e){}r=e}else{console.warn(n5(30,!1,t.status,rm(t)));try{r=Error(a+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=rm(t),t.status=n,r}let n8="NOT_LOADED",n7="LOADING_SOURCE_CODE",re="NOT_BOOTSTRAPPED",rt="BOOTSTRAPPING",rn="NOT_MOUNTED",rr="MOUNTING",ra="MOUNTED",ro="UPDATING",ri="UNMOUNTING",rs="UNLOADING",rl="LOAD_ERROR",ru="SKIP_BECAUSE_BROKEN";function rc(e){return e.status===ra}function rd(e){try{return e.activeWhen(window.location)}catch(t){return n2(t,e,ru),!1}}function rm(e){return e.name}function rp(e){return!!e.unmountThisParcel}function rf(e){return rp(e)?"parcel":"application"}function rh(){for(let e=arguments.length-1;e>0;e--)for(let t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function rg(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function ry(e){return e&&("function"==typeof e||Array.isArray(e)&&!rg(e,e=>"function"!=typeof e))}function rv(e,t){let n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[()=>Promise.resolve()]);let r=rf(e),a=rm(e);return function(e){return n.reduce((n,o,i)=>n.then(()=>{let n=o(e);return rb(n)?n:Promise.reject(n5(15,!1,r,a,t,i))}),Promise.resolve())}}function rb(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let rw=[];function rE(e,t){return Promise.resolve().then(()=>e.status!==re?e:(e.status=rt,e.bootstrap?rM(e,"bootstrap").then(n).catch(n=>{if(t)throw n9(n,e,ru);return n2(n,e,ru),e}):Promise.resolve().then(n)));function n(){return e.status=rn,e}}function rx(e,t){return Promise.resolve().then(()=>{if(e.status!==ra)return e;return e.status=ri,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(n,r=>n().then(()=>{let n=Error(r.message);if(t)throw n9(n,e,ru);n2(n,e,ru)})).then(()=>e);function n(){return rM(e,"unmount").then(()=>{e.status=rn},n=>{if(t)throw n9(n,e,ru);n2(n,e,ru)})}})}let rD=!1,r_=!1;function rk(e,t){return Promise.resolve().then(()=>e.status!==rn?e:(rD||(window.dispatchEvent(new n1("single-spa:before-first-mount")),rD=!0),e.status=rr,rM(e,"mount").then(()=>(e.status=ra,r_||(window.dispatchEvent(new n1("single-spa:first-mount")),r_=!0),e)).catch(n=>{return e.status=ra,rx(e,!0).then(r,r);function r(){if(t)throw n9(n,e,ru);return n2(n,e,ru),e}})))}let rS=0,rC={parcels:{}};function rP(){return rR.apply(rC,arguments)}function rR(e,t){let n,r,a,o=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(n5(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(n5(3,!1,typeof e.name));let i=rS++,s=e.name||`parcel-${i}`;if("object"!=typeof t)throw Error(n5(4,!1,s,typeof t));if(!t.domElement)throw Error(n5(5,!1,s));let l="function"==typeof e,u=l?e:()=>Promise.resolve(e),c={id:i,parcels:{},status:l?n7:re,customProps:t,parentName:rm(o),unmountThisParcel:()=>p.then(()=>{if(c.status!==ra)throw Error(n5(6,!1,s,c.status));return rx(c,!0)}).then(e=>(c.parentName&&delete o.parcels[c.id],e)).then(e=>(r(e),e)).catch(e=>{throw c.status=ru,a(e),e})};o.parcels[i]=c;let d=u();if(!d||"function"!=typeof d.then)throw Error(n5(7,!1));let m=(d=d.then(e=>{if(!e)throw Error(n5(8,!1));if(s=e.name||`parcel-${i}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!ry(e.bootstrap))throw Error(n5(9,!1,s));if(!ry(e.mount))throw Error(n5(10,!1,s));if(!ry(e.unmount))throw Error(n5(11,!1,s));if(e.update&&!ry(e.update))throw Error(n5(12,!1,s));let t=rv(e,"bootstrap"),r=rv(e,"mount"),a=rv(e,"unmount");c.status=re,c.name=s,c.bootstrap=t,c.mount=r,c.unmount=a,c.timeouts=rL(e.timeouts),e.update&&(c.update=rv(e,"update"),n.update=function(e){return c.customProps=e,rT(Promise.resolve().then(()=>{if(c.status!==ra)throw Error(n5(32,!1,rm(c)));return c.status=ro,rM(c,"update").then(()=>(c.status=ra,c)).catch(e=>{throw n9(e,c,ru)})}))})})).then(()=>rE(c,!0)),p=m.then(()=>rk(c,!0)),f=new Promise((e,t)=>{r=e,a=t});return n={mount:()=>rT(Promise.resolve().then(()=>{if(c.status!==rn)throw Error(n5(13,!1,s,c.status));return o.parcels[i]=c,rk(c)})),unmount:()=>rT(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:rT(d),bootstrapPromise:rT(m),mountPromise:rT(p),unmountPromise:rT(f)}}function rT(e){return e.then(()=>null)}function r$(e){let t=rm(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(n5(40,!1),t,n));let r=rh({},n,{name:t,mountParcel:rR.bind(e),singleSpa:nQ});return rp(e)&&(r.unmountSelf=e.unmountThisParcel),r}let rO={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function rN(e,t,n){if("number"!=typeof e||e<=0)throw Error(n5(16,!1));rO.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rA(e,t,n){if("number"!=typeof e||e<=0)throw Error(n5(17,!1));rO.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rI(e,t,n){if("number"!=typeof e||e<=0)throw Error(n5(18,!1));rO.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rj(e,t,n){if("number"!=typeof e||e<=0)throw Error(n5(19,!1));rO.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function rM(e,t){let n=e.timeouts[t],r=n.warningMillis,a=rf(e);return new Promise((o,i)=>{let s=!1,l=!1;e[t](r$(e)).then(e=>{s=!0,o(e)}).catch(e=>{s=!0,i(e)}),setTimeout(()=>c(1),r),setTimeout(()=>c(!0),n.millis);let u=n5(31,!1,t,a,rm(e),n.millis);function c(e){s||(!0===e?(l=!0,n.dieOnTimeout?i(Error(u)):console.error(u)):!l&&(console.warn(u),e*r+r<n.millis&&setTimeout(()=>c(e+1),r)))}})}function rL(e){let t={};for(let n in rO)t[n]=rh({},rO[n],e&&e[n]||{});return t}function rF(e){return Promise.resolve().then(()=>{let t,n;return e.loadPromise?e.loadPromise:e.status!==n8&&e.status!==rl?e:(e.status=n7,e.loadPromise=Promise.resolve().then(()=>{let r=e.loadApp(r$(e));if(!rb(r))throw n=!0,Error(n5(33,!1,rm(e)));return r.then(n=>{let r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!ry(t.bootstrap)&&(r=35),ry(t.mount)||(r=36),ry(t.unmount)||(r=37);let a=rf(t);if(r){let n;try{n=JSON.stringify(t)}catch(e){}return console.error(n5(r,!1,a,rm(e),n),t),n2(void 0,e,ru),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=rh({},e.devtools.overlays,t.devtools.overlays)),e.status=re,e.bootstrap=rv(t,"bootstrap"),e.mount=rv(t,"mount"),e.unmount=rv(t,"unmount"),e.unload=rv(t,"unload"),e.timeouts=rL(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let r;return delete e.loadPromise,n?r=ru:(r=rl,e.loadErrorTime=(new Date).getTime()),n2(t,e,r),e}))})}let rB="u">typeof window,rV={hashchange:[],popstate:[]},rU=["hashchange","popstate"];function rW(e){let t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(n5(14,!1));t=e.currentTarget.href,e.preventDefault()}let n=rq(window.location.href),r=rq(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function rH(e){if(e){let t=e[0].type;rU.indexOf(t)>=0&&rV[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function rz(){ac([],arguments)}function rK(e,t){return function(){let n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return a&&n===o||window.dispatchEvent(function(e,t){let n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}}let rG=null,rZ=!1;function rY(e){if(rZ)throw Error(n5(43,!1));a=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,rZ=!0,rG=window.history.replaceState,window.addEventListener("hashchange",rz),window.addEventListener("popstate",rz);let t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&rU.indexOf(e)>=0)||rg(rV[e],e=>e===n))return t.apply(this,arguments);rV[e].push(n)},window.removeEventListener=function(e,t){return"function"==typeof t&&rU.indexOf(e)>=0&&(rV[e]=rV[e].filter(e=>e!==t)),n.apply(this,arguments)},window.history.pushState=rK(window.history.pushState,"pushState"),window.history.replaceState=rK(rG,"replaceState")}function rq(e){let t=document.createElement("a");return t.href=e,t}rB&&(window.singleSpaNavigate?console.warn(n5(41,!1)):window.singleSpaNavigate=rW);let rJ=!1;function rX(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!rJ){let t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return rQ.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return rQ.call(this,n,window.removeEventListener,e,t,arguments)},rJ=!0}}function rQ(e,t,n,r,a){return"string"!=typeof n?e.apply(this,a):(n.split(/\s+/).forEach(e=>{rU.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))}),""===n.trim()?this:e.apply(this,a))}let r0={};function r1(e){return Promise.resolve().then(()=>{let t=r0[rm(e)];if(!t)return e;if(e.status===n8)return r4(e,t),e;if(e.status===rs)return t.promise.then(()=>e);if(e.status!==rn&&e.status!==rl)return e;let n=e.status===rl?Promise.resolve():rM(e,"unload");return e.status=rs,n.then(()=>(r4(e,t),e)).catch(n=>(delete r0[rm(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,n2(n,e,ru),t.reject(n),e))})}function r4(e,t){delete r0[rm(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=n8,t.resolve()}function r2(e,t,n,r){r0[rm(e)]={app:e,resolve:n,reject:r},Object.defineProperty(r0[rm(e)],"promise",{get:t})}let r3=[];function r6(){return r3.filter(rc).map(rm)}function r5(){return r3.map(rm)}function r9(e){let t=rg(r3,t=>rm(t)===e);return t?t.status:null}let r8=!1;function r7(e,t,n,r){var a,o;let i,s,l=(i={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(n5(39,!1));let t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((e,n)=>t.indexOf(n)>=0?e:e.concat(n),[]);if(0!==n.length)throw Error(n5(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(n5(20,!1));let r=e=>"string"==typeof e||"function"==typeof e;if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(n5(24,!1));if(!aa(e.customProps))throw Error(n5(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(n5(20,!1));if(!t)throw Error(n5(23,!1));if("function"!=typeof n)throw Error(n5(24,!1));if(!aa(r))throw Error(n5(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(a=i.loadApp)?()=>Promise.resolve(a):a,i.customProps=i.customProps||{},s=(s=Array.isArray(o=i.activeWhen)?o:[o]).map(e=>"function"==typeof e?e:ao(e)),i.activeWhen=e=>s.some(t=>t(e)),i);if(am||r8||(r8=!0,setTimeout(()=>{am||console.warn(n5(1,!1))},5e3)),-1!==r5().indexOf(l.name))throw Error(n5(21,!1,l.name));r3.push(rh({loadErrorTime:null,status:n8,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),rB&&(rX(),ac())}function ae(e=window.location){return r3.filter(t=>t.activeWhen(e)).map(rm)}function at(e){if(0===r3.filter(t=>rm(t)===e).length)throw Error(n5(25,!1,e));return(rB?an(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=r3.map(rm).indexOf(e);r3.splice(t,1)})}function an(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(n5(26,!1));let n=rg(r3,t=>rm(t)===e);if(!n)throw Error(n5(27,!1,e));let r=r0[rm(n)];if(t&&t.waitForUnmount){if(r)return r.promise;{let e=new Promise((t,r)=>{r2(n,()=>e,t,r)});return e}}{let e;return r?(e=r.promise,ar(n,r.resolve,r.reject)):e=new Promise((t,r)=>{r2(n,()=>e,t,r),ar(n,t,r)}),e}}function ar(e,t,n){Promise.resolve().then(()=>{if(rg(ae(),t=>t===rm(e)))return au()}).then(()=>rx(e).then(r1).then(()=>{t(),setTimeout(()=>{ac()})})).catch(n)}function aa(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function ao(e,t){let n=function(e,t){let n=0,r=!1,a="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let n=e[t],a=r&&"/"===n;(!r&&":"===n||a)&&o(t)}return o(e.length),RegExp(a,"i");function o(o){let i=e.slice(n,o).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(a+=r?"[^/]+/?":i,o===e.length)if(r)t&&(a+="$");else{let e=t?"":".*";a="/"===a.charAt(a.length-1)?`${a}${e}$`:`${a}(/${e})?(#.*)?$`}r=!r,n=o}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}let ai=!1,as=[],al=rB&&window.location.href;function au(){return ac()}function ac(e=[],t,n=!1){let r,a,o,i,s;if(ai)return new Promise((e,n)=>{as.push({resolve:e,reject:n,eventArguments:t})});let{appsToUnload:l,appsToUnmount:u,appsToLoad:c,appsToMount:d}=(r=[],a=[],o=[],i=[],s=(new Date).getTime(),r3.forEach(e=>{let t=e.status!==ru&&rd(e);switch(e.status){case rl:t&&s-e.loadErrorTime>=200&&o.push(e);break;case n8:case n7:t&&o.push(e);break;case re:case rn:!t&&r0[rm(e)]?r.push(e):t&&i.push(e);break;case ra:t||a.push(e)}}),{appsToUnload:r,appsToUnmount:a,appsToLoad:o,appsToMount:i}),m,p=[],f=al,h=al=window.location.href;return am?(ai=!0,m=l.concat(c,u,d),Promise.resolve().then(()=>(w(0===m.length?"before-no-app-change":"before-app-change",b(!0)),w("before-routing-event",b(!0,{cancelNavigation:g})),Promise.all(p).then(n=>{if(n.some(e=>e))return rG.call(window.history,history.state,"",f.substring(location.origin.length)),al=location.href,ai=!1,ac(e,t,!0);let r=l.map(r1),a=Promise.all(u.map(rx).map(e=>e.then(r1)).concat(r));a.then(()=>{w("before-mount-routing-event",b(!0))},e=>{throw e});let o=c.map(e=>rF(e).then(e=>ad(e,a))),i=d.filter(e=>0>c.indexOf(e)).map(e=>ad(e,a));return a.catch(e=>{throw v(),e}).then(()=>(v(),Promise.all(o.concat(i)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(y).then(()=>{},e=>{throw e})))})))):(m=c,Promise.resolve().then(()=>Promise.all(c.map(rF)).then(v).then(()=>[]).catch(e=>{throw v(),e}).finally(()=>{})));function g(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);p.push(t.catch(e=>(console.warn(Error(n5(42,!1))),console.warn(e),!1)))}function y(){let t=r6();e.forEach(e=>e.resolve(t));try{w(0===m.length?"no-app-change":"app-change",b()),w("routing-event",b())}catch(e){setTimeout(()=>{throw e})}if(ai=!1,as.length>0){let e=as;as=[],ac(e)}return t}function v(){n||(e.forEach(e=>{rH(e.eventArguments)}),rH(t))}function b(e=!1,n){let r={},a={[ra]:[],[rn]:[],[n8]:[],[ru]:[]};e?(c.concat(d).forEach((e,t)=>{i(e,ra)}),l.forEach(e=>{i(e,n8)}),u.forEach(e=>{i(e,rn)})):m.forEach(e=>{i(e)});let o={detail:{newAppStatuses:r,appsByNewStatus:a,totalAppChanges:m.length,originalEvent:null==t?void 0:t[0],oldUrl:f,newUrl:h}};return n&&rh(o.detail,n),o;function i(e,t){let n=rm(e);t=t||r9(n),r[n]=t,(a[t]=a[t]||[]).push(n)}}function w(e,t){n||window.dispatchEvent(new n1(`single-spa:${e}`,t))}}function ad(e,t){return rd(e)?rE(e).then(e=>t.then(()=>rd(e)?rk(e):e)):t.then(()=>e)}let am=!1;function ap(e){am=!0,rB&&(rY(e),ac())}rB&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...r3]},reroute:ac,NOT_LOADED:n8,toLoadPromise:rF,toBootstrapPromise:rE,unregisterApplication:at,getProfilerData:function(){return rw}});let af={address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",discardUnsavedChangesPromptBodyMultiple:"{{count}} workspaces have unsaved changes. Closing them will discard the changes:",discardUnsavedChangesPromptBodySingle:"<strong>{{workspaceTitle}}</strong> has unsaved changes. Closing it will discard them.",discardUnsavedChangesPromptTitle:"Discard unsaved changes?",keepEditing:"Keep editing",abnormalValue:"Abnormal value",actions:"Actions",actionableNotification:"Actionable notification",address:"Address",age:"Age",applicationError:"Application Error",batchActionItemSelected:"{{totalSelected}} item selected",batchActionsItemsSelected:"{{totalSelected}} items selected",cancel:"Cancel",change:"Change",Clinic:"Clinic",clearDevOverrides:"Clear dev overrides",close:"Close",closesActionableNotification:"Close actionable notification",closeSnackbar:"Close snackbar",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",copied:"Copied!",copyToClipboard:"Copy to clipboard",delete:"Delete",discardChanges:"Discard changes",edit:"Edit",emptyStateText:"There are no {{displayText}} to display",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",errorLoadingLoginLocations:"Unable to load login locations. Please try again or contact support if the problem persists.",female:"Female",leftNavigation:"Left navigation",loading:"Loading",localVersion:"Local Build",male:"Male",navigateNonHttp:"Could not navigate to the requested page as it is not a safe URL",noResultsToDisplay:"No results to display",notAvailable:"Not available",other:"Other",paginationItemsCount:"{{pageItemsCount}} / {{totalItems}} items",paginationOfPages:"of {{count}} pages",patientAvatarAlt:"Avatar for {{patientName}}",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",patientPhotoAlt:"Profile photo of {{patientName}}",patientPhotoPlaceholder:"Photo placeholder for {{patientName}}",prereleaseVersion:"Prerelease",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",recordNewEntry:"Record {{displayText}}",relationships:"Relationships",reload:"Reload",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",searchForLocation:"Search for a location",seeAll:"See all",seeMoreLists:"See {{count}} more lists",selectAll:"Select all",serverStartingUp:"The server is starting",serverStartingUpExplainer:"This can take a few minutes. OpenMRS will open automatically when the server is ready.",serverStartingUpSlowExplainer:"This is taking longer than usual. First startup after an upgrade can take 10 minutes or more. You can leave this page open.",sex:"Sex",showLess:"Show less",showMore:"Show more",snackbarNotification:"Snackbar notification",somethingWentWrongTryReloading:"Something went wrong. Please try reloading.",toggleDevTools:"Toggle dev tools",unknown:"Unknown",viewSetupProgress:"View setup progress",waitingForServer:"Waiting for the server",yearAbbreviation:"yr",yearsAbbreviation:"yrs"},ah=e=>"string"==typeof e,ag=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},ay=e=>null==e?"":""+e,av=/###/g,ab=e=>e&&e.indexOf("###")>-1?e.replace(av,"."):e,aw=e=>!e||ah(e),aE=(e,t,n)=>{let r=ah(t)?t.split("."):t,a=0;for(;a<r.length-1;){if(aw(e))return{};let t=ab(r[a]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++a}return aw(e)?{}:{obj:e,k:ab(r[a])}},ax=(e,t,n)=>{let{obj:r,k:a}=aE(e,t,Object);if(void 0!==r||1===t.length){r[a]=n;return}let o=t[t.length-1],i=t.slice(0,t.length-1),s=aE(e,i,Object);for(;void 0===s.obj&&i.length;)o=`${i[i.length-1]}.${o}`,s=aE(e,i=i.slice(0,i.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},aD=(e,t)=>{let{obj:n,k:r}=aE(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},a_=(e,t,n)=>{for(let r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?ah(e[r])||e[r]instanceof String||ah(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):a_(e[r],t[r],n):e[r]=t[r]);return e};var ak={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};let aS=e=>ah(e)?e.replace(/[&<>"'\/]/g,e=>ak[e]):e,aC=[" ",",","?","!",";"],aP=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),aR=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let r=t.split(n),a=e;for(let e=0;e<r.length;){let t;if(!a||"object"!=typeof a)return;let o="";for(let i=e;i<r.length;++i)if(i!==e&&(o+=n),o+=r[i],void 0!==(t=a[o])){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<r.length-1)continue;e+=i-e+1;break}a=t}return a},aT=e=>e?.replace("_","-"),a$={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class aO{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||a$,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(ah(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new aO(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new aO(this.logger,e)}}var aN=new aO;class aA{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n.apply(n,[e,...t])})}}class aI extends aA{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let a,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):ah(n)&&o?a.push(...n.split(o)):a.push(n)));let s=aD(this.data,a);return(!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&ah(n))?aR(this.data?.[e]?.[t],n,o):s}addResource(e,t,n,r,a={silent:!1}){let o=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,i=[e,t];n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=e.split("."),r=t,t=i[1]),this.addNamespaces(t),ax(this.data,i,r),a.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(ah(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,a,o={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),r=n,n=t,t=i[1]),this.addNamespaces(t);let s=aD(this.data,i)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?a_(s,n,a):s={...s,...n},ax(this.data,i,s),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var aj={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,a)??t}),t}};let aM=Symbol("i18next/PATH_KEY");function aL(e,t){let n,r,a,{[aM]:o}=e((r=[],(a=Object.create(null)).get=(e,t)=>(n?.revoke?.(),t===aM)?r:(r.push(t),(n=Proxy.revocable(e,a)).proxy),Proxy.revocable(Object.create(null),a).proxy));return o.join(t?.keySeparator??".")}let aF={},aB=e=>!ah(e)&&"boolean"!=typeof e&&"number"!=typeof e;class aV extends aA{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=aN.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(null==e)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let a=aB(r.res);return!1!==n.returnObjects||!a}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,i=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let r=aC.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===r.length)return!0;let a=aP.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`),o=!a.test(e);if(!o){let t=e.indexOf(n);t>0&&!a.test(e.substring(0,t))&&(o=!0)}return o})(e,n,r);if(o&&!i){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:ah(a)?[a]:a};let o=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(o[0])>-1)&&(a=o.shift()),e=o.join(r)}return{key:e,namespaces:ah(a)?[a]:a}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=aL(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);let a=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:i,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1],u=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?a?{res:`${l}${u}${i}`,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${u}${i}`:a?{res:i,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:i;let m=this.resolve(e,r),p=m?.res,f=m?.usedKey||i,h=m?.exactUsedKey||i,g=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==r.count&&!ah(r.count),b=aV.hasDefaultValue(r),w=v?this.pluralResolver.getSuffix(c,r.count,r):"",E=r.ordinal&&v?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",x=v&&!r.ordinal&&0===r.count,D=x&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${E}`]||r.defaultValue,_=p;y&&!p&&b&&(_=D);let k=aB(_),S=Object.prototype.toString.apply(_);if(y&&_&&k&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(S)&&!(ah(g)&&Array.isArray(_))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,_,{...r,ns:s}):`key '${i} (${this.language})' returned an object instead of string.`;return a?(m.res=e,m.usedParams=this.getUsedParamsDetails(r),m):e}if(o){let e=Array.isArray(_),t=e?[]:{},n=e?h:f;for(let e in _)if(Object.prototype.hasOwnProperty.call(_,e)){let a=`${n}${o}${e}`;b&&!p?t[e]=this.translate(a,{...r,defaultValue:aB(D)?D[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(a,{...r,joinArrays:!1,ns:s}),t[e]===a&&(t[e]=_[e])}p=t}}else if(y&&ah(g)&&Array.isArray(p))(p=p.join(g))&&(p=this.extendTranslation(p,e,r,n));else{let t=!1,a=!1;!this.isValidLookup(p)&&b&&(t=!0,p=D),this.isValidLookup(p)||(a=!0,p=i);let s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:p,d=b&&D!==p&&this.options.updateMissing;if(a||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,i,d?D:p),o){let e=this.resolve(i,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);let n=(e,t,n)=>{let a=b&&n!==p?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,a,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,a,d,r),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,r);x&&r[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],i+t,r[`defaultValue${t}`]||D)})}):n(e,i,D))}p=this.extendTranslation(p,e,r,m,n),a&&p===i&&this.options.appendNamespaceToMissingKey&&(p=`${l}${u}${i}`),(a||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${i}`:i,t?p:void 0,r))}return a?(m.res=p,m.usedParams=this.getUsedParamsDetails(r),m):p}extendTranslation(e,t,n,r,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){let o;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let i=ah(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(i){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!ah(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),i){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>a?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let o=n.postProcess||this.options.postProcess,i=ah(o)?[o]:o;return null!=e&&i?.length&&!1!==n.applyPostProcessor&&(e=aj.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,a,o,i;return ah(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),l=s.key;r=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==t.count&&!ah(t.count),d=c&&!t.ordinal&&0===t.count,m=void 0!==t.context&&(ah(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(n)||(i=e,!aF[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(i)&&(aF[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{let i;if(this.isValidLookup(n))return;o=r;let s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,r,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(a)&&s.push(l+e.replace(a,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+n)),m){let r=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(r),c&&(t.ordinal&&0===e.indexOf(a)&&s.push(r+e.replace(a,this.options.pluralSeparator)),s.push(r+e),d&&s.push(r+n))}}for(;i=s.pop();)this.isValidLookup(n)||(a=i,n=this.getResource(r,e,i,t))}))})}),{res:n,usedKey:r,exactUsedKey:a,usedLng:o,usedNS:i}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){let t=e.replace&&!ah(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}class aU{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=aN.create("languageUtils")}getScriptPartFromCode(e){if(!(e=aT(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=aT(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(ah(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(0>e.indexOf("-")&&0>r.indexOf("-"))&&(e.indexOf("-")>0&&0>r.indexOf("-")&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),ah(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],a=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return ah(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(e))):ah(e)&&a(this.formatLanguageCode(e)),n.forEach(e=>{0>r.indexOf(e)&&a(this.formatLanguageCode(e))}),r}}let aW={zero:0,one:1,two:2,few:3,many:4,other:5},aH={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class az{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=aN.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n,r=aT("dev"===e?"en":e),a=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{n=new Intl.PluralRules(r,{type:a})}catch(a){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),aH;if(!e.match(/-|_/))return aH;let r=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(r,t)}return this.pluralRulesCache[o]=n,n}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>aW[e]-aW[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let aK=(e,t,n,r=".",a=!0)=>{let o,i=void 0!==(o=aD(e,n))?o:aD(t,n);return!i&&a&&ah(n)&&void 0===(i=aR(e,n,r))&&(i=aR(t,n,r)),i};class aG{constructor(e={}){this.logger=aN.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:a,prefixEscaped:o,suffix:i,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:f,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:y}=e.interpolation;this.escape=void 0!==t?t:aS,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):o||"{{",this.suffix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):m||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=h||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let a,o,i,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(0>e.indexOf(this.formatSeparator)){let a=aK(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(a,void 0,n,{...r,...t,interpolationkey:e}):a}let a=e.split(this.formatSeparator),o=a.shift().trim(),i=a.join(this.formatSeparator).trim();return this.format(aK(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...r,...t,interpolationkey:o})};this.resetRegExp();let u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(i=0;a=t.regex.exec(e);){let n=a[1].trim();if(void 0===(o=l(n)))if("function"==typeof u){let t=u(e,a,r);o=ah(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else if(c){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o="";else ah(o)||this.useRawValueToEscape||(o=ay(o));let s=t.safeValue(o);if(e=e.replace(a[0],s),c?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=a[0].length):t.regex.lastIndex=0,++i>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,a,o,i=(e,t)=>{let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let r=e.split(RegExp(`${n}[ ]*{`)),a=`{${r[1]}`;e=r[0];let i=(a=this.interpolate(a,o)).match(/'/g),s=a.match(/"/g);((i?.length??0)%2!=0||s)&&s.length%2==0||(a=a.replace(/'/g,'"'));try{o=JSON.parse(a),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${a}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];(o=(o={...n}).replace&&!ah(o.replace)?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),(a=t(i.call(this,r[1].trim(),o),o))&&r[0]===e&&!ah(a))return a;ah(a)||(a=ay(a)),a||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),a=""),s.length&&(a=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),a.trim())),e=e.replace(r[0],a),this.regexp.lastIndex=0}return e}}let aZ=e=>{let t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});let i=r+JSON.stringify(o),s=t[i];return s||(s=e(aT(r),a),t[i]=s),s(n)}},aY=e=>(t,n,r)=>e(aT(n),r)(t);class aq{constructor(e={}){this.logger=aN.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let n=t.cacheInBuiltFormats?aZ:aY;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=aZ(t)}format(e,t,n,r={}){let a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&0>a[0].indexOf(")")&&a.find(e=>e.indexOf(")")>-1)){let e=a.findIndex(e=>e.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,e)].join(this.formatSeparator)}return a.reduce((e,t)=>{let{formatName:a,formatOptions:o}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let r=e.split("(");t=r[0].toLowerCase().trim();let a=r[1].substring(0,r[1].length-1);"currency"===t&&0>a.indexOf(":")?n.currency||(n.currency=a.trim()):"relativetime"===t&&0>a.indexOf(":")?n.range||(n.range=a.trim()):a.split(";").forEach(e=>{if(e){let[t,...r]=e.split(":"),a=r.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=a),"false"===a&&(n[o]=!1),"true"===a&&(n[o]=!0),isNaN(a)||(n[o]=parseInt(a,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[a]){let t=e;try{let i=r?.formatParams?.[r.interpolationkey]||{},s=i.locale||i.lng||r.locale||r.lng||n;t=this.formats[a](e,s,{...o,...r,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e},e)}}class aJ extends aA{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=aN.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let a={},o={},i={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===o[i]&&(o[i]=!0):(this.state[i]=1,r=!1,void 0===o[i]&&(o[i]=!0),void 0===a[i]&&(a[i]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(i[e]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split("|"),a=r[0],o=r[1];t&&this.emit("failedLoading",a,o,t),!t&&n&&this.store.addResourceBundle(a,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let i={};this.queue.forEach(n=>{((e,t,n,r)=>{let{obj:a,k:o}=aE(e,t,Object);a[o]=a[o]||[],a[o].push(n)})(n.loaded,[a],o),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{i[e]||(i[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,a=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:a,callback:o});this.readingCalls++;let i=(i,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*a,o)},a):o(i,s)},s=this.backend[n].bind(this.backend);if(2===s.length){try{let n=s(e,t);n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}return}return s(e,t,i)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();ah(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ah(t)&&(t=[t]);let a=this.queueLoad(e,t,n,r);if(!a.toLoad.length)return a.pending.length||r(),null;a.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){let n=e.split("|"),r=n[0],a=n[1];this.read(r,a,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${t}loading namespace ${a} for language ${r} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${r}`,o),this.loaded(e,n,o)})}saveMissing(e,t,n,r,a,o={},i=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let s={...o,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let a;(a=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof a.then?a.then(e=>i(null,e)).catch(i):i(null,a)}catch(e){i(e)}else l(e,t,n,r,i,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}let aX=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),ah(e[1])&&(t.defaultValue=e[1]),ah(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),aQ=e=>(ah(e.ns)&&(e.ns=[e.ns]),ah(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ah(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),a0=()=>{};class a1 extends aA{constructor(e={},t){if(super(),this.options=aQ(e),this.services={},this.logger=aN,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(ah(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let n=aX();this.options={...n,...this.options,...aQ(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?aN.init(r(this.modules.logger),this.options):aN.init(null,this.options),e=this.modules.formatter?this.modules.formatter:aq;let t=new aU(this.options);this.store=new aI(this.options.resources,this.options);let a=this.services;a.logger=aN,a.resourceStore=this.store,a.languageUtils=t,a.pluralResolver=new az(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(a.formatter=r(e),a.formatter.init&&a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new aG(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new aJ(r(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(a.languageDetector=r(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=r(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new aV(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=a0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let a=ag(),o=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),a}loadResources(e,t=a0){let n=t,r=ah(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=ag();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=a0),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&aj.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=ag();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(a,o)=>{o?this.isLanguageChangingTo===e&&(r(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(a,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);let n=ah(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(ah(t)?[t]:t);o&&(this.language||r(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{a(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,n){let r=(e,t,...a)=>{let o,i;(o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(a)):{...t}).lng=o.lng||r.lng,o.lngs=o.lngs||r.lngs,o.ns=o.ns||r.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||r.keyPrefix);let s=this.options.keySeparator||".";return o.keyPrefix&&Array.isArray(e)?i=e.map(e=>("function"==typeof e&&(e=aL(e,{...this.options,...t})),`${o.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=aL(e,{...this.options,...t})),i=o.keyPrefix?`${o.keyPrefix}${s}${e}`:e),this.t(i,o)};return ah(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let o=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,o);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!r||o(a,e)))}loadNamespaces(e,t){let n=ag();return this.options.ns?(ah(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=ag();ah(e)&&(e=[e]);let r=this.options.preload||[],a=e.filter(e=>0>r.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return a.length?(this.options.preload=r.concat(a),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new aU(aX());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new a1(e,t)}cloneInstance(e={},t=a0){let n=e.forkResourceStore;n&&delete e.forkResourceStore;let r={...this.options,...e,isClone:!0},a=new a1(r);return(void 0!==e.debug||void 0!==e.prefix)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n&&(a.store=new aI(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),r),a.services.resourceStore=a.store),a.translator=new aV(a.services,r),a.translator.on("*",(e,...t)=>{a.emit(e,...t)}),a.init(r,t),a.translator.options=r,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let a4=a1.createInstance();a4.createInstance=a1.createInstance,a4.createInstance,a4.dir,a4.init,a4.loadResources,a4.reloadResources,a4.use,a4.changeLanguage,a4.getFixedT,a4.t,a4.exists,a4.setDefaultNamespace,a4.hasLoadedNamespace,a4.loadNamespaces,a4.loadLanguages;let a2=a4.default||a4;function a3(e,t,n,r){return a2.t(t,{ns:e,defaultValue:n,...r})}function a6(e,t,n){return af[e]?a3("core",e,t??af[e],n):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}function a5(e,t){let n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=a9(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:n,...t});return e.startsWith("//")?r:r.replace(/^\/\//,"/")}function a9(e,t){return Object.keys(t).reduce((e,n)=>e.split("${"+n+"}").join(t[n]),e)}function a8({to:e,templateParams:t}){let n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=a5(e,t).replace(window.location.origin,""),a=new URL(r,window.location.origin);if("http:"!=a.protocol&&"https:"!=a.protocol)throw console.error(`Received request to navigate to non-http URL: ${a.toString()}`),Error(a6("navigateNonHttp"));r.startsWith(n)?rW(r):window.location.assign(r)}a2.on("initialized",function(){window.i18next.loadNamespaces(["core"])});let a7="openmrs:history";function oe(e){let t=JSON.parse(sessionStorage.getItem(a7)??"[]")||[];t.push(e),t.length>50&&(t=t.slice(-50)),sessionStorage.setItem(a7,JSON.stringify(t))}function ot(){0===JSON.parse(sessionStorage.getItem(a7)??"[]").length&&document.referrer&&oe(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let t=on();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(t[t.length-1]=window.location.href,sessionStorage.setItem(a7,JSON.stringify(t))):!e.detail.originalEvent?.singleSpa&&t.includes(window.location.href)?or({toUrl:window.location.href}):t[t.length-1]!==window.location.href&&oe(window.location.href)})}function on(){return JSON.parse(sessionStorage.getItem(a7)??"[]")}function or({toUrl:e}){let t=on(),n=t.lastIndexOf(e);if(-1!=n){let e=t.slice(0,n+1);a8({to:t[n]}),sessionStorage.setItem(a7,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function oa(){sessionStorage.removeItem(a7)}let oo="${openmrsSpaBase}/login",oi={redirectAuthFailure:{enabled:{_type:tL.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:tL.String,_default:oo,_validators:[nH.isUrl],_description:"The url to which users will be redirected when they are logged out. If set to blank, the `location` header from the response will be used."},errors:{_type:tL.Array,_default:[401],_elements:{_type:tL.Number,_validators:[nH.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:tL.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}},followRedirects:{_type:tL.Boolean,_default:!0,_description:"Whether openmrsFetch should support redirects returned from the backend"}};function os(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let ol="/ws/rest/v1",ou="/ws/fhir2/R4",oc=`${ol}/session`;function od(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function om(e,t={}){if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");let n=od(e);t.headers||(t.headers={}),es(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept;let r=!1;try{let e=new URL(n,window.location.href),t=new URL(od(ol),window.location.href),a=e.pathname.replace(/\/{2,}/g,"/"),o=t.pathname.replace(/\/{2,}/g,"/");r=e.origin===t.origin&&(a===o||a.startsWith(`${o}/`))}catch{}if(r){let e=!1;for(let[n,r]of Object.entries(t.headers))"disable-www-authenticate"===n.toLowerCase()&&(void 0===r?delete t.headers[n]:e=!0);e||(t.headers["Disable-WWW-Authenticate"]="true")}if(e.startsWith(ou)){let e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}let a=Error();return window.fetch(n,t).then(async e=>{let{redirectAuthFailure:r,followRedirects:o}=await ny("@openmrs/esm-api");if(e.ok){let t=e.headers.get("location");return(o&&t&&(n===od(oc)||204===e.status)&&a8({to:t}),204===e.status)?(e.data=null,e):e.clone().text().then(t=>{try{t&&(e.data=JSON.parse(t))}catch(e){}return e})}return(n===od(oc)&&403===e.status||r.enabled&&r.errors.includes(e.status))&&(oa(),a8({to:r.url||e.headers.get("location")||oo}),!0!==t.rejectAuthFailure)?r.resolvePromise?Promise.resolve():new Promise(()=>{}):e.clone().text().then(t=>{let r=t;try{r=JSON.parse(t)}catch(e){}throw new op(n,e,r,a)},()=>{throw new op(n,e,null,a)})})}class op extends Error{constructor(e,t,n,r){super(),os(this,"response",void 0),os(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:
|
|
13
13
|
${r.stack}
|
|
14
14
|
Stacktrace for incoming response:
|
|
15
|
-
${this.stack}`}}let op=F("session",{loaded:!1,session:null}),of=0,oh=null;function og(){return oh||(op.getState().loaded&&of>=Date.now()-6e4?null:ow())}function oy(e){let t=e?.includeAuthStatus??!0,n=e=>t?e:e.user,r=og();return r?new Promise(e=>{let t=()=>{let t=op.getState();t.loaded&&(a(),e(n(t.session)))},a=op.subscribe(t);r.then(t,t)}):Promise.resolve(n(op.getState().session))}function ov(){return og(),op}function ob(e){let t=e.locale??e.user?.userProperties?.defaultLocale;t&&t.includes("_")&&(t=t.replaceAll("_","-")),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(t)&&t!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",t)}function ow(e,t){of=Date.now();let n={};e&&t&&(n.Authorization=`Basic ${window.btoa(`${e}:${t}`)}`);let r=oT(od(ou,{headers:n,rejectAuthFailure:!0})),a=()=>{oh===r&&(oh=null)};return r.then(a,a),oh=r,r}function oE(){op.setState({loaded:!0,session:{authenticated:!1,sessionId:""}},!0)}function ox(e,t){var n,r;if(void 0===t)return!e;if(!e)return!0;return n=e,r=t,("string"==typeof n?!H(r.privileges.find(e=>n===e.display)):Array.isArray(n)?n.every(e=>!H(r.privileges.find(t=>e===t.display))):(H(n)||console.error(`Could not understand privileges "${n}"`),!0))||!H(t.roles.find(e=>"System Developer"===e.display))}function oD(){let e,t;return new Promise(n=>{let r=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};r(op.getState()),e||(t=op.subscribe(r))})}async function o_(){return(await oy()).sessionLocation}async function ok(e,t){return oT(od(ou,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},rejectAuthFailure:!0,signal:t?.signal}))}async function oS(e,t){return await od(ou,{method:"POST",body:{locale:e},headers:{"Content-Type":"application/json"},signal:t?.signal}),ow()}async function oC(e,t,n){return n||(n=new AbortController),await od(`${os}/user/${e}`,{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:n.signal}),ow()}async function oP(e,t=!1){let n=await od(t?`${ou}?rememberMe=true`:ou,{headers:{"X-Totp-Code":e}});return n.data?.authenticated?(await ow()).session:n.data}async function oR(){try{await od(ou,{method:"DELETE",rejectAuthFailure:!0})}catch(e){if(!o$(e))throw e}oE(),await ow().catch(()=>{})}function oT(e){return new Promise((t,n)=>{e.then(e=>{if("object"==typeof e?.data){let n={loaded:!0,session:e.data};op.setState(n,!0),t(n)}else n(oO(Error("The session endpoint did not respond with a session")))}).catch(e=>{if(o$(e)){var r;"object"==typeof(r=e.responseBody)&&null!==r&&!1===r.authenticated?op.setState({loaded:!0,session:e.responseBody},!0):oE(),t(op.getState());return}S(`Failed to fetch new session information: ${e}`),n(oO(e))})})}function o$(e){return e instanceof om&&(401===e.response.status||403===e.response.status)}function oO(e){return op.getState().loaded||op.setState({loaded:!1,session:null,error:e instanceof Error?e:Error(String(e))},!0),op.getState()}function oN(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}op.subscribe(e=>{e.loaded&&e.session&&ob(e.session)});let oA={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"};function oI(){nu("@openmrs/esm-api",oo),ow()}let oj="import-map-override:",oM="import-map-overrides-disabled",oL="import-map-overrides:change",oF=!1,oB=null,oV=null;async function oU(){return oV??(oV=oW().then(({map:e,complete:t})=>(t||(oV=null),e))),oV}async function oW(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[],n=!0;for(let r=0;r<e.length;r++){let a=e[r];try{if(a.src){let e=await fetch(a.src);if(!e.ok)throw Error(`Request for ${a.src} returned ${e.status} ${e.statusText}`);t.push(await e.json())}else a.textContent&&t.push(JSON.parse(a.textContent))}catch(e){n=!1,console.warn(`[import-maps] Failed to parse import map from script tag at index ${r}`,e)}}return{map:oH(t),complete:n}}function oH(e){let t={imports:{}};for(let n of e)n?.imports&&Object.assign(t.imports,n.imports);return t}function oz(){let e={};try{let t=oq();for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);if(r?.startsWith(oj)){let n=r.slice(oj.length);if(!t.includes(n)){let t=localStorage.getItem(r);t&&(e[n]=t)}}}}catch(e){console.warn("[import-maps] Failed to read import-map overrides from localStorage",e)}return{imports:e}}async function oK(){let e=await oU();return oF?oH([e,oB??oz()]):e}async function oG(){return oU()}async function oZ(){return oF?oH([await oU(),oz()]):oU()}function oY(e){if(!oF)return{imports:{}};if(e){let e={};for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(oj)){let t=localStorage.getItem(n);t&&(e[n.slice(oj.length)]=t)}}return{imports:e}}return oz()}function oq(){if(!oF)return[];try{let e=localStorage.getItem(oM);if(e){let t=JSON.parse(e);if(Array.isArray(t))return t}}catch{}return[]}function oJ(e){return!!oF&&oq().includes(e)}function oX(e,t){if(!oF)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.setItem(oj+e,t),window.dispatchEvent(new CustomEvent(oL))}catch(e){console.warn("[import-maps] Failed to write import-map override to localStorage",e)}}function oQ(e){if(!oF)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.removeItem(oj+e);let t=oq().filter(t=>t!==e);t.length>0?localStorage.setItem(oM,JSON.stringify(t)):localStorage.removeItem(oM),window.dispatchEvent(new CustomEvent(oL))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}function o0(){if(!oF)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(oj)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),localStorage.removeItem(oM),window.dispatchEvent(new CustomEvent(oL))}catch(e){console.warn("[import-maps] Failed to clear import-map overrides from localStorage",e)}}function o1(e){if(!oF)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let t=oq().filter(t=>t!==e);t.length>0?localStorage.setItem(oM,JSON.stringify(t)):localStorage.removeItem(oM),window.dispatchEvent(new CustomEvent(oL))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}let o4=!1;function o2(){!o4&&(o4=!0,(oF="development"===window.spaEnv)&&(oB=oz()))}function o3(e){return e.replace(/[\/\-@]/g,"_")}async function o6(e,t="./start",r){var a;let o,i=!r?.maxLoadingTime||r.maxLoadingTime<=0?6e5:r.maxLoadingTime;await Promise.race([o5(e,r?.importMap),new Promise((t,n)=>{o=setTimeout(()=>{var t;n(Error(`Could not resolve requested script, ${e}, within ${(t=i)<1e3?`${t} milliseconds`:t<6e4?`${Math.floor(t/1e3)} seconds`:t<36e5?`${Math.floor(t/6e4)} minutes`:t<864e5?`${Math.floor(t/36e5)} hours`:`${Math.floor(t/864e5)} days`}.`))},i)})]),o&&clearTimeout(o);let s=o3(e),l=window[s];if(!("object"==typeof(a=l)&&null!==a&&"init"in a&&"function"==typeof a.init&&"get"in a&&"function"==typeof a.get)){let e=`The global variable ${s} does not refer to a federated module`;throw console.error(e),Error(e)}l.init(n.S.default);let u=(await l.get(t))();if("object"!=typeof u||null===u){let t=`Container for ${e} did not return an ESM module as expected`;throw console.error(t),Error(t)}return u}async function o5(e,t){if("string"!=typeof e||0===e.trim().length){let e="Attempted to call importDynamic() without supplying a package to load";throw console.error(e),Error(e)}let n=o3(e);if(!window[n]){let n=t??await o9();if(!n.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let r=n.imports[e];r.startsWith("./")&&(r=window.spaBase+r.substring(1));let a=e in oY().imports;try{return await function(e){var t;let n=(t=window)[o8]??(t[o8]=new Map),r=n.get(e);if(r)return r;if(document.head.querySelector(`script[src="${e}"]`))return console.warn(`Script at ${e} already loaded. Not loading it again.`),Promise.resolve();let a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!0;let o=new Promise((t,r)=>{let o=setTimeout(()=>{console.error(`The script at ${e} did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration.`)},5e3);function i(){clearTimeout(o),a.removeEventListener("load",s),a.removeEventListener("error",l)}function s(){i(),t()}function l(t){i(),n.delete(e),a.remove();let o=`Failed to load script from ${e}`;console.error(o,t),r(t.message??o)}a.addEventListener("load",s),a.addEventListener("error",l),document.head.appendChild(a)});return n.set(e,o),o}(r)}catch(e){return a&&w({kind:"error",title:a3("scriptLoadingFailed","Error: Script failed to load"),description:a3("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:r}),actionButtonLabel:a3("resetOverrides","Reset overrides"),onActionButtonClick(){o0(),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function o9(){return oK()}let o8=Symbol.for("__openmrs_script_loading");function o7(e){return!!e&&"object"==typeof e&&!(Object.hasOwn(e,"pages")&&(!e.pages||!Array.isArray(e.pages))||Object.hasOwn(e,"extensions")&&(!e.extensions||!Array.isArray(e.extensions))||Object.hasOwn(e,"workspaces")&&(!e.workspaces||!Array.isArray(e.workspaces))||Object.hasOwn(e,"modals")&&(!e.modals||!Array.isArray(e.modals)))}function ie(e){return!!e&&"object"==typeof e&&"routes"in e&&!!e.routes&&"object"==typeof e.routes&&Object.entries(e.routes).every(([e,t])=>"string"==typeof e&&o7(t))}let it="openmrs-routes:",ir="openmrs-routes:change",ia=!1,io=null,ii=null;async function is(){return ii??(ii=il().then(({map:e,complete:t})=>(t||(ii=null),e))),ii}async function il(){let e=document.querySelectorAll("script[type='openmrs-routes']"),t=[],n=!0;for(let r=0;r<e.length;r++){let a=e[r];try{let e;if(a.src){let t=await fetch(a.src);if(!t.ok)throw Error(`Request for ${a.src} returned ${t.status} ${t.statusText}`);e=await t.json()}else a.textContent&&(e=JSON.parse(a.textContent));e&&ie(e)&&t.push(e)}catch(e){n=!1,console.warn(`[route-maps] Failed to parse routes from script tag at index ${r}`,e)}}return{map:iu(t),complete:n}}function iu(e){let t={routes:{}};for(let n of e)n&&"object"==typeof n&&!Array.isArray(n)&&(Object.assign(t.routes,n.routes),void 0===t.version&&void 0!==n.version&&(t.version=n.version));return t}async function ic(){let e={version:void 0,routes:{}};try{let t=[];for(let e=0;e<localStorage.length;e++){let n=localStorage.key(e);if(n?.startsWith(it)){let e=localStorage.getItem(n);e&&t.push({moduleName:n.slice(it.length),raw:e})}}for(let n of(await Promise.allSettled(t.map(async({moduleName:e,raw:t})=>{let n=JSON.parse(t);if(o7(n))return{moduleName:e,routes:n};if("string"==typeof n&&n.startsWith("http")){let t=await fetch(n),r=await t.json();if(o7(r))return{moduleName:e,routes:r};throw Error(`${n} did not resolve to a valid OpenmrsAppRoutes object`)}throw Error(`Override for ${e} is neither a valid routes object nor a URL`)}))))"fulfilled"===n.status?e.routes[n.value.moduleName]=n.value.routes:console.warn("[route-maps] Failed to load route override",n.reason)}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}async function id(){let e=await is();return ia?iu([e,io??await ic()]):e}async function im(){return is()}async function ip(){return ia?iu([await is(),await ic()]):is()}function ih(){if(!ia)return{};let e={};try{for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(it)){let t=localStorage.getItem(n);t&&(e[n.slice(it.length)]=t)}}}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}function ig(e,t){if(!ia)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{if("string"==typeof t)if(t.startsWith("http"))localStorage.setItem(it+e,JSON.stringify(t));else{let n=JSON.parse(t);if(!o7(n))return void console.error(`The supplied routes for ${e} is not a valid OpenmrsAppRoutes object`,t);localStorage.setItem(it+e,JSON.stringify(n))}else if(t instanceof URL)localStorage.setItem(it+e,JSON.stringify(t.toString()));else{if(!o7(t))return void console.error(`Override for ${e} is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL`,t);localStorage.setItem(it+e,JSON.stringify(t))}window.dispatchEvent(new CustomEvent(ir))}catch(e){console.warn("[route-maps] Failed to write route override to localStorage",e)}}function iy(e){if(!ia)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{localStorage.removeItem(it+e),window.dispatchEvent(new CustomEvent(ir))}catch(e){console.warn("[route-maps] Failed to remove route override from localStorage",e)}}function iv(){if(!ia)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(it)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),window.dispatchEvent(new CustomEvent(ir))}catch(e){console.warn("[route-maps] Failed to clear route overrides from localStorage",e)}}let ib=null;function iw(){return ib||(ib=(ia="development"===window.spaEnv)?ic().then(e=>{io=e}):Promise.resolve())}let iE=`${os}/attachment`;function ix(e,t){return od(`${iE}/${e}`,{signal:t.signal})}function iD(e,t,n,r){return od(i_(e,t,r),{signal:n.signal})}function i_(e,t,n){return n?`${iE}?patient=${e}&encounter=${n}`:`${iE}?patient=${e}&includeEncounterless=${t}`}async function ik(e,t,n){let r=new FormData;return r.append("fileCaption",t.fileDescription),r.append("patient",e),n&&r.append("encounter",n),t.file?r.append("file",t.file,t.fileName):(r.append("file",new File([""],t.fileName),t.fileName),r.append("base64Content",t.base64Content)),od(`${iE}`,{method:"POST",body:r})}function iS(e,t){return od(`${iE}/${e}`,{method:"DELETE",signal:t.signal})}async function iC(e,t){return e?(await od(`${ol}/Patient/${e}`,t)).data:null}function iP(e,t){let n=new CustomEvent(`openmrs:${e}`,{detail:t??void 0,cancelable:!0,bubbles:!0});return window.dispatchEvent(n)}function iR(e,t){let n=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,n),()=>{window.removeEventListener(`openmrs:${e}`,n)}}function iT(e){return{uuid:e.uuid,display:e.display}}function i$(e=null,t=null){let n=new URLSearchParams;e&&n.set("tag",e),t&&n.set("q",t);let r=n.toString();return od(`${os}/location${r?"?"+r:""}`).then(e=>e.data.results.map(iT))}function iO(e){return{uuid:e.uuid,display:e.display,name:e.name}}let iN=`${os}/visittype`;function iA(e=iN){return od(e).then(e=>e.data.results.map(iO))}var iI=((Y={}).NEWVISIT="startVisit",Y.EDITVISIT="editVisit",Y.LOADING="loadingVisit",Y),ij=((q={}).NOTSTARTED="notStarted",q.ONGOING="ongoing",q);let iM="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",iL=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};function iF(){return V("visit",iL)}function iB(e,t){iF().setState({patientUuid:e,manuallySetVisitUuid:t})}function iV(e,t){return od(`${os}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function iU(e,t,n){return od(`${os}/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function iW(e,t,n){return od(`${os}/visit?patient=${e}&v=${n??iM}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}iF().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});class iH{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+iH.version}static addUnaryOp(e){return iH.max_unop_len=Math.max(e.length,iH.max_unop_len),iH.unary_ops[e]=1,iH}static addBinaryOp(e,t,n){return iH.max_binop_len=Math.max(e.length,iH.max_binop_len),iH.binary_ops[e]=t,n?iH.right_associative.add(e):iH.right_associative.delete(e),iH}static addIdentifierChar(e){return iH.additional_identifier_chars.add(e),iH}static addLiteral(e,t){return iH.literals[e]=t,iH}static removeUnaryOp(e){return delete iH.unary_ops[e],e.length===iH.max_unop_len&&(iH.max_unop_len=iH.getMaxKeyLen(iH.unary_ops)),iH}static removeAllUnaryOps(){return iH.unary_ops={},iH.max_unop_len=0,iH}static removeIdentifierChar(e){return iH.additional_identifier_chars.delete(e),iH}static removeBinaryOp(e){return delete iH.binary_ops[e],e.length===iH.max_binop_len&&(iH.max_binop_len=iH.getMaxKeyLen(iH.binary_ops)),iH.right_associative.delete(e),iH}static removeAllBinaryOps(){return iH.binary_ops={},iH.max_binop_len=0,iH}static removeLiteral(e){return delete iH.literals[e],iH}static removeAllLiterals(){return iH.literals={},iH}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new iH(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return iH.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!iH.binary_ops[String.fromCharCode(e)]||iH.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return iH.isIdentifierStart(e)||iH.isDecimalDigit(e)}throwError(e){let t=Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(iH.hooks[e]){let n={context:this,node:t};return iH.hooks.run(e,n),n.node}return t}searchHook(e){if(iH.hooks[e]){let t={context:this};return iH.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===iH.SPACE_CODE||e===iH.TAB_CODE||e===iH.LF_CODE||e===iH.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:iH.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],n,r;for(;this.index<this.expr.length;)if((n=this.code)===iH.SEMCOL_CODE||n===iH.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())t.push(r);else if(this.index<this.expr.length){if(n===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,iH.max_binop_len),t=e.length;for(;t>0;){if(iH.binary_ops.hasOwnProperty(e)&&(!iH.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!iH.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,n,r,a,o,i,s,l;if(!(o=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return o;for(a={value:t,prec:iH.binaryPrecedence(t),right_a:iH.right_associative.has(t)},(i=this.gobbleToken())||this.throwError("Expected expression after "+t),r=[o,a,i];t=this.gobbleBinaryOp();){if(0===(n=iH.binaryPrecedence(t))){this.index-=t.length;break}a={value:t,prec:n,right_a:iH.right_associative.has(t)},l=t;let s=e=>a.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;r.length>2&&s(r[r.length-2]);)i=r.pop(),t=r.pop().value,o=r.pop(),e={type:iH.BINARY_EXP,operator:t,left:o,right:i},r.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),r.push(a,e)}for(s=r.length-1,e=r[s];s>1;)e={type:iH.BINARY_EXP,operator:r[s-1].value,left:r[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,n,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"))return this.runHook("after-token",r);if(e=this.code,iH.isDecimalDigit(e)||e===iH.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===iH.SQUOTE_CODE||e===iH.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(e===iH.OBRACK_CODE)r=this.gobbleArray();else{for(n=(t=this.expr.substr(this.index,iH.max_unop_len)).length;n>0;){if(iH.unary_ops.hasOwnProperty(t)&&(!iH.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!iH.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=n;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:iH.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--n)}iH.isIdentifierStart(e)?(r=this.gobbleIdentifier(),iH.literals.hasOwnProperty(r.name)?r={type:iH.LITERAL,value:iH.literals[r.name],raw:r.name}:r.name===iH.this_str&&(r={type:iH.THIS_EXP})):e===iH.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===iH.PERIOD_CODE||t===iH.OBRACK_CODE||t===iH.OPAREN_CODE||t===iH.QUMARK_CODE;){let n;if(t===iH.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==iH.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===iH.OBRACK_CODE?((e={type:iH.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==iH.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===iH.OPAREN_CODE?e={type:iH.CALL_EXP,arguments:this.gobbleArguments(iH.CPAREN_CODE),callee:e}:(t===iH.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),e={type:iH.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),n&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,n;for(;iH.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===iH.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);iH.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if("e"===(t=this.char)||"E"===t){for(e+=this.expr.charAt(this.index++),("+"===(t=this.char)||"-"===t)&&(e+=this.expr.charAt(this.index++));iH.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);iH.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return n=this.code,iH.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(n===iH.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===iH.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:iH.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,n=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===n){r=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return r||this.throwError('Unclosed quote after "'+e+'"'),{type:iH.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(iH.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,iH.isIdentifierPart(e))this.index++;else break;return{type:iH.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],n=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let a=this.code;if(a===e){n=!0,this.index++,e===iH.CPAREN_CODE&&r&&r>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(a===iH.COMMA_CODE){if(this.index++,++r!==t.length){if(e===iH.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===iH.CBRACK_CODE)for(let e=t.length;e<r;e++)t.push(null)}}else if(t.length!==r&&0!==r)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==iH.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return n||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(iH.CPAREN_CODE);if(this.code===iH.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:iH.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:iH.ARRAY_EXP,elements:this.gobbleArguments(iH.CBRACK_CODE)}}}Object.assign(iH,{hooks:new class{add(e,t,n){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(iH),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),iH.max_unop_len=iH.getMaxKeyLen(iH.unary_ops),iH.max_binop_len=iH.getMaxKeyLen(iH.binary_ops);let iz=e=>new iH(e).parse(),iK=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(iH).filter(e=>!iK.includes(e)&&void 0===iz[e]).forEach(e=>{iz[e]=iH[e]}),iz.Jsep=iH,iz.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:r,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}})}});let iG="ArrowFunctionExpression",iZ={Array,Boolean,Symbol,Infinity,NaN,Math,Number,BigInt,String,RegExp,JSON,isFinite,isNaN,parseFloat,parseInt,decodeURI,encodeURI,encodeURIComponent,Object:{__proto__:void 0,assign:Object.assign.bind(null),fromEntries:Object.fromEntries.bind(null),hasOwn:Object.hasOwn.bind(null),keys:Object.keys.bind(null),is:Object.is.bind(null),values:Object.values.bind(null)}},iY={...iZ,Promise};function iq(e,t={}){return i4(e,t,i6)}async function iJ(e,t={}){return i2(e,t,i6)}function iX(e,t={}){return i4(e,t,i5)}function iQ(e,t={}){return i2(e,t,i5)}function i0(e,t={}){return i4(e,t,i9)}function i1(e,t={}){return i2(e,t,i9)}function i4(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let r=sn(t,iZ),a=i8("string"==typeof e?iz(e):e,r);if(n(a))return a;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}}async function i2(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))return Promise.reject(`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`);if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let r=sn(t,iY);return Promise.resolve(i8("string"==typeof e?iz(e):e,r)).then(t=>{if(n(t))return t;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}})}function i3(e){return iz(e)}function i6(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function i5(e){return"boolean"==typeof e}function i9(e){return"number"==typeof e}function i8(e,t){switch(e.type){case"UnaryExpression":var n,r,a,o,i,s,l,u,c,d,m,p,f,h=e,g=t;let y=i8(h.argument,g);switch(h.operator){case"+":return+y;case"-":return-y;case"~":return~y;case"!":return!y;default:throw`Expression evaluator does not support operator '${h.operator}''`}case"BinaryExpression":var v=e,b=t;switch(v.operator){case"&&":return i8(v.left,b)&&i8(v.right,b);case"||":return i8(v.left,b)||i8(v.right,b);case"??":return i8(v.left,b)??i8(v.right,b)}let w=i8(v.left,b),E=i8(v.right,b);switch(v.operator){case"+":return w+E;case"-":return w-E;case"*":return w*E;case"/":return w/E;case"%":return w%E;case"**":return w**E;case"==":return w==E;case"===":return w===E;case"!=":return w!=E;case"!==":return w!==E;case">":return w>E;case">=":return w>=E;case"<":return w<E;case"<=":return w<=E;case"in":return w in E;default:throw`Expression evaluator does not support operator '${v.operator}' operator`}case"ConditionalExpression":return n=e,r=t,i8(n.test,r)?i8(n.consequent,r):i8(n.alternate,r);case"CallExpression":return so(se(e,t));case"ArrowFunctionExpression":let x;return a=e,o=t,x=a.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<x.length)throw`Required argument(s) ${x.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(x.reduce((t,n,r)=>{let a=e[r];return function e(t){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"function"==typeof t||null===t||t instanceof RegExp)return!0;if("object"==typeof t){for(let n of Object.keys(t))if(!e(t[n]))return!1;return!0}if(Array.isArray(t)){for(let n of t)if(!e(n))break}return!1}(a)&&t.push([n,a]),t},[]));return i8(a.body,o.addVariables(t))}).bind(null);case"MemberExpression":return so(st(e,t));case"ArrayExpression":return i=e,s=t,i.elements?.map(si(s));case"SequenceExpression":let D;return l=e,u=t,(D=l.expressions.map(si(u)))[D.length-1];case"NewExpression":var _=e,k=t;if(_.callee&&"Identifier"===_.callee.type){let e=_.arguments?.map(si(k));switch(_.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${_.callee.name}`}}if(_.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return e.value;case"Identifier":return c=e,d=t,(ss(c.name),d.variables&&Object.hasOwn(d.variables,c.name))?d.variables[c.name]:Object.hasOwn(d.globals,c.name)?d.globals[c.name]:void 0;case"TemplateLiteral":let S,C;return m=e,p=t,S=m.expressions?.map(si(p))??[],(C=m.quasis?.map(si(p))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+S.join("")+C.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(f=e).cooked,tail:f.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function i7(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return i7(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function se(e,t){let n=sa(e.callee,t);if(n===sr||e.optional&&null==n)return sr;let r=e.arguments?.map(si(t));if(n){if("function"!=typeof n)throw`${sc(e.callee)} is not a function`}else throw`No function named ${sc(e.callee)} is defined in this context`;return n(...r)}function st(e,t){let n=sa(e.object,t);if(n===sr||e.optional&&null==n)return sr;if(null===n)throw TypeError(`TypeError: cannot read properties of null (reading '${su(e.property,t)}')`);if(void 0===n)switch(e.object.type){case"Identifier":{let n=i7(e.object,t);throw ReferenceError(`ReferenceError: ${n} is not defined`)}case"MemberExpression":throw TypeError(`TypeError: cannot read properties of undefined (reading '${su(e.property,t)}')`);default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}if("object"!=typeof n&&"function"!=typeof n&&"string"!=typeof n&&"number"!=typeof n)throw`VisitMemberExpression does not support member access on type ${typeof n}`;let r=e.computed?function(e){if(void 0===e)throw{type:"Illegal property access",message:"No property was supplied to the property access"};if("string"!=typeof e&&"number"!=typeof e)throw{type:"Illegal property access",message:`Cannot use a value of type ${null===e?"null":typeof e} as a property name`};return e}(i8(e.property,t)):function(e){if("Identifier"!==e.type)throw`VisitMemberExpression does not support a property of type '${e.type}'`;return e.name}(e.property);ss(r),function(e,t){if(sl.has(String(t)))return;let n=Object(e);for(;null!==n;){if(Object.hasOwn(n,t)){if(n===Object.prototype||n===Function.prototype)throw{type:"Illegal property access",message:`Cannot access the ${t} property of objects`};return}n=Object.getPrototypeOf(n)}}(n,r);let a=n[r];return"function"==typeof a?a.bind(n):a}function sn(e,t){let n={variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return n.addVariables.bind(n),n}iz.plugins.register({name:"arrow",init(e){e.addBinaryOp("=>",.1,!0),e.hooks.add("gobble-expression",function(t){if(this.gobbleSpaces(),this.code===e.OPAREN_CODE){let n=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let n=this.gobbleBinaryExpression();n||this.throwError("Expected expression after "+e),t.node={type:iG,params:null,body:n};return}}this.index=n}}),e.hooks.add("after-expression",function(t){!function t(n){n&&(Object.values(n).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===n.operator&&(n.type=iG,n.params=n.left?[n.left]:null,n.body=n.right,n.params&&n.params[0].type===e.SEQUENCE_EXP&&(n.params=n.params[0].expressions),delete n.left,delete n.right,delete n.operator))}(t.node)})}}),iz.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let n=t.node;if(n&&"new"===n.operator){n.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(n.argument.type)||this.throwError("Expected new function()"),t.node=n.argument;let r=t.node;for(;r.type===e.MEMBER_EXP||r.type===e.CALL_EXP&&r.callee.type===e.MEMBER_EXP;)r=r.type===e.MEMBER_EXP?r.object:r.callee.object;r.type="NewExpression"}})}}),iz.plugins.register({name:"numbers",init(e){function t(e){return"x"===e||"X"===e?(this.index+=2,[[48,57],[65,70],[97,102]]):"b"===e||"B"===e?(this.index+=2,[[48,49]]):"o"===e||"O"===e||e>="0"&&e<="7"?(this.index+=e<="7"?1:2,[[48,55]]):null}function n(t){let n=this.index,r="",a=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:r+=this.expr.charAt(this.index++)};a(),this.code===e.PERIOD_CODE&&(r+=this.expr.charAt(this.index++),a());let o=this.char;("e"===o||"E"===o)&&(r+=this.expr.charAt(this.index++),("+"===(o=this.char)||"-"===o)&&(r+=this.expr.charAt(this.index++)),a(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")"));let i=this.code;if(e.isIdentifierStart(i))this.throwError("Variable names cannot start with a number ("+r+this.char+")");else if(i===e.PERIOD_CODE){r.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:i,number:r},null,2)}`),this.index=n;return}t.node={type:e.LITERAL,value:parseFloat(r),raw:this.expr.substring(n,this.index)}}e.hooks.add("gobble-token",function(r){if(48===this.code){var a,o,i;let s=this.index,l=this.expr.charAt(this.index+1),u=t.call(this,l);if(!u)return;let c="";for(;a=this.code,o=u,95===a||o.some(([e,t])=>a>=e&&a<=t);)95===this.code?this.index++:c+=this.expr.charAt(this.index++);if(e.isIdentifierPart(this.code)){if(e.isDecimalDigit(this.code)&&e.isDecimalDigit(l.charCodeAt(0))){this.index=s+1,n.call(this,r);return}this.throwError("unexpected char within number")}r.node={type:e.LITERAL,value:parseInt(c,"x"===(i=l)||"X"===i?16:"b"===i||"B"===i?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&n.call(this,r)})}}),iz.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let n=++this.index,r=!1;for(;this.index<this.expr.length;){if(47===this.code&&!r){let r,a=this.expr.slice(n,this.index),o="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)o+=this.char;else break}try{r=new RegExp(a,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:r,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),iz.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:r,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}})}}),iz.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,n=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},r="",a="",o=!1,i=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:a,cooked:r},tail:o});for(;this.index<i;){let i=this.expr.charAt(++this.index);if("`"===i)return this.index+=1,o=!0,s(),e.node=t,n&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===i&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),a="",r="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===i)switch(a+=i,i=this.expr.charAt(++this.index),a+=i,i){case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=i}else r+=i,a+=i}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(n){if((n.node.type===e.IDENTIFIER||n.node.type===e.MEMBER_EXP)&&96===this.code)return n.node={type:"TaggedTemplateExpression",tag:n.node,quasi:t.bind(this)(n,!1)},n.node=this.gobbleTokenProperty(n.node),n.node})}}),iz.addBinaryOp("in",7),iz.addBinaryOp("??",1);let sr=Symbol("optional chain short-circuited");function sa(e,t){switch(e.type){case"MemberExpression":return st(e,t);case"CallExpression":return se(e,t);default:return i8(e,t)}}function so(e){return e===sr?void 0:e}function si(e){return function(t){return null===t?null:i8(t,e)}}function ss(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}let sl=new Set(["toString","valueOf","hasOwnProperty"]);function su(e,t){try{return i7(e,t)}catch{return"<computed>"}}function sc(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}function sd(e){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;let t={globals:{...iY},isLocalExpression:!1,variables:new Set};return sm("string"==typeof e?iz(e):e,t),[...t.variables]}function sm(e,t){switch(e.type){case"UnaryExpression":return r=e,a=t,sm(r.argument,a);case"BinaryExpression":return o=e,i=t,[sm(o.left,i),sm(o.right,i)].filter(Boolean);case"ConditionalExpression":return s=e,l=t,[sm(s.consequent,l),sm(s.test,l),sm(s.alternate,l)].filter(Boolean);case"CallExpression":let n;return u=e,c=t,n=sm(u.callee,c),u.arguments?.map(sp(c)),n;case"ArrowFunctionExpression":var r,a,o,i,s,l,u,c,d,m,p,f,h,g,y,v,b=e,w=t;let E={...w};E.isLocalExpression=!0;let x=b.params?.map(sp(E))??[],D=sm(b.body,E)??[];if(D&&Array.isArray(D))for(let e of D)x.includes(e)||w.variables.add(e);return;case"MemberExpression":var _=e,k=t;if(sm(_.object,k),_.computed)return void sm(_.property,k);let S={...k};S.isLocalExpression=!0,sm(_.property,S);return;case"ArrayExpression":return d=e,m=t,void d.elements?.map(sp(m));case"SequenceExpression":return p=e,f=t,void p.expressions?.map(sp(f));case"NewExpression":return h=e,g=t,void h.arguments?.map(sp(g));case"Literal":case"TemplateElement":return;case"Identifier":var C=e,P=t;if(!(C.name in P.globals))if(P.isLocalExpression)return C.name;else P.variables.add(C.name);return;case"TemplateLiteral":return y=e,v=t,void(y.expressions?.map(sp(v)),y.quasis?.map(sp(v)));default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function sp(e){return function(t){return null===t?null:sm(t,e)}}let sf=V("feature-flags",{flags:function(){let e={};for(let t of Object.keys(localStorage))if(t.startsWith("openmrs:feature-flag:")){let n=t.replace("openmrs:feature-flag:",""),r=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${n}`)||"{}");e[n]={enabled:"true"===localStorage.getItem(t),...r}}return e}()});function sh(e,t,n){sf.setState(r=>({flags:{...r.flags,[e]:{enabled:r.flags[e]?.enabled??!1,label:t,description:n}}}))}function sg(){let e=sf.getState().flags;Object.keys(localStorage).filter(e=>e.startsWith("openmrs:feature-flag:")).forEach(t=>{let n=t.replace("openmrs:feature-flag:","");e[n]||(localStorage.removeItem(t),localStorage.removeItem(`openmrs:feature-flag-meta:${n}`))})}function sy(e){return sf.getState().flags[e].enabled}function sv(e,t){sf.subscribe(n=>{t(n.flags[e].enabled)})}function sb(e,t){sf.setState(n=>({flags:{...n.flags,[e]:{...n.flags[e],enabled:t}}}))}sf.subscribe(e=>{for(let[t,n]of Object.entries(e.flags))localStorage.setItem(`openmrs:feature-flag:${t}`,n.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${t}`,JSON.stringify({label:n.label,description:n.description}))});var sw=e1(function(e,t,n){ez(e,t,n)});let sE=F("extensionsInternal",{slots:{},extensions:{}}),sx=F("extensionRenderings",{renderings:new Map}),sD=()=>V("extensionsInternal",{slots:{},extensions:{}}),s_=()=>V("extensionRenderings",{renderings:new Map});function sk(e){let t=sE.getState(),n=e(t);n!==t&&sE.setState(n)}let sS=null,sC=null;function sP(){let e=sx.getState();return sS&&e===sC||(sS=new Map(e.renderings),sC=e,function(e){for(let t of(sL.clear(),e.values()))sB(t,1);sF=!0}(sS)),sS}function sR(e){sC={renderings:e},sx.setState(sC,!0)}function sT(e){let t=sP();t.has(e.renderingId)||(t.set(e.renderingId,e),sB(e,1),sR(t))}function s$(e){let t=sP(),n=t.get(e);n&&(t.delete(e),sB(n,-1),sR(t))}let sO=()=>V("extensions",{slots:{}}),sN=0,sA=new Set;function sI(e){sN++;try{return e()}finally{if(0==--sN&&sA.size>0){let e=Array.from(sA);for(let t of(sA.clear(),e))sj(t)}}}function sj(e){try{e()}catch(t){console.error(`The extension system's '${e.name}' recomputation failed`,t)}}function sM(e){sN>0?sA.add(e):sj(e)}let sL=new Map,sF=!1;function sB(e,t){let n=JSON.stringify([e.slotName,e.extensionId,e.slotModuleName,e.extensionModuleName]),r=sL.get(n);if(!r){if(t<0)return;sL.set(n,{count:1,record:{slotModuleName:e.slotModuleName,extensionModuleName:e.extensionModuleName,slotName:e.slotName,extensionId:e.extensionId}}),sF=!0;return}r.count+=t,r.count<1&&(sL.delete(n),sF=!0)}function sV(){var e,t;if(sP(),!sF)return;sF=!1;let n=Array.from(sL.values(),({record:e})=>e);n.sort(sU),e=tG.getState().mountedExtensions,t=n,e.length===t.length&&e.every((e,n)=>0===sU(e,t[n]))||tG.setState({mountedExtensions:n})}function sU(e,t){return sW(e.slotName,t.slotName)||sW(e.extensionId,t.extensionId)||sW(e.slotModuleName,t.slotModuleName)||sW(e.extensionModuleName,t.extensionModuleName)}function sW(e,t){return e===t?0:e<t?-1:1}sV(),sx.subscribe(()=>sM(sV));let sH=sD(),sz=sO(),sK=tY(),sG=tX(),sZ=new Set,sY=!1;function sq(e){if(null===e)sZ=null;else if(null!==sZ)for(let t of e)sZ.add(t);sM(sJ)}function sJ(){if(!sY){sY=!0;try{for(let e=1;;e++){let t=sZ;if(null!==t&&0===t.size)return;sZ=new Set;try{!function(e,t,n,r,a,o=null){let i=sz.getState().slots,s={},l=!1,u=Object.entries(r.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[r,c]of Object.entries(e.slots)){let d=i[r];if(d&&o&&!o.has(r)){s[r]=d;continue}let{config:m}=tJ(t,c.name),p=function(e,t,n,r,a,o){let i=function(e,t){let n=e.add||[],r=e.remove||[],a=e.order||[],{extensions:o}=sH.getState();return[...t,...n].filter(e=>!r.includes(e)).sort((e,n)=>s9(e,a,o[s0(e)]?.order,t)-s9(n,a,o[s0(n)]?.order,t))}(n,t.slots[e].attachedIds),s=[];for(let l of i){let{config:i}=t0(r,e,l),u=t1(n,e,l),c=u?sw({},i,u):i,d=s0(l),m=t.extensions[d];if(m){let e=c?.["Display conditions"]?.privileges??m.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!o?.user||!ox(e,o.user))||m.featureFlag&&!a.includes(m.featureFlag))continue;s.push({id:l,name:d,moduleName:m.moduleName,config:c,featureFlag:m.featureFlag,meta:m.meta,displayConditionExpression:c?.["Display conditions"]?.expression||m.displayExpression})}}return s}(r,e,m,n,u,a.session);d&&d.moduleName===c.moduleName&&e3(d.candidateExtensions,p)?s[r]=d:(s[r]={moduleName:c.moduleName,candidateExtensions:p},l=!0)}(l||Object.keys(i).length!==Object.keys(s).length)&&sz.setState({slots:s})}(sH.getState(),sK.getState(),sG.getState(),sf.getState(),op.getState(),t)}catch(e){throw sZ=null===t||null===sZ?null:new Set([...t,...sZ]),e}if(e>=20)return void console.error("The extension system stopped recomputing after 20 passes because something keeps invalidating slots in response to the extension store being written. Some slots are left stale until the next write.")}}finally{sY=!1}}}function sX(e,t){let n=new Set;for(let r of Object.keys(e))e[r]!==t[r]&&n.add(r);for(let r of Object.keys(t))r in e||n.add(r);return n}function sQ(e,t){return{moduleName:t,name:e,attachedIds:[]}}function s0(e){let[t]=e.split("#");return t}function s1(e,t){let n=s0(t);return e.extensions[n]}function s4(e){return s1(sH.getState(),e)}sH.subscribe((e,t)=>{sq(e.extensions!==t.extensions?null:sX(e.slots,t.slots))}),sK.subscribe((e,t)=>{sq(sX(e.slots,t.slots))}),sG.subscribe((e,t)=>{sq(sX(e.configs,t.configs))}),sf.subscribe(()=>sq(null)),op.subscribe(()=>sq(null)),sq(null);let s2=e=>sk(t=>({...t,extensions:{...t.extensions,[e.name]:{...e}}}));function s3(e,t){sk(n=>{let r=n.slots[e];return r?{...n,slots:{...n.slots,[e]:{...r,attachedIds:[...r.attachedIds,t]}}}:{...n,slots:{...n.slots,[e]:{...sQ(e),attachedIds:[t]}}}})}function s6(e,t){sk(n=>{let r=n.slots[e];return r&&r.attachedIds.includes(t)?{...n,slots:{...n.slots,[e]:{...r,attachedIds:r.attachedIds.filter(e=>e!==t)}}}:n})}function s5(e){sk(t=>{let n=t.slots[e];return n?{...t,slots:{...t.slots,[e]:{...n,attachedIds:[]}}}:t})}function s9(e,t,n,r){let a=t.indexOf(e);if(-1!==a)return a;{if(void 0!==n)return 1e3+n;let t=r.indexOf(e);return -1!==t?2e3+t:3e3}}function s8(e,t){return function(e,t,n=null,r){let a;return e.filter(e=>{let o=e.displayConditionExpression;if("string"!=typeof o||0===o.trim().length)return!0;a??(a=t&&"object"==typeof t?{session:n,...t}:{session:n});try{return!!iX(o,a)}catch(t){return console.error(`Error while evaluating expression '${o}' for ${e.id}`+(r?` in ${r}`:""),t),!1}})}(s7(e),t,op.getState().session,e)}function s7(e){return sz.getState().slots[e]?.candidateExtensions??[]}let le=(e,t)=>sH.setState(n=>{let r=n.slots[t]?.moduleName;if(r&&r!=e)return console.warn(`An extension slot with the name '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${r}.`),n;if(r&&r==e)return n;if(n.slots[t])return{...n,slots:{...n.slots,[t]:{...n.slots[t],moduleName:e}}};let a=sQ(t,e);return{...n,slots:{...n.slots,[t]:{...a}}}}),lt=()=>{sZ=null,sk(()=>({slots:{},extensions:{}})),s_().setState({renderings:new Map}),sz.setState({slots:{}})},ln=F("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function lr({name:e,basePath:t,mode:n,componentContext:r,state:a}){ln.setState({slotName:e,basePath:t,mode:n??"normal",componentContext:r,state:a})}function la(e){ln.getState().slotName===e&&ln.setState(ln.getInitialState(),!0)}let lo=F("modalRegistry",{modals:{}});function li(e){lo.setState(t=>(t.modals[e.name]=e,t))}function ls(e){let t=lo.getState().modals[e];if(!t){let n=s4(e);n&&(t={name:e,load:n.load,moduleName:n.moduleName},console.warn(`Modal ${e} was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.`),li(t))}return t}let ll=F("workspaceRegistrations",{workspaces:{}}),lu=F("workspaceGroups",{workspaceGroups:{}});function lc(e){ll.setState(t=>({workspaces:{...t.workspaces,[e.name]:{...e,load:e.load,preferredWindowSize:e.preferredWindowSize??"normal",type:e.type??"form",canHide:e.canHide??!1,canMaximize:e.canMaximize??!1,width:e.width??"narrow",groups:e.groups??[]}}}))}function ld(e){lu.setState(t=>{let n=t.workspaceGroups[e.name];return n?{workspaceGroups:{...t.workspaceGroups,[e.name]:{...n,members:Array.from(new Set([...n.members,...e.members]))}}}:{workspaceGroups:{...t.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let lm=new Set;function lp(e){let t=ll.getState().workspaces;if(t[e])return t[e];{let t=s4(e);if(t){var n;let r;return lm.has(e)||(console.warn(`The workspace '${e}' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.`),lm.add(e)),{name:t.name,title:(n=t,"string"==typeof(r=n?.meta?.title)?r:r&&"object"==typeof r?a2(n.moduleName,r.key,r.default):n.name),moduleName:t.moduleName,preferredWindowSize:t.meta?.screenSize??"normal",load:t.load,type:t.meta?.type??"form",canHide:t.meta?.canHide??!1,canMaximize:t.meta?.canMaximize??!1,width:t.meta?.width??"narrow",groups:t.meta?.groups??[]}}throw Error(`No workspace named '${e}' has been registered.`)}}function lf(e){let t=lu.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}let lh=F("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function lg(e){let{registeredWorkspacesByName:t,registeredWindowsByName:n}=lh.getState(),r=t[e];if(r){let t=n[r.window];if(t)return t;throw Error(`No workspace window found with name: ${r.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function ly(e){let{registeredGroupsByName:t,registeredWindowsByName:n}=lh.getState(),r=n[e];if(r){let n=t[r.group];if(n)return n;throw Error(`No workspace group found with name: ${r.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function lv(e){let{openedWindows:t}=lh.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}function lb(e,t){if(0==t.length)return;let{registeredGroupsByName:n}=lh.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace group ${n.name} more than once`);r[n.name]={...n,moduleName:e}}lh.setState({registeredGroupsByName:r})}function lw(e,t){if(0==t.length)return;let{registeredWindowsByName:n}=lh.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace window ${n.name} more than once`);let t={...n,moduleName:e};r[n.name]=t}lh.setState({registeredWindowsByName:r})}function lE(e,t){if(0==t.length)return;let{registeredWorkspacesByName:n}=lh.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace ${n.name} more than once`);let t={...n,moduleName:e};r[n.name]=t}lh.setState({registeredWorkspacesByName:r})}let lx=0,lD=null,l_={bootstrap:15e3,mount:15e3,unmount:15e3};function lk(e,t){if(e.timeouts)return e;let n=e.name??"parcel",r=Object.fromEntries(Object.keys(l_).filter(t=>e[t]).map(r=>{var a,o;let i,s;return[r,(a=e[r],o=l_[r],i=Array.isArray(a)?a:[a],s=e=>i.reduce((t,a,o)=>t.then(()=>{let t=a(e);return"function"==typeof t?.then&&"function"==typeof t?.catch?t:Promise.reject(Error(`Lifecycle function ${r} at array index ${o} for parcel ${n} did not return a promise`))}),Promise.resolve(void 0)),e=>{let a,i=new Promise((e,t)=>{a=setTimeout(()=>t(Error(`Lifecycle function ${r} for parcel ${n} did not settle within ${o}ms`)),o)});return Promise.race([s(e),i]).finally(()=>clearTimeout(a)).then(e=>(t(r,!1),e),e=>{throw t(r,!0),e})})]}));return{...e,...r}}async function lS(e,t){var n,r;let a,o,i,s,l,u=await (lD??(lD=new Promise((e,t)=>{rC({name:"openmrs-extension-host",bootstrap:()=>Promise.resolve(),mount:t=>(e(t.mountParcel),Promise.resolve()),unmount:()=>Promise.resolve()},{domElement:document.createElement("div")}).mountPromise.catch(t)}).catch(e=>(console.error("The host parcel used to mount extensions could not be mounted. Falling back to mounting extensions as root parcels, which leaks their DOM elements.",e),rC))),lD),c={...t},d=(a=c,o=!1,{retarget:e=>a={...e},release:i=()=>(function(e){for(let t of Object.keys(e))delete e[t]})(a),onSettled(e,t){switch(e){case"bootstrap":t&&i();return;case"mount":o||(o=t);return;case"unmount":(t||o)&&i();return}}});return r=u((n=d.onSettled,"function"==typeof e?()=>e().then(e=>lk(e,n)):lk(e,n)),c),s=e=>t=>e.call(r,d.retarget(t)).catch(e=>{throw"SKIP_BECAUSE_BROKEN"===r.getStatus()&&d.release(),e}),l=r.update&&s(r.update),Object.defineProperty(r,"update",{configurable:!0,enumerable:!0,get:()=>l,set:e=>{l=e&&s(e)}})}function lC(){return lP}function lP(e,t){let n,r=lS(e,t).then(e=>n=e);return{mount:()=>r.then(e=>e.mount()),unmount:()=>r.then(e=>e.unmount()),update:e=>r.then(t=>t.update?.(e)),getStatus:()=>n?.getStatus()??"LOADING_SOURCE_CODE",get loadPromise(){return r.then(e=>e.loadPromise)},get bootstrapPromise(){return r.then(e=>e.bootstrapPromise)},get mountPromise(){return r.then(e=>e.mountPromise)},get unmountPromise(){return r.then(e=>e.unmountPromise)}}}async function lR(e,t,n,r,a=e=>e,o={}){let i=s0(r),s=s4(r),l=null;if(e){let u;if(!s)throw Error(`Couldn't find extension '${i}' to attach to '${t}'`);let{meta:c,moduleName:d,load:m}=s,p=lx++,f=`${t}/${r}-${p}`;e.dataset.extensionRenderingId=f;let h=e=>{try{s$(f)}catch(t){console.error(e,t)}};try{sT({renderingId:f,extensionName:i,extensionModuleName:d,extensionId:r,slotName:t,slotModuleName:n})}catch(e){throw h(`Recomputing configuration after registering '${r}' failed also failed`),e}try{u=await m()}catch(e){throw h(`Recomputing configuration after '${r}' failed to load also failed`),e}try{l=await lS(a({...u,name:`${t}/${i}-${p}`}),{...o,_meta:c,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:d,extensionMeta:c},domElement:e})}catch(e){throw h(`Recomputing configuration after '${r}' failed to mount also failed`),e}l.mountPromise.then(void 0,e=>{console.error(`Extension '${r}' in slot '${t}' failed to mount`,e),h(`Recomputing configuration after '${r}' failed to mount also failed`)}),l.unmountPromise.then(()=>h(`Recomputing configuration after unmounting '${r}' failed`),e=>{console.error(`Extension '${r}' in slot '${t}' failed to unmount`,e),h(`Recomputing configuration after '${r}' failed to unmount also failed`)})}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return l}var lT=n(695),l$=n.n(lT);let lO=(0,lT.createContext)({moduleName:"",featureName:""});function lN({to:e,templateParams:t,onBeforeNavigate:n,children:r,...a}){return(0,lT.useEffect)(()=>{a.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${a.href}'`),a.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),l$().createElement("a",{onClick:r=>{0===r.button&&!r.ctrlKey&&!r.shiftKey&&!r.altKey&&!r.metaKey&&(r.preventDefault(),n?.(r),a9({to:e,templateParams:t})),0===r.button&&(r.ctrlKey||r.metaKey)&&n?.(r),0===r.button&&r.shiftKey&&n?.(r),1===r.button&&n?.(r)},href:a6(e,t),...a},r)}let lA=({state:e,children:t,...n})=>{let{extension:r}=(0,lT.useContext)(lO),a=(0,lT.useRef)(null),o=(0,lT.useRef)(Promise.resolve()),i=(0,lT.useRef)(!1),s=(0,lT.useRef)(!1),l=(0,lT.useRef)(e),u=(0,lT.useCallback)(e=>{if(!e)return;let t=()=>{"MOUNTED"===e.getStatus()&&e.unmount()};switch(e.getStatus()){case"MOUNTED":e.unmount();break;case"UPDATING":o.current?.then(t,t);break;default:e.mountPromise.then(t,()=>{})}},[]),c=(0,lT.useCallback)((e,t)=>{e.update&&"UNMOUNTING"!==e.getStatus()&&(o.current=Promise.all([e.mountPromise,o.current]).then(()=>{if(a.current?.getStatus()==="MOUNTED"&&a.current.update)return a.current.update({...t})}).catch(e=>{let t=a.current?.getStatus();"UNMOUNTING"!==t&&"NOT_MOUNTED"!==t&&"UNLOADING"!==t&&console.error(`The extension '${r?.extensionId}' failed to update`,e)}))},[]),d=(0,lT.useCallback)(t=>{t&&!a.current&&!s.current&&r?.extensionSlotName&&r.extensionSlotModuleName&&(s.current=!0,lR(t,r.extensionSlotName,r.extensionSlotModuleName,r.extensionId,void 0,e).then(t=>{(s.current=!1,a.current=t,i.current)?u(t):t&&l.current!==e&&c(t,l.current)},()=>{s.current=!1}))},[]);return(0,lT.useEffect)(()=>(i.current=!1,()=>{i.current=!0,u(a.current)}),[]),(0,lT.useEffect)(()=>{l.current=e,a.current&&c(a.current,e)},[e]),r?l$().createElement("div",{ref:d,"data-extension-id":r?.extensionId,style:{position:"relative"},...n}):null};function lI(e){let t=(0,lT.useRef)(e);return R(t.current,e)||(t.current=e),t.current}function lj(e,t){"function"==typeof t&&(t=t(e));let n={};for(let[r,a]of Object.entries(t)){let t=function(...t){e.setState(e=>a(e,...t))};n[r]=t}return n}let lM=e=>e;function lL(e,t=lM,n){let r=(0,lT.useCallback)(t=>e.subscribe(t),[e]),a=(0,lT.useCallback)(()=>t(e.getState()),[e,t]),o=(0,lT.useSyncExternalStore)(r,a,a),i=(0,lT.useMemo)(()=>n?lj(e,n):null,[e,n]);return(0,lT.useMemo)(()=>i?{...o,...i}:o,[o,i])}function lF(e,t){return lL(e,lM,t)}function lB(e){return function(t){let n=(0,lT.useCallback)(t=>e.subscribe(t),[]),r=(0,lT.useCallback)(()=>e.getState(),[]),a=(0,lT.useSyncExternalStore)(n,r,r),o=(0,lT.useMemo)(()=>t?lj(e,t):null,[t]);return(0,lT.useMemo)(()=>o?{...a,...o}:a,[a,o])}}let lV=[];Object.freeze(lV);let lU={candidateExtensions:lV};Object.freeze(lU);let lW=e=>{let t=(0,lT.useCallback)(t=>t.slots?.[e]??lU,[e]);return lL(sO(),t)},lH=e=>e.session;function lz(e,t){let{candidateExtensions:n}=lW(e),r=lL(op,lH),a=lI(t);return(0,lT.useMemo)(()=>s8(e,a),[e,a,r,n])}function lK(e,t){let{moduleName:n}=(0,lT.useContext)(lO);if(!n)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,lT.useEffect)(()=>{le(n,e)},[n,e]),{extensions:lz(e,t),extensionSlotName:e,extensionSlotModuleName:n}}function lG(e){return e}function lZ({name:e,extensionSlotName:t,select:n=lG,children:r,state:a,style:o,...i}){if(r&&a)throw Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");let s=e??t,l=(0,lT.useRef)(null),{extensions:u,extensionSlotModuleName:c}=lK(s,a),d=(0,lT.useMemo)(()=>n(u),[n,u]),m=(0,lT.useMemo)(()=>{if("function"==typeof r&&!l$().isValidElement(r))return d.map(e=>r(e,a))},[r,d]);return l$().createElement("div",{ref:l,"data-extension-slot-name":s,"data-extension-slot-module-name":c,style:{...o,position:"relative"},...i},s&&d?.map((e,t)=>l$().createElement(lO.Provider,{key:e.id,value:{moduleName:c,featureName:"",extension:{extensionId:e.id,extensionSlotName:s,extensionSlotModuleName:c,extensionMeta:e.meta}}},m?.[t]??("function"!=typeof r?r:null)??l$().createElement(lA,{state:a}))))}var lY=n(5338);function lq(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 lJ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lq(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],a in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lq(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lX(e){return(lX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lQ(e){return(lQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l0(e,t){var n;if("function"!=typeof(n=t.domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(t.name,"'. Expected a function, received ").concat(lQ(n)));return function(){var e=n(t);if(!(e instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(t.name,"'. Expected HTMLElement, received ").concat(lQ(e)));return e}}var l1=null;try{l1=require("react").createContext()}catch(e){}var l4={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function l2(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function l3(e,t){return new Promise(function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||e.errorBoundaryClass||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var a,o=l8(e,t,function(){n(this)}),i=l0(e,t)(),s=function(e){var t=e.reactDom,n=e.renderType,r=e.elementToRender,a=e.domElement,o=t[n];if("function"!=typeof o)throw Error('renderType "'.concat(n,'" did not return a function.'));switch(n){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=o(a);return i.render(r),i;case"hydrateRoot":return o(a,r);default:return o(r,a),null}}({elementToRender:o,domElement:i,reactDom:l9(e),renderType:"function"==typeof(a=e).renderType?a.renderType():a.renderType});e.domElements[t.name]=i,e.renderResults[t.name]=s})}function l6(e,t){return new Promise(function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():l9(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function l5(e,t){return new Promise(function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=l8(e,t,null),a=e.renderResults[t.name];if(a&&a.render)a.render(r);else{var o=l0(e,t)();l9(e).render(r,o)}})}function l9(e){return e.ReactDOMClient||e.ReactDOM}function l8(e,t,n){var r=e.React.createElement(e.rootComponent,t),a=l1?e.React.createElement(l1.Provider,{value:t},r):r;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function n(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return n.prototype=Object.create(e.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},n}(e,t),a=e.React.createElement(e.errorBoundaryClass,t,a)),a=e.React.createElement(e.SingleSpaRoot,lJ(lJ({},t),{},{mountFinished:n,updateFinished:function(){e.updateResolves[t.name]&&(e.updateResolves[t.name].forEach(function(e){return e()}),delete e.updateResolves[t.name])},unmountFinished:function(){e.unmountResolves[t.name]&&(e.unmountResolves[t.name](),delete e.unmountResolves[t.name])}}),a)}var l7=n(287),ue=n(3),ut=n.n(ue),un=n(2108);let ur={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},ua=new Map;(0,un.initCache)(ua);let uo={errorRetryCount:3,fetcher:od,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof om){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>ua};function ui(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},ur,e),n={...uo,...t.swrConfig};return function(e){var r,a,o,i,s;return o=a=class extends(r=l$().Component){componentDidCatch(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:n})}render(){if(this.state.caughtError)return l$().createElement("div",null,"An error has occurred. Please try reloading the page.");{let r=l$().createElement(lT.Suspense,{fallback:null},l$().createElement(ue.SWRConfig,{value:n},l$().createElement(lO.Provider,{value:this.state.config},t.disableTranslations?l$().createElement(e,this.props):l$().createElement(l7.I18nextProvider,{i18n:window.i18next,defaultNS:this.state.config.extension?`${this.state.config.moduleName}___${this.state.config.extension.extensionSlotName}___${this.state.config.extension.extensionId}`:this.state.config.moduleName},l$().createElement(e,this.props)))));return t.strictMode&&l$().StrictMode?l$().createElement(l$().StrictMode,null,r):r}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},i="displayName",s=`OpenmrsReactComponent(${t.featureName})`,i in o?Object.defineProperty(o,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[i]=s,a}}function us(e,t){return function(e){if("object"!==lX(e))throw Error("single-spa-react requires a configuration object");var t,n=lJ(lJ({},l4),e);if(!n.React)throw Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!=(t=n.ReactDOMClient)&&t.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!l1&&n.React.createContext&&(l1=n.React.createContext()),n.SingleSpaRoot=function(e){function t(e){t.displayName="SingleSpaRoot(".concat(e.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},t.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},t.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},t}(n);var r={bootstrap:l2.bind(null,n),mount:l3.bind(null,n),unmount:l6.bind(null,n)};return n.parcelCanUpdate&&(r.update=l5.bind(null,n)),r}({React:l$(),ReactDOMClient:lY,rootComponent:ui(t)(e)})}function ul(e,t){return()=>e().then(({default:e})=>us(e,t))}function uu(e,t){return()=>Promise.resolve(us(e,t))}let uc=ul,ud=N()(()=>({}));B("openmrs-app-context",ud);let um={};function up(e,t=e=>e){let n=ud.getState();return e in n?Object.freeze(Object.assign({},t?t(n[e]):n[e])):null}function uf(e,t){ud.setState(n=>(e in n||(n[e]={}),n[e]=t(n[e]),Object.assign({},n)))}function uh(e){return null===e?null:Object.freeze(Object.assign({},e))}let ug=new Map;function uy(e,t){let n=(0,lT.useRef)(t??{}),r=(0,lT.useRef)(t=>uf(e,t)),a=(0,lT.useRef)(Symbol());return(0,lT.useEffect)(()=>{let n=t??{},r=a.current;return null===up(e)?!function(e,t=um){ud.setState(n=>{if(e in n)throw Error(`Attempted to re-register namespace ${e} in the app context. Each namespace must be unregistered before the name can be registered again.`);return Object.assign({},n,{[e]:t===um?{}:t})})}(e,n):(console.warn(`Namespace ${e} is already registered in the app context. This is likely a race condition during navigation, but may indicate two components are trying to own the same namespace. Updating the existing context.`),uf(e,()=>n)),ug.set(e,r),()=>{ug.get(e)===r&&(ud.setState(t=>(e in t&&delete t[e],t)),ug.delete(e))}},[e]),(0,lT.useEffect)(()=>{let r=t??{};R(n.current,r)||(uf(e,()=>r),n.current=r)},[t]),r.current}function uv({namespace:e,value:t}){return uy(e,t),null}let ub=({children:e,value:t,fallback:n})=>t?l$().createElement(l$().Fragment,null,e):n?l$().createElement(l$().Fragment,null,n):null;function uw(){let e=(0,lT.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,lT.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function uE(e,t=e=>e??{}){let[n,r]=(0,lT.useState)(()=>{if(ux(e))return;let n=up(e);if(null!==n)return t?t(n):n});return(0,lT.useEffect)(()=>{if(ux(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,lT.useEffect)(()=>{var n;let a;return(n=e=>{if(null==e)return void r(void 0);let n=t?t(e):e;r(e=>R(e,n)?e:n)})(uh(a=up(e))),ud.subscribe(t=>{let r=e in t?t[e]:null;r!==a&&(a=r,n(uh(r)))})},[e,t]),n}function ux(e){return"string"!=typeof e||0===e.trim().length}function uD(e){let t=lz(e);return(0,lT.useMemo)(()=>t.map(e=>e.id),[t])}function u_(e){return lW(e).candidateExtensions}function uk(e,t,n){let{data:r,error:a,mutate:o,isLoading:i,isValidating:s}=ut()(e?i_(e,t,n):null,od);return(0,lT.useMemo)(()=>({isLoading:i,data:r?.data.results??[],error:a,mutate:o,isValidating:s}),[r,a,i,s,o])}function uS(e){(0,lT.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}let uC={},uP=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
|
|
16
|
-
Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function uR(e){let{moduleName:t,extension:n}=(0,lT.useContext)(lO),r=e?.externalModuleName??t;if(!r&&!n)throw Error(uP);let a=function(e){let t=(0,lT.useMemo)(()=>tZ(e),[e]),n=function(e){let[t,n]=(0,lT.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,lT.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&n(e.config)}),[e]),t}(t);if(!n)throw uC[e]||(uC[e]=new Promise(e=>{let n=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),n())})})),uC[e];return n}(r),o=function(e){let t=(0,lT.useMemo)(tX,[]),n=function(e,t){let[n,r]=(0,lT.useState)(t?()=>{let n=t0(e.getState(),t.extensionSlotName,t.extensionId);if(n.loaded&&n.config)return n.config}:null);return(0,lT.useEffect)(()=>{if(t)return e.subscribe(e=>{let a=t0(e,t.extensionSlotName,t.extensionId);a.loaded&&a.config&&!e3(a.config,n)&&r(a.config)})},[e,t,n]),n}(t,e);if(!n&&e){let n=`${e.extensionSlotName}-${e.extensionId}`;throw!uC[n]&&t&&(uC[n]=new Promise(n=>{let r=t.subscribe(t=>{let a=t0(t,e.extensionSlotName,e.extensionId);a.loaded&&a.config&&(n(a.config),r())})})),uC[n]}return n||{}}(n);return(0,lT.useMemo)(()=>e?.externalModuleName&&r===e.externalModuleName?{...a}:{...a,...o},[r,e?.externalModuleName,a,o])}let uT=lz;function u$(e,t=300){let[n,r]=(0,lT.useState)(e);return(0,lT.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}var uO=n(1760),uN=n.n(uO);let uA=`custom:${[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]].map(([e,t])=>`${e}:${t}`).join(",")}`;function uI(){let e=`${os}/emrapi/configuration?v=${uA}`,t=uN()(e,od);return(0,lT.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}function uj(){return(0,lT.useContext)(lO).extension}let uM=lB(sD());function uL(e){let t=lz(e);return(0,lT.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}let uF=lB(sO());function uB(e){let{flags:t}=lL(sf);return t[e]?.enabled??!1}function uV(){let[,e]=(0,lT.useState)(0);return(0,lT.useCallback)(()=>{e(e=>e+1)},[])}function uU(e,t,n={}){return uH(e,t,uW,n)}let uW={getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let r=new URL(oc(e.toString()),window.location.toString());return r.searchParams.set("limit",""+t),r.searchParams.set("startIndex",""+n),r.searchParams.set("totalCount","true"),r.toString()}},getNextUrl:e=>{let t=e?.links?.find(e=>"next"==e.rel)?.uri;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.totalCount??NaN,getCurrentPageSize:e=>e?.results?.length??NaN,getData:e=>e?.results};function uH(e,t,n,r={}){let{getPaginatedUrl:a,getTotalCount:o,getCurrentPageSize:i,getData:s}=n,{immutable:l,swrConfig:u}=r,c=r.fetcher??od,[d,m]=(0,lT.useState)(1),p=(0,lT.useRef)(NaN),f=(0,lT.useRef)(NaN),h=(0,lT.useRef)(d),g=(0,lT.useRef)(!1),y=(0,lT.useRef)(!1),v=e?.toString()??"",[b,w]=(0,lT.useState)(v);v!==b&&(w(v),m(1),h.current=1,p.current=NaN,f.current=NaN,g.current=!1,y.current=!1);let E=(d-1)*t,x=(0,lT.useMemo)(()=>a(e,t,E),[e,t,E]),{data:D,..._}=(l?uN():ut())(x,c,u);D?.data&&(p.current=o(D?.data),f.current=i(D?.data),g.current=!0);let k=Math.ceil(p.current/t),S=(0,lT.useCallback)(e=>{if(!Number.isInteger(e)||e<1)return void console.warn(`useServerPagination: ignoring goTo(${e}); page must be a positive integer.`);let n=Math.ceil(p.current/t);!g.current||Number.isNaN(n)||e<=n?(h.current=e,m(e)):console.warn("Invalid attempt to go to out of bounds page: "+e)},[t]);(0,lT.useEffect)(()=>{if(!g.current)return;if(Number.isNaN(p.current)){y.current||(y.current=!0,console.warn(`useServerPagination: ${v} returned no total count, so out-of-range pages cannot be detected.`));return}let e=Math.max(1,Math.ceil(p.current/t));d>e&&(console.warn(`Invalid attempt to go to out of bounds page: ${d}; returning to page ${e}.`),h.current=e,m(e))},[d,t,v,D]);let C=(0,lT.useCallback)(()=>{S(h.current+1)},[S]),P=(0,lT.useCallback)(()=>{S(h.current-1)},[S]);return{data:s(D?.data),totalPages:k,totalCount:p.current,currentPage:d,currentPageSize:f.current,paginated:k>1,showNextButton:d<k,showPreviousButton:d>1,goTo:S,goToNext:C,goToPrevious:P,..._}}function uz(e,t,n={}){return uH(e,t,uK(),n)}function uK(){return{getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let r=new URL(oc(e.toString()),window.location.toString());return r.searchParams.set("_count",""+t),r.searchParams.set("_getpagesoffset",""+n),r.toString()}},getNextUrl:e=>{let t=e?.link?.find(e=>"next"==e.relation)?.url;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.total??NaN,getCurrentPageSize:e=>e?.entry?.length??NaN,getData:e=>e?.entry?.map(e=>e.resource)}}var uG=n(9366),uZ=n.n(uG);function uY(e,t={}){return uq(e,uW,t)}function uq(e,t,n={}){let{swrInfiniteConfig:r,immutable:a}=n,{getNextUrl:o,getTotalCount:i,getData:s}=t,l=n.fetcher??od,u=(0,lT.useCallback)((n,r)=>0==n?e?.toString()??null:t.getNextUrl(r.data),[e]),{data:c,size:d,setSize:m,...p}=uZ()(u,l,{...r,...a?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),f=o(c?.[c.length-1].data),h=i(c?.[0]?.data);return{data:c?.flatMap(e=>s(e.data)),totalCount:h,hasMore:null!=f,loadMore:()=>{m((c?.length??0)+1)},nextUri:f,...p}}function uJ(e,t={}){return uX(e,uW,t)}function uX(e,t,n={}){let r=uq(e,t,n),{hasMore:a,error:o,data:i,loadMore:s,isLoading:l,nextUri:u}=r;return((0,lT.useEffect)(()=>{a&&!o&&s()},[a,u]),n.partialData)?r:{...r,data:a||o?void 0:i,isLoading:l||a}}function uQ(e,t={}){return uX(e,uK(),t)}function u0(e,t={}){return uq(e,uK(),t)}function u1(){let e="tablet";return document.body.classList.forEach(t=>{switch(t){case"omrs-breakpoint-lt-tablet":e="phone";break;case"omrs-breakpoint-gt-small-desktop":e="large-desktop";break;case"omrs-breakpoint-gt-tablet":e="small-desktop"}}),e}function u4(){let[e,t]=(0,lT.useState)(u1);return(0,lT.useEffect)(()=>{let e=()=>{t(u1())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let u2=e=>"small-desktop"===e||"large-desktop"===e;function u3(e){let t=(0,lT.useContext)(lO);(0,lT.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),lr(e),()=>{la(e.name)}),[t,e])}function u6(){return lL(ln)}let u5=[];function u9(e=null,t=null){let n=new URLSearchParams;e&&n.set("tag",e),t&&n.set("q",t);let r=n.toString(),{data:a}=uJ(`${os}/location${r?"?"+r:""}`,{immutable:!0});return a??u5}function u8(e,t=!0){let n=(0,lT.useRef)(null);return(0,lT.useEffect)(()=>{let r=r=>{t&&n.current&&r.target&&r.target instanceof Node&&(n.current.contains(r.target)||e(r))};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}},[e,t]),n}function u7(e){let t=(0,lT.useRef)();return(0,lT.useEffect)(()=>{let n=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting)return void e()},{threshold:1});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current,e]),t}function ce(e,t={}){let{abortController:n,fetchInit:r,url:a,swrConfig:o}=t,i=uw(),s=(0,lT.useMemo)(()=>r?.signal??n?.signal??i.signal,[n?.signal,r?.signal,i.signal]),l=(0,lT.useCallback)(e=>od(function(e,t){if(t)return"function"==typeof t?t(e):t;if("string"==typeof e)return e;throw Error(`When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ${e}.`)}(e,a),{...r,signal:s}),[s,r,a]);return ut()(e,l,o)}function ct(e=[],t=10){let[n,r]=(0,lT.useState)(1),a=(0,lT.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]);n>a&&r(a);let o=Math.min(Math.max(1,n),a),i=(0,lT.useMemo)(()=>{let n=(o-1)*t,r=(o+0)*t;return e.slice(n,r)},[e,o,t]),s=(0,lT.useCallback)(e=>{!Number.isInteger(e)||e<1?console.warn(`usePagination: ignoring goTo(${e}); page must be a positive integer.`):r(e)},[]),l=(0,lT.useCallback)(()=>{r(e=>e+1)},[]),u=(0,lT.useCallback)(()=>{r(e=>Math.max(1,e-1))},[]);return(0,lT.useMemo)(()=>({results:i,totalPages:a,currentPage:o,paginated:e.length>t,showNextButton:o<a,showPreviousButton:o>1,goTo:s,goToNext:l,goToPrevious:u}),[i,a,e.length,t,o,s,l,u])}function cn(e,t,n,r){return{pageSizes:(0,lT.useMemo)(()=>{let n=Math.ceil(t/e);return isNaN(n)&&(n=0),[...Array(n).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,lT.useMemo)(()=>e>t?t:e*n>t?e*(n-1)+r:e*n,[e,t,n,r])}}function cr(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function ca(e){let[t,n]=(0,lT.useState)(e??cr()),{data:r,error:a,isValidating:o}=ut()(t?["patient",t]:null,()=>iC(t,{}));return(0,lT.useEffect)(()=>{let e=()=>{let e=cr();e!==t&&n(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,lT.useMemo)(()=>({isLoading:o&&!a&&!r,patient:r,patientUuid:t,error:a}),[o,a,r,t])}function co(){let e=`${os}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:n,isLoading:r}=ut()(e,od);return(0,lT.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:r,error:n}),[t,n,r])}function ci(e){let{extensions:t,extensionSlotModuleName:n}=lK(e);return e?t.map(t=>({state:r})=>l$().createElement(lO.Provider,{value:{moduleName:n,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:n,extensionMeta:t.meta}}},l$().createElement(lA,{state:r}))):[]}function cs(){let e=(0,lT.useRef)(),[t,n]=(0,lT.useState)(null),r=null;if(!t){if(o){let e=ov().getState();e.loaded&&(r=e.session)}else o=new Promise(t=>{let n=({loaded:n,session:a})=>{n&&(t(a),r=a,e.current&&(e.current(),e.current=void 0))};n(ov().getState()),r||(e.current=ov().subscribe(n))});if(r)n(r);else throw o}(0,lT.useEffect)(()=>(e.current||(e.current=ov().subscribe(({loaded:e,session:t})=>{e&&(r=t,n(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let a=t||r;if(!a)if(o)throw console.warn("useSession is in an unexpected state. Attempting to recover."),o;else throw Error("useSession is in an invalid state.");return a}let cl=({privilege:e,fallback:t,children:n})=>{let[r,a]=(0,lT.useState)(null);return((0,lT.useEffect)(()=>{let e=ov(),t=e.subscribe(({loaded:e,session:t})=>{a(e?t?.user??null:null)}),{loaded:n,session:r}=e.getState();return n&&a(r?.user??null),t},[]),r&&ox(e,r))?l$().createElement(l$().Fragment,null,n):t?l$().createElement(l$().Fragment,null,t):null};var cu=n(2542),cc=n.n(cu),cd=n(7581);let cm=new Map;function cp(){for(let e of Array.from(cm.values()))e()}let cf={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid}};function ch(e){let t=(0,lT.useId)();return(0,lT.useEffect)(()=>{if(e)return cm.set(t,e),()=>{cm.delete(t)}},[t,e]),{...lF(iF(),cf),mutateVisit:cp}}function cg(e,t=iM){let n=(0,lT.useRef)(void 0),{patientUuid:r,manuallySetVisitUuid:a,setVisitContext:o}=ch((0,lT.useCallback)(()=>n.current?.(),[])),i=e&&r==e?a:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${i}?v=${t}`,{data:u,error:c,mutate:d,isValidating:m}=ut()(e?`${os}/visit${s}`:null,od),{data:p,error:f,mutate:h,isValidating:g}=ut()(e&&i?`${os}/visit${l}`:null,od),y=(0,lT.useMemo)(()=>u?.data.results.find(e=>null===e.stopDatetime)??null,[u]),v=(0,lT.useMemo)(()=>i&&p?p.data:null,[p,i]),b=(0,lT.useRef)(null);(0,lT.useEffect)(()=>{!m&&y&&r===e&&null===a&&o(y),g||(b.current&&v&&b.current.uuid===v.uuid&&!b.current.stopDatetime&&v.stopDatetime&&o(null),b.current=v)},[v,a,y,m,g,r]);let w=(0,lT.useCallback)(()=>{d(),h()},[d,h]);(0,lT.useEffect)(()=>{n.current=w},[w]);let E=!!(!u||i&&!p),x=!!(i?f:c);return{error:c||f,mutate:w,isValidating:m||g,activeVisit:y,currentVisit:v,currentVisitIsRetrospective:!!i,isLoading:E&&!x}}cc().extend(cd);let cy=[];function cv(){let{data:e}=uN()(iN,iA);return e??cy}let cb=new Map;async function cw(e,t){let n=t.indexOf("#"),r=n>=0,a=r?t.substring(0,n):e,o=r?t.substring(n+1):t,i=await o6(a);return i&&Object.hasOwn(i,o)&&"function"==typeof i[o]?cx(a,i).then(()=>i[o]()):(i?i&&Object.hasOwn(i,o)?console.warn(`The export ${t}, defined in ${e}'s routes.json, is not a function`):console.warn(`${a} does not define a component called "${o}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${a} for ${t} defined in ${e}'s routes.json`),cE)}let cE={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function cx(e,t){if(e in cb)await cb[e];else{let n=t??await o6(e);await (cb[e]=new Promise((t,r)=>{if(Object.hasOwn(n,"startupApp")){let a=n.startupApp;if("function"==typeof a)return Promise.resolve(a()).then(()=>{nd(e),t(null)}).catch(r)}nd(e),t(null)}))}}function cD(e,t){let n=t.name;if(!n)return void console.error(`An extension definition in ${e} is missing an name and thus cannot be
|
|
15
|
+
${this.stack}`}}let of=B("session",{loaded:!1,session:null}),oh=0,og=null;function oy(){return og||(of.getState().loaded&&oh>=Date.now()-6e4?null:oE())}function ov(e){let t=e?.includeAuthStatus??!0,n=e=>t?e:e.user,r=oy();return r?new Promise(e=>{let t=()=>{let t=of.getState();t.loaded&&(a(),e(n(t.session)))},a=of.subscribe(t);r.then(t,t)}):Promise.resolve(n(of.getState().session))}function ob(){return oy(),of}function ow(e){let t=e.locale??e.user?.userProperties?.defaultLocale;t&&t.includes("_")&&(t=t.replaceAll("_","-")),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(t)&&t!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",t)}function oE(e,t){oh=Date.now(),o??(o=oh);let n={};e&&t&&(n.Authorization=`Basic ${window.btoa(`${e}:${t}`)}`);let r=o$(om(oc,{headers:n,rejectAuthFailure:!0})),a=()=>{og===r&&(og=null)};return r.then(a,a),og=r,r}function ox(){of.setState({loaded:!0,session:{authenticated:!1,sessionId:""}},!0)}function oD(e,t){var n,r;if(void 0===t)return!e;if(!e)return!0;return n=e,r=t,("string"==typeof n?!z(r.privileges.find(e=>n===e.display)):Array.isArray(n)?n.every(e=>!z(r.privileges.find(t=>e===t.display))):(z(n)||console.error(`Could not understand privileges "${n}"`),!0))||!z(t.roles.find(e=>"System Developer"===e.display))}function o_(){let e,t;return new Promise(n=>{let r=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};r(of.getState()),e||(t=of.subscribe(r))})}async function ok(){return(await ov()).sessionLocation}async function oS(e,t){return o$(om(oc,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},rejectAuthFailure:!0,signal:t?.signal}))}async function oC(e,t){return await om(oc,{method:"POST",body:{locale:e},headers:{"Content-Type":"application/json"},signal:t?.signal}),oE()}async function oP(e,t,n){return n||(n=new AbortController),await om(`${ol}/user/${e}`,{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:n.signal}),oE()}async function oR(e,t=!1){let n=await om(t?`${oc}?rememberMe=true`:oc,{headers:{"X-Totp-Code":e}});return n.data?.authenticated?(await oE()).session:n.data}async function oT(){try{await om(oc,{method:"DELETE",rejectAuthFailure:!0})}catch(e){if(!oO(e))throw e}ox(),await oE().catch(()=>{})}function o$(e){return new Promise((t,n)=>{e.then(e=>{if("object"==typeof e?.data){let n={loaded:!0,session:e.data};of.setState(n,!0),t(n)}else!function(e){if(!e?.redirected||!e.url)return!1;try{return new URL(e.url,window.location.href).pathname.replace(/\/+$/,"").endsWith("/initialsetup")}catch{return!1}}(e)?n(oN(Error("The session endpoint did not respond with a session"))):n(oN(Error("The server is still starting up"),!0))}).catch(e=>{var r,a;if(oO(e)){"object"==typeof(r=e.responseBody)&&null!==r&&!1===r.authenticated?of.setState({loaded:!0,session:e.responseBody},!0):ox(),t(of.getState());return}(a=e)instanceof op&&502===a.response.status&&!of.getState().loaded&&void 0!==o&&Date.now()-o<18e4?n(oN(e,!0)):(C(`Failed to fetch new session information: ${e}`),n(oN(e)))})})}function oO(e){return e instanceof op&&(401===e.response.status||403===e.response.status)}function oN(e,t=!1){return of.getState().loaded||of.setState({loaded:!1,session:null,error:e instanceof Error?e:Error(String(e)),initializing:t},!0),of.getState()}function oA(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}of.subscribe(e=>{e.loaded&&e.session&&ow(e.session)});let oI={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"};function oj(){nc("@openmrs/esm-api",oi),oE()}let oM="import-map-override:",oL="import-map-overrides-disabled",oF="import-map-overrides:change",oB=!1,oV=null,oU=null;async function oW(){return oU??(oU=oH().then(({map:e,complete:t})=>(t||(oU=null),e))),oU}async function oH(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[],n=!0;for(let r=0;r<e.length;r++){let a=e[r];try{if(a.src){let e=await fetch(a.src);if(!e.ok)throw Error(`Request for ${a.src} returned ${e.status} ${e.statusText}`);t.push(await e.json())}else a.textContent&&t.push(JSON.parse(a.textContent))}catch(e){n=!1,console.warn(`[import-maps] Failed to parse import map from script tag at index ${r}`,e)}}return{map:oz(t),complete:n}}function oz(e){let t={imports:{}};for(let n of e)n?.imports&&Object.assign(t.imports,n.imports);return t}function oK(){let e={};try{let t=oJ();for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);if(r?.startsWith(oM)){let n=r.slice(oM.length);if(!t.includes(n)){let t=localStorage.getItem(r);t&&(e[n]=t)}}}}catch(e){console.warn("[import-maps] Failed to read import-map overrides from localStorage",e)}return{imports:e}}async function oG(){let e=await oW();return oB?oz([e,oV??oK()]):e}async function oZ(){return oW()}async function oY(){return oB?oz([await oW(),oK()]):oW()}function oq(e){if(!oB)return{imports:{}};if(e){let e={};for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(oM)){let t=localStorage.getItem(n);t&&(e[n.slice(oM.length)]=t)}}return{imports:e}}return oK()}function oJ(){if(!oB)return[];try{let e=localStorage.getItem(oL);if(e){let t=JSON.parse(e);if(Array.isArray(t))return t}}catch{}return[]}function oX(e){return!!oB&&oJ().includes(e)}function oQ(e,t){if(!oB)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.setItem(oM+e,t),window.dispatchEvent(new CustomEvent(oF))}catch(e){console.warn("[import-maps] Failed to write import-map override to localStorage",e)}}function o0(e){if(!oB)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.removeItem(oM+e);let t=oJ().filter(t=>t!==e);t.length>0?localStorage.setItem(oL,JSON.stringify(t)):localStorage.removeItem(oL),window.dispatchEvent(new CustomEvent(oF))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}function o1(){if(!oB)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(oM)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),localStorage.removeItem(oL),window.dispatchEvent(new CustomEvent(oF))}catch(e){console.warn("[import-maps] Failed to clear import-map overrides from localStorage",e)}}function o4(e){if(!oB)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let t=oJ().filter(t=>t!==e);t.length>0?localStorage.setItem(oL,JSON.stringify(t)):localStorage.removeItem(oL),window.dispatchEvent(new CustomEvent(oF))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}let o2=!1;function o3(){!o2&&(o2=!0,(oB="development"===window.spaEnv)&&(oV=oK()))}function o6(e){return e.replace(/[\/\-@]/g,"_")}async function o5(e,t="./start",r){var a;let o,i=!r?.maxLoadingTime||r.maxLoadingTime<=0?6e5:r.maxLoadingTime;await Promise.race([o9(e,r?.importMap),new Promise((t,n)=>{o=setTimeout(()=>{var t;n(Error(`Could not resolve requested script, ${e}, within ${(t=i)<1e3?`${t} milliseconds`:t<6e4?`${Math.floor(t/1e3)} seconds`:t<36e5?`${Math.floor(t/6e4)} minutes`:t<864e5?`${Math.floor(t/36e5)} hours`:`${Math.floor(t/864e5)} days`}.`))},i)})]),o&&clearTimeout(o);let s=o6(e),l=window[s];if(!("object"==typeof(a=l)&&null!==a&&"init"in a&&"function"==typeof a.init&&"get"in a&&"function"==typeof a.get)){let e=`The global variable ${s} does not refer to a federated module`;throw console.error(e),Error(e)}l.init(n.S.default);let u=(await l.get(t))();if("object"!=typeof u||null===u){let t=`Container for ${e} did not return an ESM module as expected`;throw console.error(t),Error(t)}return u}async function o9(e,t){if("string"!=typeof e||0===e.trim().length){let e="Attempted to call importDynamic() without supplying a package to load";throw console.error(e),Error(e)}let n=o6(e);if(!window[n]){let n=t??await o8();if(!n.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let r=n.imports[e];r.startsWith("./")&&(r=window.spaBase+r.substring(1));let a=e in oq().imports;try{return await function(e){var t;let n=(t=window)[o7]??(t[o7]=new Map),r=n.get(e);if(r)return r;if(document.head.querySelector(`script[src="${e}"]`))return console.warn(`Script at ${e} already loaded. Not loading it again.`),Promise.resolve();let a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!0;let o=new Promise((t,r)=>{let o=setTimeout(()=>{console.error(`The script at ${e} did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration.`)},5e3);function i(){clearTimeout(o),a.removeEventListener("load",s),a.removeEventListener("error",l)}function s(){i(),t()}function l(t){i(),n.delete(e),a.remove();let o=`Failed to load script from ${e}`;console.error(o,t),r(t.message??o)}a.addEventListener("load",s),a.addEventListener("error",l),document.head.appendChild(a)});return n.set(e,o),o}(r)}catch(e){return a&&E({kind:"error",title:a6("scriptLoadingFailed","Error: Script failed to load"),description:a6("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:r}),actionButtonLabel:a6("resetOverrides","Reset overrides"),onActionButtonClick(){o1(),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function o8(){return oG()}let o7=Symbol.for("__openmrs_script_loading");function ie(e){return!!e&&"object"==typeof e&&!(Object.hasOwn(e,"pages")&&(!e.pages||!Array.isArray(e.pages))||Object.hasOwn(e,"extensions")&&(!e.extensions||!Array.isArray(e.extensions))||Object.hasOwn(e,"workspaces")&&(!e.workspaces||!Array.isArray(e.workspaces))||Object.hasOwn(e,"modals")&&(!e.modals||!Array.isArray(e.modals)))}function it(e){return!!e&&"object"==typeof e&&"routes"in e&&!!e.routes&&"object"==typeof e.routes&&Object.entries(e.routes).every(([e,t])=>"string"==typeof e&&ie(t))}let ir="openmrs-routes:",ia="openmrs-routes:change",io=!1,ii=null,is=null;async function il(){return is??(is=iu().then(({map:e,complete:t})=>(t||(is=null),e))),is}async function iu(){let e=document.querySelectorAll("script[type='openmrs-routes']"),t=[],n=!0;for(let r=0;r<e.length;r++){let a=e[r];try{let e;if(a.src){let t=await fetch(a.src);if(!t.ok)throw Error(`Request for ${a.src} returned ${t.status} ${t.statusText}`);e=await t.json()}else a.textContent&&(e=JSON.parse(a.textContent));e&&it(e)&&t.push(e)}catch(e){n=!1,console.warn(`[route-maps] Failed to parse routes from script tag at index ${r}`,e)}}return{map:ic(t),complete:n}}function ic(e){let t={routes:{}};for(let n of e)n&&"object"==typeof n&&!Array.isArray(n)&&(Object.assign(t.routes,n.routes),void 0===t.version&&void 0!==n.version&&(t.version=n.version));return t}async function id(){let e={version:void 0,routes:{}};try{let t=[];for(let e=0;e<localStorage.length;e++){let n=localStorage.key(e);if(n?.startsWith(ir)){let e=localStorage.getItem(n);e&&t.push({moduleName:n.slice(ir.length),raw:e})}}for(let n of(await Promise.allSettled(t.map(async({moduleName:e,raw:t})=>{let n=JSON.parse(t);if(ie(n))return{moduleName:e,routes:n};if("string"==typeof n&&n.startsWith("http")){let t=await fetch(n),r=await t.json();if(ie(r))return{moduleName:e,routes:r};throw Error(`${n} did not resolve to a valid OpenmrsAppRoutes object`)}throw Error(`Override for ${e} is neither a valid routes object nor a URL`)}))))"fulfilled"===n.status?e.routes[n.value.moduleName]=n.value.routes:console.warn("[route-maps] Failed to load route override",n.reason)}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}async function im(){let e=await il();return io?ic([e,ii??await id()]):e}async function ip(){return il()}async function ih(){return io?ic([await il(),await id()]):il()}function ig(){if(!io)return{};let e={};try{for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(ir)){let t=localStorage.getItem(n);t&&(e[n.slice(ir.length)]=t)}}}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}function iy(e,t){if(!io)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{if("string"==typeof t)if(t.startsWith("http"))localStorage.setItem(ir+e,JSON.stringify(t));else{let n=JSON.parse(t);if(!ie(n))return void console.error(`The supplied routes for ${e} is not a valid OpenmrsAppRoutes object`,t);localStorage.setItem(ir+e,JSON.stringify(n))}else if(t instanceof URL)localStorage.setItem(ir+e,JSON.stringify(t.toString()));else{if(!ie(t))return void console.error(`Override for ${e} is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL`,t);localStorage.setItem(ir+e,JSON.stringify(t))}window.dispatchEvent(new CustomEvent(ia))}catch(e){console.warn("[route-maps] Failed to write route override to localStorage",e)}}function iv(e){if(!io)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{localStorage.removeItem(ir+e),window.dispatchEvent(new CustomEvent(ia))}catch(e){console.warn("[route-maps] Failed to remove route override from localStorage",e)}}function ib(){if(!io)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(ir)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),window.dispatchEvent(new CustomEvent(ia))}catch(e){console.warn("[route-maps] Failed to clear route overrides from localStorage",e)}}let iw=null;function iE(){return iw||(iw=(io="development"===window.spaEnv)?id().then(e=>{ii=e}):Promise.resolve())}let ix=`${ol}/attachment`;function iD(e,t){return om(`${ix}/${e}`,{signal:t.signal})}function i_(e,t,n,r){return om(ik(e,t,r),{signal:n.signal})}function ik(e,t,n){return n?`${ix}?patient=${e}&encounter=${n}`:`${ix}?patient=${e}&includeEncounterless=${t}`}async function iS(e,t,n){let r=new FormData;return r.append("fileCaption",t.fileDescription),r.append("patient",e),n&&r.append("encounter",n),t.file?r.append("file",t.file,t.fileName):(r.append("file",new File([""],t.fileName),t.fileName),r.append("base64Content",t.base64Content)),om(`${ix}`,{method:"POST",body:r})}function iC(e,t){return om(`${ix}/${e}`,{method:"DELETE",signal:t.signal})}async function iP(e,t){return e?(await om(`${ou}/Patient/${e}`,t)).data:null}function iR(e,t){let n=new CustomEvent(`openmrs:${e}`,{detail:t??void 0,cancelable:!0,bubbles:!0});return window.dispatchEvent(n)}function iT(e,t){let n=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,n),()=>{window.removeEventListener(`openmrs:${e}`,n)}}function i$(e){return{uuid:e.uuid,display:e.display}}function iO(e=null,t=null){let n=new URLSearchParams;e&&n.set("tag",e),t&&n.set("q",t);let r=n.toString();return om(`${ol}/location${r?"?"+r:""}`).then(e=>e.data.results.map(i$))}function iN(e){return{uuid:e.uuid,display:e.display,name:e.name}}let iA=`${ol}/visittype`;function iI(e=iA){return om(e).then(e=>e.data.results.map(iN))}var ij=((q={}).NEWVISIT="startVisit",q.EDITVISIT="editVisit",q.LOADING="loadingVisit",q),iM=((J={}).NOTSTARTED="notStarted",J.ONGOING="ongoing",J);let iL="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",iF=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};function iB(){return U("visit",iF)}function iV(e,t){iB().setState({patientUuid:e,manuallySetVisitUuid:t})}function iU(e,t){return om(`${ol}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function iW(e,t,n){return om(`${ol}/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function iH(e,t,n){return om(`${ol}/visit?patient=${e}&v=${n??iL}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}iB().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});class iz{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+iz.version}static addUnaryOp(e){return iz.max_unop_len=Math.max(e.length,iz.max_unop_len),iz.unary_ops[e]=1,iz}static addBinaryOp(e,t,n){return iz.max_binop_len=Math.max(e.length,iz.max_binop_len),iz.binary_ops[e]=t,n?iz.right_associative.add(e):iz.right_associative.delete(e),iz}static addIdentifierChar(e){return iz.additional_identifier_chars.add(e),iz}static addLiteral(e,t){return iz.literals[e]=t,iz}static removeUnaryOp(e){return delete iz.unary_ops[e],e.length===iz.max_unop_len&&(iz.max_unop_len=iz.getMaxKeyLen(iz.unary_ops)),iz}static removeAllUnaryOps(){return iz.unary_ops={},iz.max_unop_len=0,iz}static removeIdentifierChar(e){return iz.additional_identifier_chars.delete(e),iz}static removeBinaryOp(e){return delete iz.binary_ops[e],e.length===iz.max_binop_len&&(iz.max_binop_len=iz.getMaxKeyLen(iz.binary_ops)),iz.right_associative.delete(e),iz}static removeAllBinaryOps(){return iz.binary_ops={},iz.max_binop_len=0,iz}static removeLiteral(e){return delete iz.literals[e],iz}static removeAllLiterals(){return iz.literals={},iz}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new iz(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return iz.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!iz.binary_ops[String.fromCharCode(e)]||iz.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return iz.isIdentifierStart(e)||iz.isDecimalDigit(e)}throwError(e){let t=Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(iz.hooks[e]){let n={context:this,node:t};return iz.hooks.run(e,n),n.node}return t}searchHook(e){if(iz.hooks[e]){let t={context:this};return iz.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===iz.SPACE_CODE||e===iz.TAB_CODE||e===iz.LF_CODE||e===iz.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:iz.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],n,r;for(;this.index<this.expr.length;)if((n=this.code)===iz.SEMCOL_CODE||n===iz.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())t.push(r);else if(this.index<this.expr.length){if(n===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,iz.max_binop_len),t=e.length;for(;t>0;){if(iz.binary_ops.hasOwnProperty(e)&&(!iz.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!iz.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,n,r,a,o,i,s,l;if(!(o=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return o;for(a={value:t,prec:iz.binaryPrecedence(t),right_a:iz.right_associative.has(t)},(i=this.gobbleToken())||this.throwError("Expected expression after "+t),r=[o,a,i];t=this.gobbleBinaryOp();){if(0===(n=iz.binaryPrecedence(t))){this.index-=t.length;break}a={value:t,prec:n,right_a:iz.right_associative.has(t)},l=t;let s=e=>a.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;r.length>2&&s(r[r.length-2]);)i=r.pop(),t=r.pop().value,o=r.pop(),e={type:iz.BINARY_EXP,operator:t,left:o,right:i},r.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),r.push(a,e)}for(s=r.length-1,e=r[s];s>1;)e={type:iz.BINARY_EXP,operator:r[s-1].value,left:r[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,n,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"))return this.runHook("after-token",r);if(e=this.code,iz.isDecimalDigit(e)||e===iz.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===iz.SQUOTE_CODE||e===iz.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(e===iz.OBRACK_CODE)r=this.gobbleArray();else{for(n=(t=this.expr.substr(this.index,iz.max_unop_len)).length;n>0;){if(iz.unary_ops.hasOwnProperty(t)&&(!iz.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!iz.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=n;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:iz.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--n)}iz.isIdentifierStart(e)?(r=this.gobbleIdentifier(),iz.literals.hasOwnProperty(r.name)?r={type:iz.LITERAL,value:iz.literals[r.name],raw:r.name}:r.name===iz.this_str&&(r={type:iz.THIS_EXP})):e===iz.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===iz.PERIOD_CODE||t===iz.OBRACK_CODE||t===iz.OPAREN_CODE||t===iz.QUMARK_CODE;){let n;if(t===iz.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==iz.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===iz.OBRACK_CODE?((e={type:iz.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==iz.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===iz.OPAREN_CODE?e={type:iz.CALL_EXP,arguments:this.gobbleArguments(iz.CPAREN_CODE),callee:e}:(t===iz.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),e={type:iz.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),n&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,n;for(;iz.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===iz.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);iz.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if("e"===(t=this.char)||"E"===t){for(e+=this.expr.charAt(this.index++),("+"===(t=this.char)||"-"===t)&&(e+=this.expr.charAt(this.index++));iz.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);iz.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return n=this.code,iz.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(n===iz.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===iz.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:iz.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,n=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===n){r=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return r||this.throwError('Unclosed quote after "'+e+'"'),{type:iz.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(iz.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,iz.isIdentifierPart(e))this.index++;else break;return{type:iz.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],n=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let a=this.code;if(a===e){n=!0,this.index++,e===iz.CPAREN_CODE&&r&&r>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(a===iz.COMMA_CODE){if(this.index++,++r!==t.length){if(e===iz.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===iz.CBRACK_CODE)for(let e=t.length;e<r;e++)t.push(null)}}else if(t.length!==r&&0!==r)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==iz.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return n||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(iz.CPAREN_CODE);if(this.code===iz.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:iz.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:iz.ARRAY_EXP,elements:this.gobbleArguments(iz.CBRACK_CODE)}}}Object.assign(iz,{hooks:new class{add(e,t,n){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(iz),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),iz.max_unop_len=iz.getMaxKeyLen(iz.unary_ops),iz.max_binop_len=iz.getMaxKeyLen(iz.binary_ops);let iK=e=>new iz(e).parse(),iG=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(iz).filter(e=>!iG.includes(e)&&void 0===iK[e]).forEach(e=>{iK[e]=iz[e]}),iK.Jsep=iz,iK.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:r,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}})}});let iZ="ArrowFunctionExpression",iY={Array,Boolean,Symbol,Infinity,NaN,Math,Number,BigInt,String,RegExp,JSON,isFinite,isNaN,parseFloat,parseInt,decodeURI,encodeURI,encodeURIComponent,Object:{__proto__:void 0,assign:Object.assign.bind(null),fromEntries:Object.fromEntries.bind(null),hasOwn:Object.hasOwn.bind(null),keys:Object.keys.bind(null),is:Object.is.bind(null),values:Object.values.bind(null)}},iq={...iY,Promise};function iJ(e,t={}){return i2(e,t,i5)}async function iX(e,t={}){return i3(e,t,i5)}function iQ(e,t={}){return i2(e,t,i9)}function i0(e,t={}){return i3(e,t,i9)}function i1(e,t={}){return i2(e,t,i8)}function i4(e,t={}){return i3(e,t,i8)}function i2(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let r=sr(t,iY),a=i7("string"==typeof e?iK(e):e,r);if(n(a))return a;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}}async function i3(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))return Promise.reject(`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`);if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let r=sr(t,iq);return Promise.resolve(i7("string"==typeof e?iK(e):e,r)).then(t=>{if(n(t))return t;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}})}function i6(e){return iK(e)}function i5(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function i9(e){return"boolean"==typeof e}function i8(e){return"number"==typeof e}function i7(e,t){switch(e.type){case"UnaryExpression":var n,r,a,o,i,s,l,u,c,d,m,p,f,h=e,g=t;let y=i7(h.argument,g);switch(h.operator){case"+":return+y;case"-":return-y;case"~":return~y;case"!":return!y;default:throw`Expression evaluator does not support operator '${h.operator}''`}case"BinaryExpression":var v=e,b=t;switch(v.operator){case"&&":return i7(v.left,b)&&i7(v.right,b);case"||":return i7(v.left,b)||i7(v.right,b);case"??":return i7(v.left,b)??i7(v.right,b)}let w=i7(v.left,b),E=i7(v.right,b);switch(v.operator){case"+":return w+E;case"-":return w-E;case"*":return w*E;case"/":return w/E;case"%":return w%E;case"**":return w**E;case"==":return w==E;case"===":return w===E;case"!=":return w!=E;case"!==":return w!==E;case">":return w>E;case">=":return w>=E;case"<":return w<E;case"<=":return w<=E;case"in":return w in E;default:throw`Expression evaluator does not support operator '${v.operator}' operator`}case"ConditionalExpression":return n=e,r=t,i7(n.test,r)?i7(n.consequent,r):i7(n.alternate,r);case"CallExpression":return si(st(e,t));case"ArrowFunctionExpression":let x;return a=e,o=t,x=a.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<x.length)throw`Required argument(s) ${x.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(x.reduce((t,n,r)=>{let a=e[r];return function e(t){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"function"==typeof t||null===t||t instanceof RegExp)return!0;if("object"==typeof t){for(let n of Object.keys(t))if(!e(t[n]))return!1;return!0}if(Array.isArray(t)){for(let n of t)if(!e(n))break}return!1}(a)&&t.push([n,a]),t},[]));return i7(a.body,o.addVariables(t))}).bind(null);case"MemberExpression":return si(sn(e,t));case"ArrayExpression":return i=e,s=t,i.elements?.map(ss(s));case"SequenceExpression":let D;return l=e,u=t,(D=l.expressions.map(ss(u)))[D.length-1];case"NewExpression":var _=e,k=t;if(_.callee&&"Identifier"===_.callee.type){let e=_.arguments?.map(ss(k));switch(_.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${_.callee.name}`}}if(_.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return e.value;case"Identifier":return c=e,d=t,(sl(c.name),d.variables&&Object.hasOwn(d.variables,c.name))?d.variables[c.name]:Object.hasOwn(d.globals,c.name)?d.globals[c.name]:void 0;case"TemplateLiteral":let S,C;return m=e,p=t,S=m.expressions?.map(ss(p))??[],(C=m.quasis?.map(ss(p))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+S.join("")+C.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(f=e).cooked,tail:f.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function se(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return se(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function st(e,t){let n=so(e.callee,t);if(n===sa||e.optional&&null==n)return sa;let r=e.arguments?.map(ss(t));if(n){if("function"!=typeof n)throw`${sd(e.callee)} is not a function`}else throw`No function named ${sd(e.callee)} is defined in this context`;return n(...r)}function sn(e,t){let n=so(e.object,t);if(n===sa||e.optional&&null==n)return sa;if(null===n)throw TypeError(`TypeError: cannot read properties of null (reading '${sc(e.property,t)}')`);if(void 0===n)switch(e.object.type){case"Identifier":{let n=se(e.object,t);throw ReferenceError(`ReferenceError: ${n} is not defined`)}case"MemberExpression":throw TypeError(`TypeError: cannot read properties of undefined (reading '${sc(e.property,t)}')`);default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}if("object"!=typeof n&&"function"!=typeof n&&"string"!=typeof n&&"number"!=typeof n)throw`VisitMemberExpression does not support member access on type ${typeof n}`;let r=e.computed?function(e){if(void 0===e)throw{type:"Illegal property access",message:"No property was supplied to the property access"};if("string"!=typeof e&&"number"!=typeof e)throw{type:"Illegal property access",message:`Cannot use a value of type ${null===e?"null":typeof e} as a property name`};return e}(i7(e.property,t)):function(e){if("Identifier"!==e.type)throw`VisitMemberExpression does not support a property of type '${e.type}'`;return e.name}(e.property);sl(r),function(e,t){if(su.has(String(t)))return;let n=Object(e);for(;null!==n;){if(Object.hasOwn(n,t)){if(n===Object.prototype||n===Function.prototype)throw{type:"Illegal property access",message:`Cannot access the ${t} property of objects`};return}n=Object.getPrototypeOf(n)}}(n,r);let a=n[r];return"function"==typeof a?a.bind(n):a}function sr(e,t){let n={variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return n.addVariables.bind(n),n}iK.plugins.register({name:"arrow",init(e){e.addBinaryOp("=>",.1,!0),e.hooks.add("gobble-expression",function(t){if(this.gobbleSpaces(),this.code===e.OPAREN_CODE){let n=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let n=this.gobbleBinaryExpression();n||this.throwError("Expected expression after "+e),t.node={type:iZ,params:null,body:n};return}}this.index=n}}),e.hooks.add("after-expression",function(t){!function t(n){n&&(Object.values(n).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===n.operator&&(n.type=iZ,n.params=n.left?[n.left]:null,n.body=n.right,n.params&&n.params[0].type===e.SEQUENCE_EXP&&(n.params=n.params[0].expressions),delete n.left,delete n.right,delete n.operator))}(t.node)})}}),iK.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let n=t.node;if(n&&"new"===n.operator){n.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(n.argument.type)||this.throwError("Expected new function()"),t.node=n.argument;let r=t.node;for(;r.type===e.MEMBER_EXP||r.type===e.CALL_EXP&&r.callee.type===e.MEMBER_EXP;)r=r.type===e.MEMBER_EXP?r.object:r.callee.object;r.type="NewExpression"}})}}),iK.plugins.register({name:"numbers",init(e){function t(e){return"x"===e||"X"===e?(this.index+=2,[[48,57],[65,70],[97,102]]):"b"===e||"B"===e?(this.index+=2,[[48,49]]):"o"===e||"O"===e||e>="0"&&e<="7"?(this.index+=e<="7"?1:2,[[48,55]]):null}function n(t){let n=this.index,r="",a=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:r+=this.expr.charAt(this.index++)};a(),this.code===e.PERIOD_CODE&&(r+=this.expr.charAt(this.index++),a());let o=this.char;("e"===o||"E"===o)&&(r+=this.expr.charAt(this.index++),("+"===(o=this.char)||"-"===o)&&(r+=this.expr.charAt(this.index++)),a(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")"));let i=this.code;if(e.isIdentifierStart(i))this.throwError("Variable names cannot start with a number ("+r+this.char+")");else if(i===e.PERIOD_CODE){r.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:i,number:r},null,2)}`),this.index=n;return}t.node={type:e.LITERAL,value:parseFloat(r),raw:this.expr.substring(n,this.index)}}e.hooks.add("gobble-token",function(r){if(48===this.code){var a,o,i;let s=this.index,l=this.expr.charAt(this.index+1),u=t.call(this,l);if(!u)return;let c="";for(;a=this.code,o=u,95===a||o.some(([e,t])=>a>=e&&a<=t);)95===this.code?this.index++:c+=this.expr.charAt(this.index++);if(e.isIdentifierPart(this.code)){if(e.isDecimalDigit(this.code)&&e.isDecimalDigit(l.charCodeAt(0))){this.index=s+1,n.call(this,r);return}this.throwError("unexpected char within number")}r.node={type:e.LITERAL,value:parseInt(c,"x"===(i=l)||"X"===i?16:"b"===i||"B"===i?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&n.call(this,r)})}}),iK.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let n=++this.index,r=!1;for(;this.index<this.expr.length;){if(47===this.code&&!r){let r,a=this.expr.slice(n,this.index),o="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)o+=this.char;else break}try{r=new RegExp(a,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:r,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?r=!0:r&&this.code===e.CBRACK_CODE&&(r=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),iK.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:r,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=n}}else this.throwError("Expected :")}})}}),iK.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,n=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},r="",a="",o=!1,i=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:a,cooked:r},tail:o});for(;this.index<i;){let i=this.expr.charAt(++this.index);if("`"===i)return this.index+=1,o=!0,s(),e.node=t,n&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===i&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),a="",r="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===i)switch(a+=i,i=this.expr.charAt(++this.index),a+=i,i){case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=i}else r+=i,a+=i}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(n){if((n.node.type===e.IDENTIFIER||n.node.type===e.MEMBER_EXP)&&96===this.code)return n.node={type:"TaggedTemplateExpression",tag:n.node,quasi:t.bind(this)(n,!1)},n.node=this.gobbleTokenProperty(n.node),n.node})}}),iK.addBinaryOp("in",7),iK.addBinaryOp("??",1);let sa=Symbol("optional chain short-circuited");function so(e,t){switch(e.type){case"MemberExpression":return sn(e,t);case"CallExpression":return st(e,t);default:return i7(e,t)}}function si(e){return e===sa?void 0:e}function ss(e){return function(t){return null===t?null:i7(t,e)}}function sl(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}let su=new Set(["toString","valueOf","hasOwnProperty"]);function sc(e,t){try{return se(e,t)}catch{return"<computed>"}}function sd(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}function sm(e){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;let t={globals:{...iq},isLocalExpression:!1,variables:new Set};return sp("string"==typeof e?iK(e):e,t),[...t.variables]}function sp(e,t){switch(e.type){case"UnaryExpression":return r=e,a=t,sp(r.argument,a);case"BinaryExpression":return o=e,i=t,[sp(o.left,i),sp(o.right,i)].filter(Boolean);case"ConditionalExpression":return s=e,l=t,[sp(s.consequent,l),sp(s.test,l),sp(s.alternate,l)].filter(Boolean);case"CallExpression":let n;return u=e,c=t,n=sp(u.callee,c),u.arguments?.map(sf(c)),n;case"ArrowFunctionExpression":var r,a,o,i,s,l,u,c,d,m,p,f,h,g,y,v,b=e,w=t;let E={...w};E.isLocalExpression=!0;let x=b.params?.map(sf(E))??[],D=sp(b.body,E)??[];if(D&&Array.isArray(D))for(let e of D)x.includes(e)||w.variables.add(e);return;case"MemberExpression":var _=e,k=t;if(sp(_.object,k),_.computed)return void sp(_.property,k);let S={...k};S.isLocalExpression=!0,sp(_.property,S);return;case"ArrayExpression":return d=e,m=t,void d.elements?.map(sf(m));case"SequenceExpression":return p=e,f=t,void p.expressions?.map(sf(f));case"NewExpression":return h=e,g=t,void h.arguments?.map(sf(g));case"Literal":case"TemplateElement":return;case"Identifier":var C=e,P=t;if(!(C.name in P.globals))if(P.isLocalExpression)return C.name;else P.variables.add(C.name);return;case"TemplateLiteral":return y=e,v=t,void(y.expressions?.map(sf(v)),y.quasis?.map(sf(v)));default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function sf(e){return function(t){return null===t?null:sp(t,e)}}let sh=U("feature-flags",{flags:function(){let e={};for(let t of Object.keys(localStorage))if(t.startsWith("openmrs:feature-flag:")){let n=t.replace("openmrs:feature-flag:",""),r=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${n}`)||"{}");e[n]={enabled:"true"===localStorage.getItem(t),...r}}return e}()});function sg(e,t,n){sh.setState(r=>({flags:{...r.flags,[e]:{enabled:r.flags[e]?.enabled??!1,label:t,description:n}}}))}function sy(){let e=sh.getState().flags;Object.keys(localStorage).filter(e=>e.startsWith("openmrs:feature-flag:")).forEach(t=>{let n=t.replace("openmrs:feature-flag:","");e[n]||(localStorage.removeItem(t),localStorage.removeItem(`openmrs:feature-flag-meta:${n}`))})}function sv(e){return sh.getState().flags[e].enabled}function sb(e,t){sh.subscribe(n=>{t(n.flags[e].enabled)})}function sw(e,t){sh.setState(n=>({flags:{...n.flags,[e]:{...n.flags[e],enabled:t}}}))}sh.subscribe(e=>{for(let[t,n]of Object.entries(e.flags))localStorage.setItem(`openmrs:feature-flag:${t}`,n.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${t}`,JSON.stringify({label:n.label,description:n.description}))});var sE=e4(function(e,t,n){eK(e,t,n)});let sx=B("extensionsInternal",{slots:{},extensions:{}}),sD=B("extensionRenderings",{renderings:new Map}),s_=()=>U("extensionsInternal",{slots:{},extensions:{}}),sk=()=>U("extensionRenderings",{renderings:new Map});function sS(e){let t=sx.getState(),n=e(t);n!==t&&sx.setState(n)}let sC=null,sP=null;function sR(){let e=sD.getState();return sC&&e===sP||(sC=new Map(e.renderings),sP=e,function(e){for(let t of(sF.clear(),e.values()))sV(t,1);sB=!0}(sC)),sC}function sT(e){sP={renderings:e},sD.setState(sP,!0)}function s$(e){let t=sR();t.has(e.renderingId)||(t.set(e.renderingId,e),sV(e,1),sT(t))}function sO(e){let t=sR(),n=t.get(e);n&&(t.delete(e),sV(n,-1),sT(t))}let sN=()=>U("extensions",{slots:{}}),sA=0,sI=new Set;function sj(e){sA++;try{return e()}finally{if(0==--sA&&sI.size>0){let e=Array.from(sI);for(let t of(sI.clear(),e))sM(t)}}}function sM(e){try{e()}catch(t){console.error(`The extension system's '${e.name}' recomputation failed`,t)}}function sL(e){sA>0?sI.add(e):sM(e)}let sF=new Map,sB=!1;function sV(e,t){let n=JSON.stringify([e.slotName,e.extensionId,e.slotModuleName,e.extensionModuleName]),r=sF.get(n);if(!r){if(t<0)return;sF.set(n,{count:1,record:{slotModuleName:e.slotModuleName,extensionModuleName:e.extensionModuleName,slotName:e.slotName,extensionId:e.extensionId}}),sB=!0;return}r.count+=t,r.count<1&&(sF.delete(n),sB=!0)}function sU(){var e,t;if(sR(),!sB)return;sB=!1;let n=Array.from(sF.values(),({record:e})=>e);n.sort(sW),e=tZ.getState().mountedExtensions,t=n,e.length===t.length&&e.every((e,n)=>0===sW(e,t[n]))||tZ.setState({mountedExtensions:n})}function sW(e,t){return sH(e.slotName,t.slotName)||sH(e.extensionId,t.extensionId)||sH(e.slotModuleName,t.slotModuleName)||sH(e.extensionModuleName,t.extensionModuleName)}function sH(e,t){return e===t?0:e<t?-1:1}sU(),sD.subscribe(()=>sL(sU));let sz=s_(),sK=sN(),sG=tq(),sZ=tQ(),sY=new Set,sq=!1;function sJ(e){if(null===e)sY=null;else if(null!==sY)for(let t of e)sY.add(t);sL(sX)}function sX(){if(!sq){sq=!0;try{for(let e=1;;e++){let t=sY;if(null!==t&&0===t.size)return;sY=new Set;try{!function(e,t,n,r,a,o=null){let i=sK.getState().slots,s={},l=!1,u=Object.entries(r.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[r,c]of Object.entries(e.slots)){let d=i[r];if(d&&o&&!o.has(r)){s[r]=d;continue}let{config:m}=tX(t,c.name),p=function(e,t,n,r,a,o){let i=function(e,t){let n=e.add||[],r=e.remove||[],a=e.order||[],{extensions:o}=sz.getState();return[...t,...n].filter(e=>!r.includes(e)).sort((e,n)=>s8(e,a,o[s1(e)]?.order,t)-s8(n,a,o[s1(n)]?.order,t))}(n,t.slots[e].attachedIds),s=[];for(let l of i){let{config:i}=t1(r,e,l),u=t4(n,e,l),c=u?sE({},i,u):i,d=s1(l),m=t.extensions[d];if(m){let e=c?.["Display conditions"]?.privileges??m.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!o?.user||!oD(e,o.user))||m.featureFlag&&!a.includes(m.featureFlag))continue;s.push({id:l,name:d,moduleName:m.moduleName,config:c,featureFlag:m.featureFlag,meta:m.meta,displayConditionExpression:c?.["Display conditions"]?.expression||m.displayExpression})}}return s}(r,e,m,n,u,a.session);d&&d.moduleName===c.moduleName&&e6(d.candidateExtensions,p)?s[r]=d:(s[r]={moduleName:c.moduleName,candidateExtensions:p},l=!0)}(l||Object.keys(i).length!==Object.keys(s).length)&&sK.setState({slots:s})}(sz.getState(),sG.getState(),sZ.getState(),sh.getState(),of.getState(),t)}catch(e){throw sY=null===t||null===sY?null:new Set([...t,...sY]),e}if(e>=20)return void console.error("The extension system stopped recomputing after 20 passes because something keeps invalidating slots in response to the extension store being written. Some slots are left stale until the next write.")}}finally{sq=!1}}}function sQ(e,t){let n=new Set;for(let r of Object.keys(e))e[r]!==t[r]&&n.add(r);for(let r of Object.keys(t))r in e||n.add(r);return n}function s0(e,t){return{moduleName:t,name:e,attachedIds:[]}}function s1(e){let[t]=e.split("#");return t}function s4(e,t){let n=s1(t);return e.extensions[n]}function s2(e){return s4(sz.getState(),e)}sz.subscribe((e,t)=>{sJ(e.extensions!==t.extensions?null:sQ(e.slots,t.slots))}),sG.subscribe((e,t)=>{sJ(sQ(e.slots,t.slots))}),sZ.subscribe((e,t)=>{sJ(sQ(e.configs,t.configs))}),sh.subscribe(()=>sJ(null)),of.subscribe(()=>sJ(null)),sJ(null);let s3=e=>sS(t=>({...t,extensions:{...t.extensions,[e.name]:{...e}}}));function s6(e,t){sS(n=>{let r=n.slots[e];return r?{...n,slots:{...n.slots,[e]:{...r,attachedIds:[...r.attachedIds,t]}}}:{...n,slots:{...n.slots,[e]:{...s0(e),attachedIds:[t]}}}})}function s5(e,t){sS(n=>{let r=n.slots[e];return r&&r.attachedIds.includes(t)?{...n,slots:{...n.slots,[e]:{...r,attachedIds:r.attachedIds.filter(e=>e!==t)}}}:n})}function s9(e){sS(t=>{let n=t.slots[e];return n?{...t,slots:{...t.slots,[e]:{...n,attachedIds:[]}}}:t})}function s8(e,t,n,r){let a=t.indexOf(e);if(-1!==a)return a;{if(void 0!==n)return 1e3+n;let t=r.indexOf(e);return -1!==t?2e3+t:3e3}}function s7(e,t){return function(e,t,n=null,r){let a;return e.filter(e=>{let o=e.displayConditionExpression;if("string"!=typeof o||0===o.trim().length)return!0;a??(a=t&&"object"==typeof t?{session:n,...t}:{session:n});try{return!!iQ(o,a)}catch(t){return console.error(`Error while evaluating expression '${o}' for ${e.id}`+(r?` in ${r}`:""),t),!1}})}(le(e),t,of.getState().session,e)}function le(e){return sK.getState().slots[e]?.candidateExtensions??[]}let lt=(e,t)=>sz.setState(n=>{let r=n.slots[t]?.moduleName;if(r&&r!=e)return console.warn(`An extension slot with the name '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${r}.`),n;if(r&&r==e)return n;if(n.slots[t])return{...n,slots:{...n.slots,[t]:{...n.slots[t],moduleName:e}}};let a=s0(t,e);return{...n,slots:{...n.slots,[t]:{...a}}}}),ln=()=>{sY=null,sS(()=>({slots:{},extensions:{}})),sk().setState({renderings:new Map}),sK.setState({slots:{}})},lr=B("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function la({name:e,basePath:t,mode:n,componentContext:r,state:a}){lr.setState({slotName:e,basePath:t,mode:n??"normal",componentContext:r,state:a})}function lo(e){lr.getState().slotName===e&&lr.setState(lr.getInitialState(),!0)}let li=B("modalRegistry",{modals:{}});function ls(e){li.setState(t=>(t.modals[e.name]=e,t))}function ll(e){let t=li.getState().modals[e];if(!t){let n=s2(e);n&&(t={name:e,load:n.load,moduleName:n.moduleName},console.warn(`Modal ${e} was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.`),ls(t))}return t}let lu=B("workspaceRegistrations",{workspaces:{}}),lc=B("workspaceGroups",{workspaceGroups:{}});function ld(e){lu.setState(t=>({workspaces:{...t.workspaces,[e.name]:{...e,load:e.load,preferredWindowSize:e.preferredWindowSize??"normal",type:e.type??"form",canHide:e.canHide??!1,canMaximize:e.canMaximize??!1,width:e.width??"narrow",groups:e.groups??[]}}}))}function lm(e){lc.setState(t=>{let n=t.workspaceGroups[e.name];return n?{workspaceGroups:{...t.workspaceGroups,[e.name]:{...n,members:Array.from(new Set([...n.members,...e.members]))}}}:{workspaceGroups:{...t.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let lp=new Set;function lf(e){let t=lu.getState().workspaces;if(t[e])return t[e];{let t=s2(e);if(t){var n;let r;return lp.has(e)||(console.warn(`The workspace '${e}' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.`),lp.add(e)),{name:t.name,title:(n=t,"string"==typeof(r=n?.meta?.title)?r:r&&"object"==typeof r?a3(n.moduleName,r.key,r.default):n.name),moduleName:t.moduleName,preferredWindowSize:t.meta?.screenSize??"normal",load:t.load,type:t.meta?.type??"form",canHide:t.meta?.canHide??!1,canMaximize:t.meta?.canMaximize??!1,width:t.meta?.width??"narrow",groups:t.meta?.groups??[]}}throw Error(`No workspace named '${e}' has been registered.`)}}function lh(e){let t=lc.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}let lg=B("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function ly(e){let{registeredWorkspacesByName:t,registeredWindowsByName:n}=lg.getState(),r=t[e];if(r){let t=n[r.window];if(t)return t;throw Error(`No workspace window found with name: ${r.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function lv(e){let{registeredGroupsByName:t,registeredWindowsByName:n}=lg.getState(),r=n[e];if(r){let n=t[r.group];if(n)return n;throw Error(`No workspace group found with name: ${r.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function lb(e){let{openedWindows:t}=lg.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}function lw(e,t){if(0==t.length)return;let{registeredGroupsByName:n}=lg.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace group ${n.name} more than once`);r[n.name]={...n,moduleName:e}}lg.setState({registeredGroupsByName:r})}function lE(e,t){if(0==t.length)return;let{registeredWindowsByName:n}=lg.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace window ${n.name} more than once`);let t={...n,moduleName:e};r[n.name]=t}lg.setState({registeredWindowsByName:r})}function lx(e,t){if(0==t.length)return;let{registeredWorkspacesByName:n}=lg.getState(),r={...n};for(let n of t){if(r[n.name])throw Error(`Cannot register workspace ${n.name} more than once`);let t={...n,moduleName:e};r[n.name]=t}lg.setState({registeredWorkspacesByName:r})}let lD=0,l_=null,lk={bootstrap:15e3,mount:15e3,unmount:15e3};function lS(e,t){if(e.timeouts)return e;let n=e.name??"parcel",r=Object.fromEntries(Object.keys(lk).filter(t=>e[t]).map(r=>{var a,o;let i,s;return[r,(a=e[r],o=lk[r],i=Array.isArray(a)?a:[a],s=e=>i.reduce((t,a,o)=>t.then(()=>{let t=a(e);return"function"==typeof t?.then&&"function"==typeof t?.catch?t:Promise.reject(Error(`Lifecycle function ${r} at array index ${o} for parcel ${n} did not return a promise`))}),Promise.resolve(void 0)),e=>{let a,i=new Promise((e,t)=>{a=setTimeout(()=>t(Error(`Lifecycle function ${r} for parcel ${n} did not settle within ${o}ms`)),o)});return Promise.race([s(e),i]).finally(()=>clearTimeout(a)).then(e=>(t(r,!1),e),e=>{throw t(r,!0),e})})]}));return{...e,...r}}async function lC(e,t){var n,r;let a,o,i,s,l,u=await (l_??(l_=new Promise((e,t)=>{rP({name:"openmrs-extension-host",bootstrap:()=>Promise.resolve(),mount:t=>(e(t.mountParcel),Promise.resolve()),unmount:()=>Promise.resolve()},{domElement:document.createElement("div")}).mountPromise.catch(t)}).catch(e=>(console.error("The host parcel used to mount extensions could not be mounted. Falling back to mounting extensions as root parcels, which leaks their DOM elements.",e),rP))),l_),c={...t},d=(a=c,o=!1,{retarget:e=>a={...e},release:i=()=>(function(e){for(let t of Object.keys(e))delete e[t]})(a),onSettled(e,t){switch(e){case"bootstrap":t&&i();return;case"mount":o||(o=t);return;case"unmount":(t||o)&&i();return}}});return r=u((n=d.onSettled,"function"==typeof e?()=>e().then(e=>lS(e,n)):lS(e,n)),c),s=e=>t=>e.call(r,d.retarget(t)).catch(e=>{throw"SKIP_BECAUSE_BROKEN"===r.getStatus()&&d.release(),e}),l=r.update&&s(r.update),Object.defineProperty(r,"update",{configurable:!0,enumerable:!0,get:()=>l,set:e=>{l=e&&s(e)}})}function lP(){return lR}function lR(e,t){let n,r=lC(e,t).then(e=>n=e);return{mount:()=>r.then(e=>e.mount()),unmount:()=>r.then(e=>e.unmount()),update:e=>r.then(t=>t.update?.(e)),getStatus:()=>n?.getStatus()??"LOADING_SOURCE_CODE",get loadPromise(){return r.then(e=>e.loadPromise)},get bootstrapPromise(){return r.then(e=>e.bootstrapPromise)},get mountPromise(){return r.then(e=>e.mountPromise)},get unmountPromise(){return r.then(e=>e.unmountPromise)}}}async function lT(e,t,n,r,a=e=>e,o={}){let i=s1(r),s=s2(r),l=null;if(e){let u;if(!s)throw Error(`Couldn't find extension '${i}' to attach to '${t}'`);let{meta:c,moduleName:d,load:m}=s,p=lD++,f=`${t}/${r}-${p}`;e.dataset.extensionRenderingId=f;let h=e=>{try{sO(f)}catch(t){console.error(e,t)}};try{s$({renderingId:f,extensionName:i,extensionModuleName:d,extensionId:r,slotName:t,slotModuleName:n})}catch(e){throw h(`Recomputing configuration after registering '${r}' failed also failed`),e}try{u=await m()}catch(e){throw h(`Recomputing configuration after '${r}' failed to load also failed`),e}try{l=await lC(a({...u,name:`${t}/${i}-${p}`}),{...o,_meta:c,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:d,extensionMeta:c},domElement:e})}catch(e){throw h(`Recomputing configuration after '${r}' failed to mount also failed`),e}l.mountPromise.then(void 0,e=>{console.error(`Extension '${r}' in slot '${t}' failed to mount`,e),h(`Recomputing configuration after '${r}' failed to mount also failed`)}),l.unmountPromise.then(()=>h(`Recomputing configuration after unmounting '${r}' failed`),e=>{console.error(`Extension '${r}' in slot '${t}' failed to unmount`,e),h(`Recomputing configuration after '${r}' failed to unmount also failed`)})}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return l}var l$=n(695),lO=n.n(l$);let lN=(0,l$.createContext)({moduleName:"",featureName:""});function lA({to:e,templateParams:t,onBeforeNavigate:n,children:r,...a}){return(0,l$.useEffect)(()=>{a.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${a.href}'`),a.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),lO().createElement("a",{onClick:r=>{0===r.button&&!r.ctrlKey&&!r.shiftKey&&!r.altKey&&!r.metaKey&&(r.preventDefault(),n?.(r),a8({to:e,templateParams:t})),0===r.button&&(r.ctrlKey||r.metaKey)&&n?.(r),0===r.button&&r.shiftKey&&n?.(r),1===r.button&&n?.(r)},href:a5(e,t),...a},r)}let lI=({state:e,children:t,...n})=>{let{extension:r}=(0,l$.useContext)(lN),a=(0,l$.useRef)(null),o=(0,l$.useRef)(Promise.resolve()),i=(0,l$.useRef)(!1),s=(0,l$.useRef)(!1),l=(0,l$.useRef)(e),u=(0,l$.useCallback)(e=>{if(!e)return;let t=()=>{"MOUNTED"===e.getStatus()&&e.unmount()};switch(e.getStatus()){case"MOUNTED":e.unmount();break;case"UPDATING":o.current?.then(t,t);break;default:e.mountPromise.then(t,()=>{})}},[]),c=(0,l$.useCallback)((e,t)=>{e.update&&"UNMOUNTING"!==e.getStatus()&&(o.current=Promise.all([e.mountPromise,o.current]).then(()=>{if(a.current?.getStatus()==="MOUNTED"&&a.current.update)return a.current.update({...t})}).catch(e=>{let t=a.current?.getStatus();"UNMOUNTING"!==t&&"NOT_MOUNTED"!==t&&"UNLOADING"!==t&&console.error(`The extension '${r?.extensionId}' failed to update`,e)}))},[]),d=(0,l$.useCallback)(t=>{t&&!a.current&&!s.current&&r?.extensionSlotName&&r.extensionSlotModuleName&&(s.current=!0,lT(t,r.extensionSlotName,r.extensionSlotModuleName,r.extensionId,void 0,e).then(t=>{(s.current=!1,a.current=t,i.current)?u(t):t&&l.current!==e&&c(t,l.current)},()=>{s.current=!1}))},[]);return(0,l$.useEffect)(()=>(i.current=!1,()=>{i.current=!0,u(a.current)}),[]),(0,l$.useEffect)(()=>{l.current=e,a.current&&c(a.current,e)},[e]),r?lO().createElement("div",{ref:d,"data-extension-id":r?.extensionId,style:{position:"relative"},...n}):null};function lj(e){let t=(0,l$.useRef)(e);return T(t.current,e)||(t.current=e),t.current}function lM(e,t){"function"==typeof t&&(t=t(e));let n={};for(let[r,a]of Object.entries(t)){let t=function(...t){e.setState(e=>a(e,...t))};n[r]=t}return n}let lL=e=>e;function lF(e,t=lL,n){let r=(0,l$.useCallback)(t=>e.subscribe(t),[e]),a=(0,l$.useCallback)(()=>t(e.getState()),[e,t]),o=(0,l$.useSyncExternalStore)(r,a,a),i=(0,l$.useMemo)(()=>n?lM(e,n):null,[e,n]);return(0,l$.useMemo)(()=>i?{...o,...i}:o,[o,i])}function lB(e,t){return lF(e,lL,t)}function lV(e){return function(t){let n=(0,l$.useCallback)(t=>e.subscribe(t),[]),r=(0,l$.useCallback)(()=>e.getState(),[]),a=(0,l$.useSyncExternalStore)(n,r,r),o=(0,l$.useMemo)(()=>t?lM(e,t):null,[t]);return(0,l$.useMemo)(()=>o?{...a,...o}:a,[a,o])}}let lU=[];Object.freeze(lU);let lW={candidateExtensions:lU};Object.freeze(lW);let lH=e=>{let t=(0,l$.useCallback)(t=>t.slots?.[e]??lW,[e]);return lF(sN(),t)},lz=e=>e.session;function lK(e,t){let{candidateExtensions:n}=lH(e),r=lF(of,lz),a=lj(t);return(0,l$.useMemo)(()=>s7(e,a),[e,a,r,n])}function lG(e,t){let{moduleName:n}=(0,l$.useContext)(lN);if(!n)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,l$.useEffect)(()=>{lt(n,e)},[n,e]),{extensions:lK(e,t),extensionSlotName:e,extensionSlotModuleName:n}}function lZ(e){return e}function lY({name:e,extensionSlotName:t,select:n=lZ,children:r,state:a,style:o,...i}){if(r&&a)throw Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");let s=e??t,l=(0,l$.useRef)(null),{extensions:u,extensionSlotModuleName:c}=lG(s,a),d=(0,l$.useMemo)(()=>n(u),[n,u]),m=(0,l$.useMemo)(()=>{if("function"==typeof r&&!lO().isValidElement(r))return d.map(e=>r(e,a))},[r,d]);return lO().createElement("div",{ref:l,"data-extension-slot-name":s,"data-extension-slot-module-name":c,style:{...o,position:"relative"},...i},s&&d?.map((e,t)=>lO().createElement(lN.Provider,{key:e.id,value:{moduleName:c,featureName:"",extension:{extensionId:e.id,extensionSlotName:s,extensionSlotModuleName:c,extensionMeta:e.meta}}},m?.[t]??("function"!=typeof r?r:null)??lO().createElement(lI,{state:a}))))}var lq=n(5338);function lJ(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 lX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lJ(Object(n),!0).forEach(function(t){var r,a,o;r=e,a=t,o=n[t],a in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lJ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lQ(e){return(lQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l0(e){return(l0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l1(e,t){var n;if("function"!=typeof(n=t.domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(t.name,"'. Expected a function, received ").concat(l0(n)));return function(){var e=n(t);if(!(e instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(t.name,"'. Expected HTMLElement, received ").concat(l0(e)));return e}}var l4=null;try{l4=require("react").createContext()}catch(e){}var l2={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function l3(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function l6(e,t){return new Promise(function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||e.errorBoundaryClass||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var a,o=l7(e,t,function(){n(this)}),i=l1(e,t)(),s=function(e){var t=e.reactDom,n=e.renderType,r=e.elementToRender,a=e.domElement,o=t[n];if("function"!=typeof o)throw Error('renderType "'.concat(n,'" did not return a function.'));switch(n){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=o(a);return i.render(r),i;case"hydrateRoot":return o(a,r);default:return o(r,a),null}}({elementToRender:o,domElement:i,reactDom:l8(e),renderType:"function"==typeof(a=e).renderType?a.renderType():a.renderType});e.domElements[t.name]=i,e.renderResults[t.name]=s})}function l5(e,t){return new Promise(function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():l8(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function l9(e,t){return new Promise(function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=l7(e,t,null),a=e.renderResults[t.name];if(a&&a.render)a.render(r);else{var o=l1(e,t)();l8(e).render(r,o)}})}function l8(e){return e.ReactDOMClient||e.ReactDOM}function l7(e,t,n){var r=e.React.createElement(e.rootComponent,t),a=l4?e.React.createElement(l4.Provider,{value:t},r):r;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function n(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return n.prototype=Object.create(e.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},n}(e,t),a=e.React.createElement(e.errorBoundaryClass,t,a)),a=e.React.createElement(e.SingleSpaRoot,lX(lX({},t),{},{mountFinished:n,updateFinished:function(){e.updateResolves[t.name]&&(e.updateResolves[t.name].forEach(function(e){return e()}),delete e.updateResolves[t.name])},unmountFinished:function(){e.unmountResolves[t.name]&&(e.unmountResolves[t.name](),delete e.unmountResolves[t.name])}}),a)}var ue=n(287),ut=n(3),un=n.n(ut),ur=n(2108);let ua={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},uo=new Map;(0,ur.initCache)(uo);let ui={errorRetryCount:3,fetcher:om,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof op){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>uo};function us(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},ua,e),n={...ui,...t.swrConfig};return function(e){var r,a,o,i,s;return o=a=class extends(r=lO().Component){componentDidCatch(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:n})}render(){if(this.state.caughtError)return lO().createElement("div",null,"An error has occurred. Please try reloading the page.");{let r=lO().createElement(l$.Suspense,{fallback:null},lO().createElement(ut.SWRConfig,{value:n},lO().createElement(lN.Provider,{value:this.state.config},t.disableTranslations?lO().createElement(e,this.props):lO().createElement(ue.I18nextProvider,{i18n:window.i18next,defaultNS:this.state.config.extension?`${this.state.config.moduleName}___${this.state.config.extension.extensionSlotName}___${this.state.config.extension.extensionId}`:this.state.config.moduleName},lO().createElement(e,this.props)))));return t.strictMode&&lO().StrictMode?lO().createElement(lO().StrictMode,null,r):r}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},i="displayName",s=`OpenmrsReactComponent(${t.featureName})`,i in o?Object.defineProperty(o,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[i]=s,a}}function ul(e,t){return function(e){if("object"!==lQ(e))throw Error("single-spa-react requires a configuration object");var t,n=lX(lX({},l2),e);if(!n.React)throw Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!=(t=n.ReactDOMClient)&&t.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!l4&&n.React.createContext&&(l4=n.React.createContext()),n.SingleSpaRoot=function(e){function t(e){t.displayName="SingleSpaRoot(".concat(e.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},t.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},t.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},t}(n);var r={bootstrap:l3.bind(null,n),mount:l6.bind(null,n),unmount:l5.bind(null,n)};return n.parcelCanUpdate&&(r.update=l9.bind(null,n)),r}({React:lO(),ReactDOMClient:lq,rootComponent:us(t)(e)})}function uu(e,t){return()=>e().then(({default:e})=>ul(e,t))}function uc(e,t){return()=>Promise.resolve(ul(e,t))}let ud=uu,um=A()(()=>({}));V("openmrs-app-context",um);let up={};function uf(e,t=e=>e){let n=um.getState();return e in n?Object.freeze(Object.assign({},t?t(n[e]):n[e])):null}function uh(e,t){um.setState(n=>(e in n||(n[e]={}),n[e]=t(n[e]),Object.assign({},n)))}function ug(e){return null===e?null:Object.freeze(Object.assign({},e))}let uy=new Map;function uv(e,t){let n=(0,l$.useRef)(t??{}),r=(0,l$.useRef)(t=>uh(e,t)),a=(0,l$.useRef)(Symbol());return(0,l$.useEffect)(()=>{let n=t??{},r=a.current;return null===uf(e)?!function(e,t=up){um.setState(n=>{if(e in n)throw Error(`Attempted to re-register namespace ${e} in the app context. Each namespace must be unregistered before the name can be registered again.`);return Object.assign({},n,{[e]:t===up?{}:t})})}(e,n):(console.warn(`Namespace ${e} is already registered in the app context. This is likely a race condition during navigation, but may indicate two components are trying to own the same namespace. Updating the existing context.`),uh(e,()=>n)),uy.set(e,r),()=>{uy.get(e)===r&&(um.setState(t=>(e in t&&delete t[e],t)),uy.delete(e))}},[e]),(0,l$.useEffect)(()=>{let r=t??{};T(n.current,r)||(uh(e,()=>r),n.current=r)},[t]),r.current}function ub({namespace:e,value:t}){return uv(e,t),null}let uw=({children:e,value:t,fallback:n})=>t?lO().createElement(lO().Fragment,null,e):n?lO().createElement(lO().Fragment,null,n):null;function uE(){let e=(0,l$.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,l$.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function ux(e,t=e=>e??{}){let[n,r]=(0,l$.useState)(()=>{if(uD(e))return;let n=uf(e);if(null!==n)return t?t(n):n});return(0,l$.useEffect)(()=>{if(uD(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,l$.useEffect)(()=>{var n;let a;return(n=e=>{if(null==e)return void r(void 0);let n=t?t(e):e;r(e=>T(e,n)?e:n)})(ug(a=uf(e))),um.subscribe(t=>{let r=e in t?t[e]:null;r!==a&&(a=r,n(ug(r)))})},[e,t]),n}function uD(e){return"string"!=typeof e||0===e.trim().length}function u_(e){let t=lK(e);return(0,l$.useMemo)(()=>t.map(e=>e.id),[t])}function uk(e){return lH(e).candidateExtensions}function uS(e,t,n){let{data:r,error:a,mutate:o,isLoading:i,isValidating:s}=un()(e?ik(e,t,n):null,om);return(0,l$.useMemo)(()=>({isLoading:i,data:r?.data.results??[],error:a,mutate:o,isValidating:s}),[r,a,i,s,o])}function uC(e){(0,l$.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}let uP={},uR=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
|
|
16
|
+
Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function uT(e){let{moduleName:t,extension:n}=(0,l$.useContext)(lN),r=e?.externalModuleName??t;if(!r&&!n)throw Error(uR);let a=function(e){let t=(0,l$.useMemo)(()=>tY(e),[e]),n=function(e){let[t,n]=(0,l$.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,l$.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&n(e.config)}),[e]),t}(t);if(!n)throw uP[e]||(uP[e]=new Promise(e=>{let n=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),n())})})),uP[e];return n}(r),o=function(e){let t=(0,l$.useMemo)(tQ,[]),n=function(e,t){let[n,r]=(0,l$.useState)(t?()=>{let n=t1(e.getState(),t.extensionSlotName,t.extensionId);if(n.loaded&&n.config)return n.config}:null);return(0,l$.useEffect)(()=>{if(t)return e.subscribe(e=>{let a=t1(e,t.extensionSlotName,t.extensionId);a.loaded&&a.config&&!e6(a.config,n)&&r(a.config)})},[e,t,n]),n}(t,e);if(!n&&e){let n=`${e.extensionSlotName}-${e.extensionId}`;throw!uP[n]&&t&&(uP[n]=new Promise(n=>{let r=t.subscribe(t=>{let a=t1(t,e.extensionSlotName,e.extensionId);a.loaded&&a.config&&(n(a.config),r())})})),uP[n]}return n||{}}(n);return(0,l$.useMemo)(()=>e?.externalModuleName&&r===e.externalModuleName?{...a}:{...a,...o},[r,e?.externalModuleName,a,o])}let u$=lK;function uO(e,t=300){let[n,r]=(0,l$.useState)(e);return(0,l$.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}var uN=n(1760),uA=n.n(uN);let uI=`custom:${[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]].map(([e,t])=>`${e}:${t}`).join(",")}`;function uj(){let e=`${ol}/emrapi/configuration?v=${uI}`,t=uA()(e,om);return(0,l$.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}function uM(){return(0,l$.useContext)(lN).extension}let uL=lV(s_());function uF(e){let t=lK(e);return(0,l$.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}let uB=lV(sN());function uV(e){let{flags:t}=lF(sh);return t[e]?.enabled??!1}function uU(){let[,e]=(0,l$.useState)(0);return(0,l$.useCallback)(()=>{e(e=>e+1)},[])}function uW(e,t,n={}){return uz(e,t,uH,n)}let uH={getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let r=new URL(od(e.toString()),window.location.toString());return r.searchParams.set("limit",""+t),r.searchParams.set("startIndex",""+n),r.searchParams.set("totalCount","true"),r.toString()}},getNextUrl:e=>{let t=e?.links?.find(e=>"next"==e.rel)?.uri;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.totalCount??NaN,getCurrentPageSize:e=>e?.results?.length??NaN,getData:e=>e?.results};function uz(e,t,n,r={}){let{getPaginatedUrl:a,getTotalCount:o,getCurrentPageSize:i,getData:s}=n,{immutable:l,swrConfig:u}=r,c=r.fetcher??om,[d,m]=(0,l$.useState)(1),p=(0,l$.useRef)(NaN),f=(0,l$.useRef)(NaN),h=(0,l$.useRef)(d),g=(0,l$.useRef)(!1),y=(0,l$.useRef)(!1),v=e?.toString()??"",[b,w]=(0,l$.useState)(v);v!==b&&(w(v),m(1),h.current=1,p.current=NaN,f.current=NaN,g.current=!1,y.current=!1);let E=(d-1)*t,x=(0,l$.useMemo)(()=>a(e,t,E),[e,t,E]),{data:D,..._}=(l?uA():un())(x,c,u);D?.data&&(p.current=o(D?.data),f.current=i(D?.data),g.current=!0);let k=Math.ceil(p.current/t),S=(0,l$.useCallback)(e=>{if(!Number.isInteger(e)||e<1)return void console.warn(`useServerPagination: ignoring goTo(${e}); page must be a positive integer.`);let n=Math.ceil(p.current/t);!g.current||Number.isNaN(n)||e<=n?(h.current=e,m(e)):console.warn("Invalid attempt to go to out of bounds page: "+e)},[t]);(0,l$.useEffect)(()=>{if(!g.current)return;if(Number.isNaN(p.current)){y.current||(y.current=!0,console.warn(`useServerPagination: ${v} returned no total count, so out-of-range pages cannot be detected.`));return}let e=Math.max(1,Math.ceil(p.current/t));d>e&&(console.warn(`Invalid attempt to go to out of bounds page: ${d}; returning to page ${e}.`),h.current=e,m(e))},[d,t,v,D]);let C=(0,l$.useCallback)(()=>{S(h.current+1)},[S]),P=(0,l$.useCallback)(()=>{S(h.current-1)},[S]);return{data:s(D?.data),totalPages:k,totalCount:p.current,currentPage:d,currentPageSize:f.current,paginated:k>1,showNextButton:d<k,showPreviousButton:d>1,goTo:S,goToNext:C,goToPrevious:P,..._}}function uK(e,t,n={}){return uz(e,t,uG(),n)}function uG(){return{getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let r=new URL(od(e.toString()),window.location.toString());return r.searchParams.set("_count",""+t),r.searchParams.set("_getpagesoffset",""+n),r.toString()}},getNextUrl:e=>{let t=e?.link?.find(e=>"next"==e.relation)?.url;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.total??NaN,getCurrentPageSize:e=>e?.entry?.length??NaN,getData:e=>e?.entry?.map(e=>e.resource)}}var uZ=n(9366),uY=n.n(uZ);function uq(e,t={}){return uJ(e,uH,t)}function uJ(e,t,n={}){let{swrInfiniteConfig:r,immutable:a}=n,{getNextUrl:o,getTotalCount:i,getData:s}=t,l=n.fetcher??om,u=(0,l$.useCallback)((n,r)=>0==n?e?.toString()??null:t.getNextUrl(r.data),[e]),{data:c,size:d,setSize:m,...p}=uY()(u,l,{...r,...a?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),f=o(c?.[c.length-1].data),h=i(c?.[0]?.data);return{data:c?.flatMap(e=>s(e.data)),totalCount:h,hasMore:null!=f,loadMore:()=>{m((c?.length??0)+1)},nextUri:f,...p}}function uX(e,t={}){return uQ(e,uH,t)}function uQ(e,t,n={}){let r=uJ(e,t,n),{hasMore:a,error:o,data:i,loadMore:s,isLoading:l,nextUri:u}=r;return((0,l$.useEffect)(()=>{a&&!o&&s()},[a,u]),n.partialData)?r:{...r,data:a||o?void 0:i,isLoading:l||a}}function u0(e,t={}){return uQ(e,uG(),t)}function u1(e,t={}){return uJ(e,uG(),t)}function u4(){let e="tablet";return document.body.classList.forEach(t=>{switch(t){case"omrs-breakpoint-lt-tablet":e="phone";break;case"omrs-breakpoint-gt-small-desktop":e="large-desktop";break;case"omrs-breakpoint-gt-tablet":e="small-desktop"}}),e}function u2(){let[e,t]=(0,l$.useState)(u4);return(0,l$.useEffect)(()=>{let e=()=>{t(u4())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let u3=e=>"small-desktop"===e||"large-desktop"===e;function u6(e){let t=(0,l$.useContext)(lN);(0,l$.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),la(e),()=>{lo(e.name)}),[t,e])}function u5(){return lF(lr)}let u9=[];function u8(e=null,t=null){let n=new URLSearchParams;e&&n.set("tag",e),t&&n.set("q",t);let r=n.toString(),{data:a}=uX(`${ol}/location${r?"?"+r:""}`,{immutable:!0});return a??u9}function u7(e,t=!0){let n=(0,l$.useRef)(null);return(0,l$.useEffect)(()=>{let r=r=>{t&&n.current&&r.target&&r.target instanceof Node&&(n.current.contains(r.target)||e(r))};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}},[e,t]),n}function ce(e){let t=(0,l$.useRef)();return(0,l$.useEffect)(()=>{let n=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting)return void e()},{threshold:1});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current,e]),t}function ct(e,t={}){let{abortController:n,fetchInit:r,url:a,swrConfig:o}=t,i=uE(),s=(0,l$.useMemo)(()=>r?.signal??n?.signal??i.signal,[n?.signal,r?.signal,i.signal]),l=(0,l$.useCallback)(e=>om(function(e,t){if(t)return"function"==typeof t?t(e):t;if("string"==typeof e)return e;throw Error(`When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ${e}.`)}(e,a),{...r,signal:s}),[s,r,a]);return un()(e,l,o)}function cn(e=[],t=10){let[n,r]=(0,l$.useState)(1),a=(0,l$.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]);n>a&&r(a);let o=Math.min(Math.max(1,n),a),i=(0,l$.useMemo)(()=>{let n=(o-1)*t,r=(o+0)*t;return e.slice(n,r)},[e,o,t]),s=(0,l$.useCallback)(e=>{!Number.isInteger(e)||e<1?console.warn(`usePagination: ignoring goTo(${e}); page must be a positive integer.`):r(e)},[]),l=(0,l$.useCallback)(()=>{r(e=>e+1)},[]),u=(0,l$.useCallback)(()=>{r(e=>Math.max(1,e-1))},[]);return(0,l$.useMemo)(()=>({results:i,totalPages:a,currentPage:o,paginated:e.length>t,showNextButton:o<a,showPreviousButton:o>1,goTo:s,goToNext:l,goToPrevious:u}),[i,a,e.length,t,o,s,l,u])}function cr(e,t,n,r){return{pageSizes:(0,l$.useMemo)(()=>{let n=Math.ceil(t/e);return isNaN(n)&&(n=0),[...Array(n).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,l$.useMemo)(()=>e>t?t:e*n>t?e*(n-1)+r:e*n,[e,t,n,r])}}function ca(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function co(e){let[t,n]=(0,l$.useState)(e??ca()),{data:r,error:a,isValidating:o}=un()(t?["patient",t]:null,()=>iP(t,{}));return(0,l$.useEffect)(()=>{let e=()=>{let e=ca();e!==t&&n(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,l$.useMemo)(()=>({isLoading:o&&!a&&!r,patient:r,patientUuid:t,error:a}),[o,a,r,t])}function ci(){let e=`${ol}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:n,isLoading:r}=un()(e,om);return(0,l$.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:r,error:n}),[t,n,r])}function cs(e){let{extensions:t,extensionSlotModuleName:n}=lG(e);return e?t.map(t=>({state:r})=>lO().createElement(lN.Provider,{value:{moduleName:n,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:n,extensionMeta:t.meta}}},lO().createElement(lI,{state:r}))):[]}function cl(){let e=(0,l$.useRef)(),[t,n]=(0,l$.useState)(null),r=null;if(!t){if(i){let e=ob().getState();e.loaded&&(r=e.session)}else i=new Promise(t=>{let n=({loaded:n,session:a})=>{n&&(t(a),r=a,e.current&&(e.current(),e.current=void 0))};n(ob().getState()),r||(e.current=ob().subscribe(n))});if(r)n(r);else throw i}(0,l$.useEffect)(()=>(e.current||(e.current=ob().subscribe(({loaded:e,session:t})=>{e&&(r=t,n(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let a=t||r;if(!a)if(i)throw console.warn("useSession is in an unexpected state. Attempting to recover."),i;else throw Error("useSession is in an invalid state.");return a}let cu=({privilege:e,fallback:t,children:n})=>{let[r,a]=(0,l$.useState)(null);return((0,l$.useEffect)(()=>{let e=ob(),t=e.subscribe(({loaded:e,session:t})=>{a(e?t?.user??null:null)}),{loaded:n,session:r}=e.getState();return n&&a(r?.user??null),t},[]),r&&oD(e,r))?lO().createElement(lO().Fragment,null,n):t?lO().createElement(lO().Fragment,null,t):null};var cc=n(2542),cd=n.n(cc),cm=n(7581);let cp=new Map;function cf(){for(let e of Array.from(cp.values()))e()}let ch={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid}};function cg(e){let t=(0,l$.useId)();return(0,l$.useEffect)(()=>{if(e)return cp.set(t,e),()=>{cp.delete(t)}},[t,e]),{...lB(iB(),ch),mutateVisit:cf}}function cy(e,t=iL){let n=(0,l$.useRef)(void 0),{patientUuid:r,manuallySetVisitUuid:a,setVisitContext:o}=cg((0,l$.useCallback)(()=>n.current?.(),[])),i=e&&r==e?a:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${i}?v=${t}`,{data:u,error:c,mutate:d,isValidating:m}=un()(e?`${ol}/visit${s}`:null,om),{data:p,error:f,mutate:h,isValidating:g}=un()(e&&i?`${ol}/visit${l}`:null,om),y=(0,l$.useMemo)(()=>u?.data.results.find(e=>null===e.stopDatetime)??null,[u]),v=(0,l$.useMemo)(()=>i&&p?p.data:null,[p,i]),b=(0,l$.useRef)(null);(0,l$.useEffect)(()=>{!m&&y&&r===e&&null===a&&o(y),g||(b.current&&v&&b.current.uuid===v.uuid&&!b.current.stopDatetime&&v.stopDatetime&&o(null),b.current=v)},[v,a,y,m,g,r]);let w=(0,l$.useCallback)(()=>{d(),h()},[d,h]);(0,l$.useEffect)(()=>{n.current=w},[w]);let E=!!(!u||i&&!p),x=!!(i?f:c);return{error:c||f,mutate:w,isValidating:m||g,activeVisit:y,currentVisit:v,currentVisitIsRetrospective:!!i,isLoading:E&&!x}}cd().extend(cm);let cv=[];function cb(){let{data:e}=uA()(iA,iI);return e??cv}let cw=new Map;async function cE(e,t){let n=t.indexOf("#"),r=n>=0,a=r?t.substring(0,n):e,o=r?t.substring(n+1):t,i=await o5(a);return i&&Object.hasOwn(i,o)&&"function"==typeof i[o]?cD(a,i).then(()=>i[o]()):(i?i&&Object.hasOwn(i,o)?console.warn(`The export ${t}, defined in ${e}'s routes.json, is not a function`):console.warn(`${a} does not define a component called "${o}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${a} for ${t} defined in ${e}'s routes.json`),cx)}let cx={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function cD(e,t){if(e in cw)await cw[e];else{let n=t??await o5(e);await (cw[e]=new Promise((t,r)=>{if(Object.hasOwn(n,"startupApp")){let a=n.startupApp;if("function"==typeof a)return Promise.resolve(a()).then(()=>{nm(e),t(null)}).catch(r)}nm(e),t(null)}))}}function c_(e,t){let n=t.name;if(!n)return void console.error(`An extension definition in ${e} is missing an name and thus cannot be
|
|
17
17
|
registered. To fix this, ensure that you define the "name" field inside the
|
|
18
18
|
extension definition.`,t);t.slots&&t.slot&&console.warn(`The extension ${n} from ${e} declares both a 'slots' property and
|
|
19
19
|
a 'slot' property. Only the 'slots' property will be honored.`);let r=t.slots?t.slots:t.slot?[t.slot]:[];if(!t.component)return void console.error(`The extension ${n} from ${e} is missing a 'component' entry and thus cannot be registered.
|
|
20
|
-
To fix this, ensure that you define a 'component' field inside the extension definition.`,t);for(let a of(
|
|
20
|
+
To fix this, ensure that you define a 'component' field inside the extension definition.`,t);for(let a of(s3({name:n,load:()=>cE(e,t.component),meta:t.meta||{},order:t.order,moduleName:e,privileges:t.privileges,featureFlag:t.featureFlag,displayExpression:t.displayExpression}),r))s6(a,n)}let ck=[];function cS(e,t){sj(()=>(function(e,t){if(e&&t&&"object"==typeof t){nd(e);let n=t.extensions??[],r=t.modals??[],a=t.workspaces??[],o=t.workspaceGroups??[],i=t.featureFlags??[],s=t.workspaceGroups2??[],l=t.workspaceWindows2??[],u=t.workspaces2??[];t.pages?.forEach(t=>{t&&"object"==typeof t&&Object.hasOwn(t,"component")&&(Object.hasOwn(t,"route")||Object.hasOwn(t,"routeRegex")||Object.hasOwn(t,"routes"))?ck.push({...t,appName:e}):console.warn(`A page for ${e} could not be registered as it does not appear to have the required properties`,t)}),n.forEach(t=>{t&&"object"==typeof t&&Object.hasOwn(t,"name")&&Object.hasOwn(t,"component")?c_(e,t):console.warn(`An extension for ${e} could not be registered as it does not appear to have the required properties`,t)}),r.forEach(t=>{if(t&&"object"==typeof t&&Object.hasOwn(t,"name")&&Object.hasOwn(t,"component")){let n;(n=t.name)?t.component?ls({name:n,moduleName:e,load:()=>cE(e,t.component)}):console.error(`The modal ${n} from ${e} is missing a 'component' entry and thus cannot be registered.
|
|
21
21
|
To fix this, ensure that you define a 'component' field inside the modal definition.`,t):console.error(`A modal definition in ${e} is missing an name and thus cannot be
|
|
22
22
|
registered. To fix this, ensure that you define the "name" field inside the
|
|
23
23
|
modal definition.`,t)}else console.warn(`A modal for ${e} could not be registered as it does not appear to have the required properties`,t)}),a.forEach(t=>{t&&"object"==typeof t&&Object.hasOwn(t,"name")&&Object.hasOwn(t,"component")?function(e,t){let n=t.name;if(!n)return console.error(`A workspace definition in ${e} is missing a name and thus cannot be registered.
|
|
24
24
|
To fix this, ensure that you define the "name" field inside the workspace definition.`,t);let r=t.title;if(!r)return console.error(`A workspace definition in ${e} is missing a title and thus cannot be registered.
|
|
25
25
|
To fix this, ensure that you define the "title" field inside the workspace definition.`,t);if(!t.component)return console.error(`The workspace ${n} from ${e} is missing a 'component' entry and thus cannot be registered.
|
|
26
|
-
To fix this, ensure that you define a 'component' field inside the workspace definition.`,t);for(let a of(
|
|
27
|
-
To fix this, ensure that you define the "name" field inside the workspace definition.`,t)}else console.warn(`A workspace group for ${e} could not be registered as it does not appear to have the required properties`,t)}),
|
|
26
|
+
To fix this, ensure that you define a 'component' field inside the workspace definition.`,t);for(let a of(ld({name:n,title:r,component:t.component,moduleName:e,type:t.type,canHide:t.canHide,canMaximize:t.canMaximize,width:t.width,preferredWindowSize:t.preferredWindowSize,groups:t.groups,load:()=>cE(e,t.component)}),t.groups||[]))lm({name:a,members:[n]})}(e,t):console.warn(`A workspace for ${e} could not be registered as it does not appear to have the required properties`,t)}),o.forEach(t=>{if(t&&"object"==typeof t&&Object.hasOwn(t,"name")){let n;(n=t.name)?lm({name:n,members:t.members??[]}):console.error(`A workspace group definition in ${e} is missing a name and thus cannot be registered.
|
|
27
|
+
To fix this, ensure that you define the "name" field inside the workspace definition.`,t)}else console.warn(`A workspace group for ${e} could not be registered as it does not appear to have the required properties`,t)}),lw(e,s);for(let t of(lE(e,l),l))t.icon&&c_(e,{name:t.name,component:t.icon,slot:t.group,order:t.order});lx(e,u),i.forEach(t=>{if(t&&"object"==typeof t&&Object.hasOwn(t,"flagName"))t.flagName?t.label?t.description?sg(t.flagName,t.label,t.description):console.error(`A feature flag definition in ${e} is missing a description and thus cannot be registered.
|
|
28
28
|
To fix this, ensure that you define the "description" field inside the feature flag definition.`,t):console.error(`A feature flag definition in ${e} is missing a description and thus cannot be registered.
|
|
29
29
|
To fix this, ensure that you define the "label" field inside the feature flag definition.`,t):console.error(`A feature flag definition in ${e} is missing a name and thus cannot be registered.
|
|
30
|
-
To fix this, ensure that you define the "name" field inside the feature flag definition.`,t);else console.warn(`A feature flag for ${e} could not be registered as it does not appear to have the required properties`,t)})}})(e,t))}function
|
|
31
|
-
To fix this, ensure that you define the "route" (or alternatively the "routeRegex") field inside the extension definition.`,e):t.component?
|
|
32
|
-
To fix this, ensure that you define the "component" field inside the page definition.`,e)}(r,t)}}let cC={PHONE_MIN:0,PHONE_MAX:600,TABLET_MIN:601,TABLET_MAX:1023,SMALL_DESKTOP_MIN:1024,SMALL_DESKTOP_MAX:1439,LARGE_DESKTOP_MIN:1440,LARGE_DESKTOP_MAX:Number.MAX_SAFE_INTEGER};function cP(){document.body.classList.toggle("omrs-breakpoint-lt-tablet",window.innerWidth<cC.TABLET_MIN),document.body.classList.toggle("omrs-breakpoint-gt-phone",window.innerWidth>cC.PHONE_MAX),document.body.classList.toggle("omrs-breakpoint-gt-tablet",window.innerWidth>cC.TABLET_MAX),document.body.classList.toggle("omrs-breakpoint-lt-desktop",window.innerWidth<cC.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-small-desktop",window.innerWidth<cC.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-large-desktop",window.innerWidth<cC.LARGE_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-gt-small-desktop",window.innerWidth>cC.SMALL_DESKTOP_MAX)}let cR=!1;function cT(){cR||(window.addEventListener("resize",cP),cP(),cR=!0)}var c$=n(4848),cO=n(6942),cN=n.n(cO);function cA({title:e,children:t}){let n="tablet"===u4();return(0,c$.jsxs)("div",{className:cN()({"-esm-stock-management__card-header-module__tabletHeader___rUYi0":n,"-esm-stock-management__card-header-module__desktopHeader___CDa37":!n}),children:[(0,c$.jsx)("h4",{children:e}),t]})}let cI=["red","magenta","purple","blue","teal","cyan","gray","green","warm-gray","cool-gray","high-contrast","outline"],cj={primaryColor:{_type:tM.String,_description:"The color for displaying primary diagnoses tags",_default:"red",_validators:[nW.oneOf(cI)]},secondaryColor:{_type:tM.String,_description:"The color for displaying secondary diagnoses tags",_default:"blue",_validators:[nW.oneOf(cI)]}},cM={"Brand color #1":{_default:"#005d5d",_type:tM.String},"Brand color #2":{_default:"#004144",_type:tM.String},"Brand color #3":{_default:"#007d79",_type:tM.String},excludePatientIdentifierCodeTypes:{uuids:{_type:tM.Array,_description:"List of UUIDs of patient identifier types to exclude from rendering in the patient banner",_default:[],_elements:{_type:tM.UUID}}},implementationName:{_type:tM.String,_description:"A name of the place (or authority) where all possible locations a user can choose are located.",_default:"Clinic"},patientPhotoConceptUuid:{_type:tM.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:tM.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[nW.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}},preferredDateLocale:{_type:tM.Object,_description:"Allows setting the locale used for date formatting for any browser locale. Does not affect time formatting. Keys should be locale codes, and values should be the preferred locale for formatting dates. For example, {'en': 'en-US', 'fr-CA': 'en-CA'}.",_default:{en:"en-GB"},_elements:{_type:tM.String}},diagnosisTags:cj};var cL=n(9284);let cF={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},cB=e=>(0,c$.jsx)(cL.TableBatchActions,{translateWithId:(e,t)=>{let n=cF[e];return n?a3(n,e,t):e},...e}),cV="-esm-stock-management__custom-overflow-menu-module__container___lY3iq",cU="-esm-stock-management__custom-overflow-menu-module__menu___dReHr",cW="-esm-stock-management__custom-overflow-menu-module__show___48R0e",cH="-esm-stock-management__custom-overflow-menu-module__overflowMenuButton___tsY8r",cz=(0,lT.createContext)(null);function cK(){let e=(0,lT.useContext)(cz);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function cG({menuTitle:e,children:t}){let[n,r]=l$().useState(!1),a=u8(()=>r(!1),n),o="tablet"===u4(),i=(0,lT.useCallback)(()=>r(e=>!e),[]),s=(0,lT.useRef)(null),l=(0,lT.useRef)(null),u=(0,lT.useId)(),c=`custom-overflow-menu-trigger-${u}`,d=`custom-overflow-menu-${u}`,m=(0,lT.useCallback)(()=>{r(!1),s.current?.focus()},[]),p=(0,lT.useMemo)(()=>({closeMenu:m}),[m]),f=(0,lT.useCallback)(e=>{"Escape"===e.key&&n&&(e.stopPropagation(),m())},[m,n]),h=lT.Children.toArray(t);(0,lT.useEffect)(()=>{if(n&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[n]);let g=(0,lT.useCallback)(({currentIndex:e,direction:t})=>{let n=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!n?.length)return;let r=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,a=Array.from(n).indexOf(r);if(-1===a)return void n[t>0?0:n.length-1]?.focus();let o=a+t,i=o<0?n.length-1:o>=n.length?0:o;n[i]?.focus()},[]),y=h.map((e,t)=>(0,lT.isValidElement)(e)?(0,lT.cloneElement)(e,{closeMenu:m,handleOverflowMenuItemFocus:g,index:t}):e);return(0,c$.jsxs)("div",{"data-overflow-menu":!0,className:cN()("cds--overflow-menu",cV),ref:a,children:[(0,c$.jsx)("button",{className:cN()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":n},cH),"aria-controls":d,"aria-expanded":n,"aria-haspopup":"true",id:c,onClick:i,onKeyDown:f,ref:s,children:e}),(0,c$.jsxs)("div",{className:cN()("cds--overflow-menu-options","cds--overflow-menu--flip",cU,{[cW]:n}),"aria-labelledby":c,"data-floating-menu-direction":"bottom",id:d,onKeyDown:f,ref:l,role:"menu",tabIndex:-1,children:[(0,c$.jsx)("ul",{className:cN()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":o}),children:(0,c$.jsx)(cz.Provider,{value:p,children:y})}),(0,c$.jsx)("span",{})]})]})}function cZ(e){let t=(0,lT.useContext)(cz);return(0,c$.jsx)(cL.OverflowMenuItem,{...e,closeMenu:t?.closeMenu})}var cY=n(7283);let cq=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-chart-line","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-mobile-check","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-two-factor-authentication","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],cJ=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),cX=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-add",iconProps:e})})),cQ=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),c0=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),c1=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),c4=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),c2=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),c3=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),c6=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),c5=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),c9=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),c8=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),c7=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),de=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),dt=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),dn=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),dr=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),da=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),di=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),ds=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),dl=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),du=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),dc=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-close",iconProps:e})})),dd=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),dm=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),dp=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-document",iconProps:e})})),df=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),dh=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-download",iconProps:e})})),dg=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),dy=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),dv=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),db=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-events",iconProps:e})})),dw=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),dE=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),dx=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),dD=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),d_=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),dk=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-group",iconProps:e})})),dS=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),dC=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),dP=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),dR=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-information",iconProps:e})})),dT=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),d$=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),dO=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),dN=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),dA=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),dI=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-location",iconProps:e})})),dj=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),dM=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),dL=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),dF=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),dB=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),dV=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),dU=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-money",iconProps:e})})),dW=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),dH=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),dz=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),dK=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),dG=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-password",iconProps:e})})),dZ=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),dY=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),dq=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),dJ=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),dX=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),dQ=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),d0=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),d1=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-report",iconProps:e})})),d4=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),d2=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-save",iconProps:e})})),d3=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-search",iconProps:e})})),d6=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),d5=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),d9=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),d8=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),d7=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),me=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),mt=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),mn=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-table",iconProps:e})})),mr=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-time",iconProps:e})})),ma=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),mo=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),mi=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),ms=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),ml=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),mu=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),mc=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),md=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),mm=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-user",iconProps:e})})),mp=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),mf=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-view",iconProps:e})})),mh=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(mx,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),mg=mh,my=df,mv=dA,mb=dP,mw=d8,mE=(0,lT.memo)((0,lT.forwardRef)(function({icon:e,fallback:t,...n},r){let a=(0,lT.useRef)(e?document.getElementById(e):void 0);return(0,lT.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(a.current=e?document.getElementById(e):void 0)});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,c$.jsx)(ub,{value:a.current,fallback:t,children:(0,c$.jsx)(mx,{ref:r,icon:e,iconProps:n})})})),mx=(0,lT.memo)((0,lT.forwardRef)(function({icon:e,iconProps:t},n){let{className:r,fill:a,size:o}=Object.assign({},{fill:"currentColor",size:20},t);(o<=0||o>72)&&(console.error(`Invalid size '${o}' specified for ${e}. Defaulting to 20.`),o=20);let i=(0,lT.useRef)(null);return(0,lT.useImperativeHandle)(n,()=>i.current),(0,lT.useEffect)(()=>{i.current&&"currentColor"!==a&&i.current.style.setProperty("--omrs-icon-fill",a)},[]),(0,c$.jsx)("svg",{ref:i,className:cN()("omrs-icon","-esm-stock-management__icons-module__icon___sq7Qp",r),height:o,width:o,viewBox:"0 0 16 16",children:(0,c$.jsx)("use",{href:`#${e}`})})})),mD=({path:e,title:t,basePath:n,icon:r})=>{let{t:a}=(0,l7.useTranslation)(),o=(0,cY.useLocation)(),i=(0,lT.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let n=t.split("/").map(e=>decodeURIComponent(e)),r=(o.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return r.some((e,t)=>n.every((e,n)=>r[t+n]===e))},[o.pathname,e]);return(0,c$.jsx)("div",{children:(0,c$.jsx)(lN,{className:cN()("cds--side-nav__link",{"active-left-nav-link":i}),to:`${n}/${encodeURIComponent(e)}`,children:(0,c$.jsxs)("span",{className:"-esm-stock-management__dashboard-module__menu___Lg1M+",children:[(0,c$.jsx)(mE,{icon:r,className:"-esm-stock-management__dashboard-module__icon___Y2DxK",size:16}),(0,c$.jsx)("span",{children:a(t)})]})})},e)};function m_(e){return function({basePath:t}){return(0,c$.jsx)(cY.BrowserRouter,{children:(0,c$.jsx)(mD,{basePath:t,...e})})}}function mk(e){let t=(0,lT.useRef)(null);return(0,lT.useMemo)(()=>({get current(){return t.current},set current(value){t.current=value,"function"==typeof e?e(value):e&&(e.current=value)}}),[e])}function mS(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let mC="u">typeof document?l$().useLayoutEffect:()=>{};function mP(e){let t=(0,lT.useRef)(null);return mC(()=>{t.current=e},[e]),(0,lT.useCallback)((...e)=>{let n=t.current;return null==n?void 0:n(...e)},[])}let mR={prefix:String(Math.round(1e10*Math.random())),current:0},mT=l$().createContext(mR),m$=l$().createContext(!1),mO=("u">typeof window&&window.document&&window.document.createElement,new WeakMap),mN="function"==typeof l$().useId?function(e){let t=l$().useId(),[n]=(0,lT.useState)(mM()),r=n?"react-aria":`react-aria${mR.prefix}`;return e||`${r}-${t}`}:function(e){let t=(0,lT.useContext)(mT),n=function(e=!1){let t=(0,lT.useContext)(mT),n=(0,lT.useRef)(null);if(null===n.current&&!e){var r,a;let e=null==(a=l$().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||null==(r=a.ReactCurrentOwner)?void 0:r.current;if(e){let n=mO.get(e);null==n?mO.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,mO.delete(e))}n.current=++t.current}return n.current}(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`};function mA(){return!1}function mI(){return!0}function mj(e){return()=>{}}function mM(){return"function"==typeof l$().useSyncExternalStore?l$().useSyncExternalStore(mj,mA,mI):(0,lT.useContext)(m$)}let mL=!!("u">typeof window&&window.document&&window.document.createElement),mF=new Map;function mB(e){let[t,n]=(0,lT.useState)(e),r=(0,lT.useRef)(null),a=mN(t),o=(0,lT.useRef)(null);if(i&&i.register(o,a),mL){let e=mF.get(a);e&&!e.includes(r)?e.push(r):mF.set(a,[r])}return mC(()=>()=>{i&&i.unregister(o),mF.delete(a)},[a]),(0,lT.useEffect)(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),a}function mV(e=[]){let t=mB(),[n,r]=function(e){let[t,n]=(0,lT.useState)(e),r=(0,lT.useRef)(null),a=mP(()=>{if(!r.current)return;let e=r.current.next();if(e.done){r.current=null;return}t===e.value?a():n(e.value)});mC(()=>{r.current&&a()});let o=mP(e=>{r.current=e(t),a()});return[t,o]}(t),a=(0,lT.useCallback)(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return mC(a,[t,a,...e]),n}"u">typeof FinalizationRegistry&&(i=new FinalizationRegistry(e=>{mF.delete(e)}));let mU=function(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=function e(t){var n,r,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(a&&(a+=" "),a+=r)}else for(r in t)t[r]&&(a&&(a+=" "),a+=r);return a}(e))&&(r&&(r+=" "),r+=t);return r};function mW(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],a=r[e];"function"==typeof n&&"function"==typeof a&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&90>=e.charCodeAt(2)?t[e]=mS(n,a):("className"===e||"UNSAFE_className"===e)&&"string"==typeof n&&"string"==typeof a?t[e]=mU(n,a):"id"===e&&n&&a?t.id=function(e,t){if(e===t)return e;let n=mF.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=mF.get(t);return r?(r.forEach(t=>t.current=e),e):t}(n,a):t[e]=void 0!==a?a:n}}return t}let mH=Symbol("default");function mz({values:e,children:t}){for(let[n,r]of e)t=l$().createElement(n.Provider,{value:r},t);return t}function mK(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:i,values:s}=e;return(0,lT.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:a}):t,l="function"==typeof n?n({...s,defaultStyle:i||{}}):n,u="function"==typeof r?r({...s,defaultChildren:o}):null==r?o:r,{className:null!=e?e:a,style:l||i?{...i,...l}:void 0,children:null!=u?u:o,"data-rac":""}},[t,n,r,a,o,i,s])}function mG(e,t){let n=(0,lT.useContext)(e);if(null===t)return null;if(n&&"object"==typeof n&&"slots"in n&&n.slots){let e=t||mH;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:"A slot prop is required.";throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function mZ(e,t,n){let{ref:r,...a}=mG(n,e.slot)||{},o=mk((0,lT.useMemo)(()=>(function(...e){return 1===e.length&&e[0]?e[0]:t=>{for(let n of e)"function"==typeof n?n(t):null!=n&&(n.current=t)}})(t,r),[t,r])),i=mW(a,e);return"style"in a&&a.style&&"style"in e&&e.style&&("function"==typeof a.style||"function"==typeof e.style?i.style=t=>{let n="function"==typeof a.style?a.style(t):a.style,r={...t.defaultStyle,...n},o="function"==typeof e.style?e.style({...t,defaultStyle:r}):e.style;return{...r,...o}}:i.style={...a.style,...e.style}),[i,o]}function mY(e=!0){let[t,n]=(0,lT.useState)(e),r=(0,lT.useRef)(!1),a=(0,lT.useCallback)(e=>{r.current=!0,n(!!e)},[]);return mC(()=>{r.current||n(!1)},[]),[a,t]}function mq(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}let mJ=(0,lT.createContext)(null),mX=null;function mQ(e,t="assertive",n=7e3){mX?mX.announce(e,t,n):(mX=new m0,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?mX.announce(e,t,n):setTimeout(()=>{(null==mX?void 0:mX.isAttached())&&(null==mX||mX.announce(e,t,n))},100))}class m0{isAttached(){var e;return null==(e=this.node)?void 0:e.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",n=7e3){var r,a;if(!this.node)return;let o=document.createElement("div");"object"==typeof e?(o.setAttribute("role","img"),o.setAttribute("aria-labelledby",e["aria-labelledby"])):o.textContent=e,"assertive"===t?null==(r=this.assertiveLog)||r.appendChild(o):null==(a=this.politeLog)||a.appendChild(o),""!==e&&setTimeout(()=>{o.remove()},n)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"u">typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}let m1=new Set(["id"]),m4=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),m2=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),m3=/^(data-.*)$/;function m6(e,t={}){let{labelable:n,isLink:r,propNames:a}=t,o={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(m1.has(t)||n&&m4.has(t)||r&&m2.has(t)||(null==a?void 0:a.has(t))||m3.test(t))&&(o[t]=e[t]);return o}let m5=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])'],m9=m5.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";m5.push('[tabindex]:not([tabindex="-1"]):not([disabled])');let m8=m5.join(':not([hidden]):not([tabindex="-1"]),');function m7(e){return e.matches(m9)}function pe(e){return e.matches(m8)}let pt=e=>{var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document},pn=e=>e&&"window"in e&&e.window===e?e:pt(e).defaultView||window;function pr(e){if(function(){if(null==pa){pa=!1;try{document.createElement("div").focus({get preventScroll(){return pa=!0,!0}})}catch{}}return pa}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let pa=null;function po(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function pi(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function ps(e){let t=(0,lT.useRef)({isFocused:!1,observer:null});mC(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]);let n=mP(t=>{null==e||e(t)});return(0,lT.useCallback)(e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target;r.addEventListener("focusout",e=>{t.current.isFocused=!1,r.disabled&&n(po(e)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var e;null==(e=t.current.observer)||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let pl=!1;function pu(e){var t;return!("u"<typeof window)&&null!=window.navigator&&((null==(t=window.navigator.userAgentData)?void 0:t.brands.some(t=>e.test(t.brand)))||e.test(window.navigator.userAgent))}function pc(e){var t;return"u">typeof window&&null!=window.navigator&&e.test((null==(t=window.navigator.userAgentData)?void 0:t.platform)||window.navigator.platform)}function pd(e){let t=null;return()=>(null==t&&(t=e()),t)}let pm=pd(function(){return pc(/^Mac/i)}),pp=pd(function(){return pc(/^iPhone/i)}),pf=pd(function(){return pc(/^iPad/i)||pm()&&navigator.maxTouchPoints>1}),ph=pd(function(){return pp()||pf()});pd(function(){return pm()||ph()});let pg=pd(function(){return pu(/AppleWebKit/i)&&!py()}),py=pd(function(){return pu(/Chrome/i)}),pv=pd(function(){return pu(/Android/i)}),pb=pd(function(){return pu(/Firefox/i)}),pw=new Map,pE=new Set;function px(){if("u"<typeof window)return;function e(e){return"propertyName"in e}let t=n=>{if(!e(n)||!n.target)return;let r=pw.get(n.target);if(r&&(r.delete(n.propertyName),0===r.size&&(n.target.removeEventListener("transitioncancel",t),pw.delete(n.target)),0===pw.size)){for(let e of pE)e();pE.clear()}};document.body.addEventListener("transitionrun",n=>{if(!e(n)||!n.target)return;let r=pw.get(n.target);r||(r=new Set,pw.set(n.target,r),n.target.addEventListener("transitioncancel",t,{once:!0})),r.add(n.propertyName)}),document.body.addEventListener("transitionend",t)}function pD(e){requestAnimationFrame(()=>{0===pw.size?e():pE.add(e)})}"u">typeof document&&("loading"!==document.readyState?px():document.addEventListener("DOMContentLoaded",px));let p_="default",pk="",pS=new WeakMap;function pC(e){if(ph())"disabled"===p_&&(p_="restoring",setTimeout(()=>{pD(()=>{if("restoring"===p_){let t=pt(e);"none"===t.documentElement.style.webkitUserSelect&&(t.documentElement.style.webkitUserSelect=pk||""),pk="",p_="default"}})},300));else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&pS.has(e)){let t=pS.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";"none"===e.style[n]&&(e.style[n]=t),""===e.getAttribute("style")&&e.removeAttribute("style"),pS.delete(e)}}let pP=l$().createContext({register:()=>{}});function pR(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function pT(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function p$(e,t,n){var r=pR(e,t,"set");if(r.set)r.set.call(e,n);else{if(!r.writable)throw TypeError("attempted to set read only private field");r.value=n}return n}function pO(e,t){mC(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function pN(){let e=(0,lT.useRef)(new Map),t=(0,lT.useCallback)((t,n,r,a)=>{let o=(null==a?void 0:a.once)?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:o,options:a}),t.addEventListener(n,o,a)},[]),n=(0,lT.useCallback)((t,n,r,a)=>{var o;let i=(null==(o=e.current.get(r))?void 0:o.fn)||r;t.removeEventListener(n,i,a),e.current.delete(r)},[]),r=(0,lT.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,lT.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}pP.displayName="PressResponderContext";function pA(e,t){return!!t&&!!e&&e.contains(t)}function pI(e){return e.target}function pj(e,t,n=!0){var r,a;let{metaKey:o,ctrlKey:i,altKey:s,shiftKey:l}=t;pb()&&(null==(a=window.event)||null==(r=a.type)?void 0:r.startsWith("key"))&&"_blank"===e.target&&(pm()?o=!0:i=!0);let u=pg()&&pm()&&!pf()&&1?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:o,ctrlKey:i,altKey:s,shiftKey:l}):new MouseEvent("click",{metaKey:o,ctrlKey:i,altKey:s,shiftKey:l,bubbles:!0,cancelable:!0});pj.isOpening=n,pr(e),e.dispatchEvent(u),pj.isOpening=!1}function pM(e){return 0===e.mozInputSource&&!!e.isTrusted||(pv()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}pj.isOpening=!1;var pL=n(5747),pF=n.n(pL),pB=new WeakMap;class pV{continuePropagation(){p$(this,pB,!1)}get shouldStopPropagation(){var e;return e=pR(this,pB,"get"),e.get?e.get.call(this):e.value}constructor(e,t,n,r){var a;pT(this,pB,{writable:!0,value:void 0}),p$(this,pB,!0);let o=null!=(a=null==r?void 0:r.target)?a:n.currentTarget;const i=null==o?void 0:o.getBoundingClientRect();let s,l=0,u,c=null;null!=n.clientX&&null!=n.clientY&&(u=n.clientX,c=n.clientY),i&&(null!=u&&null!=c?(s=u-i.left,l=c-i.top):(s=i.width/2,l=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=s,this.y=l}}let pU=Symbol("linkClicked");function pW(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:a,onPressUp:o,onClick:i,isDisabled:s,isPressed:l,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:m,...p}=function(e){let t=(0,lT.useContext)(pP);if(t){let{register:n,...r}=t;e=mW(r,e),n()}return pO(t,e.ref),e}(e),[f,h]=(0,lT.useState)(!1),g=(0,lT.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:y,removeAllGlobalListeners:v}=pN(),b=mP((e,t)=>{let a=g.current;if(s||a.didFirePressStart)return!1;let o=!0;if(a.isTriggeringEvent=!0,r){let n=new pV("pressstart",t,e);r(n),o=n.shouldStopPropagation}return n&&n(!0),a.isTriggeringEvent=!1,a.didFirePressStart=!0,h(!0),o}),w=mP((e,r,o=!0)=>{let i=g.current;if(!i.didFirePressStart)return!1;i.didFirePressStart=!1,i.isTriggeringEvent=!0;let l=!0;if(a){let t=new pV("pressend",r,e);a(t),l=t.shouldStopPropagation}if(n&&n(!1),h(!1),t&&o&&!s){let n=new pV("press",r,e);t(n),l&&(l=n.shouldStopPropagation)}return i.isTriggeringEvent=!1,l}),E=mP((e,t)=>{let n=g.current;if(s)return!1;if(o){n.isTriggeringEvent=!0;let r=new pV("pressup",t,e);return o(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0}),x=mP(e=>{let t=g.current;if(t.isPressed&&t.target){for(let n of(t.didFirePressStart&&null!=t.pointerType&&w(pK(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,v(),d||pC(t.target),t.disposables))n();t.disposables=[]}}),D=mP(e=>{c&&x(e)}),_=mP(e=>{null==i||i(e)}),k=mP((e,t)=>{if(i){let n=new MouseEvent("click",e);pi(n,t),i(po(n))}}),S=(0,lT.useMemo)(()=>{let e=g.current,t={onKeyDown(t){if(pz(t.nativeEvent,t.currentTarget)&&pA(t.currentTarget,pI(t.nativeEvent))){var r;pG(pI(t.nativeEvent),t.key)&&t.preventDefault();let a=!0;if(!e.isPressed&&!t.repeat){e.target=t.currentTarget,e.isPressed=!0,e.pointerType="keyboard",a=b(t,"keyboard");let r=t.currentTarget;y(pt(t.currentTarget),"keyup",mS(t=>{pz(t,r)&&!t.repeat&&pA(r,pI(t))&&e.target&&E(pK(e.target,t),"keyboard")},n),!0)}a&&t.stopPropagation(),t.metaKey&&pm()&&(null==(r=e.metaKeyEvents)||r.set(t.key,t.nativeEvent))}else"Meta"===t.key&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||pA(t.currentTarget,pI(t.nativeEvent)))&&t&&0===t.button&&!e.isTriggeringEvent&&!pj.isOpening){let n=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&("virtual"===e.pointerType||pM(t.nativeEvent))){let e=b(t,"virtual"),r=E(t,"virtual"),a=w(t,"virtual");_(t),n=e&&r&&a}else if(e.isPressed&&"keyboard"!==e.pointerType){let r=e.pointerType||t.nativeEvent.pointerType||"virtual";n=w(pK(t.currentTarget,t),r,!0),e.isOverTarget=!1,_(t),x(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{var n,r,a;if(e.isPressed&&e.target&&pz(t,e.target)){pG(pI(t),t.key)&&t.preventDefault();let n=pI(t),a=pA(e.target,pI(t));w(pK(e.target,t),"keyboard",a),a&&k(t,e.target),v(),"Enter"!==t.key&&pH(e.target)&&pA(e.target,n)&&!t[pU]&&(t[pU]=!0,pj(e.target,t,!1)),e.isPressed=!1,null==(r=e.metaKeyEvents)||r.delete(t.key)}else if("Meta"===t.key&&(null==(n=e.metaKeyEvents)?void 0:n.size)){let t=e.metaKeyEvents;for(let n of(e.metaKeyEvents=void 0,t.values()))null==(a=e.target)||a.dispatchEvent(new KeyboardEvent("keyup",n))}};if("u">typeof PointerEvent){t.onPointerDown=t=>{var a;if(0!==t.button||!pA(t.currentTarget,pI(t.nativeEvent)))return;if(a=t.nativeEvent,!pv()&&0===a.width&&0===a.height||1===a.width&&1===a.height&&0===a.pressure&&0===a.detail&&"mouse"===a.pointerType){e.pointerType="virtual";return}e.pointerType=t.pointerType;let o=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,d||function(e){if(ph()){if("default"===p_){let t=pt(e);pk=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}p_="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";pS.set(e,e.style[t]),e.style[t]="none"}}(e.target),o=b(t,e.pointerType);let a=pI(t.nativeEvent);"releasePointerCapture"in a&&a.releasePointerCapture(t.pointerId),y(pt(t.currentTarget),"pointerup",n,!1),y(pt(t.currentTarget),"pointercancel",r,!1)}o&&t.stopPropagation()},t.onMouseDown=t=>{if(pA(t.currentTarget,pI(t.nativeEvent))&&0===t.button){if(u){let n=function(e){for(;e&&!m7(e);)e=e.parentElement;let t=pn(e),n=t.document.activeElement;if(!n||n===e)return;pl=!0;let r=!1,a=e=>{(e.target===n||r)&&e.stopImmediatePropagation()},o=t=>{(t.target===n||r)&&(t.stopImmediatePropagation(),e||r||(r=!0,pr(n),l()))},i=t=>{(t.target===e||r)&&t.stopImmediatePropagation()},s=t=>{(t.target===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,pr(n),l()))};t.addEventListener("blur",a,!0),t.addEventListener("focusout",o,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",i,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener("blur",a,!0),t.removeEventListener("focusout",o,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",i,!0),pl=!1,r=!1},u=requestAnimationFrame(l);return l}(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{pA(t.currentTarget,pI(t.nativeEvent))&&"virtual"!==e.pointerType&&0===t.button&&E(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!0,b(pK(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!1,w(pK(e.target,t),e.pointerType,!1),D(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&e.target){if(pA(e.target,pI(t))&&null!=e.pointerType){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?x(t):(pr(e.target),e.target.click()))},80);y(t.currentTarget,"click",()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else x(t);e.isOverTarget=!1}},r=e=>{x(e)};t.onDragStart=e=>{pA(e.currentTarget,pI(e.nativeEvent))&&x(e)}}return t},[y,s,u,v,d,x,D,w,b,E,_,k]);return(0,lT.useEffect)(()=>{let e=null==m?void 0:m.current;e&&e instanceof pn(e).Element&&"auto"===pn(e).getComputedStyle(e).touchAction&&(e.style.touchAction="pan-x pan-y pinch-zoom")},[m]),(0,lT.useEffect)(()=>{let e=g.current;return()=>{var t;for(let n of(d||pC(null!=(t=e.target)?t:void 0),e.disposables))n();e.disposables=[]}},[d]),{isPressed:l||f,pressProps:mW(p,S)}}function pH(e){return"A"===e.tagName&&e.hasAttribute("href")}function pz(e,t){let{key:n,code:r}=e,a=t.getAttribute("role");return("Enter"===n||" "===n||"Spacebar"===n||"Space"===r)&&!(t instanceof pn(t).HTMLInputElement&&!pY(t,n)||t instanceof pn(t).HTMLTextAreaElement||t.isContentEditable)&&!(("link"===a||!a&&pH(t))&&"Enter"!==n)}function pK(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r}}function pG(e,t){return e instanceof HTMLInputElement?!pY(e,t):!(e instanceof HTMLInputElement)&&(e instanceof HTMLButtonElement?"submit"!==e.type&&"reset"!==e.type:!pH(e))}let pZ=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function pY(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:pZ.has(e.type)}let pq=null,pJ=new Set,pX=new Map,pQ=!1,p0=!1,p1={Tab:!0,Escape:!0};function p4(e,t){for(let n of pJ)n(e,t)}function p2(e){pQ=!0,e.metaKey||!pm()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(pq="keyboard",p4("keyboard",e))}function p3(e){pq="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(pQ=!0,p4("pointer",e))}function p6(e){pM(e)&&(pQ=!0,pq="virtual")}function p5(e){e.target!==window&&e.target!==document&&!pl&&e.isTrusted&&(pQ||p0||(pq="virtual",p4("virtual",e)),pQ=!1,p0=!1)}function p9(){pl||(pQ=!1,p0=!0)}function p8(e){if("u"<typeof window||pX.get(pn(e)))return;let t=pn(e),n=pt(e),r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){pQ=!0,r.apply(this,arguments)},n.addEventListener("keydown",p2,!0),n.addEventListener("keyup",p2,!0),n.addEventListener("click",p6,!0),t.addEventListener("focus",p5,!0),t.addEventListener("blur",p9,!1),"u">typeof PointerEvent&&(n.addEventListener("pointerdown",p3,!0),n.addEventListener("pointermove",p3,!0),n.addEventListener("pointerup",p3,!0)),t.addEventListener("beforeunload",()=>{p7(e)},{once:!0}),pX.set(t,{focus:r})}let p7=(e,t)=>{let n=pn(e),r=pt(e);t&&r.removeEventListener("DOMContentLoaded",t),pX.has(n)&&(n.HTMLElement.prototype.focus=pX.get(n).focus,r.removeEventListener("keydown",p2,!0),r.removeEventListener("keyup",p2,!0),r.removeEventListener("click",p6,!0),n.removeEventListener("focus",p5,!0),n.removeEventListener("blur",p9,!1),"u">typeof PointerEvent&&(r.removeEventListener("pointerdown",p3,!0),r.removeEventListener("pointermove",p3,!0),r.removeEventListener("pointerup",p3,!0)),pX.delete(n))};function fe(){return"pointer"!==pq}"u">typeof document&&("loading"!==(d=pt(void 0)).readyState?p8(void 0):d.addEventListener("DOMContentLoaded",()=>{p8(void 0)}));let ft=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function fn(e){let t=pt(e),n=((e=document)=>e.activeElement)(t);"virtual"===pq?pD(()=>{((e=document)=>e.activeElement)(t)===n&&e.isConnected&&pr(e)}):pr(e)}function fr(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:a}=e,o=(0,lT.useCallback)(e=>{if(e.target===e.currentTarget)return r&&r(e),a&&a(!1),!0},[r,a]),i=ps(o),s=(0,lT.useCallback)(e=>{let t=pt(e.target),r=t?((e=document)=>e.activeElement)(t):((e=document)=>e.activeElement)();e.target===e.currentTarget&&r===pI(e.nativeEvent)&&(n&&n(e),a&&a(!0),i(e))},[a,n,i]);return{focusProps:{onFocus:!t&&(n||a||r)?s:void 0,onBlur:!t&&(r||a)?o:void 0}}}function fa(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented:()=>n.isDefaultPrevented(),stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped:()=>t}),t&&n.stopPropagation()}}let fo=l$().createContext(null);function fi(e,t){let{focusProps:n}=fr(e),{keyboardProps:r}={keyboardProps:e.isDisabled?{}:{onKeyDown:fa(e.onKeyDown),onKeyUp:fa(e.onKeyUp)}},a=mW(n,r),o=function(e){let t=(0,lT.useContext)(fo)||{};pO(t,e);let{ref:n,...r}=t;return r}(t),i=e.isDisabled?{}:o,s=(0,lT.useRef)(e.autoFocus);(0,lT.useEffect)(()=>{s.current&&t.current&&fn(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:mW({...a,tabIndex:l},i)}}function fs(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:a}=e,o=(0,lT.useRef)({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=pN(),l=(0,lT.useCallback)(e=>{e.currentTarget.contains(e.target)&&o.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(o.current.isFocusWithin=!1,s(),n&&n(e),a&&a(!1))},[n,a,o,s]),u=ps(l),c=(0,lT.useCallback)(e=>{if(!e.currentTarget.contains(e.target))return;let t=pt(e.target),n=((e=document)=>e.activeElement)(t);if(!o.current.isFocusWithin&&n===pI(e.nativeEvent)){r&&r(e),a&&a(!0),o.current.isFocusWithin=!0,u(e);let n=e.currentTarget;i(t,"focus",e=>{if(o.current.isFocusWithin&&!pA(n,e.target)){let r=new t.defaultView.FocusEvent("blur",{relatedTarget:e.target});pi(r,n),l(po(r))}},{capture:!0})}},[r,a,u,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}function fl(e={}){var t;let{autoFocus:n=!1,isTextInput:r,within:a}=e,o=(0,lT.useRef)({isFocused:!1,isFocusVisible:n||fe()}),[i,s]=(0,lT.useState)(!1),[l,u]=(0,lT.useState)(()=>o.current.isFocused&&o.current.isFocusVisible),c=(0,lT.useCallback)(()=>u(o.current.isFocused&&o.current.isFocusVisible),[]),d=(0,lT.useCallback)(e=>{o.current.isFocused=e,s(e),c()},[c]);t={isTextInput:r},p8(),(0,lT.useEffect)(()=>{let e=(e,n)=>{var r;let a,i,s,l,u;r=!!(null==t?void 0:t.isTextInput),a=pt(null==n?void 0:n.target),i="u">typeof window?pn(null==n?void 0:n.target).HTMLInputElement:HTMLInputElement,s="u">typeof window?pn(null==n?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l="u">typeof window?pn(null==n?void 0:n.target).HTMLElement:HTMLElement,u="u">typeof window?pn(null==n?void 0:n.target).KeyboardEvent:KeyboardEvent,(r=r||a.activeElement instanceof i&&!ft.has(a.activeElement.type)||a.activeElement instanceof s||a.activeElement instanceof l&&a.activeElement.isContentEditable)&&"keyboard"===e&&n instanceof u&&!p1[n.key]||(e=>{o.current.isFocusVisible=e,c()})(fe())};return pJ.add(e),()=>{pJ.delete(e)}},[]);let{focusProps:m}=fr({isDisabled:a,onFocusChange:d}),{focusWithinProps:p}=fs({isDisabled:!a,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:l,focusProps:a?p:m}}l$().forwardRef(function(e,t){let{children:n,...r}=e,a=mk(t),o={...r,ref:a};return l$().createElement(fo.Provider,{value:o},n)});let fu=!1,fc=0;function fd(e){"touch"===e.pointerType&&(fu=!0,setTimeout(()=>{fu=!1},50))}function fm(){if("u">typeof document)return"u">typeof PointerEvent&&document.addEventListener("pointerup",fd),fc++,()=>{!(--fc>0)&&"u">typeof PointerEvent&&document.removeEventListener("pointerup",fd)}}function fp(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:a}=e,[o,i]=(0,lT.useState)(!1),s=(0,lT.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,lT.useEffect)(fm,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=pN(),{hoverProps:c,triggerHoverEnd:d}=(0,lT.useMemo)(()=>{let e=(e,t)=>{let a=s.target;s.pointerType="",s.target=null,"touch"!==t&&s.isHovered&&a&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:a,pointerType:t}),n&&n(!1),i(!1))},o={};return"u">typeof PointerEvent&&(o.onPointerEnter=r=>{fu&&"mouse"===r.pointerType||((r,o)=>{if(s.pointerType=o,a||"touch"===o||s.isHovered||!r.currentTarget.contains(r.target))return;s.isHovered=!0;let u=r.currentTarget;s.target=u,l(pt(r.target),"pointerover",t=>{s.isHovered&&s.target&&!pA(s.target,t.target)&&e(t,t.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:u,pointerType:o}),n&&n(!0),i(!0)})(r,r.pointerType)},o.onPointerLeave=t=>{!a&&t.currentTarget.contains(t.target)&&e(t,t.pointerType)}),{hoverProps:o,triggerHoverEnd:e}},[t,n,r,a,s,l,u]);return(0,lT.useEffect)(()=>{a&&d({currentTarget:s.target},s.pointerType)},[a]),{hoverProps:c,isHovered:o}}if("u">typeof HTMLTemplateElement){let e=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild").get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}let ff=(0,lT.createContext)(!1);function fh(e){let t=(t,n)=>(0,lT.useContext)(ff)?null:e(t,n);return t.displayName=e.displayName||e.name,(0,lT.forwardRef)(t)}let fg=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),fy=(0,lT.createContext)({}),fv=fh(function(e,t){var n;[e,t]=mZ(e,t,fy);let r=((n=e).isPending&&(n.onPress=void 0,n.onPressStart=void 0,n.onPressEnd=void 0,n.onPressChange=void 0,n.onPressUp=void 0,n.onKeyDown=void 0,n.onKeyUp=void 0,n.onClick=void 0,n.href=void 0),e=n),{isPending:a}=r,{buttonProps:o,isPressed:i}=function(e,t){let n,{elementType:r="button",isDisabled:a,onPress:o,onPressStart:i,onPressEnd:s,onPressUp:l,onPressChange:u,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:m,href:p,target:f,rel:h,type:g="button"}=e;n="button"===r?{type:g,disabled:a}:{role:"button",href:"a"!==r||a?void 0:p,target:"a"===r?f:void 0,type:"input"===r?g:void 0,disabled:"input"===r?a:void 0,"aria-disabled":a&&"input"!==r?a:void 0,rel:"a"===r?h:void 0};let{pressProps:y,isPressed:v}=pW({onPressStart:i,onPressEnd:s,onPressChange:u,onPress:o,onPressUp:l,onClick:m,isDisabled:a,preventFocusOnPress:c,ref:t}),{focusableProps:b}=fi(e,t);d&&(b.tabIndex=a?-1:b.tabIndex);let w=mW(b,y,m6(e,{labelable:!0}));return{isPressed:v,buttonProps:mW(n,w,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}(e,t),{focusProps:s,isFocused:l,isFocusVisible:u}=fl(e),{hoverProps:c,isHovered:d}=fp({...e,isDisabled:e.isDisabled||a}),m={isHovered:d,isPressed:(r.isPressed||i)&&!a,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:null!=a&&a},p=mK({...e,values:m,defaultClassName:"react-aria-Button"}),f=mB(o.id),h=mB(),g=o["aria-labelledby"];a&&(g?g=`${g} ${h}`:o["aria-label"]&&(g=`${f} ${h}`));let y=(0,lT.useRef)(a);return(0,lT.useEffect)(()=>{let e={"aria-labelledby":g||f};!y.current&&l&&a?mQ(e,"assertive"):y.current&&l&&!a&&mQ(e,"assertive"),y.current=a},[a,l,g,f]),l$().createElement("button",{...m6(e,{propNames:fg}),...mW(o,s,c),...p,type:"submit"===o.type&&a?"button":o.type,id:f,ref:t,"aria-labelledby":g,slot:e.slot||void 0,"aria-disabled":a?"true":o["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":m.isPressed||void 0,"data-hovered":d||void 0,"data-focused":l||void 0,"data-pending":a||void 0,"data-focus-visible":u||void 0},l$().createElement(mJ.Provider,{value:{id:h}},p.children))});(0,lT.createContext)(null),(0,lT.createContext)(null),(0,lT.createContext)(null),(0,lT.createContext)(null),(0,lT.createContext)(null);let fb=(0,lT.createContext)({}),fw=(0,lT.createContext)({}),fE=(0,lT.forwardRef)(function(e,t){[e,t]=mZ(e,t,fw);let{elementType:n="span",...r}=e;return l$().createElement(n,{className:"react-aria-Text",...r,ref:t})}),fx=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),fD=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function f_(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),n="function"==typeof t.getTextInfo?t.getTextInfo():t.textInfo;if(n)return"rtl"===n.direction;if(t.script)return fx.has(t.script)}let t=e.split("-")[0];return fD.has(t)}let fk=Symbol.for("react-aria.i18n.locale");function fS(){let e="u">typeof window&&window[fk]||"u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:f_(e)?"rtl":"ltr"}}let fC=fS(),fP=new Set;function fR(){for(let e of(fC=fS(),fP))e(fC)}function fT(){let e=mM(),[t,n]=(0,lT.useState)(fC);return((0,lT.useEffect)(()=>(0===fP.size&&window.addEventListener("languagechange",fR),fP.add(n),()=>{fP.delete(n),0===fP.size&&window.removeEventListener("languagechange",fR)}),[]),e)?{locale:"en-US",direction:"ltr"}:t}let f$=l$().createContext(null);function fO(e){let{locale:t,children:n}=e,r=fT(),a=l$().useMemo(()=>t?{locale:t,direction:f_(t)?"rtl":"ltr"}:r,[r,t]);return l$().createElement(f$.Provider,{value:a},n)}function fN(){let e=fT();return(0,lT.useContext)(f$)||e}var fA={};function fI(e,t){return e-t*Math.floor(e/t)}function fj(e,t,n,r){let a=(t=fL(e,t))-1,o=-2;return n<=2?o=0:fM(t)&&(o=-1),1721425+365*a+Math.floor(a/4)-Math.floor(a/100)+Math.floor(a/400)+Math.floor((367*n-362)/12+o+r)}function fM(e){return e%4==0&&(e%100!=0||e%400==0)}function fL(e,t){return"BC"===e?1-t:t}function fF(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}fA={"ar-AE":{dateRange:e=>`${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,dateSelected:e=>`${e.date} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,finishRangeSelectionPrompt:"انقر لإنهاء عملية تحديد نطاق التاريخ",maximumDate:"آخر تاريخ متاح",minimumDate:"أول تاريخ متاح",next:"التالي",previous:"السابق",selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.dateRange}`,startRangeSelectionPrompt:"انقر لبدء عملية تحديد نطاق التاريخ",todayDate:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date}`,todayDateSelected:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date} \u{645}\u{62D}\u{62F}\u{62F}`},"bg-BG":{dateRange:e=>`${e.startDate} \u{434}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435} ${e.date}`,finishRangeSelectionPrompt:"Натиснете, за да довършите избора на времеви интервал",maximumDate:"Последна налична дата",minimumDate:"Първа налична дата",next:"Напред",previous:"Назад",selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Натиснете, за да пристъпите към избора на времеви интервал",todayDate:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date}`,todayDateSelected:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date} \u{441}\u{430} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438}`},"cs-CZ":{dateRange:e=>`${e.startDate} a\u{17E} ${e.endDate}`,dateSelected:e=>`Vybr\xe1no ${e.date}`,finishRangeSelectionPrompt:"Kliknut\xedm dokonč\xedte v\xfdběr rozsahu dat",maximumDate:"Posledn\xed dostupn\xe9 datum",minimumDate:"Prvn\xed dostupn\xe9 datum",next:"Dalš\xed",previous:"Předchoz\xed",selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknut\xedm zah\xe1j\xedte v\xfdběr rozsahu dat",todayDate:e=>`Dnes, ${e.date}`,todayDateSelected:e=>`Dnes, vybr\xe1no ${e.date}`},"da-DK":{dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klik for at fuldf\xf8re valg af datoomr\xe5de",maximumDate:"Sidste ledige dato",minimumDate:"F\xf8rste ledige dato",next:"N\xe6ste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.dateRange}`,startRangeSelectionPrompt:"Klik for at starte valg af datoomr\xe5de",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`},"de-DE":{dateRange:e=>`${e.startDate} bis ${e.endDate}`,dateSelected:e=>`${e.date} ausgew\xe4hlt`,finishRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beenden",maximumDate:"Letztes verf\xfcgbares Datum",minimumDate:"Erstes verf\xfcgbares Datum",next:"Weiter",previous:"Zur\xfcck",selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.dateRange}`,startRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beginnen",todayDate:e=>`Heute, ${e.date}`,todayDateSelected:e=>`Heute, ${e.date} ausgew\xe4hlt`},"el-GR":{dateRange:e=>`${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,dateSelected:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${e.date}`,finishRangeSelectionPrompt:"Κάντε κλικ για να ολοκληρώσετε την επιλογή εύρους ημερομηνιών",maximumDate:"Τελευταία διαθέσιμη ημερομηνία",minimumDate:"Πρώτη διαθέσιμη ημερομηνία",next:"Επόμενο",previous:"Προηγούμενο",selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.dateRange}`,startRangeSelectionPrompt:"Κάντε κλικ για να ξεκινήσετε την επιλογή εύρους ημερομηνιών",todayDate:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, ${e.date}`,todayDateSelected:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3C4}\u{3B7}\u{3BA}\u{3B5} ${e.date}`},"en-US":{previous:"Previous",next:"Next",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.dateRange}`,todayDate:e=>`Today, ${e.date}`,todayDateSelected:e=>`Today, ${e.date} selected`,dateSelected:e=>`${e.date} selected`,startRangeSelectionPrompt:"Click to start selecting date range",finishRangeSelectionPrompt:"Click to finish selecting date range",minimumDate:"First available date",maximumDate:"Last available date",dateRange:e=>`${e.startDate} to ${e.endDate}`},"es-ES":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} seleccionado`,finishRangeSelectionPrompt:"Haga clic para terminar de seleccionar rango de fechas",maximumDate:"\xdaltima fecha disponible",minimumDate:"Primera fecha disponible",next:"Siguiente",previous:"Anterior",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo seleccionado: ${e.dateRange}`,startRangeSelectionPrompt:"Haga clic para comenzar a seleccionar un rango de fechas",todayDate:e=>`Hoy, ${e.date}`,todayDateSelected:e=>`Hoy, ${e.date} seleccionado`},"et-EE":{dateRange:e=>`${e.startDate} kuni ${e.endDate}`,dateSelected:e=>`${e.date} valitud`,finishRangeSelectionPrompt:"Kl\xf5psake kuup\xe4evavahemiku valimise l\xf5petamiseks",maximumDate:"Viimane saadaolev kuup\xe4ev",minimumDate:"Esimene saadaolev kuup\xe4ev",next:"J\xe4rgmine",previous:"Eelmine",selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.dateRange}`,startRangeSelectionPrompt:"Kl\xf5psake kuup\xe4evavahemiku valimiseks",todayDate:e=>`T\xe4na, ${e.date}`,todayDateSelected:e=>`T\xe4na, ${e.date} valitud`},"fi-FI":{dateRange:e=>`${e.startDate} \u{2013} ${e.endDate}`,dateSelected:e=>`${e.date} valittu`,finishRangeSelectionPrompt:"Lopeta p\xe4iv\xe4m\xe4\xe4r\xe4alueen valinta napsauttamalla t\xe4t\xe4.",maximumDate:"Viimeinen varattavissa oleva p\xe4iv\xe4m\xe4\xe4r\xe4",minimumDate:"Ensimm\xe4inen varattavissa oleva p\xe4iv\xe4m\xe4\xe4r\xe4",next:"Seuraava",previous:"Edellinen",selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.dateRange}`,startRangeSelectionPrompt:"Aloita p\xe4iv\xe4m\xe4\xe4r\xe4alueen valinta napsauttamalla t\xe4t\xe4.",todayDate:e=>`T\xe4n\xe4\xe4n, ${e.date}`,todayDateSelected:e=>`T\xe4n\xe4\xe4n, ${e.date} valittu`},"fr-FR":{dateRange:e=>`${e.startDate} \xe0 ${e.endDate}`,dateSelected:e=>`${e.date} s\xe9lectionn\xe9`,finishRangeSelectionPrompt:"Cliquer pour finir de s\xe9lectionner la plage de dates",maximumDate:"Derni\xe8re date disponible",minimumDate:"Premi\xe8re date disponible",next:"Suivant",previous:"Pr\xe9c\xe9dent",selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.dateRange}`,startRangeSelectionPrompt:"Cliquer pour commencer \xe0 s\xe9lectionner la plage de dates",todayDate:e=>`Aujourd'hui, ${e.date}`,todayDateSelected:e=>`Aujourd\u{2019}hui, ${e.date} s\xe9lectionn\xe9`},"he-IL":{dateRange:e=>`${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,dateSelected:e=>`${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,finishRangeSelectionPrompt:"חץ כדי לסיים את בחירת טווח התאריכים",maximumDate:"תאריך פנוי אחרון",minimumDate:"תאריך פנוי ראשון",next:"הבא",previous:"הקודם",selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.dateRange}`,startRangeSelectionPrompt:"לחץ כדי להתחיל בבחירת טווח התאריכים",todayDate:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date}`,todayDateSelected:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`},"hr-HR":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} odabran`,finishRangeSelectionPrompt:"Kliknite da dovršite raspon odabranih datuma",maximumDate:"Posljednji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sljedeći",previous:"Prethodni",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete raspon odabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, odabran ${e.date}`},"hu-HU":{dateRange:e=>`${e.startDate}\u{2013}${e.endDate}`,dateSelected:e=>`${e.date} kiv\xe1lasztva`,finishRangeSelectionPrompt:"Kattintson a d\xe1tumtartom\xe1ny kijel\xf6l\xe9s\xe9nek befejez\xe9s\xe9hez",maximumDate:"Utols\xf3 el\xe9rhető d\xe1tum",minimumDate:"Az első el\xe9rhető d\xe1tum",next:"K\xf6vetkező",previous:"Előző",selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.dateRange}`,startRangeSelectionPrompt:"Kattintson a d\xe1tumtartom\xe1ny kijel\xf6l\xe9s\xe9nek ind\xedt\xe1s\xe1hoz",todayDate:e=>`Ma, ${e.date}`,todayDateSelected:e=>`Ma, ${e.date} kijel\xf6lve`},"it-IT":{dateRange:e=>`Da ${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selezionata`,finishRangeSelectionPrompt:"Fai clic per completare la selezione dell’intervallo di date",maximumDate:"Ultima data disponibile",minimumDate:"Prima data disponibile",next:"Successivo",previous:"Precedente",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: ${e.dateRange}`,startRangeSelectionPrompt:"Fai clic per selezionare l’intervallo di date",todayDate:e=>`Oggi, ${e.date}`,todayDateSelected:e=>`Oggi, ${e.date} selezionata`},"ja-JP":{dateRange:e=>`${e.startDate} \u{304B}\u{3089} ${e.endDate}`,dateSelected:e=>`${e.date} \u{3092}\u{9078}\u{629E}`,finishRangeSelectionPrompt:"クリックして日付範囲の選択を終了",maximumDate:"最終利用可能日",minimumDate:"最初の利用可能日",next:"次へ",previous:"前へ",selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.dateRange}`,startRangeSelectionPrompt:"クリックして日付範囲の選択を開始",todayDate:e=>`\u{672C}\u{65E5}\u{3001}${e.date}`,todayDateSelected:e=>`\u{672C}\u{65E5}\u{3001}${e.date} \u{3092}\u{9078}\u{629E}`},"ko-KR":{dateRange:e=>`${e.startDate} ~ ${e.endDate}`,dateSelected:e=>`${e.date} \u{C120}\u{D0DD}\u{B428}`,finishRangeSelectionPrompt:"날짜 범위 선택을 완료하려면 클릭하십시오.",maximumDate:"마지막으로 사용 가능한 일자",minimumDate:"처음으로 사용 가능한 일자",next:"다음",previous:"이전",selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.dateRange}`,startRangeSelectionPrompt:"날짜 범위 선택을 시작하려면 클릭하십시오.",todayDate:e=>`\u{C624}\u{B298}, ${e.date}`,todayDateSelected:e=>`\u{C624}\u{B298}, ${e.date} \u{C120}\u{D0DD}\u{B428}`},"lt-LT":{dateRange:e=>`Nuo ${e.startDate} iki ${e.endDate}`,dateSelected:e=>`Pasirinkta ${e.date}`,finishRangeSelectionPrompt:"Spustelėkite, kad baigtumėte pasirinkti datų intervalą",maximumDate:"Paskutinė galima data",minimumDate:"Pirmoji galima data",next:"Paskesnis",previous:"Ankstesnis",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: ${e.dateRange}`,startRangeSelectionPrompt:"Spustelėkite, kad pradėtumėte pasirinkti datų intervalą",todayDate:e=>`\u{160}iandien, ${e.date}`,todayDateSelected:e=>`\u{160}iandien, pasirinkta ${e.date}`},"lv-LV":{dateRange:e=>`No ${e.startDate} l\u{12B}dz ${e.endDate}`,dateSelected:e=>`Atlas\u{12B}ts: ${e.date}`,finishRangeSelectionPrompt:"Noklikšķiniet, lai pabeigtu datumu diapazona atlasi",maximumDate:"Pēdējais pieejamais datums",minimumDate:"Pirmais pieejamais datums",next:"Tālāk",previous:"Atpakaļ",selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: ${e.dateRange}`,startRangeSelectionPrompt:"Noklikšķiniet, lai sāktu datumu diapazona atlasi",todayDate:e=>`\u{160}odien, ${e.date}`,todayDateSelected:e=>`Atlas\u{12B}ta \u{161}odiena, ${e.date}`},"nb-NO":{dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klikk for \xe5 fullf\xf8re valg av datoomr\xe5de",maximumDate:"Siste tilgjengelige dato",minimumDate:"F\xf8rste tilgjengelige dato",next:"Neste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.dateRange}`,startRangeSelectionPrompt:"Klikk for \xe5 starte valg av datoomr\xe5de",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`},"nl-NL":{dateRange:e=>`${e.startDate} tot ${e.endDate}`,dateSelected:e=>`${e.date} geselecteerd`,finishRangeSelectionPrompt:"Klik om de selectie van het datumbereik te voltooien",maximumDate:"Laatste beschikbare datum",minimumDate:"Eerste beschikbare datum",next:"Volgende",previous:"Vorige",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.dateRange}`,startRangeSelectionPrompt:"Klik om het datumbereik te selecteren",todayDate:e=>`Vandaag, ${e.date}`,todayDateSelected:e=>`Vandaag, ${e.date} geselecteerd`},"pl-PL":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`Wybrano ${e.date}`,finishRangeSelectionPrompt:"Kliknij, aby zakończyć wyb\xf3r zakresu dat",maximumDate:"Ostatnia dostępna data",minimumDate:"Pierwsza dostępna data",next:"Dalej",previous:"Wstecz",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknij, aby rozpocząć wyb\xf3r zakresu dat",todayDate:e=>`Dzisiaj, ${e.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e.date}`},"pt-BR":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para concluir a sele\xe7\xe3o do intervalo de datas",maximumDate:"\xdaltima data dispon\xedvel",minimumDate:"Primeira data dispon\xedvel",next:"Pr\xf3ximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para iniciar a sele\xe7\xe3o do intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`},"pt-PT":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para terminar de selecionar o intervalo de datas",maximumDate:"\xdaltima data dispon\xedvel",minimumDate:"Primeira data dispon\xedvel",next:"Pr\xf3ximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para come\xe7ar a selecionar o intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`},"ro-RO":{dateRange:e=>`De la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,dateSelected:e=>`${e.date} selectat\u{103}`,finishRangeSelectionPrompt:"Apăsaţi pentru a finaliza selecţia razei pentru dată",maximumDate:"Ultima dată disponibilă",minimumDate:"Prima dată disponibilă",next:"Următorul",previous:"\xcenainte",selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: ${e.dateRange}`,startRangeSelectionPrompt:"Apăsaţi pentru a \xeencepe selecţia razei pentru dată",todayDate:e=>`Ast\u{103}zi, ${e.date}`,todayDateSelected:e=>`Azi, ${e.date} selectat\u{103}`},"ru-RU":{dateRange:e=>`\u{421} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:"Щелкните, чтобы завершить выбор диапазона дат",maximumDate:"Последняя доступная дата",minimumDate:"Первая доступная дата",next:"Далее",previous:"Назад",selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Щелкните, чтобы начать выбор диапазона дат",todayDate:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`},"sk-SK":{dateRange:e=>`Od ${e.startDate} do ${e.endDate}`,dateSelected:e=>`Vybrat\xfd d\xe1tum ${e.date}`,finishRangeSelectionPrompt:"Kliknut\xedm dokonč\xedte v\xfdber rozsahu d\xe1tumov",maximumDate:"Posledn\xfd dostupn\xfd d\xe1tum",minimumDate:"Prv\xfd dostupn\xfd d\xe1tum",next:"Nasleduj\xface",previous:"Predch\xe1dzaj\xface",selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknut\xedm spust\xedte v\xfdber rozsahu d\xe1tumov",todayDate:e=>`Dnes ${e.date}`,todayDateSelected:e=>`Vybrat\xfd dne\u{161}n\xfd d\xe1tum ${e.date}`},"sl-SI":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izbrano`,finishRangeSelectionPrompt:"Kliknite za dokončanje izbire datumskega obsega",maximumDate:"Zadnji razpoložljivi datum",minimumDate:"Prvi razpoložljivi datum",next:"Naprej",previous:"Nazaj",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite za začetek izbire datumskega obsega",todayDate:e=>`Danes, ${e.date}`,todayDateSelected:e=>`Danes, ${e.date} izbrano`},"sr-SP":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izabran`,finishRangeSelectionPrompt:"Kliknite da dovršite opseg izabranih datuma",maximumDate:"Zadnji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sledeći",previous:"Prethodni",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani period: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete opseg izabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, izabran ${e.date}`},"sv-SE":{dateRange:e=>`${e.startDate} till ${e.endDate}`,dateSelected:e=>`${e.date} har valts`,finishRangeSelectionPrompt:"Klicka f\xf6r att avsluta val av datumintervall",maximumDate:"Sista tillg\xe4ngliga datum",minimumDate:"F\xf6rsta tillg\xe4ngliga datum",next:"N\xe4sta",previous:"F\xf6reg\xe5ende",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.dateRange}`,startRangeSelectionPrompt:"Klicka f\xf6r att v\xe4lja datumintervall",todayDate:e=>`Idag, ${e.date}`,todayDateSelected:e=>`Idag, ${e.date} har valts`},"tr-TR":{dateRange:e=>`${e.startDate} - ${e.endDate}`,dateSelected:e=>`${e.date} se\xe7ildi`,finishRangeSelectionPrompt:"Tarih aralığı se\xe7imini tamamlamak i\xe7in tıklayın",maximumDate:"Son m\xfcsait tarih",minimumDate:"İlk m\xfcsait tarih",next:"Sonraki",previous:"\xd6nceki",selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.dateRange}`,startRangeSelectionPrompt:"Tarih aralığı se\xe7imini başlatmak i\xe7in tıklayın",todayDate:e=>`Bug\xfcn, ${e.date}`,todayDateSelected:e=>`Bug\xfcn, ${e.date} se\xe7ildi`},"uk-UA":{dateRange:e=>`${e.startDate} \u{2014} ${e.endDate}`,dateSelected:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:"Натисніть, щоб завершити вибір діапазону дат",maximumDate:"Остання доступна дата",minimumDate:"Перша доступна дата",next:"Наступний",previous:"Попередній",selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Натисніть, щоб почати вибір діапазону дат",todayDate:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`},"zh-CN":{dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.date}`,finishRangeSelectionPrompt:"单击以完成选择日期范围",maximumDate:"最后一个可用日期",minimumDate:"第一个可用日期",next:"下一页",previous:"上一页",selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:"单击以开始选择日期范围",todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`},"zh-TW":{dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9078}\u{53D6} ${e.date}`,finishRangeSelectionPrompt:"按一下以完成選取日期範圍",maximumDate:"最後一個可用日期",minimumDate:"第一個可用日期",next:"下一頁",previous:"上一頁",selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:"按一下以開始選取日期範圍",todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${e.date}`}};let fB={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class fV{fromJulianDay(e){let t=e-1721426,n=Math.floor(t/146097),r=fI(t,146097),a=Math.floor(r/36524),o=fI(r,36524),i=Math.floor(o/1461),s=Math.floor(fI(o,1461)/365),[l,u]=fF(400*n+100*a+4*i+s+ +(4!==a&&4!==s)),c=e-fj(l,u,1,1),d=2;e<fj(l,u,3,1)?d=0:fM(u)&&(d=1);let m=Math.floor(((c+d)*12+373)/367),p=e-fj(l,u,m,1)+1;return new f7(l,u,m,p)}toJulianDay(e){return fj(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return fB[fM(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return fM(e.year)?366:365}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return"BC"===e.era}balanceDate(e){e.year<=0&&(e.era="BC"===e.era?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}function fU(e,t){let n=e.copy(),r="hour"in n?fX(n,t):0;fW(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,fH(n),fz(n),n.day+=7*(t.weeks||0),n.day+=t.days||0,n.day+=r,function(e){for(;e.day<1;)e.month--,fH(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,fH(e)}(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let a=n.calendar.getYearsInEra(n);if(n.year>a){var o,i;let e=null==(o=(i=n.calendar).isInverseEra)?void 0:o.call(i,n);n.year=a,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function fW(e,t){var n,r;(null==(n=(r=e.calendar).isInverseEra)?void 0:n.call(r,e))&&(t=-t),e.year+=t}function fH(e){for(;e.month<1;)fW(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,fW(e,1)}function fz(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function fK(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),fz(e)}function fG(e){let t={};for(let n in e)"number"==typeof e[n]&&(t[n]=-e[n]);return t}function fZ(e,t){let n=e.copy();return null!=t.era&&(n.era=t.era),null!=t.year&&(n.year=t.year),null!=t.month&&(n.month=t.month),null!=t.day&&(n.day=t.day),fK(n),n}function fY(e,t){let n=e.copy();return null!=t.hour&&(n.hour=t.hour),null!=t.minute&&(n.minute=t.minute),null!=t.second&&(n.second=t.second),null!=t.millisecond&&(n.millisecond=t.millisecond),fq(n),n}function fq(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function fJ(e,t){let n=e%t;return n<0&&(n+=t),n}function fX(e,t){let n;return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,e.second+=Math.floor(e.millisecond/1e3),e.millisecond=fJ(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=fJ(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=fJ(e.minute,60),n=Math.floor(e.hour/24),e.hour=fJ(e.hour,24),n}function fQ(e,t){let n=e.copy();return fX(n,t),n}function f0(e,t,n,r){let a=e.copy();switch(t){case"era":{let t=e.calendar.getEras(),o=t.indexOf(e.era);if(o<0)throw Error("Invalid era: "+e.era);o=f4(o,n,0,t.length-1,null==r?void 0:r.round),a.era=t[o],fK(a);break}case"year":var o,i;(null==(o=(i=a.calendar).isInverseEra)?void 0:o.call(i,a))&&(n=-n),a.year=f4(e.year,n,-1/0,9999,null==r?void 0:r.round),a.year===-1/0&&(a.year=1),a.calendar.balanceYearMonth&&a.calendar.balanceYearMonth(a,e);break;case"month":a.month=f4(e.month,n,1,e.calendar.getMonthsInYear(e),null==r?void 0:r.round);break;case"day":a.day=f4(e.day,n,1,e.calendar.getDaysInMonth(e),null==r?void 0:r.round);break;default:throw Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(a),fK(a),a}function f1(e,t,n,r){let a=e.copy();switch(t){case"hour":{let t=e.hour,o=0,i=23;if((null==r?void 0:r.hourCycle)===12){let e=t>=12;o=12*!!e,i=e?23:11}a.hour=f4(t,n,o,i,null==r?void 0:r.round);break}case"minute":a.minute=f4(e.minute,n,0,59,null==r?void 0:r.round);break;case"second":a.second=f4(e.second,n,0,59,null==r?void 0:r.round);break;case"millisecond":a.millisecond=f4(e.millisecond,n,0,999,null==r?void 0:r.round);break;default:throw Error("Unsupported field "+t)}return a}function f4(e,t,n,r,a=!1){if(a){(e+=Math.sign(t))<n&&(e=r);let a=Math.abs(t);(e=t>0?Math.ceil(e/a)*a:Math.floor(e/a)*a)>r&&(e=n)}else(e+=t)<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function f2(e,t){let n;return n=(null!=t.years&&0!==t.years||null!=t.months&&0!==t.months||null!=t.weeks&&0!==t.weeks||null!=t.days&&0!==t.days?hd(fU(hh(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):hi(e)-e.offset)+(t.milliseconds||0),n+=1e3*(t.seconds||0),n+=6e4*(t.minutes||0),hg(hp(n+=36e5*(t.hours||0),e.timeZone),e.calendar)}function f3(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function f6(e){let t,n=hg(e,new fV);return t="BC"===n.era?1===n.year?"0000":"-"+String(Math.abs(1-n.year)).padStart(6,"00"):String(n.year).padStart(4,"0"),`${t}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`}function f5(e){return`${f6(e)}T${f3(e)}`}function f9(e){let t,n="object"==typeof e[0]?e.shift():new fV;if("string"==typeof e[0])t=e.shift();else{let e=n.getEras();t=e[e.length-1]}return[n,t,e.shift(),e.shift(),e.shift()]}var f8=new WeakMap;class f7{copy(){return this.era?new f7(this.calendar,this.era,this.year,this.month,this.day):new f7(this.calendar,this.year,this.month,this.day)}add(e){return fU(this,e)}subtract(e){return fU(this,fG(e))}set(e){return fZ(this,e)}cycle(e,t,n){return f0(this,e,t,n)}toDate(e){return hm(this,e)}toString(){return f6(this)}compare(e){return hk(this,e)}constructor(...e){pT(this,f8,{writable:!0,value:void 0});let[t,n,r,a,o]=f9(e);this.calendar=t,this.era=n,this.year=r,this.month=a,this.day=o,fK(this)}}var he=new WeakMap;class ht{copy(){return new ht(this.hour,this.minute,this.second,this.millisecond)}add(e){return fQ(this,e)}subtract(e){return fQ(this,fG(e))}set(e){return fY(this,e)}cycle(e,t,n){return f1(this,e,t,n)}toString(){return f3(this)}compare(e){var t,n;return t=this,n=e,hS(t)-hS(n)}constructor(e=0,t=0,n=0,r=0){pT(this,he,{writable:!0,value:void 0}),this.hour=e,this.minute=t,this.second=n,this.millisecond=r,fq(this)}}var hn=new WeakMap;class hr{copy(){return this.era?new hr(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new hr(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return fU(this,e)}subtract(e){return fU(this,fG(e))}set(e){return fZ(fY(this,e),e)}cycle(e,t,n){switch(e){case"era":case"year":case"month":case"day":return f0(this,e,t,n);default:return f1(this,e,t,n)}}toDate(e,t){return hm(this,e,t)}toString(){return f5(this)}compare(e){var t,n;let r=hk(this,e);return 0===r?(t=this,n=hh(e),hS(t)-hS(n)):r}constructor(...e){pT(this,hn,{writable:!0,value:void 0});let[t,n,r,a,o]=f9(e);this.calendar=t,this.era=n,this.year=r,this.month=a,this.day=o,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,fK(this)}}var ha=new WeakMap;class ho{copy(){return this.era?new ho(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new ho(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return f2(this,e)}subtract(e){return f2(this,fG(e))}set(e,t){let n,r;return 0===(r=fY(fZ(n=hh(this),e),e)).compare(n)?this:hg(hp(hd(r,this.timeZone,t),this.timeZone),this.calendar)}cycle(e,t,n){return function(e,t,n,r){switch(t){case"hour":{let t=0,a=23;if((null==r?void 0:r.hourCycle)===12){let n=e.hour>=12;t=12*!!n,a=n?23:11}let o=hh(e),i=hg(fY(o,{hour:t}),new fV),s=[hd(i,e.timeZone,"earlier"),hd(i,e.timeZone,"later")].filter(t=>hp(t,e.timeZone).day===i.day)[0],l=hg(fY(o,{hour:a}),new fV),u=[hd(l,e.timeZone,"earlier"),hd(l,e.timeZone,"later")].filter(t=>hp(t,e.timeZone).day===l.day).pop(),c=hi(e)-e.offset,d=Math.floor(c/36e5),m=c%36e5;return hg(hp(c=36e5*f4(d,n,Math.floor(s/36e5),Math.floor(u/36e5),null==r?void 0:r.round)+m,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return f1(e,t,n,r);case"era":case"year":case"month":case"day":return hg(hp(hd(f0(hh(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error("Unsupported field "+t)}}(this,e,t,n)}toDate(){var e;return e=this,new Date(hi(e)-e.offset)}toString(){var e;let t,n,r;return`${f5(this)}${t=0>Math.sign(e=this.offset)?"-":"+",n=Math.floor((e=Math.abs(e))/36e5),r=e%36e5/6e4,`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}[${this.timeZone}]`}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-(function(e,t){if(e instanceof ho){var n,r;return e.timeZone===t?e:(n=e,r=t,hg(hp(hi(n)-n.offset,r),n.calendar))}return hp(hd(e,t,void 0),t)})(e,this.timeZone).toDate().getTime()}constructor(...e){pT(this,ha,{writable:!0,value:void 0});let[t,n,r,a,o]=f9(e),i=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=a,this.day=o,this.timeZone=i,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,fK(this)}}function hi(e){return hs(fL((e=hg(e,new fV)).era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function hs(e,t,n,r,a,o,i){let s=new Date;return s.setUTCHours(r,a,o,i),s.setUTCFullYear(e,t-1,n),s.getTime()}function hl(e,t){if("UTC"===t)return 0;if(e>0&&t===hP())return -6e4*new Date(e).getTimezoneOffset();let{year:n,month:r,day:a,hour:o,minute:i,second:s}=hc(e,t);return hs(n,r,a,o,i,s,0)-1e3*Math.floor(e/1e3)}let hu=new Map;function hc(e,t){let n=hu.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),hu.set(t,n));let r=n.formatToParts(new Date(e)),a={};for(let e of r)"literal"!==e.type&&(a[e.type]=e.value);return{year:"BC"===a.era||"B"===a.era?-a.year+1:+a.year,month:+a.month,day:+a.day,hour:"24"===a.hour?0:+a.hour,minute:+a.minute,second:+a.second}}function hd(e,t,n="compatible"){var r,a,o;let i=hh(e);if("UTC"===t)return hi(i);if(t===hP()&&"compatible"===n){i=hg(i,new fV);let e=new Date,t=fL(i.era,i.year);return e.setFullYear(t,i.month-1,i.day),e.setHours(i.hour,i.minute,i.second,i.millisecond),e.getTime()}let s=hi(i),l=hl(s-864e5,t),u=hl(s+864e5,t),c=(r=i,((a=s-l)==(o=s-u)?[a]:[a,o]).filter(e=>{var n;let a;return n=r,a=hc(e,t),n.year===a.year&&n.month===a.month&&n.day===a.day&&n.hour===a.hour&&n.minute===a.minute&&n.second===a.second}));if(1===c.length)return c[0];if(c.length>1)switch(n){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(s-l,s-u);case"compatible":case"later":return Math.max(s-l,s-u);case"reject":throw RangeError("No such absolute time found")}}function hm(e,t,n="compatible"){return new Date(hd(e,t,n))}function hp(e,t){let n=hl(e,t),r=new Date(e+n),a=r.getUTCFullYear();return new ho(a<1?"BC":"AD",a<1?-a+1:a,r.getUTCMonth()+1,r.getUTCDate(),t,n,r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())}function hf(e){return new f7(e.calendar,e.era,e.year,e.month,e.day)}function hh(e,t){let n=0,r=0,a=0,o=0;if("timeZone"in e)({hour:n,minute:r,second:a,millisecond:o}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:a,millisecond:o}=t),new hr(e.calendar,e.era,e.year,e.month,e.day,n,r,a,o)}function hg(e,t){if(hw(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,fK(r),r}let hy={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function hv(e,t){return t=hg(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function hb(e,t){return hw(e.calendar,t.calendar)&&hv(e,t)}function hw(e,t){var n,r,a,o;return null!=(o=null!=(a=null==(n=e.isEqual)?void 0:n.call(e,t))?a:null==(r=t.isEqual)?void 0:r.call(t,e))?o:e.identifier===t.identifier}let hE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function hx(e,t,n){let r,a=Math.ceil(e.calendar.toJulianDay(e)+1-(n?hE[n]:(r=function(e){if(Intl.Locale){let t=hO.get(e);return!t&&(t=new Intl.Locale(e).maximize().region)&&hO.set(e,t),t}let t=e.split("-")[1];return"u"===t?void 0:t}(t))&&hy[r]||0))%7;return a<0&&(a+=7),a}function hD(e){return hp(Date.now(),e)}function h_(e){return hf(hD(e))}function hk(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function hS(e){return 36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}let hC=null;function hP(){return null==hC&&(hC=new Intl.DateTimeFormat().resolvedOptions().timeZone),hC}function hR(e){return e.subtract({days:e.day-1})}function hT(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function h$(e,t,n){let r=hx(e,t,n);return e.subtract({days:r})}let hO=new Map;function hN(e,t){return e&&t?0>=e.compare(t)?e:t:e||t}function hA(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}let hI=Symbol.for("react-aria.i18n.locale"),hj=Symbol.for("react-aria.i18n.strings");class hM{getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,n="en-US"){var r;if(t[e])return t[e];let a=(r=e,Intl.Locale?new Intl.Locale(r).language:r.split("-")[0]);if(t[a])return t[a];for(let e in t)if(e.startsWith(a+"-"))return t[e];return t[n]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if("u"<typeof window)return null;let t=window[hI];if(void 0===m){let e=window[hj];if(!e)return null;for(let n in m={},e)m[n]=new hM({[t]:e[n]},t)}let n=null==m?void 0:m[e];if(!n)throw Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return n}constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}}let hL=new Map,hF=new Map;class hB{format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return"function"==typeof n?n(t,this):n}plural(e,t,n="cardinal"){let r=t["="+e];if(r)return"function"==typeof r?r():r;let a=this.locale+":"+n,o=hL.get(a);return o||(o=new Intl.PluralRules(this.locale,{type:n}),hL.set(a,o)),"function"==typeof(r=t[o.select(e)]||t.other)?r():r}number(e){let t=hF.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),hF.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return"function"==typeof n?n():n}constructor(e,t){this.locale=e,this.strings=t}}let hV=new WeakMap;function hU(e,t){let n;return t&&hM.getGlobalDictionaryForPackage(t)||((n=hV.get(e))||(n=new hM(e),hV.set(e,n)),n)}function hW(e,t){let{locale:n}=fN(),r=hU(e,t);return(0,lT.useMemo)(()=>new hB(n,r),[n,r])}let hH=new Map;class hz{format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if("function"==typeof this.formatter.formatRange)return this.formatter.formatRange(e,t);if(t<e)throw RangeError("End date must be >= start date");return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if("function"==typeof this.formatter.formatRangeToParts)return this.formatter.formatRangeToParts(e,t);if(t<e)throw RangeError("End date must be >= start date");let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return null==hY&&(hY="h12"===new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle),hY&&(this.resolvedHourCycle||(this.resolvedHourCycle=function(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,"");let n=hG(e+=(e.includes("-u-")?"":"-u")+"-nu-latn",{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(e=>"hour"===e.type).value,10),a=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>"hour"===e.type).value,10);if(0===r&&23===a)return"h23";if(24===r&&23===a)return"h24";if(0===r&&11===a)return"h11";if(12===r&&11===a)return"h12";throw Error("Unexpected hour cycle result")}(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12="h11"===this.resolvedHourCycle||"h12"===this.resolvedHourCycle),"ethiopic-amete-alem"===e.calendar&&(e.calendar="ethioaa"),e}constructor(e,t={}){this.formatter=hG(e,t),this.options=t}}let hK={true:{ja:"h11"},false:{}};function hG(e,t={}){if("boolean"==typeof t.hour12&&(null==hZ&&(hZ="24"===new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))),hZ)){let n=hK[String((t={...t}).hour12)][e.split("-")[0]],r=t.hour12?"h12":"h23";t.hourCycle=null!=n?n:r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(hH.has(n))return hH.get(n);let r=new Intl.DateTimeFormat(e,t);return hH.set(n,r),r}let hZ=null,hY=null;function hq(e,t){let n=(0,lT.useRef)(null);return e&&n.current&&t(e,n.current)&&(e=n.current),n.current=e,e}function hJ(e){e=hq(null!=e?e:{},hX);let{locale:t}=fN();return(0,lT.useMemo)(()=>new hz(t,e),[t,e])}function hX(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}function hQ(e){return e&&e.__esModule?e.default:e}let h0=new WeakMap;function h1(e){return(null==e?void 0:e.calendar.identifier)==="gregory"&&"BC"===e.era?"short":void 0}function h4(e,t,n,r){let a=hW(hQ(fA),"@react-aria/calendar"),o=h1(e)||h1(t),i=hJ({month:"long",year:"numeric",era:o,calendar:e.calendar.identifier,timeZone:n}),s=hJ({month:"long",year:"numeric",day:"numeric",era:o,calendar:e.calendar.identifier,timeZone:n});return(0,lT.useMemo)(()=>{if(hv(e,hR(e))){let o=e,s=t;if(e.calendar.getFormattableMonth&&(o=e.calendar.getFormattableMonth(e)),t.calendar.getFormattableMonth&&(s=t.calendar.getFormattableMonth(t)),hv(t,hT(e)))return i.format(o.toDate(n));if(hv(t,hT(t)))return r?h2(i,a,o,s,n):i.formatRange(o.toDate(n),s.toDate(n))}return r?h2(s,a,e,t,n):s.formatRange(e.toDate(n),t.toDate(n))},[e,t,i,s,a,n,r])}function h2(e,t,n,r,a){let o=e.formatRangeToParts(n.toDate(a),r.toDate(a)),i=-1;for(let e=0;e<o.length;e++){let t=o[e];if("shared"===t.source&&"literal"===t.type)i=e;else if("endRange"===t.source)break}let s="",l="";for(let e=0;e<o.length;e++)e<i?s+=o[e].value:e>i&&(l+=o[e].value);return t.format("dateRange",{startDate:s,endDate:l})}function h3(e,t){let n=(0,lT.useRef)(!0),r=(0,lT.useRef)(null);(0,lT.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,lT.useEffect)(()=>{let a=r.current;n.current?n.current=!1:(!a||t.some((e,t)=>!Object.is(e,a[t])))&&e(),r.current=t},t)}function h6(e,t){let{id:n,"aria-label":r,"aria-labelledby":a}=e;return n=mB(n),a&&r?a=[...new Set([n,...a.trim().split(/\s+/)])].join(" "):a&&(a=a.trim().split(/\s+/).join(" ")),r||a||!t||(r=t),{id:n,"aria-label":r,"aria-labelledby":a}}function h5(e,t){var n,r;let a,o,i,s,l,u=hW((n=fA)&&n.__esModule?n.default:n,"@react-aria/calendar"),c=m6(e),d=h4(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),m=h4(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);h3(()=>{t.isFocused||mQ(m)},[m]);let p=(i=hW(hQ(fA),"@react-aria/calendar"),"highlightedRange"in t?{start:a,end:o}=t.highlightedRange||{}:a=o=null!=(r=t.value)?r:void 0,s=hJ({weekday:"long",month:"long",year:"numeric",day:"numeric",era:h1(a)||h1(o),timeZone:t.timeZone}),l="anchorDate"in t?t.anchorDate:null,(0,lT.useMemo)(()=>{if(!l&&a&&o)if(hv(a,o)){let e=s.format(a.toDate(t.timeZone));return i.format("selectedDateDescription",{date:e})}else{let e=h2(s,i,a,o,t.timeZone);return i.format("selectedRangeDescription",{dateRange:e})}return""},[a,o,l,t.timeZone,i,s]));h3(()=>{p&&mQ(p,"polite",4e3)},[p]);let f=mV([!!e.errorMessage,e.isInvalid,e.validationState]);h0.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:f,selectedDateDescription:p});let[h,g]=(0,lT.useState)(!1),y=e.isDisabled||t.isNextVisibleRangeInvalid();y&&h&&(g(!1),t.setFocused(!0));let[v,b]=(0,lT.useState)(!1),w=e.isDisabled||t.isPreviousVisibleRangeInvalid();return w&&v&&(b(!1),t.setFocused(!0)),{calendarProps:mW(c,h6({id:e.id,"aria-label":[e["aria-label"],m].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]}),{role:"application","aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":u.format("next"),isDisabled:y,onFocusChange:g},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":u.format("previous"),isDisabled:w,onFocusChange:b},errorMessageProps:{id:f},title:d}}let h9={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function h8(e){let{children:t,elementType:n="div",isFocusable:r,style:a,...o}=e,{visuallyHiddenProps:i}=function(e={}){let{style:t,isFocusable:n}=e,[r,a]=(0,lT.useState)(!1),{focusWithinProps:o}=fs({isDisabled:!n,onFocusWithinChange:e=>a(e)}),i=(0,lT.useMemo)(()=>r?t:t?{...h9,...t}:h9,[r]);return{visuallyHiddenProps:{...o,style:i}}}(e);return l$().createElement(n,mW(o,i),t)}function h7(e,t,n,r){let a=mP(n),o=null==n;(0,lT.useEffect)(()=>{if(o||!e.current)return;let n=e.current;return n.addEventListener(t,a,r),()=>{n.removeEventListener(t,a,r)}},[e,t,r,o,a])}let ge=0,gt=new Map;function gn(e){let[t,n]=(0,lT.useState)();return mC(()=>{if(!e)return;let t=gt.get(e);if(t)n(t.element.id);else{let r=`react-aria-description-${ge++}`;n(r);let a=document.createElement("div");a.id=r,a.style.display="none",a.textContent=e,document.body.appendChild(a),t={refCount:0,element:a},gt.set(e,t)}return t.refCount++,()=>{t&&0==--t.refCount&&(t.element.remove(),gt.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function gr(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function ga(e,t,n){let r="left"===n?"offsetLeft":"offsetTop",a=0;for(;t.offsetParent&&(a+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){a-=e[r];break}t=t.offsetParent}return a}function go(e,t){if(e&&document.contains(e)){let i=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(i).overflow)for(let t of function(e){let t=[];for(;e&&e!==document.documentElement;)gr(e,void 0)&&t.push(e),e=e.parentElement;return t}(e))!function(e,t){let n=ga(e,t,"left"),r=ga(e,t,"top"),a=t.offsetWidth,o=t.offsetHeight,i=e.scrollLeft,s=e.scrollTop,{borderTopWidth:l,borderLeftWidth:u,scrollPaddingTop:c,scrollPaddingRight:d,scrollPaddingBottom:m,scrollPaddingLeft:p}=getComputedStyle(e),f=i+parseInt(u,10),h=s+parseInt(l,10),g=f+e.clientWidth,y=h+e.clientHeight,v=parseInt(c,10)||0,b=parseInt(m,10)||0,w=parseInt(d,10)||0,E=parseInt(p,10)||0;n<=i+E?i=n-parseInt(u,10)-E:n+a>g-w&&(i+=n+a-g+w),r<=h+v?s=r-parseInt(l,10)-v:r+o>y-b&&(s+=r+o-y+b),e.scrollLeft=i,e.scrollTop=s}(t,e);else{var n,r,a,o;let{left:i,top:s}=e.getBoundingClientRect();null==e||null==(n=e.scrollIntoView)||n.call(e,{block:"nearest"});let{left:l,top:u}=e.getBoundingClientRect();(Math.abs(i-l)>1||Math.abs(s-u)>1)&&(null==t||null==(a=t.containingElement)||null==(r=a.scrollIntoView)||r.call(a,{block:"center",inline:"center"}),null==(o=e.scrollIntoView)||o.call(e,{block:"nearest"}))}}}function gi(e,t){let n=e;for(gr(n,t)&&(n=n.parentElement);n&&!gr(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}class gs extends fV{fromJulianDay(e){let t=super.fromJulianDay(e);return new f7(this,fL(t.era,t.year)- -543,t.month,t.day)}toJulianDay(e){return super.toJulianDay(gl(e))}getEras(){return["BE"]}getDaysInMonth(e){return super.getDaysInMonth(gl(e))}balanceDate(){}constructor(...e){super(...e),this.identifier="buddhist"}}function gl(e){let[t,n]=fF(e.year+-543);return new f7(t,n,e.month,e.day)}function gu(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function gc(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-gu(e,n,1,1))/30),a=t+1-gu(e,n,r,1);return[n,r,a]}function gd(e){return Math.floor(e%4/3)}function gm(e,t){return t%13!=0?30:gd(e)+5}class gp{fromJulianDay(e){let[t,n,r]=gc(1723856,e),a="AM";return t<=0&&(a="AA",t+=5500),new f7(this,a,t,n,r)}toJulianDay(e){let t=e.year;return"AA"===e.era&&(t-=5500),gu(1723856,t,e.month,e.day)}getDaysInMonth(e){return gm(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+gd(e.year)}getYearsInEra(e){return"AA"===e.era?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class gf extends gp{fromJulianDay(e){let[t,n,r]=gc(1723856,e);return new f7(this,"AA",t+=5500,n,r)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier="ethioaa"}}class gh extends gp{fromJulianDay(e){let[t,n,r]=gc(1824665,e),a="CE";return t<=0&&(a="BCE",t=1-t),new f7(this,a,t,n,r)}toJulianDay(e){let t=e.year;return"BCE"===e.era&&(t=1-t),gu(1824665,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return"BCE"===e.era&&(t=1-t),gm(t,e.month)}isInverseEra(e){return"BCE"===e.era}balanceDate(e){e.year<=0&&(e.era="BCE"===e.era?"CE":"BCE",e.year=1-e.year)}getEras(){return["BCE","CE"]}getYearsInEra(e){return"BCE"===e.era?9999:9715}constructor(...e){super(...e),this.identifier="coptic"}}let gg=765433;function gy(e){return 7>fI(7*e+1,19)}function gv(e){let t=Math.floor((235*e-234)/19),n=29*t+Math.floor((12084+13753*t)/25920);return 3>fI(3*(n+1),7)&&(n+=1),n}function gb(e){let t,n;return gv(e)+(t=gv(e-1),n=gv(e),gv(e+1)-n==356?2:+(n-t==382))}function gw(e){return gb(e+1)-gb(e)}function gE(e,t){if(t>=6&&!gy(e)&&t++,4===t||7===t||9===t||11===t||13===t)return 29;let n=function(e){let t=gw(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}(e);return 2===t?2===n?30:29:3===t?0===n?29:30:6===t?30*!!gy(e):30}class gx{fromJulianDay(e){let t=e-347997,n=Math.floor((25920*t/gg*19+234)/235)+1,r=gb(n),a=Math.floor(t-r);for(;a<1;)a=Math.floor(t-(r=gb(--n)));let o=1,i=0;for(;i<a;)i+=gE(n,o),o++;let s=a-(i-=gE(n,--o));return new f7(this,n,o,s)}toJulianDay(e){let t=gb(e.year);for(let n=1;n<e.month;n++)t+=gE(e.year,n);return t+e.day+347997}getDaysInMonth(e){return gE(e.year,e.month)}getMonthsInYear(e){return gy(e.year)?13:12}getDaysInYear(e){return gw(e.year)}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(e,t){t.year!==e.year&&(gy(t.year)&&!gy(e.year)&&t.month>6?e.month--:!gy(t.year)&&gy(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier="hebrew"}}class gD extends fV{fromJulianDay(e){let t,n,r,a=super.fromJulianDay(e),o=a.year-78,i=e-fj(a.era,a.year,1,1);if(i<80?(o--,i+=(t=fM(a.year-1)?31:30)+155+90+10):(t=fM(a.year)?31:30,i-=80),i<t)n=1,r=i+1;else{let e=i-t;e<155?(n=Math.floor(e/31)+2,r=e%31+1):(e-=155,n=Math.floor(e/30)+7,r=e%30+1)}return new f7(this,o,n,r)}toJulianDay(e){let t,n,[r,a]=fF(e.year+78);return(fM(a)?(t=31,n=fj(r,a,3,21)):(t=30,n=fj(r,a,3,22)),1===e.month)?n+e.day-1:(n+=t+31*Math.min(e.month-2,5),e.month>=8&&(n+=(e.month-7)*30),n+=e.day-1)}getDaysInMonth(e){return 1===e.month&&fM(e.year+78)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...e){super(...e),this.identifier="indian"}}function g_(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function gk(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),a=Math.min(12,Math.ceil((n-(29+g_(t,r,1,1)))/29.5)+1),o=n-g_(t,r,a,1)+1;return new f7(e,r,a,o)}function gS(e){return(14+11*e)%30<11}class gC{fromJulianDay(e){return gk(this,1948440,e)}toJulianDay(e){return g_(1948440,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return 12===e.month&&gS(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return gS(e.year)?355:354}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class gP extends gC{fromJulianDay(e){return gk(this,1948439,e)}toJulianDay(e){return g_(1948439,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier="islamic-tbla"}}function gR(e){return 460322+l[e-1300]}function gT(e,t){return(s[e-1300]&1<<11-(t-1))==0?29:30}function g$(e,t){let n=gR(e);for(let r=1;r<t;r++)n+=gT(e,r);return n}function gO(e){return l[e+1-1300]-l[e-1300]}class gN extends gC{fromJulianDay(e){let t=e-1948440,n=gR(1300),r=gR(1600);if(t<n||t>r)return super.fromJulianDay(e);{let e=1299,n=1,r=1;for(;r>0;){r=t-gR(++e)+1;let a=gO(e);if(r===a){n=12;break}if(r<a){let t=gT(e,n);for(n=1;r>t;)r-=t,t=gT(e,++n);break}}return new f7(this,e,n,t-g$(e,n)+1)}}toJulianDay(e){return e.year<1300||e.year>1600?super.toJulianDay(e):1948440+g$(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<1300||e.year>1600?super.getDaysInMonth(e):gT(e.year,e.month)}getDaysInYear(e){return e.year<1300||e.year>1600?super.getDaysInYear(e):gO(e.year)}constructor(){if(super(),this.identifier="islamic-umalqura",s||(s=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),e=>e.charCodeAt(0)).buffer)),!l){l=new Uint32Array(301);let e=0;for(let t=1300;t<=1600;t++){l[t-1300]=e;for(let n=1;n<=12;n++)e+=gT(t,n)}}}}let gA=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],gI=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],gj=[1867,1911,1925,1988,2018],gM=["meiji","taisho","showa","heisei","reiwa"];function gL(e){let t=gA.findIndex(([t,n,r])=>!!(e.year<t)||e.year===t&&!!(e.month<n)||e.year===t&&e.month===n&&!!(e.day<r));return -1===t?gA.length-1:0===t?0:t-1}function gF(e){let t=gj[gM.indexOf(e.era)];if(!t)throw Error("Unknown era: "+e.era);return new f7(e.year+t,e.month,e.day)}class gB extends fV{fromJulianDay(e){let t=super.fromJulianDay(e),n=gL(t);return new f7(this,gM[n],t.year-gj[n],t.month,t.day)}toJulianDay(e){return super.toJulianDay(gF(e))}balanceDate(e){let t=gF(e),n=gL(t);gM[n]!==e.era&&(e.era=gM[n],e.year=t.year-gj[n]),this.constrainDate(e)}constrainDate(e){let t=gM.indexOf(e.era),n=gI[t];if(null!=n){let[r,a,o]=n,i=r-gj[t];e.year=Math.max(1,Math.min(i,e.year)),e.year===i&&(e.month=Math.min(a,e.month),e.month===a&&(e.day=Math.min(o,e.day)))}if(1===e.year&&t>=0){let[,n,r]=gA[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return gM}getYearsInEra(e){let t=gM.indexOf(e.era),n=gA[t],r=gA[t+1];if(null==r)return 9999-n[0]+1;let a=r[0]-n[0];return(e.month<r[1]||e.month===r[1]&&e.day<r[2])&&a++,a}getDaysInMonth(e){return super.getDaysInMonth(gF(e))}getMinimumMonthInYear(e){let t=gV(e);return t?t[1]:1}getMinimumDayInMonth(e){let t=gV(e);return t&&e.month===t[1]?t[2]:1}constructor(...e){super(...e),this.identifier="japanese"}}function gV(e){if(1===e.year)return gA[gM.indexOf(e.era)]}let gU=[0,31,62,93,124,155,186,216,246,276,306,336];class gW{fromJulianDay(e){let t=e-1948320,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),a=r<216?Math.floor(r/31):Math.floor((r-6)/30),o=r-gU[a]+1;return new f7(this,n,a+1,o)}toJulianDay(e){let t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=gU[e.month-1],t+=e.day}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||8>fI(25*e.year+11,33)?30:29}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}function gH(e){return"minguo"===e.era?e.year+1911:1-e.year+1911}function gz(e){let t=e-1911;return t>0?["minguo",t]:["before_minguo",1-t]}class gK extends fV{fromJulianDay(e){let t=super.fromJulianDay(e),[n,r]=gz(fL(t.era,t.year));return new f7(this,n,r,t.month,t.day)}toJulianDay(e){return super.toJulianDay(gG(e))}getEras(){return["before_minguo","minguo"]}balanceDate(e){let[t,n]=gz(gH(e));e.era=t,e.year=n}isInverseEra(e){return"before_minguo"===e.era}getDaysInMonth(e){return super.getDaysInMonth(gG(e))}getYearsInEra(e){return"before_minguo"===e.era?9999:8088}constructor(...e){super(...e),this.identifier="roc"}}function gG(e){let[t,n]=fF(gH(e));return new f7(t,n,e.month,e.day)}function gZ(e){switch(e){case"buddhist":return new gs;case"ethiopic":return new gp;case"ethioaa":return new gf;case"coptic":return new gh;case"hebrew":return new gx;case"indian":return new gD;case"islamic-civil":return new gC;case"islamic-tbla":return new gP;case"islamic-umalqura":return new gN;case"japanese":return new gB;case"persian":return new gW;case"roc":return new gK;default:return new fV}}function gY(e,t,n){return null!=t&&0>e.compare(t)||null!=n&&e.compare(n)>0}function gq(e,t,n,r,a){let o={};for(let e in t)o[e]=Math.floor(t[e]/2),o[e]>0&&t[e]%2==0&&o[e]--;let i=gJ(e,t,n).subtract(o);return gQ(e,i,t,n,r,a)}function gJ(e,t,n,r,a){let o=e;if(t.years)o=hR(e.subtract({months:e.month-1}));else t.months?o=hR(e):t.weeks&&(o=h$(e,n));return gQ(e,o,t,n,r,a)}function gX(e,t,n,r,a){let o={...t};o.days?o.days--:o.weeks?o.weeks--:o.months?o.months--:o.years&&o.years--;let i=gJ(e,t,n).subtract(o);return gQ(e,i,t,n,r,a)}function gQ(e,t,n,r,a,o){if(a&&e.compare(a)>=0){let e=hA(t,gJ(hf(a),n,r));e&&(t=e)}if(o&&0>=e.compare(o)){let e=hN(t,gX(hf(o),n,r));e&&(t=e)}return t}function g0(e,t,n){if(t){let n=hA(e,hf(t));n&&(e=n)}if(n){let t=hN(e,hf(n));t&&(e=t)}return e}function g1(e,t,n){if(!n)return e;for(;e.compare(t)>=0&&n(e);)e=e.subtract({days:1});return e.compare(t)>=0?e:null}function g4(e,t,n){let[r,a]=(0,lT.useState)(e||t),o=(0,lT.useRef)(void 0!==e),i=void 0!==e;(0,lT.useEffect)(()=>{o.current,o.current=i},[i]);let s=i?e:r,l=(0,lT.useCallback)((e,...t)=>{let r=(e,...t)=>{n&&!Object.is(s,e)&&n(e,...t),i||(s=e)};"function"==typeof e?a((n,...a)=>{let o=e(i?s:n,...a);return(r(o,...t),i)?n:o}):(i||a(e),r(e,...t))},[i,s,n]);return[s,l]}function g2(e){var t,n,r;let a=(0,lT.useMemo)(()=>new hz(e.locale),[e.locale]),o=(0,lT.useMemo)(()=>a.resolvedOptions(),[a]),{locale:i,createCalendar:s,visibleDuration:l={months:1},minValue:u,maxValue:c,selectionAlignment:d,isDateUnavailable:m,pageBehavior:p="visible",firstDayOfWeek:f}=e,h=(0,lT.useMemo)(()=>s(o.calendar),[s,o.calendar]),[g,y]=g4(e.value,null!=(t=e.defaultValue)?t:null,e.onChange),v=(0,lT.useMemo)(()=>g?hg(hf(g),h):null,[g,h]),b=(0,lT.useMemo)(()=>g&&"timeZone"in g?g.timeZone:o.timeZone,[g,o.timeZone]),[w,E]=g4((0,lT.useMemo)(()=>e.focusedValue?g0(hg(hf(e.focusedValue),h),u,c):void 0,[e.focusedValue,h,u,c]),(0,lT.useMemo)(()=>g0(e.defaultFocusedValue?hg(hf(e.defaultFocusedValue),h):v||hg(h_(b),h),u,c),[e.defaultFocusedValue,v,b,h,u,c]),e.onFocusChange),[x,D]=(0,lT.useState)(()=>{switch(d){case"start":return gJ(w,l,i,u,c);case"end":return gX(w,l,i,u,c);default:return gq(w,l,i,u,c)}}),[_,k]=(0,lT.useState)(e.autoFocus||!1),S=(0,lT.useMemo)(()=>{let e={...l};return e.days?e.days--:e.days=-1,x.add(e)},[x,l]),[C,P]=(0,lT.useState)(h);if(!hw(h,C)){let e=hg(w,h);D(gq(e,l,i,u,c)),E(e),P(h)}function R(e){E(e=g0(e,u,c))}function T(t){if(!e.isDisabled&&!e.isReadOnly){let e=t;if(null===e)return void y(null);(e=g1(e=g0(e,u,c),x,m))&&(e=hg(e,(null==g?void 0:g.calendar)||new fV),g&&"hour"in g?y(g.set(e)):y(e))}}gY(w,u,c)?E(g0(w,u,c)):0>w.compare(x)?D(gX(w,l,i,u,c)):w.compare(S)>0&&D(gJ(w,l,i,u,c));let $=(0,lT.useMemo)(()=>!!v&&(!!(m&&m(v))||gY(v,u,c)),[v,m,u,c]),O=e.isInvalid||"invalid"===e.validationState||$,N=(0,lT.useMemo)(()=>"visible"===p?l:g3(l),[p,l]);return{isDisabled:null!=(n=e.isDisabled)&&n,isReadOnly:null!=(r=e.isReadOnly)&&r,value:v,setValue:T,visibleRange:{start:x,end:S},minValue:u,maxValue:c,focusedDate:w,timeZone:b,validationState:O?"invalid":null,isValueInvalid:O,setFocusedDate(e){R(e),k(!0)},focusNextDay(){R(w.add({days:1}))},focusPreviousDay(){R(w.subtract({days:1}))},focusNextRow(){l.days?this.focusNextPage():(l.weeks||l.months||l.years)&&R(w.add({weeks:1}))},focusPreviousRow(){l.days?this.focusPreviousPage():(l.weeks||l.months||l.years)&&R(w.subtract({weeks:1}))},focusNextPage(){let e=x.add(N);E(g0(w.add(N),u,c)),D(gJ(gQ(w,e,N,i,u,c),N,i))},focusPreviousPage(){let e=x.subtract(N);E(g0(w.subtract(N),u,c)),D(gJ(gQ(w,e,N,i,u,c),N,i))},focusSectionStart(){l.days?R(x):l.weeks?R(h$(w,i)):(l.months||l.years)&&R(hR(w))},focusSectionEnd(){l.days?R(S):l.weeks?R(h$(w,i,void 0).add({days:6})):(l.months||l.years)&&R(hT(w))},focusNextSection(e){e||l.days?l.days?this.focusNextPage():l.weeks?R(w.add({months:1})):(l.months||l.years)&&R(w.add({years:1})):R(w.add(g3(l)))},focusPreviousSection(e){e||l.days?l.days?this.focusPreviousPage():l.weeks?R(w.subtract({months:1})):(l.months||l.years)&&R(w.subtract({years:1})):R(w.subtract(g3(l)))},selectFocusedDate(){m&&m(w)||T(w)},selectDate(e){T(e)},isFocused:_,setFocused:k,isInvalid:e=>gY(e,u,c),isSelected(e){return null!=v&&hv(e,v)&&!this.isCellDisabled(e)&&!this.isCellUnavailable(e)},isCellFocused:e=>_&&w&&hv(e,w),isCellDisabled(t){return e.isDisabled||0>t.compare(x)||t.compare(S)>0||this.isInvalid(t)},isCellUnavailable:t=>!!e.isDateUnavailable&&e.isDateUnavailable(t),isPreviousVisibleRangeInvalid(){let e=x.subtract({days:1});return hv(e,x)||this.isInvalid(e)},isNextVisibleRangeInvalid(){let e=S.add({days:1});return hv(e,S)||this.isInvalid(e)},getDatesInWeek(e,t=x){let n=t.add({weeks:e}),r=[],a=hx(n=h$(n,i,f),i,f);for(let e=0;e<a;e++)r.push(null);for(;r.length<7;){r.push(n);let e=n.add({days:1});if(hv(n,e))break;n=e}for(;r.length<7;)r.push(null);return r}}}function g3(e){let t={...e};for(let n in e)t[n]=1;return t}function g6(e,t){return e&&t?(0>t.compare(e)&&([e,t]=[t,e]),{start:hf(e),end:hf(t)}):null}function g5(e,t){return(e=hg(e,(null==t?void 0:t.calendar)||new fV),t&&"hour"in t)?t.set(e):e}function g9(e,t,n){let r=e.add({days:n});for(;(n<0?r.compare(t.visibleRange.start)>=0:0>=r.compare(t.visibleRange.end))&&!t.isCellUnavailable(r);)r=r.add({days:n});if(t.isCellUnavailable(r))return r.add({days:-n})}let g8=(0,lT.createContext)(null),g7=(0,lT.createContext)(null),ye=(0,lT.createContext)(null),yt=(0,lT.createContext)(null),yn=(0,lT.forwardRef)(function(e,t){[e,t]=mZ(e,t,g8);let{locale:n}=fN(),r=g2({...e,locale:n,createCalendar:e.createCalendar||gZ}),{calendarProps:a,prevButtonProps:o,nextButtonProps:i,errorMessageProps:s,title:l}=h5(e,r),u=mK({...e,values:{state:r,isDisabled:e.isDisabled||!1,isInvalid:r.isValueInvalid},defaultClassName:"react-aria-Calendar"});return l$().createElement("div",{...u,...a,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":r.isValueInvalid||void 0},l$().createElement(mz,{values:[[fy,{slots:{previous:o,next:i}}],[fb,{"aria-hidden":!0,level:2,children:l}],[ye,r],[g8,e],[fw,{slots:{errorMessage:s}}]]},l$().createElement(h8,null,l$().createElement("h2",null,a["aria-label"])),u.children,l$().createElement(h8,null,l$().createElement("button",{"aria-label":i["aria-label"],disabled:i.isDisabled,onClick:()=>r.focusNextPage(),tabIndex:-1}))))}),yr=(0,lT.forwardRef)(function(e,t){var n,r;let a,o,i;[e,t]=mZ(e,t,g7);let{locale:s}=fN(),l=function(e){let{value:t,defaultValue:n,onChange:r,createCalendar:a,locale:o,visibleDuration:i={months:1},minValue:s,maxValue:l,...u}=e,[c,d]=g4(t,n||null,r),[m,p]=(0,lT.useState)(null),f="center";if(c&&c.start&&c.end){let e=gq(hf(c.start),i,o,s,l).add(i).subtract({days:1});c.end.compare(e)>0&&(f="start")}let h=(0,lT.useRef)(null),[g,y]=(0,lT.useState)(null),v=(0,lT.useMemo)(()=>hA(s,null==g?void 0:g.start),[s,g]),b=(0,lT.useMemo)(()=>hN(l,null==g?void 0:g.end),[l,g]),w=g2({...u,value:c&&c.start,createCalendar:a,locale:o,visibleDuration:i,minValue:v,maxValue:b,selectionAlignment:f}),E=t=>{t&&e.isDateUnavailable&&!e.allowsNonContiguousRanges?(h.current={start:g9(t,w,-1),end:g9(t,w,1)},y(h.current)):(h.current=null,y(null))},[x,D]=(0,lT.useState)(w.visibleRange);hb(w.visibleRange.start,x.start)&&hb(w.visibleRange.end,x.end)||(E(m),D(w.visibleRange));let _=e=>{e?(p(e),E(e)):(p(null),E(null))},k=m?g6(m,w.focusedDate):c&&g6(c.start,c.end),S=t=>{if(e.isReadOnly)return;let n=g1(g0(t,v,b),w.visibleRange.start,e.isDateUnavailable);if(n)if(m){let e=g6(m,n);e&&d({start:g5(e.start,null==c?void 0:c.start),end:g5(e.end,null==c?void 0:c.end)}),_(null)}else _(n)},[C,P]=(0,lT.useState)(!1),{isDateUnavailable:R}=e,T=(0,lT.useMemo)(()=>!!c&&!m&&(!!(R&&(R(c.start)||R(c.end)))||gY(c.start,s,l)||gY(c.end,s,l)),[R,c,m,s,l]),$=e.isInvalid||"invalid"===e.validationState||T;return{...w,value:c,setValue:d,anchorDate:m,setAnchorDate:_,highlightedRange:k,validationState:$?"invalid":null,isValueInvalid:$,selectFocusedDate(){S(w.focusedDate)},selectDate:S,highlightDate(e){m&&w.setFocusedDate(e)},isSelected:e=>!!(k&&e.compare(k.start)>=0&&0>=e.compare(k.end)&&!w.isCellDisabled(e)&&!w.isCellUnavailable(e)),isInvalid(e){var t,n;return w.isInvalid(e)||gY(e,null==(t=h.current)?void 0:t.start,null==(n=h.current)?void 0:n.end)},isDragging:C,setDragging:P}}({...e,locale:s,createCalendar:e.createCalendar||gZ}),{calendarProps:u,prevButtonProps:c,nextButtonProps:d,errorMessageProps:m,title:p}=(n=e,r=t,a=h5(n,l),o=(0,lT.useRef)(!1),h7(i=(0,lT.useRef)("u">typeof window?window:null),"pointerdown",e=>{o.current=0===e.width&&0===e.height}),h7(i,"pointerup",e=>{if(o.current){o.current=!1;return}if(l.setDragging(!1),!l.anchorDate)return;let t=e.target;r.current&&r.current.contains(document.activeElement)&&(!r.current.contains(t)||!t.closest('button, [role="button"]'))&&l.selectFocusedDate()}),a.calendarProps.onBlur=e=>{r.current&&(e.relatedTarget&&r.current.contains(e.relatedTarget)||!l.anchorDate||l.selectFocusedDate())},h7(r,"touchmove",e=>{l.isDragging&&e.preventDefault()},{passive:!1,capture:!0}),a),f=mK({...e,values:{state:l,isDisabled:e.isDisabled||!1,isInvalid:l.isValueInvalid},defaultClassName:"react-aria-RangeCalendar"});return l$().createElement("div",{...f,...u,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":l.isValueInvalid||void 0},l$().createElement(mz,{values:[[fy,{slots:{previous:c,next:d}}],[fb,{"aria-hidden":!0,level:2,children:p}],[yt,l],[g7,e],[fw,{slots:{errorMessage:m}}]]},l$().createElement(h8,null,l$().createElement("h2",null,u["aria-label"])),f.children,l$().createElement(h8,null,l$().createElement("button",{"aria-label":d["aria-label"],disabled:d.isDisabled,onClick:()=>l.focusNextPage(),tabIndex:-1}))))}),ya=(0,lT.createContext)(null),yo=(0,lT.forwardRef)(function(e,t){var n,r;let a=(0,lT.useContext)(ye),o=(0,lT.useContext)(yt),i=mG(g8),s=mG(g7),l=null!=a?a:o,u=l.visibleRange.start;e.offset&&(u=u.add(e.offset));let c=null!=(n=null==i?void 0:i.firstDayOfWeek)?n:null==s?void 0:s.firstDayOfWeek,{gridProps:d,headerProps:m,weekDays:p,weeksInMonth:f}=function(e,t){let n,{startDate:r=t.visibleRange.start,endDate:a=t.visibleRange.end,firstDayOfWeek:o}=e,{direction:i}=fN(),s=h4(r,a,t.timeZone,!0),{ariaLabel:l,ariaLabelledBy:u}=h0.get(t),c=h6({"aria-label":[l,s].filter(Boolean).join(", "),"aria-labelledby":u}),d=hJ({weekday:e.weekdayStyle||"narrow",timeZone:t.timeZone}),{locale:m}=fN(),p=(0,lT.useMemo)(()=>{let e=h$(h_(t.timeZone),m,o);return[...Array(7).keys()].map(n=>{let r=e.add({days:n}).toDate(t.timeZone);return d.format(r)})},[m,t.timeZone,d,o]),f=(n=r.calendar.getDaysInMonth(r),Math.ceil((hx(hR(r),m,o)+n)/7));return{gridProps:mW(c,{role:"grid","aria-readonly":t.isReadOnly||void 0,"aria-disabled":t.isDisabled||void 0,"aria-multiselectable":"highlightedRange"in t||void 0,onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),t.selectFocusedDate();break;case"PageUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousSection(e.shiftKey);break;case"PageDown":e.preventDefault(),e.stopPropagation(),t.focusNextSection(e.shiftKey);break;case"End":e.preventDefault(),e.stopPropagation(),t.focusSectionEnd();break;case"Home":e.preventDefault(),e.stopPropagation(),t.focusSectionStart();break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===i?t.focusNextDay():t.focusPreviousDay();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousRow();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===i?t.focusPreviousDay():t.focusNextDay();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),t.focusNextRow();break;case"Escape":"setAnchorDate"in t&&(e.preventDefault(),t.setAnchorDate(null))}},onFocus:()=>t.setFocused(!0),onBlur:()=>t.setFocused(!1)}),headerProps:{"aria-hidden":!0},weekDays:p,weeksInMonth:f}}({startDate:u,endDate:hT(u),weekdayStyle:e.weekdayStyle,firstDayOfWeek:c},l);return l$().createElement(ya.Provider,{value:{headerProps:m,weekDays:p,startDate:u,weeksInMonth:f}},l$().createElement("table",{...m6(e),...d,ref:t,style:e.style,className:null!=(r=e.className)?r:"react-aria-CalendarGrid"},"function"!=typeof e.children?e.children:l$().createElement(l$().Fragment,null,l$().createElement(yi,null,e=>l$().createElement(ys,null,e)),l$().createElement(yl,null,e.children))))}),yi=(0,lT.forwardRef)(function(e,t){let{children:n,style:r,className:a}=e,{headerProps:o,weekDays:i}=(0,lT.useContext)(ya);return l$().createElement("thead",{...m6(e),...o,ref:t,style:r,className:a||"react-aria-CalendarGridHeader"},l$().createElement("tr",null,i.map((e,t)=>l$().cloneElement(n(e),{key:t}))))}),ys=(0,lT.forwardRef)(function(e,t){let{children:n,style:r,className:a}=e;return l$().createElement("th",{...m6(e),ref:t,style:r,className:a||"react-aria-CalendarHeaderCell"},n)}),yl=(0,lT.forwardRef)(function(e,t){let{children:n,style:r,className:a}=e,o=(0,lT.useContext)(ye),i=(0,lT.useContext)(yt),s=null!=o?o:i,{startDate:l,weeksInMonth:u}=(0,lT.useContext)(ya);return l$().createElement("tbody",{...m6(e),ref:t,style:r,className:a||"react-aria-CalendarGridBody"},[...Array(u).keys()].map(e=>l$().createElement("tr",{key:e},s.getDatesInWeek(e,l).map((e,t)=>e?l$().cloneElement(n(e),{key:t}):l$().createElement("td",{key:t})))))}),yu=(0,lT.forwardRef)(function({date:e,...t},n){var r,a,o;let i=(0,lT.useContext)(ye),s=(0,lT.useContext)(yt),l=null!=i?i:s,{startDate:u}=null!=(r=(0,lT.useContext)(ya))?r:{startDate:l.visibleRange.start},c=(0,lT.useRef)(null),{cellProps:d,buttonProps:m,...p}=function(e,t,n){var r;let a,{date:o,isDisabled:i}=e,{errorMessageId:s,selectedDateDescription:l}=h0.get(t),u=hW((r=fA)&&r.__esModule?r.default:r,"@react-aria/calendar"),c=hJ({weekday:"long",day:"numeric",month:"long",year:"numeric",era:h1(o),timeZone:t.timeZone}),d=t.isSelected(o),m=t.isCellFocused(o);i=i||t.isCellDisabled(o);let p=t.isCellUnavailable(o),f=!i&&!p,h=t.isValueInvalid&&!!("highlightedRange"in t?!t.anchorDate&&t.highlightedRange&&o.compare(t.highlightedRange.start)>=0&&0>=o.compare(t.highlightedRange.end):t.value&&hv(t.value,o));h&&(d=!0),o=hq(o,hb);let g=(0,lT.useMemo)(()=>o.toDate(t.timeZone),[o,t.timeZone]),y=hv(o,h_(t.timeZone)),v=(0,lT.useMemo)(()=>{let e="";return"highlightedRange"in t&&t.value&&!t.anchorDate&&(hv(o,t.value.start)||hv(o,t.value.end))&&(e=l+", "),e+=c.format(g),y?e=u.format(d?"todayDateSelected":"todayDate",{date:e}):d&&(e=u.format("dateSelected",{date:e})),t.minValue&&hv(o,t.minValue)?e+=", "+u.format("minimumDate"):t.maxValue&&hv(o,t.maxValue)&&(e+=", "+u.format("maximumDate")),e},[c,g,u,d,y,o,t,l]),b="";"anchorDate"in t&&m&&!t.isReadOnly&&f&&(b=t.anchorDate?u.format("finishRangeSelectionPrompt"):u.format("startRangeSelectionPrompt"));let w=gn(b),E=(0,lT.useRef)(!1),x=(0,lT.useRef)(!1),D=(0,lT.useRef)(void 0),{pressProps:_,isPressed:k}=pW({shouldCancelOnPointerExit:"anchorDate"in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!f||t.isReadOnly,onPressStart(e){if(t.isReadOnly)return void t.setFocusedDate(o);if("highlightedRange"in t&&!t.anchorDate&&("mouse"===e.pointerType||"touch"===e.pointerType)){if(t.highlightedRange&&!h){if(hv(o,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(o),t.setDragging(!0),x.current=!0;return}else if(hv(o,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(o),t.setDragging(!0),x.current=!0;return}}let n=()=>{t.setDragging(!0),D.current=void 0,t.selectDate(o),t.setFocusedDate(o),E.current=!0};"touch"===e.pointerType?D.current=setTimeout(n,200):n()}},onPressEnd(){x.current=!1,E.current=!1,clearTimeout(D.current),D.current=void 0},onPress(){"anchorDate"in t||t.isReadOnly||(t.selectDate(o),t.setFocusedDate(o))},onPressUp(e){if(!t.isReadOnly&&("anchorDate"in t&&D.current&&(t.selectDate(o),t.setFocusedDate(o)),"anchorDate"in t))if(x.current)t.setAnchorDate(o);else if(t.anchorDate&&!E.current)t.selectDate(o),t.setFocusedDate(o);else if("keyboard"!==e.pointerType||t.anchorDate)"virtual"===e.pointerType&&(t.selectDate(o),t.setFocusedDate(o));else{t.selectDate(o);let e=o.add({days:1});t.isInvalid(e)&&(e=o.subtract({days:1})),t.isInvalid(e)||t.setFocusedDate(e)}}});i||(a=hv(o,t.focusedDate)?0:-1),(0,lT.useEffect)(()=>{m&&n.current&&(pr(n.current),"pointer"!==pq&&document.activeElement===n.current&&go(n.current,{containingElement:gi(n.current)}))},[m,n]);let S=hJ({day:"numeric",timeZone:t.timeZone,calendar:o.calendar.identifier}),C=(0,lT.useMemo)(()=>S.formatToParts(g).find(e=>"day"===e.type).value,[S,g]);return{cellProps:{role:"gridcell","aria-disabled":!f||void 0,"aria-selected":d||void 0,"aria-invalid":h||void 0},buttonProps:mW(_,{onFocus(){i||t.setFocusedDate(o)},tabIndex:a,role:"button","aria-disabled":!f||void 0,"aria-label":v,"aria-invalid":h||void 0,"aria-describedby":[h?s:void 0,w["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(e){"highlightDate"in t&&("touch"!==e.pointerType||t.isDragging)&&f&&t.highlightDate(o)},onPointerDown(e){"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId)},onContextMenu(e){e.preventDefault()}}),isPressed:k,isFocused:m,isSelected:d,isDisabled:i,isUnavailable:p,isOutsideVisibleRange:0>o.compare(t.visibleRange.start)||o.compare(t.visibleRange.end)>0,isInvalid:h,formattedDate:C}}({date:e},l,c),{hoverProps:f,isHovered:h}=fp({...t,isDisabled:p.isDisabled}),{focusProps:g,isFocusVisible:y}=fl();y&&(y=p.isFocused);let v=(a=u,o=hg(o=e,a.calendar),a=hR(a),o=hR(o),a.era!==o.era||a.year!==o.year||a.month!==o.month),b=!1,w=!1;"highlightedRange"in l&&l.highlightedRange&&(b=hv(e,l.highlightedRange.start),w=hv(e,l.highlightedRange.end));let E=mK({...t,defaultChildren:p.formattedDate,defaultClassName:"react-aria-CalendarCell",values:{date:e,isHovered:h,isOutsideMonth:v,isFocusVisible:y,isSelectionStart:b,isSelectionEnd:w,...p}}),x={"data-focused":p.isFocused||void 0,"data-hovered":h||void 0,"data-pressed":p.isPressed||void 0,"data-unavailable":p.isUnavailable||void 0,"data-disabled":p.isDisabled||void 0,"data-focus-visible":y||void 0,"data-outside-visible-range":p.isOutsideVisibleRange||void 0,"data-outside-month":v||void 0,"data-selected":p.isSelected||void 0,"data-selection-start":b||void 0,"data-selection-end":w||void 0,"data-invalid":p.isInvalid||void 0};return l$().createElement("td",{...d,ref:n},l$().createElement("div",{...mW(m6(t),m,g,f,x,E),ref:c}))}),yc=(0,lT.createContext)({}),yd=(0,lT.forwardRef)(function(e,t){var n,r;[e,t]=mZ(e,t,yc);let{isDisabled:a,isInvalid:o,onHoverStart:i,onHoverChange:s,onHoverEnd:l,...u}=e,{hoverProps:c,isHovered:d}=fp({onHoverStart:i,onHoverChange:s,onHoverEnd:l,isDisabled:a}),{isFocused:m,isFocusVisible:p,focusProps:f}=fl({within:!0});null!=a||(a=!!e["aria-disabled"]&&"false"!==e["aria-disabled"]),null!=o||(o=!!e["aria-invalid"]&&"false"!==e["aria-invalid"]);let h=mK({...e,values:{isHovered:d,isFocusWithin:m,isFocusVisible:p,isDisabled:a,isInvalid:o},defaultClassName:"react-aria-Group"});return l$().createElement("div",{...mW(u,f,c),...h,ref:t,role:null!=(n=e.role)?n:"group",slot:null!=(r=e.slot)?r:void 0,"data-focus-within":m||void 0,"data-hovered":d||void 0,"data-focus-visible":p||void 0,"data-disabled":a||void 0,"data-invalid":o||void 0},h.children)}),ym=(0,lT.createContext)({}),yp=fh(function(e,t){[e,t]=mZ(e,t,ym);let{hoverProps:n,isHovered:r}=fp(e),{isFocused:a,isFocusVisible:o,focusProps:i}=fl({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e["aria-invalid"]&&"false"!==e["aria-invalid"],l=mK({...e,values:{isHovered:r,isFocused:a,isFocusVisible:o,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:"react-aria-Input"});return l$().createElement("input",{...mW((e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...a}=e;return a})(e),i,n),...l,ref:t,"data-focused":a||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":o||void 0,"data-invalid":s||void 0})});var yf={};yf={"ar-AE":{calendar:"التقويم",day:"يوم",dayPeriod:"ص/م",endDate:"تاريخ الانتهاء",era:"العصر",hour:"الساعات",minute:"الدقائق",month:"الشهر",second:"الثواني",selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,selectedTimeDescription:e=>`\u{627}\u{644}\u{648}\u{642}\u{62A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.time}`,startDate:"تاريخ البدء",timeZoneName:"التوقيت",weekday:"اليوم",year:"السنة"},"bg-BG":{calendar:"Календар",day:"ден",dayPeriod:"пр.об./сл.об.",endDate:"Крайна дата",era:"ера",hour:"час",minute:"минута",month:"месец",second:"секунда",selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{434}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{432}\u{440}\u{435}\u{43C}\u{435}: ${e.time}`,startDate:"Начална дата",timeZoneName:"часова зона",weekday:"ден от седмицата",year:"година"},"cs-CZ":{calendar:"Kalend\xe1ř",day:"den",dayPeriod:"č\xe1st dne",endDate:"Konečn\xe9 datum",era:"letopočet",hour:"hodina",minute:"minuta",month:"měs\xedc",second:"sekunda",selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.startDate} a\u{17E} ${e.endDate}`,selectedTimeDescription:e=>`Vybran\xfd \u{10D}as: ${e.time}`,startDate:"Poč\xe1tečn\xed datum",timeZoneName:"časov\xe9 p\xe1smo",weekday:"den v t\xfddnu",year:"rok"},"da-DK":{calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xe6ra",hour:"time",minute:"minut",month:"m\xe5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xe5r"},"de-DE":{calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xe4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgew\xe4hlte Zeit: ${e.time}`,startDate:"Anfangsdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"},"el-GR":{calendar:"Ημερολόγιο",day:"ημέρα",dayPeriod:"π.μ./μ.μ.",endDate:"Ημερομηνία λήξης",era:"περίοδος",hour:"ώρα",minute:"λεπτό",month:"μήνας",second:"δευτερόλεπτο",selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,selectedTimeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3CE}\u{3C1}\u{3B1}: ${e.time}`,startDate:"Ημερομηνία έναρξης",timeZoneName:"ζώνη ώρας",weekday:"καθημερινή",year:"έτος"},"en-US":{era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`},"es-ES":{calendar:"Calendario",day:"d\xeda",dayPeriod:"a.\xa0m./p.\xa0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xeda de la semana",year:"a\xf1o"},"et-EE":{calendar:"Kalender",day:"p\xe4ev",dayPeriod:"enne/p\xe4rast l\xf5unat",endDate:"L\xf5ppkuup\xe4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:"Alguskuup\xe4ev",timeZoneName:"ajav\xf6\xf6nd",weekday:"n\xe4dalap\xe4ev",year:"aasta"},"fi-FI":{calendar:"Kalenteri",day:"p\xe4iv\xe4",dayPeriod:"vuorokaudenaika",endDate:"P\xe4\xe4ttymisp\xe4iv\xe4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.startDate} \u{2013} ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:"Alkamisp\xe4iv\xe4",timeZoneName:"aikavy\xf6hyke",weekday:"viikonp\xe4iv\xe4",year:"vuosi"},"fr-FR":{calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xe8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie\xa0: ${e.time}`,startDate:"Date de d\xe9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xe9e"},"he-IL":{calendar:"לוח שנה",day:"יום",dayPeriod:"לפנה״צ/אחה״צ",endDate:"תאריך סיום",era:"תקופה",hour:"שעה",minute:"דקה",month:"חודש",second:"שנייה",selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,selectedTimeDescription:e=>`\u{5D6}\u{5DE}\u{5DF} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.time}`,startDate:"תאריך התחלה",timeZoneName:"אזור זמן",weekday:"יום בשבוע",year:"שנה"},"hr-HR":{calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum završetka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:"Datum početka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"},"hu-HU":{calendar:"Napt\xe1r",day:"nap",dayPeriod:"napszak",endDate:"Befejező d\xe1tum",era:"\xe9ra",hour:"\xf3ra",minute:"perc",month:"h\xf3nap",second:"m\xe1sodperc",selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.startDate}\u{2013}${e.endDate}`,selectedTimeDescription:e=>`Kijel\xf6lt id\u{151}: ${e.time}`,startDate:"Kezdő d\xe1tum",timeZoneName:"időz\xf3na",weekday:"h\xe9t napja",year:"\xe9v"},"it-IT":{calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"},"ja-JP":{calendar:"カレンダー",day:"日",dayPeriod:"午前/午後",endDate:"終了日",era:"時代",hour:"時",minute:"分",month:"月",second:"秒",selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.startDate} \u{304B}\u{3089} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{6642}\u{9593} : ${e.time}`,startDate:"開始日",timeZoneName:"タイムゾーン",weekday:"曜日",year:"年"},"ko-KR":{calendar:"달력",day:"일",dayPeriod:"오전/오후",endDate:"종료일",era:"연호",hour:"시",minute:"분",month:"월",second:"초",selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`\u{C120}\u{D0DD} \u{C2DC}\u{AC04}: ${e.time}`,startDate:"시작일",timeZoneName:"시간대",weekday:"요일",year:"년"},"lt-LT":{calendar:"Kalendorius",day:"diena",dayPeriod:"iki pietų / po pietų",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minutė",month:"mėnuo",second:"sekundė",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:"Pradžios data",timeZoneName:"laiko juosta",weekday:"savaitės diena",year:"metai"},"lv-LV":{calendar:"Kalendārs",day:"diena",dayPeriod:"priekšpusdienā/pēcpusdienā",endDate:"Beigu datums",era:"ēra",hour:"stundas",minute:"minūtes",month:"mēnesis",second:"sekundes",selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: no ${e.startDate} l\u{12B}dz ${e.endDate}`,selectedTimeDescription:e=>`Atlas\u{12B}tais laiks: ${e.time}`,startDate:"Sākuma datums",timeZoneName:"laika josla",weekday:"nedēļas diena",year:"gads"},"nb-NO":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xe5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xe5r"},"nl-NL":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"},"pl-PL":{calendar:"Kalendarz",day:"dzień",dayPeriod:"rano / po południu / wieczorem",endDate:"Data końcowa",era:"era",hour:"godzina",minute:"minuta",month:"miesiąc",second:"sekunda",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:"Data początkowa",timeZoneName:"strefa czasowa",weekday:"dzień tygodnia",year:"rok"},"pt-BR":{calendar:"Calend\xe1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xeas",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xe1rio",weekday:"dia da semana",year:"ano"},"pt-PT":{calendar:"Calend\xe1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xe9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xeas",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data de In\xedcio",timeZoneName:"fuso hor\xe1rio",weekday:"dia da semana",year:"ano"},"ro-RO":{calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dată final",era:"eră",hour:"oră",minute:"minut",month:"lună",second:"secundă",selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectat\u{103}: ${e.time}`,startDate:"Dată \xeenceput",timeZoneName:"fus orar",weekday:"ziua din săptăm\xe2nă",year:"an"},"ru-RU":{calendar:"Календарь",day:"день",dayPeriod:"AM/PM",endDate:"Дата окончания",era:"эра",hour:"час",minute:"минута",month:"месяц",second:"секунда",selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: \u{441} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{43E}\u{435} \u{432}\u{440}\u{435}\u{43C}\u{44F}: ${e.time}`,startDate:"Дата начала",timeZoneName:"часовой пояс",weekday:"день недели",year:"год"},"sk-SK":{calendar:"Kalend\xe1r",day:"deň",dayPeriod:"AM/PM",endDate:"D\xe1tum ukončenia",era:"letopočet",hour:"hodina",minute:"min\xfata",month:"mesiac",second:"sekunda",selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybrat\xfd \u{10D}as: ${e.time}`,startDate:"D\xe1tum začatia",timeZoneName:"časov\xe9 p\xe1smo",weekday:"deň t\xfdždňa",year:"rok"},"sl-SI":{calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani \u{10D}as: ${e.time}`,startDate:"Datum začetka",timeZoneName:"časovni pas",weekday:"dan v tednu",year:"leto"},"sr-SP":{calendar:"Kalendar",day:"дан",dayPeriod:"пре подне/по подне",endDate:"Datum završetka",era:"ера",hour:"сат",minute:"минут",month:"месец",second:"секунд",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:"Datum početka",timeZoneName:"временска зона",weekday:"дан у недељи",year:"година"},"sv-SE":{calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xe5nad",second:"sekund",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xe5r"},"tr-TR":{calendar:"Takvim",day:"g\xfcn",dayPeriod:"\xd6\xd6/\xd6S",endDate:"Bitiş Tarihi",era:"\xe7ağ",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Se\xe7ilen Zaman: ${e.time}`,startDate:"Başlangı\xe7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftanın g\xfcn\xfc",year:"yıl"},"uk-UA":{calendar:"Календар",day:"день",dayPeriod:"дп/пп",endDate:"Дата завершення",era:"ера",hour:"година",minute:"хвилина",month:"місяць",second:"секунда",selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{2014} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${e.time}`,startDate:"Дата початку",timeZoneName:"часовий пояс",weekday:"день тижня",year:"рік"},"zh-CN":{calendar:"日历",day:"日",dayPeriod:"上午/下午",endDate:"结束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65F6}\u{95F4}\u{FF1A}${e.time}`,startDate:"开始日期",timeZoneName:"时区",weekday:"工作日",year:"年"},"zh-TW":{calendar:"日曆",day:"日",dayPeriod:"上午/下午",endDate:"結束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{6642}\u{9593}\u{FF1A}${e.time}`,startDate:"開始日期",timeZoneName:"时区",weekday:"工作日",year:"年"}};let yh=l$().createContext(null),yg="react-aria-focus-scope-restore",yy=null;function yv(e){var t,n,r,a,o,i,s,l,u,c;let d,m,p,f,{children:h,contain:g,restoreFocus:y,autoFocus:v}=e,b=(0,lT.useRef)(null),w=(0,lT.useRef)(null),E=(0,lT.useRef)([]),{parentNode:x}=(0,lT.useContext)(yh)||{},D=(0,lT.useMemo)(()=>new yN({scopeRef:E}),[E]);mC(()=>{let e=x||yA.root;if(yA.getTreeNode(e.scopeRef)&&yy&&!yD(yy,e.scopeRef)){let t=yA.getTreeNode(yy);t&&(e=t)}e.addChild(D),yA.addNode(D)},[D,x]),mC(()=>{let e=yA.getTreeNode(E);e&&(e.contain=!!g)},[g]),mC(()=>{var e;let t=null==(e=b.current)?void 0:e.nextSibling,n=[],r=e=>e.stopPropagation();for(;t&&t!==w.current;)n.push(t),t.addEventListener(yg,r),t=t.nextSibling;return E.current=n,()=>{for(let e of n)e.removeEventListener(yg,r)}},[h]),mC(()=>{if(n||r)return;let e=t.current,a=pt(e?e[0]:void 0),o=e=>{let n=pI(e);yE(n,t.current)?yy=t:yx(n)||(yy=null)};return a.addEventListener("focusin",o,!1),null==e||e.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{a.removeEventListener("focusin",o,!1),null==e||e.forEach(e=>e.removeEventListener("focusin",o,!1))}},[t=E,n=y,r=g]),a=E,o=g,d=(0,lT.useRef)(void 0),m=(0,lT.useRef)(void 0),mC(()=>{let e=a.current;if(!o){m.current&&(cancelAnimationFrame(m.current),m.current=void 0);return}let t=pt(e?e[0]:void 0),n=e=>{if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey||!yw(a)||e.isComposing)return;let n=((e=document)=>e.activeElement)(t),r=a.current;if(!r||!yE(n,r))return;let o=yR(yb(r),{tabbable:!0},r);if(!n)return;o.currentNode=n;let i=e.shiftKey?o.previousNode():o.nextNode();i||(o.currentNode=e.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,i=e.shiftKey?o.previousNode():o.nextNode()),e.preventDefault(),i&&y_(i,!0)},r=e=>{(!yy||yD(yy,a))&&yE(pI(e),a.current)?(yy=a,d.current=pI(e)):yw(a)&&!yx(pI(e),a)?d.current?d.current.focus():yy&&yy.current&&yS(yy.current):yw(a)&&(d.current=pI(e))},i=e=>{m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{let n=pq,r=("virtual"===n||null===n)&&pv()&&py(),o=((e=document)=>e.activeElement)(t);if(!r&&o&&yw(a)&&!yx(o,a)){yy=a;let t=pI(e);if(t&&t.isConnected){var i;d.current=t,null==(i=d.current)||i.focus()}else yy.current&&yS(yy.current)}})};return t.addEventListener("keydown",n,!1),t.addEventListener("focusin",r,!1),null==e||e.forEach(e=>e.addEventListener("focusin",r,!1)),null==e||e.forEach(e=>e.addEventListener("focusout",i,!1)),()=>{t.removeEventListener("keydown",n,!1),t.removeEventListener("focusin",r,!1),null==e||e.forEach(e=>e.removeEventListener("focusin",r,!1)),null==e||e.forEach(e=>e.removeEventListener("focusout",i,!1))}},[a,o]),mC(()=>()=>{m.current&&cancelAnimationFrame(m.current)},[m]),i=E,s=y,l=g,p=(0,lT.useRef)("u">typeof document?((e=document)=>e.activeElement)(pt(i.current?i.current[0]:void 0)):null),mC(()=>{let e=i.current,t=pt(e?e[0]:void 0);if(!s||l)return;let n=()=>{(!yy||yD(yy,i))&&yE(((e=document)=>e.activeElement)(t),i.current)&&(yy=i)};return t.addEventListener("focusin",n,!1),null==e||e.forEach(e=>e.addEventListener("focusin",n,!1)),()=>{t.removeEventListener("focusin",n,!1),null==e||e.forEach(e=>e.removeEventListener("focusin",n,!1))}},[i,l]),mC(()=>{let e=pt(i.current?i.current[0]:void 0);if(!s)return;let t=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!yw(i)||t.isComposing)return;let n=e.activeElement;if(!yx(n,i)||!yC(i))return;let r=yA.getTreeNode(i);if(!r)return;let a=r.nodeToRestore,o=yR(e.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if(a&&a.isConnected&&a!==e.body||(a=void 0,r.nodeToRestore=void 0),(!s||!yx(s,i))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(yx(s,i));(t.preventDefault(),t.stopPropagation(),s)?y_(s,!0):yx(a)?y_(a,!0):n.blur()}};return l||e.addEventListener("keydown",t,!0),()=>{l||e.removeEventListener("keydown",t,!0)}},[i,s,l]),mC(()=>{var e;let t=pt(i.current?i.current[0]:void 0);if(!s)return;let n=yA.getTreeNode(i);if(n)return n.nodeToRestore=null!=(e=p.current)?e:void 0,()=>{let e=yA.getTreeNode(i);if(!e)return;let n=e.nodeToRestore,r=((e=document)=>e.activeElement)(t);if(s&&n&&(r&&yx(r,i)||r===t.body&&yC(i))){let e=yA.clone();requestAnimationFrame(()=>{if(t.activeElement===t.body){let t=e.getTreeNode(i);for(;t;){if(t.nodeToRestore&&t.nodeToRestore.isConnected)return void yP(t.nodeToRestore);t=t.parent}for(t=e.getTreeNode(i);t;){if(t.scopeRef&&t.scopeRef.current&&yA.getTreeNode(t.scopeRef))return void yP(yk(t.scopeRef.current,!0));t=t.parent}}})}}},[i,s]),u=E,c=v,f=l$().useRef(c),(0,lT.useEffect)(()=>{f.current&&(yy=u,!yE(((e=document)=>e.activeElement)(pt(u.current?u.current[0]:void 0)),yy.current)&&u.current&&yS(u.current)),f.current=!1},[u]),(0,lT.useEffect)(()=>{let e=((e=document)=>e.activeElement)(pt(E.current?E.current[0]:void 0)),t=null;if(yE(e,E.current)){for(let n of yA.traverse())n.scopeRef&&yE(e,n.scopeRef.current)&&(t=n);t===yA.getTreeNode(E)&&(yy=t.scopeRef)}},[E]),mC(()=>()=>{var e,t,n;let r=null!=(n=null==(t=yA.getTreeNode(E))||null==(e=t.parent)?void 0:e.scopeRef)?n:null;(E===yy||yD(E,yy))&&(!r||yA.getTreeNode(r))&&(yy=r),yA.removeTreeNode(E)},[E]);let _=(0,lT.useMemo)(()=>{var e;return e=E,{focusNext(t={}){var n;let r=e.current,{from:a,tabbable:o,wrap:i,accept:s}=t,l=a||((e=document)=>e.activeElement)(pt(null!=(n=r[0])?n:void 0)),u=r[0].previousElementSibling,c=yR(yb(r),{tabbable:o,accept:s},r);c.currentNode=yE(l,r)?l:u;let d=c.nextNode();return!d&&i&&(c.currentNode=u,d=c.nextNode()),d&&y_(d,!0),d},focusPrevious(t={}){var n;let r=e.current,{from:a,tabbable:o,wrap:i,accept:s}=t,l=a||((e=document)=>e.activeElement)(pt(null!=(n=r[0])?n:void 0)),u=r[r.length-1].nextElementSibling,c=yR(yb(r),{tabbable:o,accept:s},r);c.currentNode=yE(l,r)?l:u;let d=c.previousNode();return!d&&i&&(c.currentNode=u,d=c.previousNode()),d&&y_(d,!0),d},focusFirst(t={}){let n=e.current,{tabbable:r,accept:a}=t,o=yR(yb(n),{tabbable:r,accept:a},n);o.currentNode=n[0].previousElementSibling;let i=o.nextNode();return i&&y_(i,!0),i},focusLast(t={}){let n=e.current,{tabbable:r,accept:a}=t,o=yR(yb(n),{tabbable:r,accept:a},n);o.currentNode=n[n.length-1].nextElementSibling;let i=o.previousNode();return i&&y_(i,!0),i}}},[]),k=(0,lT.useMemo)(()=>({focusManager:_,parentNode:D}),[D,_]);return l$().createElement(yh.Provider,{value:k},l$().createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:b}),h,l$().createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:w}))}function yb(e){return e[0].parentElement}function yw(e){let t=yA.getTreeNode(yy);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function yE(e,t){return!!e&&!!t&&t.some(t=>t.contains(e))}function yx(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of yA.traverse(yA.getTreeNode(t)))if(n&&yE(e,n.current))return!0;return!1}function yD(e,t){var n;let r=null==(n=yA.getTreeNode(t))?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function y_(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{fn(e)}catch{}}function yk(e,t=!0){let n=e[0].previousElementSibling,r=yb(e),a=yR(r,{tabbable:t},e);a.currentNode=n;let o=a.nextNode();return t&&!o&&((a=yR(r=yb(e),{tabbable:!1},e)).currentNode=n,o=a.nextNode()),o}function yS(e,t=!0){y_(yk(e,t))}function yC(e){let t=yA.getTreeNode(yy);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null==t?void 0:t.scopeRef)===e}function yP(e){e.dispatchEvent(new CustomEvent(yg,{bubbles:!0,cancelable:!0}))&&y_(e)}function yR(e,t,n){var r,a,o;let i=(null==t?void 0:t.tabbable)?pe:m7,s=pt((null==e?void 0:e.nodeType)===Node.ELEMENT_NODE?e:null),l=(r=e||s,a=NodeFilter.SHOW_ELEMENT,o={acceptNode(e){var r;return(null==t||null==(r=t.from)?void 0:r.contains(e))?NodeFilter.FILTER_REJECT:i(e)&&function e(t,n){return"#comment"!==t.nodeName&&function(e){let t=pn(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,a="none"!==n&&"hidden"!==r&&"collapse"!==r;if(a){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);a="none"!==n&&"hidden"!==r&&"collapse"!==r}return a}(t)&&!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==t.nodeName||!n||"SUMMARY"===n.nodeName||t.hasAttribute("open"))&&(!t.parentElement||e(t.parentElement,t))}(e)&&(!n||yE(e,n))&&(!(null==t?void 0:t.accept)||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}},s.createTreeWalker(r,a,o));return(null==t?void 0:t.from)&&(l.currentNode=t.from),l}function yT(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:a,tabbable:o=t.tabbable,wrap:i=t.wrap,accept:s=t.accept}=n,l=a||((e=document)=>e.activeElement)(pt(r)),u=yR(r,{tabbable:o,accept:s});r.contains(l)&&(u.currentNode=l);let c=u.nextNode();return!c&&i&&(u.currentNode=r,c=u.nextNode()),c&&y_(c,!0),c},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:a,tabbable:o=t.tabbable,wrap:i=t.wrap,accept:s=t.accept}=n,l=a||((e=document)=>e.activeElement)(pt(r)),u=yR(r,{tabbable:o,accept:s});if(r.contains(l))u.currentNode=l;else{let e=y$(u);return e&&y_(e,!0),null!=e?e:null}let c=u.previousNode();if(!c&&i){u.currentNode=r;let e=y$(u);if(!e)return null;c=e}return c&&y_(c,!0),null!=c?c:null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:a=t.tabbable,accept:o=t.accept}=n,i=yR(r,{tabbable:a,accept:o}).nextNode();return i&&y_(i,!0),i},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:a=t.tabbable,accept:o=t.accept}=n,i=y$(yR(r,{tabbable:a,accept:o}));return i&&y_(i,!0),null!=i?i:null}}}function y$(e){let t,n;do(t=e.lastChild())&&(n=t);while(t);return n}class yO{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(null!=t?t:null);if(!r)return;let a=new yN({scopeRef:e});r.addChild(a),a.parent=r,this.fastMap.set(e,a),n&&(a.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&yE(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){var e,t;let n=new yO;for(let r of this.traverse())n.addTreeNode(r.scopeRef,null!=(t=null==(e=r.parent)?void 0:e.scopeRef)?t:null,r.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new yN({scopeRef:null}),this.fastMap.set(null,this.root)}}class yN{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let yA=new yO;function yI(e,t,n){let{direction:r}=fN(),a=(0,lT.useMemo)(()=>yT(t),[t]),o=()=>{var e;if(!t.current)return;let n=null==(e=window.event)?void 0:e.target,r=yR(t.current,{tabbable:!0});if(n&&(r.currentNode=n,n=r.previousNode()),!n){let e;do(e=r.lastChild())&&(n=e);while(e)}for(;null==n?void 0:n.hasAttribute("data-placeholder");){let e=r.previousNode();if(e&&e.hasAttribute("data-placeholder"))n=e;else break}n&&n.focus()},{pressProps:i}=pW({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(e){"mouse"===e.pointerType&&o()},onPress(e){"mouse"!==e.pointerType&&o()}});return mW(i,{onKeyDown:o=>{if(o.currentTarget.contains(o.target)&&(o.altKey&&("ArrowDown"===o.key||"ArrowUp"===o.key)&&"setOpen"in e&&(o.preventDefault(),o.stopPropagation(),e.setOpen(!0)),!n))switch(o.key){case"ArrowLeft":if(o.preventDefault(),o.stopPropagation(),"rtl"===r){if(t.current){let e=o.target,n=yj(t.current,e.getBoundingClientRect().left,-1);n&&n.focus()}}else a.focusPrevious();break;case"ArrowRight":if(o.preventDefault(),o.stopPropagation(),"rtl"===r){if(t.current){let e=o.target,n=yj(t.current,e.getBoundingClientRect().left,1);n&&n.focus()}}else a.focusNext()}}})}function yj(e,t,n){let r=yR(e,{tabbable:!0}),a=r.nextNode(),o=null,i=1/0;for(;a;){let e=a.getBoundingClientRect().left-t,s=Math.abs(e);Math.sign(e)===n&&s<i&&(o=a,i=s),a=r.nextNode()}return o}function yM(e,t,n){let r=(0,lT.useRef)(t),a=mP(()=>{n&&n(r.current)});(0,lT.useEffect)(()=>{var t;let n=null==e||null==(t=e.current)?void 0:t.form;return null==n||n.addEventListener("reset",a),()=>{null==n||n.removeEventListener("reset",a)}},[e,a])}function yL(e){let{description:t,errorMessage:n,isInvalid:r,validationState:a}=e,{labelProps:o,fieldProps:i}=function(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":a,labelElementType:o="label"}=e;t=mB(t);let i=mB(),s={};return n&&(r=r?`${i} ${r}`:i,s={id:i,htmlFor:"label"===o?t:void 0}),{labelProps:s,fieldProps:h6({id:t,"aria-label":a,"aria-labelledby":r})}}(e),s=mV([!!t,!!n,r,a]),l=mV([!!t,!!n,r,a]);return{labelProps:o,fieldProps:i=mW(i,{"aria-describedby":[s,l,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),descriptionProps:{id:s},errorMessageProps:{id:l}}}function yF(e,t,n){let{validationBehavior:r,focus:a}=e;mC(()=>{if("native"===r&&(null==n?void 0:n.current)&&!n.current.disabled){var e;let r,a=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(a),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation({isInvalid:!(e=n.current).validity.valid,validationDetails:{badInput:(r=e.validity).badInput,customError:r.customError,patternMismatch:r.patternMismatch,rangeOverflow:r.rangeOverflow,rangeUnderflow:r.rangeUnderflow,stepMismatch:r.stepMismatch,tooLong:r.tooLong,tooShort:r.tooShort,typeMismatch:r.typeMismatch,valueMissing:r.valueMissing,valid:r.valid},validationErrors:e.validationMessage?[e.validationMessage]:[]})}});let o=mP(()=>{t.resetValidation()}),i=mP(e=>{var r,o;t.displayValidation.isInvalid||t.commitValidation();let i=null==n||null==(r=n.current)?void 0:r.form;!e.defaultPrevented&&n&&i&&function(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(!n.validity.valid)return n}return null}(i)===n.current&&(a?a():null==(o=n.current)||o.focus(),pq="keyboard",p4("keyboard",null)),e.preventDefault()}),s=mP(()=>{t.commitValidation()});(0,lT.useEffect)(()=>{let e=null==n?void 0:n.current;if(!e)return;let t=e.form;return e.addEventListener("invalid",i),e.addEventListener("change",s),null==t||t.addEventListener("reset",o),()=>{e.removeEventListener("invalid",i),e.removeEventListener("change",s),null==t||t.removeEventListener("reset",o)}},[n,i,s,o,r])}let yB=new WeakMap,yV="__role_"+Date.now(),yU="__focusManager_"+Date.now();function yW(e,t,n){var r,a;let o,{isInvalid:i,validationErrors:s,validationDetails:l}=t.displayValidation,{labelProps:u,fieldProps:c,descriptionProps:d,errorMessageProps:m}=yL({...e,labelElementType:"span",isInvalid:i,errorMessage:e.errorMessage||s}),p=(0,lT.useRef)(null),{focusWithinProps:f}=fs({...e,onFocusWithin(n){var r;p.current=t.value,null==(r=e.onFocus)||r.call(e,n)},onBlurWithin:n=>{var r;t.confirmPlaceholder(),t.value!==p.current&&t.commitValidation(),null==(r=e.onBlur)||r.call(e,n)},onFocusWithinChange:e.onFocusChange}),h=hW((a=yf)&&a.__esModule?a.default:a,"@react-aria/datepicker"),g="hour"===t.maxGranularity?"selectedTimeDescription":"selectedDateDescription",y="hour"===t.maxGranularity?"time":"date",v=gn(t.value?h.format(g,{[y]:t.formatValue({month:"long"})}):""),b="presentation"===e[yV]?c["aria-describedby"]:[v["aria-describedby"],c["aria-describedby"]].filter(Boolean).join(" ")||void 0,w=e[yU],E=(0,lT.useMemo)(()=>w||yT(n),[w,n]),x=yI(t,n,"presentation"===e[yV]);yB.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:[u.id,e["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:b,focusManager:E});let D=(0,lT.useRef)(e.autoFocus);o="presentation"===e[yV]?{role:"presentation"}:mW(c,{role:"group","aria-disabled":e.isDisabled||void 0,"aria-describedby":b}),(0,lT.useEffect)(()=>{D.current&&E.focusFirst(),D.current=!1},[E]),yM(e.inputRef,t.value,t.setValue),yF({...e,focus(){E.focusFirst()}},t,e.inputRef);let _={type:"hidden",name:e.name,value:(null==(r=t.value)?void 0:r.toString())||"",disabled:e.isDisabled};"native"===e.validationBehavior&&(_.type="text",_.hidden=!0,_.required=e.isRequired,_.onChange=()=>{});let k=m6(e);return{labelProps:{...u,onClick:()=>{E.focusFirst()}},fieldProps:mW(k,o,x,f,{onKeyDown(t){e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){e.onKeyUp&&e.onKeyUp(t)},style:{unicodeBidi:"isolate"}}),inputProps:_,descriptionProps:d,errorMessageProps:m,isInvalid:i,validationErrors:s,validationDetails:l}}var yH={};yH={"ar-AE":{rangeOverflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.maxValue} \u{623}\u{648} \u{642}\u{628}\u{644} \u{630}\u{644}\u{643}.`,rangeReversed:"تاريخ البدء يجب أن يكون قبل تاريخ الانتهاء.",rangeUnderflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.minValue} \u{623}\u{648} \u{628}\u{639}\u{62F} \u{630}\u{644}\u{643}.`,unavailableDate:"البيانات المحددة غير متاحة."},"bg-BG":{rangeOverflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.maxValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{440}\u{430}\u{43D}\u{43D}\u{430}.`,rangeReversed:"Началната дата трябва да е преди крайната.",rangeUnderflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.minValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{43A}\u{44A}\u{441}\u{43D}\u{43E}.`,unavailableDate:"Избраната дата не е налична."},"cs-CZ":{rangeOverflow:e=>`Hodnota mus\xed b\xfdt ${e.maxValue} nebo d\u{159}\xedv\u{11B}j\u{161}\xed.`,rangeReversed:"Datum zah\xe1jen\xed mus\xed předch\xe1zet datu ukončen\xed.",rangeUnderflow:e=>`Hodnota mus\xed b\xfdt ${e.minValue} nebo pozd\u{11B}j\u{161}\xed.`,unavailableDate:"Vybran\xe9 datum nen\xed k dispozici."},"da-DK":{rangeOverflow:e=>`V\xe6rdien skal v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xe6re f\xf8r slutdatoen.",rangeUnderflow:e=>`V\xe6rdien skal v\xe6re ${e.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xe6ngelig."},"de-DE":{rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder fr\xfcher sein.`,rangeReversed:"Das Anfangsdatum muss vor dem Enddatum liegen.",rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder sp\xe4ter sein.`,unavailableDate:"Das ausgew\xe4hlte Datum ist nicht verf\xfcgbar."},"el-GR":{rangeOverflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.maxValue} \u{3AE} \u{3C0}\u{3B1}\u{3BB}\u{3B1}\u{3B9}\u{3CC}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,rangeReversed:"Η ημερομηνία έναρξης πρέπει να είναι πριν από την ημερομηνία λήξης.",rangeUnderflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.minValue} \u{3AE} \u{3BC}\u{3B5}\u{3C4}\u{3B1}\u{3B3}\u{3B5}\u{3BD}\u{3AD}\u{3C3}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,unavailableDate:"Η επιλεγμένη ημερομηνία δεν είναι διαθέσιμη."},"en-US":{rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."},"es-ES":{rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xf3n.",rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."},"et-EE":{rangeOverflow:e=>`V\xe4\xe4rtus peab olema ${e.maxValue} v\xf5i varasem.`,rangeReversed:"Alguskuup\xe4ev peab olema enne l\xf5ppkuup\xe4eva.",rangeUnderflow:e=>`V\xe4\xe4rtus peab olema ${e.minValue} v\xf5i hilisem.`,unavailableDate:"Valitud kuup\xe4ev pole saadaval."},"fi-FI":{rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sit\xe4 aikaisempi.`,rangeReversed:"Aloitusp\xe4iv\xe4n on oltava ennen lopetusp\xe4iv\xe4\xe4.",rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sit\xe4 my\xf6h\xe4isempi.`,unavailableDate:"Valittu p\xe4iv\xe4m\xe4\xe4r\xe4 ei ole k\xe4ytett\xe4viss\xe4."},"fr-FR":{rangeOverflow:e=>`La valeur doit \xeatre ${e.maxValue} ou ant\xe9rieure.`,rangeReversed:"La date de d\xe9but doit \xeatre ant\xe9rieure \xe0 la date de fin.",rangeUnderflow:e=>`La valeur doit \xeatre ${e.minValue} ou ult\xe9rieure.`,unavailableDate:"La date s\xe9lectionn\xe9e n’est pas disponible."},"he-IL":{rangeOverflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.maxValue} \u{5D0}\u{5D5} \u{5DE}\u{5D5}\u{5E7}\u{5D3}\u{5DD} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,rangeReversed:"תאריך ההתחלה חייב להיות לפני תאריך הסיום.",rangeUnderflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.minValue} \u{5D0}\u{5D5} \u{5DE}\u{5D0}\u{5D5}\u{5D7}\u{5E8} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,unavailableDate:"התאריך הנבחר אינו זמין."},"hr-HR":{rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:"Datum početka mora biti prije datuma završetka.",rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."},"hu-HU":{rangeOverflow:e=>`Az \xe9rt\xe9knek ${e.maxValue} vagy kor\xe1bbinak kell lennie.`,rangeReversed:"A kezdő d\xe1tumnak a befejező d\xe1tumn\xe1l kor\xe1bbinak kell lennie.",rangeUnderflow:e=>`Az \xe9rt\xe9knek ${e.minValue} vagy k\xe9s\u{151}bbinek kell lennie.`,unavailableDate:"A kiv\xe1lasztott d\xe1tum nem \xe9rhető el."},"it-IT":{rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."},"ja-JP":{rangeOverflow:e=>`\u{5024}\u{306F} ${e.maxValue} \u{4EE5}\u{4E0B}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,rangeReversed:"開始日は終了日より前にする必要があります。",rangeUnderflow:e=>`\u{5024}\u{306F} ${e.minValue} \u{4EE5}\u{4E0A}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,unavailableDate:"選択した日付は使用できません。"},"ko-KR":{rangeOverflow:e=>`\u{AC12}\u{C740} ${e.maxValue} \u{C774}\u{C804}\u{C774}\u{C5B4}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,rangeReversed:"시작일은 종료일 이전이어야 합니다.",rangeUnderflow:e=>`\u{AC12}\u{C740} ${e.minValue} \u{C774}\u{C0C1}\u{C774}\u{C5B4}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,unavailableDate:"선택한 날짜를 사용할 수 없습니다."},"lt-LT":{rangeOverflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.maxValue} arba ankstesn\u{117}.`,rangeReversed:"Pradžios data turi būti ankstesnė nei pabaigos data.",rangeUnderflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.minValue} arba naujesn\u{117}.`,unavailableDate:"Pasirinkta data nepasiekiama."},"lv-LV":{rangeOverflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.maxValue} vai agr\u{101}kai.`,rangeReversed:"Sākuma datumam ir jābūt pirms beigu datuma.",rangeUnderflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.minValue} vai v\u{113}l\u{101}kai.`,unavailableDate:"Atlasītais datums nav pieejams."},"nb-NO":{rangeOverflow:e=>`Verdien m\xe5 v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xe5 v\xe6re f\xf8r sluttdatoen.",rangeUnderflow:e=>`Verdien m\xe5 v\xe6re ${e.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."},"nl-NL":{rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."},"pl-PL":{rangeOverflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.maxValue} lub wcze\u{15B}niejsz\u{105}.`,rangeReversed:"Data rozpoczęcia musi być wcześniejsza niż data zakończenia.",rangeUnderflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.minValue} lub p\xf3\u{17A}niejsz\u{105}.`,unavailableDate:"Wybrana data jest niedostępna."},"pt-BR":{rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xe0 data final.",rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xedvel."},"pt-PT":{rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:"A data de in\xedcio deve ser anterior \xe0 data de fim.",rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xedvel."},"ro-RO":{rangeOverflow:e=>`Valoarea trebuie s\u{103} fie ${e.maxValue} sau anterioar\u{103}.`,rangeReversed:"Data de \xeenceput trebuie să fie anterioară datei de sf\xe2rșit.",rangeUnderflow:e=>`Valoarea trebuie s\u{103} fie ${e.minValue} sau ulterioar\u{103}.`,unavailableDate:"Data selectată nu este disponibilă."},"ru-RU":{rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{43F}\u{43E}\u{437}\u{436}\u{435} ${e.maxValue}.`,rangeReversed:"Дата начала должна предшествовать дате окончания.",rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{44C}\u{448}\u{435} ${e.minValue}.`,unavailableDate:"Выбранная дата недоступна."},"sk-SK":{rangeOverflow:e=>`Hodnota mus\xed by\u{165} ${e.maxValue} alebo skor\u{161}ia.`,rangeReversed:"D\xe1tum začiatku mus\xed byť skorš\xed ako d\xe1tum konca.",rangeUnderflow:e=>`Hodnota mus\xed by\u{165} ${e.minValue} alebo neskor\u{161}ia.`,unavailableDate:"Vybrat\xfd d\xe1tum je nedostupn\xfd."},"sl-SI":{rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starej\u{161}a.`,rangeReversed:"Začetni datum mora biti pred končnim datumom.",rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novej\u{161}a.`,unavailableDate:"Izbrani datum ni na voljo."},"sr-SP":{rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:"Datum početka mora biti pre datuma završetka.",rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."},"sv-SE":{rangeOverflow:e=>`V\xe4rdet m\xe5ste vara ${e.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xe5ste vara f\xf6re slutdatumet.",rangeUnderflow:e=>`V\xe4rdet m\xe5ste vara ${e.minValue} eller senare.`,unavailableDate:"Det valda datumet \xe4r inte tillg\xe4ngligt."},"tr-TR":{rangeOverflow:e=>`De\u{11F}er, ${e.maxValue} veya \xf6ncesi olmal\u{131}d\u{131}r.`,rangeReversed:"Başlangı\xe7 tarihi bitiş tarihinden \xf6nce olmalıdır.",rangeUnderflow:e=>`De\u{11F}er, ${e.minValue} veya sonras\u{131} olmal\u{131}d\u{131}r.`,unavailableDate:"Se\xe7ilen tarih kullanılamıyor."},"uk-UA":{rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{43F}\u{456}\u{437}\u{43D}\u{456}\u{448}\u{435} ${e.maxValue}.`,rangeReversed:"Дата початку має передувати даті завершення.",rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{456}\u{448}\u{435} ${e.minValue}.`,unavailableDate:"Вибрана дата недоступна."},"zh-CN":{rangeOverflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{65E5}\u{671F}\u{3002}`,rangeReversed:"开始日期必须早于结束日期。",rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{65E5}\u{671F}\u{3002}`,unavailableDate:"所选日期不可用。"},"zh-TW":{rangeOverflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{3002}`,rangeReversed:"開始日期必須在結束日期之前。",rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{3002}`,unavailableDate:"所選日期無法使用。"}};let yz={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},yK={...yz,customError:!0,valid:!1},yG={isInvalid:!1,validationDetails:yz,validationErrors:[]},yZ=(0,lT.createContext)({}),yY="__formValidationState"+Date.now();function yq(e){if(e[yY]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:a,commitValidation:o}=e[yY];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:a,commitValidation:o}}return function(e){let{isInvalid:t,validationState:n,name:r,value:a,builtinValidation:o,validate:i,validationBehavior:s="aria"}=e;n&&(t||(t="invalid"===n));let l=void 0!==t?{isInvalid:t,validationErrors:[],validationDetails:yK}:null,u=(0,lT.useMemo)(()=>i&&null!=a?yX(function(e,t){if("function"==typeof e){let n=e(t);if(n&&"boolean"!=typeof n)return yJ(n)}return[]}(i,a)):null,[i,a]);(null==o?void 0:o.validationDetails.valid)&&(o=void 0);let c=(0,lT.useContext)(yZ),d=(0,lT.useMemo)(()=>r?Array.isArray(r)?r.flatMap(e=>yJ(c[e])):yJ(c[r]):[],[c,r]),[m,p]=(0,lT.useState)(c),[f,h]=(0,lT.useState)(!1);c!==m&&(p(c),h(!1));let g=(0,lT.useMemo)(()=>yX(f?[]:d),[f,d]),y=(0,lT.useRef)(yG),[v,b]=(0,lT.useState)(yG),w=(0,lT.useRef)(yG),[E,x]=(0,lT.useState)(!1);return(0,lT.useEffect)(()=>{if(!E)return;x(!1);let e=u||o||y.current;yQ(e,w.current)||(w.current=e,b(e))}),{realtimeValidation:l||g||u||o||yG,displayValidation:"native"===s?l||g||v:l||g||u||o||v,updateValidation(e){"aria"!==s||yQ(v,e)?y.current=e:b(e)},resetValidation(){yQ(yG,w.current)||(w.current=yG,b(yG)),"native"===s&&x(!1),h(!0)},commitValidation(){"native"===s&&x(!0),h(!0)}}}(e)}function yJ(e){return e?Array.isArray(e)?e:[e]:[]}function yX(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:yK}:null}function yQ(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function y0(...e){let t=new Set,n=!1,r={...yz};for(let a of e){for(let e of a.validationErrors)t.add(e);for(let e in n||(n=a.isInvalid),r)r[e]||(r[e]=a.validationDetails[e])}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}let y1=new hM((J=yH)&&J.__esModule?J.default:J);function y4(){return"u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US"}function y2(e,t,n,r,a){let o=null!=e&&null!=n&&e.compare(n)>0,i=null!=e&&null!=t&&0>e.compare(t),s=null!=e&&(null==r?void 0:r(e))||!1,l=o||i||s,u=[];if(l){let e=y4(),r=new hB(e,hM.getGlobalDictionaryForPackage("@react-stately/datepicker")||y1),l=new hz(e,y5({},a)),c=l.resolvedOptions().timeZone;i&&null!=t&&u.push(r.format("rangeUnderflow",{minValue:l.format(t.toDate(c))})),o&&null!=n&&u.push(r.format("rangeOverflow",{maxValue:l.format(n.toDate(c))})),s&&u.push(r.format("unavailableDate"))}return{isInvalid:l,validationErrors:u,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:o,rangeUnderflow:i,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!l}}}let y3={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},y6={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function y5(e,t){var n;e={...t.shouldForceLeadingZeros?y6:y3,...e};let r=t.granularity||"minute",a=Object.keys(e),o=a.indexOf(null!=(n=t.maxGranularity)?n:"year");o<0&&(o=0);let i=a.indexOf(r);if(i<0&&(i=2),o>i)throw Error("maxGranularity must be greater than granularity");let s=a.slice(o,i+1).reduce((t,n)=>(t[n]=e[n],t),{});return null!=t.hourCycle&&(s.hour12=12===t.hourCycle),s.timeZone=t.timeZone||"UTC",("hour"===r||"minute"===r||"second"===r)&&t.timeZone&&!t.hideTimeZone&&(s.timeZoneName="short"),t.showEra&&0===o&&(s.era="short"),s}function y9(e){return e&&"hour"in e?e:new ht}function y8(e,t){return null===e?null:e?hg(e,t):void 0}function y7(e,t,n,r){if(e)return y8(e,n);let a=hg(hD(null!=r?r:hP()).set({hour:0,minute:0,second:0,millisecond:0}),n);return"year"===t||"month"===t||"day"===t?hf(a):r?a:hh(a)}function ve(e,t){let n=e&&"timeZone"in e?e.timeZone:void 0,r=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw Error("Invalid granularity "+t+" for value "+e.toString());let[a,o]=(0,lT.useState)([r,n]);return e&&(a[0]!==r||a[1]!==n)&&o([r,n]),t||(t=e?r:a[0]),[t,e?n:a[1]]}let vt=new hM({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"ዓዓዓዓ",month:"ሚሜ",day:"ቀቀ"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"سنة",month:"شهر",day:"يوم"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"гггг",month:"мм",day:"дд"},bg:{year:"гггг",month:"мм",day:"дд"},bn:{year:"yyyy",month:"মিমি",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"ساڵ",month:"مانگ",day:"ڕۆژ"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"źź"},el:{year:"εεεε",month:"μμ",day:"ηη"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"سال",month:"ماه",day:"روز"},ff:{year:"hhhh",month:"ll",day:"\xf1\xf1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"שנה",month:"חודש",day:"יום"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xe9\xe9\xe9\xe9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"年",month:"月",day:"日"},ka:{year:"წწწწ",month:"თთ",day:"რრ"},kk:{year:"жжжж",month:"аа",day:"кк"},kn:{year:"ವವವವ",month:"ಮಿಮೀ",day:"ದಿದಿ"},ko:{year:"연도",month:"월",day:"일"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"ປປປປ",month:"ດດ",day:"ວວ"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"വർഷം",month:"മാസം",day:"തീയതി"},ms:{year:"tttt",month:"mm",day:"hh"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},no:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"гггг",month:"мм",day:"дд"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"гггг",month:"мм",day:"дд"},sv:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"сссс",month:"мм",day:"рр"},th:{year:"ปปปป",month:"ดด",day:"วว"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"рррр",month:"мм",day:"дд"},"zh-CN":{year:"年",month:"月",day:"日"},"zh-TW":{year:"年",month:"月",day:"日"}},"en"),vn={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},vr={year:5,month:2,day:7,hour:2,minute:15,second:15},va={dayperiod:"dayPeriod"};function vo(e){var t,n;let{locale:r,createCalendar:a,hideTimeZone:o,isDisabled:i=!1,isReadOnly:s=!1,isRequired:l=!1,minValue:u,maxValue:c,isDateUnavailable:d}=e,m=e.value||e.defaultValue||e.placeholderValue||null,[p,f]=ve(m,e.granularity),h=f||"UTC";if(m&&!(p in m))throw Error("Invalid granularity "+p+" for value "+m.toString());let g=(0,lT.useMemo)(()=>new hz(r),[r]),y=(0,lT.useMemo)(()=>a(g.resolvedOptions().calendar),[a,g]),[v,b]=g4(e.value,null!=(t=e.defaultValue)?t:null,e.onChange),w=(0,lT.useMemo)(()=>{var e;return null!=(e=y8(v,y))?e:null},[v,y]),[E,x]=(0,lT.useState)(()=>y7(e.placeholderValue,p,y,f)),D="gregory"===y.identifier&&"BC"===(w||E).era,_=(0,lT.useMemo)(()=>{var t;return{granularity:p,maxGranularity:null!=(t=e.maxGranularity)?t:"year",timeZone:f,hideTimeZone:o,hourCycle:e.hourCycle,showEra:D,shouldForceLeadingZeros:e.shouldForceLeadingZeros}},[e.maxGranularity,p,e.hourCycle,e.shouldForceLeadingZeros,f,o,D]),k=(0,lT.useMemo)(()=>y5({},_),[_]),S=(0,lT.useMemo)(()=>new hz(r,k),[r,k]),C=(0,lT.useMemo)(()=>S.resolvedOptions(),[S]),P=(0,lT.useMemo)(()=>S.formatToParts(new Date).filter(e=>vn[e.type]).reduce((e,t)=>(e[t.type]=!0,e),{}),[S]),[R,T]=(0,lT.useState)(()=>e.value||e.defaultValue?{...P}:{}),$=(0,lT.useRef)(null),O=(0,lT.useRef)(y);(0,lT.useEffect)(()=>{hw(y,O.current)||(O.current=y,x(t=>Object.keys(R).length>0?hg(t,y):y7(e.placeholderValue,p,y,f)))},[y,p,R,f,e.placeholderValue]),v&&Object.keys(R).length<Object.keys(P).length&&T(R={...P}),null==v&&Object.keys(R).length===Object.keys(P).length&&(T(R={}),x(y7(e.placeholderValue,p,y,f)));let N=w&&Object.keys(R).length>=Object.keys(P).length?w:E,A=t=>{if(e.isDisabled||e.isReadOnly)return;let n=Object.keys(R),r=Object.keys(P);null==t?(b(null),x(y7(e.placeholderValue,p,y,f)),T({})):n.length>=r.length||n.length===r.length-1&&P.dayPeriod&&!R.dayPeriod&&"dayPeriod"!==$.current?b(t=hg(t,(null==m?void 0:m.calendar)||new fV)):x(t),$.current=null},I=(0,lT.useMemo)(()=>N.toDate(h),[N,h]),j=(0,lT.useMemo)(()=>(function(e,t,n,r,a,o,i,s){let l=["hour","minute","second"],u=n.formatToParts(e),c=[];for(let e of u){var d,m;let n=vn[e.type];"era"===e.type&&1===o.getEras().length&&(n=!1);let u=vn[e.type]&&!t[e.type],p=vn[e.type]?(d=e.type,m=e.value,"era"===d||"dayPeriod"===d?m:"year"===d||"month"===d||"day"===d?vt.getStringForLocale(d,i):"––"):null,f={type:va[e.type]||e.type,text:u?p:e.value,...vi(a,e.type,r),isPlaceholder:u,placeholder:p,isEditable:n};"hour"===e.type?(c.push({type:"literal",text:"",...vi(a,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1}),c.push(f),e.type===s&&c.push({type:"literal",text:"",...vi(a,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):l.includes(e.type)&&e.type===s?(c.push(f),c.push({type:"literal",text:"",...vi(a,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):c.push(f)}return c})(I,R,S,C,N,y,r,p),[I,R,S,C,N,y,r,p]);P.era&&R.year&&!R.era?(R.era=!0,T({...R})):!P.era&&R.era&&(delete R.era,T({...R}));let M=e=>{R[e]=!0,"year"===e&&P.era&&(R.era=!0),T({...R})},L=(e,t)=>{if(R[e])A(function(e,t,n,r){switch(t){case"era":case"year":case"month":case"day":return e.cycle(t,n,{round:"year"===t})}if("hour"in e)switch(t){case"dayPeriod":{let t=e.hour;return e.set({hour:t>=12?t-12:t+12})}case"hour":case"minute":case"second":return e.cycle(t,n,{round:"hour"!==t,hourCycle:r.hour12?12:24})}throw Error("Unknown segment: "+t)}(N,e,t,C));else{M(e);let t=Object.keys(R),n=Object.keys(P);(t.length>=n.length||t.length===n.length-1&&P.dayPeriod&&!R.dayPeriod)&&A(N)}},F=(0,lT.useMemo)(()=>y2(v,u,c,d,_),[v,u,c,d,_]),B=yq({...e,value:v,builtinValidation:F}),V=B.displayValidation.isInvalid,U=e.validationState||(V?"invalid":null);return{...B,value:w,dateValue:I,calendar:y,setValue:A,segments:j,dateFormatter:S,validationState:U,isInvalid:V,granularity:p,maxGranularity:null!=(n=e.maxGranularity)?n:"year",isDisabled:i,isReadOnly:s,isRequired:l,increment(e){L(e,1)},decrement(e){L(e,-1)},incrementPage(e){L(e,vr[e]||1)},decrementPage(e){L(e,-(vr[e]||1))},setSegment(e,t){M(e),A(function(e,t,n,r){switch(t){case"day":case"month":case"year":case"era":return e.set({[t]:n})}if("hour"in e&&"number"==typeof n)switch(t){case"dayPeriod":{let t=e.hour,r=t>=12;if(n>=12===r)return e;return e.set({hour:r?t-12:t+12})}case"hour":if(r.hour12){let t=e.hour>=12;t||12!==n||(n=0),t&&n<12&&(n+=12)}case"minute":case"second":return e.set({[t]:n})}throw Error("Unknown segment: "+t)}(N,e,t,C))},confirmPlaceholder(){if(e.isDisabled||e.isReadOnly)return;let t=Object.keys(R),n=Object.keys(P);t.length===n.length-1&&P.dayPeriod&&!R.dayPeriod&&(T(R={...P}),A(N.copy()))},clearSegment(t){delete R[t],$.current=t,T({...R});let n=y7(e.placeholderValue,p,y,f),r=N;if("dayPeriod"===t&&"hour"in N&&"hour"in n){let e=N.hour>=12,t=n.hour>=12;e&&!t?r=N.set({hour:N.hour-12}):!e&&t&&(r=N.set({hour:N.hour+12}))}else"hour"===t&&"hour"in N&&N.hour>=12&&R.dayPeriod?r=N.set({hour:n.hour+12}):t in N&&(r=N.set({[t]:n[t]}));b(null),A(r)},formatValue:e=>w?new hz(r,y5(e,_)).format(I):"",getDateFormatter:(e,t)=>new hz(e,y5({},{..._,...t}))}}function vi(e,t,n){switch(t){case"era":{let t=e.calendar.getEras();return{value:t.indexOf(e.era),minValue:0,maxValue:t.length-1}}case"year":return{value:e.year,minValue:1,maxValue:e.calendar.getYearsInEra(e)};case"month":return{value:e.month,minValue:e.calendar.getMinimumMonthInYear?e.calendar.getMinimumMonthInYear(e):1,maxValue:e.calendar.getMonthsInYear(e)};case"day":return{value:e.day,minValue:e.calendar.getMinimumDayInMonth?e.calendar.getMinimumDayInMonth(e):1,maxValue:e.calendar.getDaysInMonth(e)}}if("hour"in e)switch(t){case"dayPeriod":return{value:12*(e.hour>=12),minValue:0,maxValue:12};case"hour":if(n.hour12){let t=e.hour>=12;return{value:e.hour,minValue:12*!!t,maxValue:t?23:11}}return{value:e.hour,minValue:0,maxValue:23};case"minute":return{value:e.minute,minValue:0,maxValue:59};case"second":return{value:e.second,minValue:0,maxValue:59}}return{}}let vs=(0,lT.createContext)(null),vl=(0,lT.createContext)(null),vu=(0,lT.createContext)(null),vc=(0,lT.forwardRef)(function(e,t){let n=(0,lT.useContext)(vl),r=(0,lT.useContext)(vu);return n||r?l$().createElement(vm,{...e,ref:t}):l$().createElement(vd,{...e,ref:t})}),vd=(0,lT.forwardRef)((e,t)=>{let[n,r]=mZ({slot:e.slot},t,vs),{locale:a}=fN(),o=vo({...n,locale:a,createCalendar:gZ}),i=(0,lT.useRef)(null),{fieldProps:s,inputProps:l}=yW({...n,inputRef:i},o,r);return l$().createElement(mz,{values:[[vl,o],[ym,{...l,ref:i}],[yc,{...s,ref:r,isInvalid:o.isInvalid,isDisabled:o.isDisabled}]]},l$().createElement(vm,e))}),vm=(0,lT.forwardRef)((e,t)=>{let{className:n,children:r}=e,a=(0,lT.useContext)(vl),o=(0,lT.useContext)(vu),i=null!=a?a:o;return l$().createElement(l$().Fragment,null,l$().createElement(yd,{...e,ref:t,slot:e.slot||void 0,className:null!=n?n:"react-aria-DateInput",isInvalid:i.isInvalid,isDisabled:i.isDisabled},i.segments.map((e,t)=>(0,lT.cloneElement)(r(e),{key:t}))),l$().createElement(yp,null))}),vp=(0,lT.createContext)({});function vf({children:e}){let t=(0,lT.useMemo)(()=>({register:()=>{}}),[]);return l$().createElement(pP.Provider,{value:t},e)}l$().forwardRef(({children:e,...t},n)=>{let r=(0,lT.useRef)(!1),a=(0,lT.useContext)(pP);n=mk(n||(null==a?void 0:a.ref));let o=mW(a||{},{...t,ref:n,register(){r.current=!0,a&&a.register()}});return pO(a,n),(0,lT.useEffect)(()=>{r.current||(r.current=!0)},[]),l$().createElement(pP.Provider,{value:o},e)});let vh=l$().createContext(null);function vg(e){var t;let n=mM(),{portalContainer:r=n?null:document.body,isExiting:a}=e,[o,i]=(0,lT.useState)(!1),s=(0,lT.useMemo)(()=>({contain:o,setContain:i}),[o,i]),{getContainer:l}=null!=(t=(0,lT.useContext)(vp))?t:{};if(!e.portalContainer&&l&&(r=l()),!r)return null;let u=e.children;return e.disableFocusManagement||(u=l$().createElement(yv,{restoreFocus:!0,contain:(e.shouldContainFocus||o)&&!a},u)),u=l$().createElement(vh.Provider,{value:s},l$().createElement(vf,null,u)),pF().createPortal(u,r)}let vy=(0,lT.createContext)(null),vv=(0,lT.createContext)(null),vb=(0,lT.forwardRef)(function(e,t){let n=e["aria-labelledby"];[e,t]=mZ(e,t,vy);let{dialogProps:r,titleProps:a}=function(e,t){let n,r,{role:a="dialog"}=e,o=mV();o=e["aria-label"]?void 0:o;let i=(0,lT.useRef)(!1);return(0,lT.useEffect)(()=>{if(t.current&&!t.current.contains(document.activeElement)){fn(t.current);let e=setTimeout(()=>{document.activeElement===t.current&&(i.current=!0,t.current&&(t.current.blur(),fn(t.current)),i.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),mC(()=>{null==r||r(!0)},[r=null==(n=(0,lT.useContext)(vh))?void 0:n.setContain]),{dialogProps:{...m6(e,{labelable:!0}),role:a,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||o,onBlur:e=>{i.current&&e.stopPropagation()}},titleProps:{id:o}}}({...e,"aria-labelledby":n},t),o=(0,lT.useContext)(vv);r["aria-label"]||r["aria-labelledby"]||e["aria-labelledby"]&&(r["aria-labelledby"]=e["aria-labelledby"]);let i=mK({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(null==o?void 0:o.close)||(()=>{})}});return l$().createElement("section",{...m6(e),...r,...i,ref:t,slot:e.slot||void 0},l$().createElement(mz,{values:[[fb,{slots:{[mH]:{},title:{...a,level:2}}}],[fy,{slots:{[mH]:{},close:{onPress:()=>null==o?void 0:o.close()}}}]]},i.children))}),vw=(0,lT.createContext)(null),vE=(0,lT.forwardRef)(function(e,t){let n=(0,lT.useContext)(vw);return(null==n?void 0:n.isInvalid)?l$().createElement(vx,{...e,ref:t}):null}),vx=(0,lT.forwardRef)((e,t)=>{let n=(0,lT.useContext)(vw),r=m6(e),a=mK({...e,defaultClassName:"react-aria-FieldError",defaultChildren:0===n.validationErrors.length?void 0:n.validationErrors.join(" "),values:n});return null==a.children?null:l$().createElement(fE,{slot:"errorMessage",...r,...a,ref:t})}),vD=(0,lT.createContext)(null),v_=(0,lT.createContext)({}),vk=fh(function(e,t){[e,t]=mZ(e,t,v_);let{elementType:n="label",...r}=e;return l$().createElement(n,{className:"react-aria-Label",...r,ref:t})}),vS=(0,lT.createContext)({placement:"bottom"}),vC=new WeakMap,vP=[];function vR(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}function vT(e,t){let n=e,r=t.toString(),a=r.indexOf("."),o=a>=0?r.length-a:0;if(o>0){let e=Math.pow(10,o);n=Math.round(n*e)/e}return n}function v$(e,t,n,r){t=Number(t),n=Number(n);let a=(e-(isNaN(t)?0:t))%r,o=vT(2*Math.abs(a)>=r?e+Math.sign(a)*(r-Math.abs(a)):e-a,r);return isNaN(t)?!isNaN(n)&&o>n&&(o=Math.floor(vT(n/r,r))*r):o<t?o=t:!isNaN(n)&&o>n&&(o=t+Math.floor(vT((n-t)/r,r))*r),o=vT(o,r)}let vO={top:"top",bottom:"top",left:"left",right:"left"},vN={top:"bottom",bottom:"top",left:"right",right:"left"},vA={top:"left",left:"top"},vI={top:"height",left:"width"},vj={width:"totalWidth",height:"totalHeight"},vM={},vL="u">typeof document?window.visualViewport:null;function vF(e){var t,n,r,a,o;let i=0,s=0,l=0,u=0,c=0,d=0,m={},p=(null!=(t=null==vL?void 0:vL.scale)?t:1)>1;if("BODY"===e.tagName){let t=document.documentElement;l=t.clientWidth,u=t.clientHeight,i=null!=(n=null==vL?void 0:vL.width)?n:l,s=null!=(r=null==vL?void 0:vL.height)?r:u,m.top=t.scrollTop||e.scrollTop,m.left=t.scrollLeft||e.scrollLeft,vL&&(c=vL.offsetTop,d=vL.offsetLeft)}else({width:i,height:s,top:c,left:d}=vH(e)),m.top=e.scrollTop,m.left=e.scrollLeft,l=i,u=s;return pg()&&("BODY"===e.tagName||"HTML"===e.tagName)&&p&&(m.top=0,m.left=0,c=null!=(a=null==vL?void 0:vL.pageTop)?a:0,d=null!=(o=null==vL?void 0:vL.pageLeft)?o:0),{width:i,height:s,totalWidth:l,totalHeight:u,scroll:m,top:c,left:d}}function vB(e,t,n,r,a,o,i){var s;let l=null!=(s=a.scroll[e])?s:0,u=r[vI[e]],c=r.scroll[vO[e]]+o,d=u+r.scroll[vO[e]]-o,m=t-l+i[e]-r[vO[e]],p=t-l+n+i[e]-r[vO[e]];return m<c?c-m:p>d?Math.max(d-p,c-m):0}function vV(e){if(vM[e])return vM[e];let[t,n]=e.split(" "),r=vO[t]||"right",a=vA[r];vO[n]||(n="center");let o=vI[r],i=vI[a];return vM[e]={placement:t,crossPlacement:n,axis:r,crossAxis:a,size:o,crossSize:i},vM[e]}function vU(e,t,n,r,a,o,i,s,l,u){var c,d,m,p,f;let{placement:h,crossPlacement:g,axis:y,crossAxis:v,size:b,crossSize:w}=r,E={};E[v]=null!=(c=e[v])?c:0,"center"===g?E[v]+=((null!=(d=e[w])?d:0)-(null!=(m=n[w])?m:0))/2:g!==v&&(E[v]+=(null!=(p=e[w])?p:0)-(null!=(f=n[w])?f:0)),E[v]+=o;let x=e[v]-n[w]+l+u,D=e[v]+e[w]-l-u;if(E[v]=vR(E[v],x,D),h===y){let n=s?i[b]:t[vj[b]];E[vN[y]]=Math.floor(n-e[y]+a)}else E[y]=Math.floor(e[y]+e[b]+a);return E}function vW(e,t,n,r,a,o){var i,s,l;let{placement:u,axis:c,size:d}=o;return u===c?Math.max(0,n[c]-e[c]-(null!=(i=e.scroll[c])?i:0)+t[c]-(null!=(s=r[c])?s:0)-r[vN[c]]-a):Math.max(0,e[d]+e[c]+e.scroll[c]-t[c]-n[c]-n[d]-(null!=(l=r[c])?l:0)-r[vN[c]]-a)}function vH(e){let{top:t,left:n,width:r,height:a}=e.getBoundingClientRect(),{scrollTop:o,scrollLeft:i,clientTop:s,clientLeft:l}=document.documentElement;return{top:t+o-s,left:n+i-l,width:r,height:a}}function vz(e,t){let n,r=window.getComputedStyle(e);if("fixed"===r.position){let{top:t,left:r,width:a,height:o}=e.getBoundingClientRect();n={top:t,left:r,width:a,height:o}}else{n=vH(e);let r=vH(t),a=window.getComputedStyle(t);r.top+=(parseInt(a.borderTopWidth,10)||0)-t.scrollTop,r.left+=(parseInt(a.borderLeftWidth,10)||0)-t.scrollLeft,n.top-=r.top,n.left-=r.left}return n.top-=parseInt(r.marginTop,10)||0,n.left-=parseInt(r.marginLeft,10)||0,n}function vK(e){let t=window.getComputedStyle(e);return"none"!==t.transform||/transform|perspective/.test(t.willChange)||"none"!==t.filter||"paint"===t.contain||"backdropFilter"in t&&"none"!==t.backdropFilter||"WebkitBackdropFilter"in t&&"none"!==t.WebkitBackdropFilter}let vG=new WeakMap;function vZ(e){let{ref:t,box:n,onResize:r}=e;(0,lT.useEffect)(()=>{let e=null==t?void 0:t.current;if(e)if(void 0===window.ResizeObserver)return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)};else{let t=new window.ResizeObserver(e=>{e.length&&r()});return t.observe(e,{box:n}),()=>{e&&t.unobserve(e)}}},[r,t,n])}let vY="u">typeof document?window.visualViewport:null;function vq(e,t){if(e.button>0)return!1;if(e.target){let t=e.target.ownerDocument;if(!t||!t.documentElement.contains(e.target)||e.target.closest("[data-react-aria-top-layer]"))return!1}return!!t.current&&!e.composedPath().includes(t.current)}let vJ=[],vX="u">typeof document&&window.visualViewport,vQ=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),v0=0;function v1(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function v4(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function v2(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=gi(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect().top,r=n.getBoundingClientRect().top;r>t+n.clientHeight&&(e.scrollTop+=r-t)}n=e.parentElement}}var v3={};function v6(e){var t;let{onDismiss:n,...r}=e,a=h6(r,hW((t=v3)&&t.__esModule?t.default:t,"@react-aria/overlays").format("dismiss"));return l$().createElement(h8,null,l$().createElement("button",{...a,tabIndex:-1,onClick:()=>{n&&n()},style:{width:1,height:1}}))}function v5(e,t,n){mC(()=>{if(t&&e.current){if(!("getAnimations"in e.current))return void n();let t=e.current.getAnimations();if(0===t.length)return void n();let r=!1;return Promise.all(t.map(e=>e.finished)).then(()=>{r||(0,pL.flushSync)(()=>{n()})}).catch(()=>{}),()=>{r=!0}}},[e,t,n])}function v9(e){let[t,n]=g4(e.isOpen,e.defaultOpen||!1,e.onOpenChange),r=(0,lT.useCallback)(()=>{n(!0)},[n]),a=(0,lT.useCallback)(()=>{n(!1)},[n]),o=(0,lT.useCallback)(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:a,toggle:o}}v3={"ar-AE":{dismiss:"تجاهل"},"bg-BG":{dismiss:"Отхвърляне"},"cs-CZ":{dismiss:"Odstranit"},"da-DK":{dismiss:"Luk"},"de-DE":{dismiss:"Schlie\xdfen"},"el-GR":{dismiss:"Απόρριψη"},"en-US":{dismiss:"Dismiss"},"es-ES":{dismiss:"Descartar"},"et-EE":{dismiss:"L\xf5peta"},"fi-FI":{dismiss:"Hylk\xe4\xe4"},"fr-FR":{dismiss:"Rejeter"},"he-IL":{dismiss:"התעלם"},"hr-HR":{dismiss:"Odbaci"},"hu-HU":{dismiss:"Elutas\xedt\xe1s"},"it-IT":{dismiss:"Ignora"},"ja-JP":{dismiss:"閉じる"},"ko-KR":{dismiss:"무시"},"lt-LT":{dismiss:"Atmesti"},"lv-LV":{dismiss:"Nerādīt"},"nb-NO":{dismiss:"Lukk"},"nl-NL":{dismiss:"Negeren"},"pl-PL":{dismiss:"Zignoruj"},"pt-BR":{dismiss:"Descartar"},"pt-PT":{dismiss:"Dispensar"},"ro-RO":{dismiss:"Revocare"},"ru-RU":{dismiss:"Пропустить"},"sk-SK":{dismiss:"Zrušiť"},"sl-SI":{dismiss:"Opusti"},"sr-SP":{dismiss:"Odbaci"},"sv-SE":{dismiss:"Avvisa"},"tr-TR":{dismiss:"Kapat"},"uk-UA":{dismiss:"Скасувати"},"zh-CN":{dismiss:"取消"},"zh-TW":{dismiss:"關閉"}};let v8=(0,lT.createContext)(null),v7=(0,lT.createContext)(null),be=(0,lT.forwardRef)(function(e,t){[e,t]=mZ(e,t,v8);let n=(0,lT.useContext)(vv),r=v9(e),a=null==e.isOpen&&null==e.defaultOpen&&n?n:r,o=function(e,t){let[n,r]=(0,lT.useState)(t?"open":"closed");switch(n){case"open":t||r("exiting");break;case"closed":case"exiting":t&&r("open")}let a="exiting"===n;return v5(e,a,(0,lT.useCallback)(()=>{r(e=>"exiting"===e?"closed":e)},[])),a}(t,a.isOpen)||e.isExiting||!1,i=(0,lT.useContext)(ff),{direction:s}=fN();if(i){let t=e.children;return"function"==typeof t&&(t=t({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),l$().createElement(l$().Fragment,null,t)}return!a||a.isOpen||o?l$().createElement(bt,{...e,triggerRef:e.triggerRef,state:a,popoverRef:t,isExiting:o,dir:s}):null});function bt({state:e,isExiting:t,UNSTABLE_portalContainer:n,...r}){var a,o;let i=(0,lT.useRef)(null),[s,l]=(0,lT.useState)(0),c=(0,lT.useRef)(null),d=(0,lT.useContext)(v7),m=d&&"SubmenuTrigger"===r.trigger;mC(()=>{i.current&&e.isOpen&&l(i.current.getBoundingClientRect().width)},[e.isOpen,i]);let{popoverProps:p,underlayProps:f,arrowProps:h,placement:g}=function(e,t){let{triggerRef:n,popoverRef:r,groupRef:a,isNonModal:o,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s,...l}=e,c="SubmenuTrigger"===l.trigger,{overlayProps:d,underlayProps:m}=function(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:a,isDismissable:o=!1,isKeyboardDismissDisabled:i=!1,shouldCloseOnInteractOutside:s}=e;(0,lT.useEffect)(()=>{if(a&&!vJ.includes(t))return vJ.push(t),()=>{let e=vJ.indexOf(t);e>=0&&vJ.splice(e,1)}},[a,t]);let l=()=>{vJ[vJ.length-1]===t&&n&&n()};!function(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:a}=e,o=(0,lT.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),i=mP(e=>{n&&vq(e,t)&&(a&&a(e),o.current.isPointerDown=!0)}),s=mP(e=>{n&&n(e)});(0,lT.useEffect)(()=>{let e=o.current;if(r)return;let n=pt(t.current);if("u">typeof PointerEvent){let r=n=>{e.isPointerDown&&vq(n,t)&&s(n),e.isPointerDown=!1};return n.addEventListener("pointerdown",i,!0),n.addEventListener("pointerup",r,!0),()=>{n.removeEventListener("pointerdown",i,!0),n.removeEventListener("pointerup",r,!0)}}},[t,r,i,s])}({ref:t,onInteractOutside:o&&a?e=>{(!s||s(e.target))&&(vJ[vJ.length-1]===t&&(e.stopPropagation(),e.preventDefault()),l())}:void 0,onInteractOutsideStart:e=>{(!s||s(e.target))&&vJ[vJ.length-1]===t&&(e.stopPropagation(),e.preventDefault())}});let{focusWithinProps:u}=fs({isDisabled:!r,onBlurWithin:e=>{!(!e.relatedTarget||yx(e.relatedTarget,yy))&&(!s||s(e.relatedTarget))&&(null==n||n())}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||i||e.nativeEvent.isComposing||(e.stopPropagation(),e.preventDefault(),l())},...u},underlayProps:{onPointerDown:e=>{e.target===e.currentTarget&&e.preventDefault()}}}}({isOpen:t.isOpen,onClose:t.close,shouldCloseOnBlur:!0,isDismissable:!o||c,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s},null!=a?a:r),{overlayProps:p,arrowProps:f,placement:h}=function(e){var t,n,r;let{direction:a}=fN(),{arrowSize:o=0,targetRef:i,overlayRef:s,scrollRef:l=s,placement:u="bottom",containerPadding:c=12,shouldFlip:d=!0,boundaryElement:m="u">typeof document?document.body:null,offset:p=0,crossOffset:f=0,shouldUpdatePosition:h=!0,isOpen:g=!0,onClose:y,maxHeight:v,arrowBoundaryOffset:b=0}=e,[w,E]=(0,lT.useState)(null),x=[h,u,s.current,i.current,l.current,c,d,m,p,f,g,a,v,b,o],D=(0,lT.useRef)(null==vY?void 0:vY.scale);(0,lT.useEffect)(()=>{g&&(D.current=null==vY?void 0:vY.scale)},[g]);let _=(0,lT.useCallback)(()=>{var e,t,n,r,y,w;if(!1===h||!g||!s.current||!i.current||!m||(null==vY?void 0:vY.scale)!==D.current)return;let x=null;if(l.current&&l.current.contains(document.activeElement)){let r=null==(e=document.activeElement)?void 0:e.getBoundingClientRect(),a=l.current.getBoundingClientRect();(x={type:"top",offset:(null!=(t=null==r?void 0:r.top)?t:0)-a.top}).offset>a.height/2&&(x.type="bottom",x.offset=(null!=(n=null==r?void 0:r.bottom)?n:0)-a.bottom)}let _=s.current;!v&&s.current&&(_.style.top="0px",_.style.bottom="",_.style.maxHeight=(null!=(y=null==(r=window.visualViewport)?void 0:r.height)?y:window.innerHeight)+"px");let k=function(e){var t,n,r,a;let o,{placement:i,targetNode:s,overlayNode:l,scrollNode:u,padding:c,shouldFlip:d,boundaryElement:m,offset:p,crossOffset:f,maxHeight:h,arrowSize:g=0,arrowBoundaryOffset:y=0}=e,v=l instanceof HTMLElement?function(e){let t=e.offsetParent;if(t&&t===document.body&&"static"===window.getComputedStyle(t).position&&!vK(t)&&(t=document.documentElement),null==t)for(t=e.parentElement;t&&!vK(t);)t=t.parentElement;return t||document.documentElement}(l):document.documentElement,b=v===document.documentElement,w=window.getComputedStyle(v).position,E=b?vH(s):vz(s,v);if(!b){let{marginTop:e,marginLeft:t}=window.getComputedStyle(s);E.top+=parseInt(e,10)||0,E.left+=parseInt(t,10)||0}let x=vH(l),D={top:parseInt((o=window.getComputedStyle(l)).marginTop,10)||0,bottom:parseInt(o.marginBottom,10)||0,left:parseInt(o.marginLeft,10)||0,right:parseInt(o.marginRight,10)||0};x.width+=(null!=(t=D.left)?t:0)+(null!=(n=D.right)?n:0),x.height+=(null!=(r=D.top)?r:0)+(null!=(a=D.bottom)?a:0);let _={top:u.scrollTop,left:u.scrollLeft,width:u.scrollWidth,height:u.scrollHeight},k=vF(m),S=vF(v),C="BODY"===m.tagName?vH(v):vz(v,m);return"HTML"===v.tagName&&"BODY"===m.tagName&&(S.scroll.top=0,S.scroll.left=0),function(e,t,n,r,a,o,i,s,l,u,c,d,m,p,f,h){var g,y,v,b,w,E,x,D,_,k,S,C,P,R;let T,$,O,N=vV(e),{size:A,crossAxis:I,crossSize:j,placement:M,crossPlacement:L}=N,F=vU(t,s,n,N,c,d,u,m,f,h),B=c,V=vW(s,u,t,a,o+c,N);if(i&&r[A]>V){let e=vV(`${vN[M]} ${L}`),r=vU(t,s,n,e,c,d,u,m,f,h);vW(s,u,t,a,o+c,e)>V&&(N=e,F=r,B=c)}let U="bottom";"top"===N.axis?"top"===N.placement?U="top":"bottom"===N.placement&&(U="bottom"):"top"===N.crossAxis&&("top"===N.crossPlacement?U="bottom":"bottom"===N.crossPlacement&&(U="top"));let W=vB(I,F[I],n[j],s,l,o,u);F[I]+=W;let H=(w=F,E=n.height,x=U,T=m?u.height:s[vj.height],$=null!=w.top?u.top+w.top:u.top+(T-(null!=(D=w.bottom)?D:0)-E),O="top"!==x?Math.max(0,s.height+s.top+(null!=(_=s.scroll.top)?_:0)-$-((null!=(k=a.top)?k:0)+(null!=(S=a.bottom)?S:0)+o)):Math.max(0,$+E-(s.top+(null!=(C=s.scroll.top)?C:0))-((null!=(P=a.top)?P:0)+(null!=(R=a.bottom)?R:0)+o)),Math.min(s.height-2*o,O));p&&p<H&&(H=p),n.height=Math.min(n.height,H),W=vB(I,(F=vU(t,s,n,N,B,d,u,m,f,h))[I],n[j],s,l,o,u),F[I]+=W;let z={},K=t[I]+.5*t[j]-F[I]-a[vO[I]],G=f/2+h,Z="left"===vO[I]?(null!=(g=a.left)?g:0)+(null!=(y=a.right)?y:0):(null!=(v=a.top)?v:0)+(null!=(b=a.bottom)?b:0),Y=n[j]-Z-f/2-h,q=vR(K,t[I]+f/2-(F[I]+a[vO[I]]),t[I]+t[j]-f/2-(F[I]+a[vO[I]]));return z[I]=vR(q,G,Y),{position:F,maxHeight:H,arrowOffsetLeft:z.left,arrowOffsetTop:z.top,placement:N.placement}}(i,E,x,_,D,c,d,k,S,C,p,f,!!w&&"static"!==w,h,g,y)}({placement:(w=u,"rtl"===a?w.replace("start","right").replace("end","left"):w.replace("start","left").replace("end","right")),overlayNode:s.current,targetNode:i.current,scrollNode:l.current||s.current,padding:c,shouldFlip:d,boundaryElement:m,offset:p,crossOffset:f,maxHeight:v,arrowSize:o,arrowBoundaryOffset:b});if(k.position){if(_.style.top="",_.style.bottom="",_.style.left="",_.style.right="",Object.keys(k.position).forEach(e=>_.style[e]=k.position[e]+"px"),_.style.maxHeight=null!=k.maxHeight?k.maxHeight+"px":"",x&&document.activeElement&&l.current){let e=document.activeElement.getBoundingClientRect(),t=l.current.getBoundingClientRect(),n=e[x.type]-t[x.type];l.current.scrollTop+=n-x.offset}E(k)}},x);mC(_,x),mC(()=>(window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}),[r=_]),vZ({ref:s,onResize:_}),vZ({ref:i,onResize:_});let k=(0,lT.useRef)(!1);mC(()=>{let e,t=()=>{k.current=!0,clearTimeout(e),e=setTimeout(()=>{k.current=!1},500),_()},n=()=>{k.current&&t()};return null==vY||vY.addEventListener("resize",t),null==vY||vY.addEventListener("scroll",n),()=>{null==vY||vY.removeEventListener("resize",t),null==vY||vY.removeEventListener("scroll",n)}},[_]);let S=(0,lT.useCallback)(()=>{k.current||null==y||y()},[y,k]);return!function(e){let{triggerRef:t,isOpen:n,onClose:r}=e;(0,lT.useEffect)(()=>{if(!n||null===r)return;let e=e=>{let n=e.target;if(!t.current||n instanceof Node&&!n.contains(t.current)||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;let a=r||vG.get(t.current);a&&a()};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[n,r,t])}({triggerRef:i,isOpen:g,onClose:y&&S}),{overlayProps:{style:{position:"absolute",zIndex:1e5,...null==w?void 0:w.position,maxHeight:null!=(t=null==w?void 0:w.maxHeight)?t:"100vh"}},placement:null!=(n=null==w?void 0:w.placement)?n:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:null==w?void 0:w.arrowOffsetLeft,top:null==w?void 0:w.arrowOffsetTop}},updatePosition:_}}({...l,targetRef:n,overlayRef:r,isOpen:t.isOpen,onClose:o&&!c?t.close:null});return!function(e={}){let{isDisabled:t}=e;mC(()=>{if(!t){let e,t,n,r;return 1==++v0&&(u=ph()?(n=null,r=mS(v4(document,"touchstart",n=>{((e=gi(n.target,!0))!==document.documentElement||e!==document.body)&&e instanceof HTMLElement&&"auto"===window.getComputedStyle(e).overscrollBehavior&&(t=v1(e,"overscrollBehavior","contain"))},{passive:!1,capture:!0}),v4(document,"touchmove",t=>{e&&e!==document.documentElement&&e!==document.body?e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault():t.preventDefault()},{passive:!1,capture:!0}),v4(document,"touchend",()=>{t&&t()},{passive:!1,capture:!0}),v4(document,"focus",e=>{var t;let r=e.target;((t=r)instanceof HTMLInputElement&&!vQ.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable)&&((()=>{if(n)return;let e=window.pageXOffset,t=window.pageYOffset;n=mS(v4(window,"scroll",()=>{window.scrollTo(0,0)}),v1(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),v1(document.documentElement,"overflow","hidden"),v1(document.body,"marginTop",`-${t}px`),()=>{window.scrollTo(e,t)}),window.scrollTo(0,0)})(),r.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{r.style.transform="",vX&&(vX.height<window.innerHeight?requestAnimationFrame(()=>{v2(r)}):vX.addEventListener("resize",()=>v2(r),{once:!0}))}))},!0)),()=>{null==t||t(),null==n||n(),r()}):mS(v1(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),v1(document.documentElement,"overflow","hidden"))),()=>{0==--v0&&u()}}},[t])}({isDisabled:o||!t.isOpen}),mC(()=>{if(t.isOpen&&r.current){if(!o)return function(e,t=document.body){let n=new Set(e),r=new Set,a=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(t);let t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),i=t(e);if(i===NodeFilter.FILTER_ACCEPT&&o(e),i!==NodeFilter.FILTER_REJECT){let e=a.nextNode();for(;null!=e;)o(e),e=a.nextNode()}},o=e=>{var t;let n=null!=(t=vC.get(e))?t:0;("true"!==e.getAttribute("aria-hidden")||0!==n)&&(0===n&&e.setAttribute("aria-hidden","true"),r.add(e),vC.set(e,n+1))};vP.length&&vP[vP.length-1].disconnect(),a(t);let i=new MutationObserver(e=>{for(let t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some(e=>e.contains(t.target))){for(let e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&("true"===e.dataset.liveAnnouncer||"true"===e.dataset.reactAriaTopLayer)?n.add(e):e instanceof Element&&a(e)}});i.observe(t,{childList:!0,subtree:!0});let s={visibleNodes:n,hiddenNodes:r,observe(){i.observe(t,{childList:!0,subtree:!0})},disconnect(){i.disconnect()}};return vP.push(s),()=>{for(let e of(i.disconnect(),r)){let t=vC.get(e);null!=t&&(1===t?(e.removeAttribute("aria-hidden"),vC.delete(e)):vC.set(e,t-1))}s===vP[vP.length-1]?(vP.pop(),vP.length&&vP[vP.length-1].observe()):vP.splice(vP.indexOf(s),1)}}([null!=(n=null==a?void 0:a.current)?n:r.current]);var e,n,i=null!=(e=null==a?void 0:a.current)?e:r.current;let t=vP[vP.length-1];return t&&!t.visibleNodes.has(i)?(t.visibleNodes.add(i),()=>{t.visibleNodes.delete(i)}):void 0}},[o,t.isOpen,r,a]),{popoverProps:mW(d,p),arrowProps:f,underlayProps:m,placement:h}}({...r,offset:null!=(a=r.offset)?a:8,arrowSize:s,groupRef:m?d:c},e),y=r.popoverRef,v=function(e,t=!0){let[n,r]=(0,lT.useState)(!0),a=n&&t;return mC(()=>{if(a&&e.current&&"getAnimations"in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,a]),v5(e,a,(0,lT.useCallback)(()=>r(!1),[])),a}(y,!!g)||r.isEntering||!1,b=mK({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:g,isEntering:v,isExiting:t}}),w=!r.isNonModal||"SubmenuTrigger"===r.trigger,[E,x]=(0,lT.useState)(!1);mC(()=>{y.current&&x(w&&!y.current.querySelector("[role=dialog]"))},[y,w]),(0,lT.useEffect)(()=>{E&&y.current&&!y.current.contains(document.activeElement)&&fn(y.current)},[E,y]);let D={...p.style,...b.style},_=l$().createElement("div",{...mW(m6(r),p),...b,role:E?"dialog":void 0,tabIndex:E?-1:void 0,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],ref:y,slot:r.slot||void 0,style:D,dir:r.dir,"data-trigger":r.trigger,"data-placement":g,"data-entering":v||void 0,"data-exiting":t||void 0},!r.isNonModal&&l$().createElement(v6,{onDismiss:e.close}),l$().createElement(vS.Provider,{value:{...h,placement:g,ref:i}},b.children),l$().createElement(v6,{onDismiss:e.close}));return m?l$().createElement(vg,{...r,shouldContainFocus:E,isExiting:t,portalContainer:null!=(o=null!=n?n:null==d?void 0:d.current)?o:void 0},_):l$().createElement(vg,{...r,shouldContainFocus:E,isExiting:t,portalContainer:n},!r.isNonModal&&e.isOpen&&l$().createElement("div",{"data-testid":"underlay",...f,style:{position:"fixed",inset:0}}),l$().createElement("div",{ref:c,style:{display:"contents"}},l$().createElement(v7.Provider,{value:c},_)))}function bn(e){return(null==e?void 0:e.start)!=null&&null!=e.end}let br=(0,lT.createContext)(null),ba=(0,lT.createContext)(null),bo=(0,lT.createContext)(null),bi=(0,lT.createContext)(null),bs=(0,lT.forwardRef)(function(e,t){var n,r;[e,t]=mZ(e,t,br);let{validationBehavior:a}=mG(vD)||{},o=null!=(r=null!=(n=e.validationBehavior)?n:a)?r:"native",i=function(e){var t;let n=v9(e),[r,a]=g4(e.value,e.defaultValue||null,e.onChange),o=r||e.placeholderValue||null,[i,s]=ve(o,e.granularity),l=null!=r?r.toDate(null!=s?s:"UTC"):null,u="hour"===i||"minute"===i||"second"===i,c=null==(t=e.shouldCloseOnSelect)||t,[d,m]=(0,lT.useState)(null),[p,f]=(0,lT.useState)(null);if(r&&(d=r,"hour"in r&&(p=r)),o&&!(i in o))throw Error("Invalid granularity "+i+" for value "+o.toString());let h=(null==r?void 0:r.calendar.identifier)==="gregory"&&"BC"===r.era,g=(0,lT.useMemo)(()=>({granularity:i,timeZone:s,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:h}),[i,e.hourCycle,e.shouldForceLeadingZeros,s,e.hideTimeZone,h]),{minValue:y,maxValue:v,isDateUnavailable:b}=e,w=(0,lT.useMemo)(()=>y2(r,y,v,b,g),[r,y,v,b,g]),E=yq({...e,value:r,builtinValidation:w}),x=E.displayValidation.isInvalid,D=e.validationState||(x?"invalid":null),_=(e,t)=>{a("timeZone"in t?t.set(hf(e)):hh(e,t)),m(null),f(null),E.commitValidation()};return{...E,value:r,setValue:a,dateValue:d,timeValue:p,setDateValue:t=>{let r="function"==typeof c?c():c;u?p||r?_(t,p||y9(e.defaultValue||e.placeholderValue)):m(t):(a(t),E.commitValidation()),r&&n.setOpen(!1)},setTimeValue:e=>{d&&e?_(d,e):f(e)},granularity:i,hasTime:u,...n,setOpen(t){!t&&!r&&d&&u&&_(d,p||y9(e.defaultValue||e.placeholderValue)),n.setOpen(t)},validationState:D,isInvalid:x,formatValue:(e,t)=>l?new hz(e,y5(t,g)).format(l):"",getDateFormatter:(e,t)=>new hz(e,y5({},{...g,...t}))}}({...e,validationBehavior:o}),s=(0,lT.useRef)(null),[l,u]=mY(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,fieldProps:m,buttonProps:p,dialogProps:f,calendarProps:h,descriptionProps:g,errorMessageProps:y,...v}=function(e,t,n){var r;let a=mB(),o=mB(),i=mB(),s=hW((r=yf)&&r.__esModule?r.default:r,"@react-aria/datepicker"),{isInvalid:l,validationErrors:u,validationDetails:c}=t.displayValidation,{labelProps:d,fieldProps:m,descriptionProps:p,errorMessageProps:f}=yL({...e,labelElementType:"span",isInvalid:l,errorMessage:e.errorMessage||u}),h=yI(t,n),g=m["aria-labelledby"]||m.id,{locale:y}=fN(),v=t.formatValue(y,{month:"long"}),b=gn(v?s.format("selectedDateDescription",{date:v}):""),w=[b["aria-describedby"],m["aria-describedby"]].filter(Boolean).join(" ")||void 0,E=m6(e),x=(0,lT.useMemo)(()=>yT(n),[n]),D=(0,lT.useRef)(!1),{focusWithinProps:_}=fs({...e,isDisabled:t.isOpen,onBlurWithin:t=>{let n=document.getElementById(o);if(!(null==n?void 0:n.contains(t.relatedTarget))){var r,a;D.current=!1,null==(r=e.onBlur)||r.call(e,t),null==(a=e.onFocusChange)||a.call(e,!1)}},onFocusWithin:t=>{if(!D.current){var n,r;D.current=!0,null==(n=e.onFocus)||n.call(e,t),null==(r=e.onFocusChange)||r.call(e,!0)}}});return{groupProps:mW(E,h,m,b,_,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":g,"aria-describedby":w,onKeyDown(n){!t.isOpen&&e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){!t.isOpen&&e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...d,onClick:()=>{x.focusFirst()}},fieldProps:{...m,id:i,[yV]:"presentation","aria-describedby":w,value:t.value,onChange:t.setValue,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,granularity:e.granularity,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior,[yY]:t,autoFocus:e.autoFocus,name:e.name},descriptionProps:p,errorMessageProps:f,buttonProps:{...b,id:a,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${a} ${g}`,"aria-describedby":w,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:o,"aria-labelledby":`${a} ${g}`},calendarProps:{autoFocus:!0,value:t.dateValue,onChange:t.setDateValue,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,defaultFocusedValue:t.dateValue?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" ")},isInvalid:l,validationErrors:u,validationDetails:c}}({...mq(e),label:u,validationBehavior:o},i,s),[b,w]=(0,lT.useState)(null),E=(0,lT.useCallback)(()=>{s.current&&w(s.current.offsetWidth+"px")},[]);vZ({ref:s,onResize:E});let{focusProps:x,isFocused:D,isFocusVisible:_}=fl({within:!0}),k=mK({...e,values:{state:i,isFocusWithin:D,isFocusVisible:_,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen},defaultClassName:"react-aria-DatePicker"}),S=m6(e);return delete S.id,l$().createElement(mz,{values:[[bo,i],[yc,{...c,ref:s,isInvalid:i.isInvalid}],[vs,m],[fy,{...p,isPressed:i.isOpen}],[v_,{...d,ref:l,elementType:"span"}],[g8,h],[vv,i],[v8,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":b}}],[vy,f],[fw,{slots:{description:g,errorMessage:y}}],[vw,v]]},l$().createElement("div",{...x,...S,...k,ref:t,slot:e.slot||void 0,"data-focus-within":D||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":_||void 0,"data-disabled":e.isDisabled||void 0,"data-open":i.isOpen||void 0}))}),bl=(0,lT.forwardRef)(function(e,t){var n,r;[e,t]=mZ(e,t,ba);let{validationBehavior:a}=mG(vD)||{},o=null!=(r=null!=(n=e.validationBehavior)?n:a)?r:"native",i=function(e){var t,n,r;let a=v9(e),[o,i]=g4(e.value,e.defaultValue||null,e.onChange),[s,l]=(0,lT.useState)(()=>o||{start:null,end:null});null==o&&s.start&&s.end&&l(s={start:null,end:null});let u=o||s,c=e=>{l(e||{start:null,end:null}),bn(e)?i(e):i(null)},[d,m]=ve((null==u?void 0:u.start)||(null==u?void 0:u.end)||e.placeholderValue||null,e.granularity),p="hour"===d||"minute"===d||"second"===d,f=null==(r=e.shouldCloseOnSelect)||r,[h,g]=(0,lT.useState)(null),[y,v]=(0,lT.useState)(null);u&&bn(u)&&(h=u,"hour"in u.start&&(y=u));let b=(e,t)=>{c({start:"timeZone"in t.start?t.start.set(hf(e.start)):hh(e.start,t.start),end:"timeZone"in t.end?t.end.set(hf(e.end)):hh(e.end,t.end)}),g(null),v(null),P.commitValidation()},w=t=>{let n="function"==typeof f?f():f;p?bn(t)&&(null==y?void 0:y.start)&&(null==y?void 0:y.end)?b(t,{start:(null==y?void 0:y.start)||y9(e.placeholderValue),end:(null==y?void 0:y.end)||y9(e.placeholderValue)}):g(t):bn(t)?(c(t),P.commitValidation()):g(t),n&&a.setOpen(!1)},E=e=>{bn(h)&&bn(e)?b(h,e):v(e)},x=(null==u||null==(t=u.start)?void 0:t.calendar.identifier)==="gregory"&&"BC"===u.start.era||(null==u||null==(n=u.end)?void 0:n.calendar.identifier)==="gregory"&&"BC"===u.end.era,D=(0,lT.useMemo)(()=>({granularity:d,timeZone:m,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:x}),[d,e.hourCycle,e.shouldForceLeadingZeros,m,e.hideTimeZone,x]),{minValue:_,maxValue:k,isDateUnavailable:S}=e,C=(0,lT.useMemo)(()=>{var e,t;let n;return n=y0(y2(null!=(e=null==u?void 0:u.start)?e:null,_,k,S,D),y2(null!=(t=null==u?void 0:u.end)?t:null,_,k,S,D)),(null==u?void 0:u.end)!=null&&null!=u.start&&0>u.end.compare(u.start)&&(n=y0(n,{isInvalid:!0,validationErrors:[(hM.getGlobalDictionaryForPackage("@react-stately/datepicker")||y1).getStringForLocale("rangeReversed",y4())],validationDetails:{...yz,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})),n},[u,_,k,S,D]),P=yq({...e,value:o,name:(0,lT.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:C}),R=P.displayValidation.isInvalid,T=e.validationState||(R?"invalid":null);return{...P,value:u,setValue:c,dateRange:h,timeRange:y,granularity:d,hasTime:p,setDate(e,t){var n,r;"start"===e?w({start:t,end:null!=(n=null==h?void 0:h.end)?n:null}):w({start:null!=(r=null==h?void 0:h.start)?r:null,end:t})},setTime(e,t){var n,r;"start"===e?E({start:t,end:null!=(n=null==y?void 0:y.end)?n:null}):E({start:null!=(r=null==y?void 0:y.start)?r:null,end:t})},setDateTime(e,t){var n,r;"start"===e?c({start:t,end:null!=(n=null==u?void 0:u.end)?n:null}):c({start:null!=(r=null==u?void 0:u.start)?r:null,end:t})},setDateRange:w,setTimeRange:E,...a,setOpen(t){!t&&!((null==u?void 0:u.start)&&(null==u?void 0:u.end))&&bn(h)&&p&&b(h,{start:(null==y?void 0:y.start)||y9(e.placeholderValue),end:(null==y?void 0:y.end)||y9(e.placeholderValue)}),a.setOpen(t)},validationState:T,isInvalid:R,formatValue(t,n){let r;if(!u||!u.start||!u.end)return null;let a="timeZone"in u.start?u.start.timeZone:void 0,o=e.granularity||(u.start&&"minute"in u.start?"minute":"day"),i="timeZone"in u.end?u.end.timeZone:void 0,s=e.granularity||(u.end&&"minute"in u.end?"minute":"day"),l=y5(n,{granularity:o,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===u.start.calendar.identifier&&"BC"===u.start.era||"gregory"===u.end.calendar.identifier&&"BC"===u.end.era}),c=u.start.toDate(a||"UTC"),d=u.end.toDate(i||"UTC"),m=new hz(t,l);if(a===i&&o===s&&0!==u.start.compare(u.end)){try{let e=m.formatRangeToParts(c,d),t=-1;for(let n=0;n<e.length;n++){let r=e[n];if("shared"===r.source&&"literal"===r.type)t=n;else if("endRange"===r.source)break}let n="",r="";for(let a=0;a<e.length;a++)a<t?n+=e[a].value:a>t&&(r+=e[a].value);return{start:n,end:r}}catch{}r=m}else r=new hz(t,y5(n,{granularity:s,timeZone:i,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:m.format(c),end:r.format(d)}},getDateFormatter:(e,t)=>new hz(e,y5({},{...D,...t}))}}({...e,validationBehavior:o}),s=(0,lT.useRef)(null),[l,u]=mY(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,startFieldProps:m,endFieldProps:p,buttonProps:f,dialogProps:h,calendarProps:g,descriptionProps:y,errorMessageProps:v,...b}=function(e,t,n){var r,a,o,i,s,l;let u=hW((l=yf)&&l.__esModule?l.default:l,"@react-aria/datepicker"),{isInvalid:c,validationErrors:d,validationDetails:m}=t.displayValidation,{labelProps:p,fieldProps:f,descriptionProps:h,errorMessageProps:g}=yL({...e,labelElementType:"span",isInvalid:c,errorMessage:e.errorMessage||d}),y=f["aria-labelledby"]||f.id,{locale:v}=fN(),b=t.formatValue(v,{month:"long"}),w=gn(b?u.format("selectedRangeDescription",{startDate:b.start,endDate:b.end}):""),E={"aria-label":u.format("startDate"),"aria-labelledby":y},x={"aria-label":u.format("endDate"),"aria-labelledby":y},D=mB(),_=mB(),k=yI(t,n),S=[w["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,C=(0,lT.useMemo)(()=>yT(n,{accept:e=>e.id!==D}),[n,D]),P={[yU]:C,[yV]:"presentation","aria-describedby":S,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},R=m6(e),T=(0,lT.useRef)(!1),{focusWithinProps:$}=fs({...e,isDisabled:t.isOpen,onBlurWithin:t=>{let n=document.getElementById(_);if(!(null==n?void 0:n.contains(t.relatedTarget))){var r,a;T.current=!1,null==(r=e.onBlur)||r.call(e,t),null==(a=e.onFocusChange)||a.call(e,!1)}},onFocusWithin:t=>{if(!T.current){var n,r;T.current=!0,null==(n=e.onFocus)||n.call(e,t),null==(r=e.onFocusChange)||r.call(e,!0)}}}),O=(0,lT.useRef)(yG),N=(0,lT.useRef)(yG);return{groupProps:mW(R,k,f,w,$,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":S,onKeyDown(n){!t.isOpen&&e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){!t.isOpen&&e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...p,onClick:()=>{C.focusFirst()}},buttonProps:{...w,id:D,"aria-haspopup":"dialog","aria-label":u.format("calendar"),"aria-labelledby":`${D} ${y}`,"aria-describedby":S,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:_,"aria-labelledby":`${D} ${y}`},startFieldProps:{...E,...P,value:null!=(i=null==(r=t.value)?void 0:r.start)?i:null,onChange:e=>t.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,[yY]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){O.current=e,t.updateValidation(y0(e,N.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...x,...P,value:null!=(s=null==(a=t.value)?void 0:a.end)?s:null,onChange:e=>t.setDateTime("end",e),name:e.endName,[yY]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){N.current=e,t.updateValidation(y0(O.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:h,errorMessageProps:g,calendarProps:{autoFocus:!0,value:(null==(o=t.dateRange)?void 0:o.start)&&t.dateRange.end?t.dateRange:null,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" ")},isInvalid:c,validationErrors:d,validationDetails:m}}({...mq(e),label:u,validationBehavior:o},i,s),[w,E]=(0,lT.useState)(null),x=(0,lT.useCallback)(()=>{s.current&&E(s.current.offsetWidth+"px")},[]);vZ({ref:s,onResize:x});let{focusProps:D,isFocused:_,isFocusVisible:k}=fl({within:!0}),S=mK({...e,values:{state:i,isFocusWithin:_,isFocusVisible:k,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen},defaultClassName:"react-aria-DateRangePicker"}),C=m6(e);return delete C.id,l$().createElement(mz,{values:[[bi,i],[yc,{...c,ref:s,isInvalid:i.isInvalid}],[fy,{...f,isPressed:i.isOpen}],[v_,{...d,ref:l,elementType:"span"}],[g7,g],[vv,i],[v8,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":w}}],[vy,h],[vs,{slots:{start:m,end:p}}],[fw,{slots:{description:y,errorMessage:v}}],[vw,b]]},l$().createElement("div",{...D,...C,...S,ref:t,slot:e.slot||void 0,"data-focus-within":_||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":k||void 0,"data-disabled":e.isDisabled||void 0,"data-open":i.isOpen||void 0}))});function bu(e){return l$().createElement(fO,e)}function bc(e,t,n=!1){if(null==e)return n?e:void 0;if("string"==typeof e&&!e)return n?null:void 0;if(e instanceof f7||e instanceof hr||e instanceof ho)return t?hg(e,t):e;{let n=cc()(e).toDate(),r=new f7(n.getFullYear(),n.getMonth()+1,n.getDate());return t?hg(r,t):r}}function bd(e){if(e)return e.toDate(hP())}function bm(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function bp(e){let t=e??"",n=bm(t);if(!n)return t;try{return new Intl.DisplayNames([n],{type:"language"}).of(n)??t}catch{return t}}function bf(){let e=window.i18next.language,t=bm(e)??e;return"ht"===t&&(t="fr-HT"),t}if("u">typeof navigator){let e=navigator;X=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;X=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var bh=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch(e){return"en-US"}}(X||"en-US"),bg=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},by={};for(let e=1;e<100;e++)by[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var bv={arab:1632,arabext:1776,bali:6992,beng:2534,deva:2406,fullwide:65296,gujr:2790,khmr:6112,knda:3302,laoo:3792,limb:6470,mlym:3430,mong:6160,mymr:4160,orya:2918,tamldec:3046,telu:3174,thai:3664,tibt:3872},bb="[1234567890一二三四五六七八九〇\\d]",bw={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,〇:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},bE={},bx={"Eastern Daylight Time":-240,"Eastern Standard Time":-300,"Central Daylight Time":-300,"Central Standard Time":-360,"Mountain Daylight Time":-360,"Mountain Standard Time":-420,"Pacific Daylight Time":-420,"Pacific Standard Time":-480,"Coordinated Universal Time":0,ACDT:630,ACST:570,ACT:480,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,AMST:-180,AMT:-240,ART:-180,AST:180,AWDT:540,AWST:480,AZOST:-60,AZT:240,BDT:360,BIOT:360,BIT:-720,BOT:-240,BRST:-120,BRT:-180,BTT:360,CAT:120,CCT:390,CDT:-300,CEDT:120,CEST:120,CET:60,CHADT:825,CHAST:765,CHOT:480,ChST:600,CHUT:600,CIST:-480,CIT:480,CKT:-600,CLST:-180,CLT:-240,COST:-240,COT:-300,CST:-360,CT:480,CVT:-60,CXT:420,DAVT:420,DDUT:600,DFT:60,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEDT:180,EEST:180,EET:120,EGST:0,EGT:-60,EIT:540,EST:-300,FET:180,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GIT:-540,GMT:0,GST:-120,GYT:-240,HADT:-540,HAEC:120,HAST:-600,HKT:480,HMT:300,HOVT:420,HST:-600,IBST:0,ICT:420,IDT:180,IOT:180,IRDT:270,IRKT:480,IRST:210,IST:120,JST:540,KGT:360,KOST:660,KRAT:420,KST:540,LHST:630,LINT:840,MAGT:720,MART:-510,MAWT:300,MDT:-360,MET:60,MEST:120,MHT:720,MIST:660,MIT:-510,MMT:390,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:660,NPT:345,NST:-150,NT:-150,NUT:-660,NZDT:780,NZST:720,OMST:360,ORAT:300,PDT:-420,PET:-300,PETT:720,PGT:600,PHOT:780,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PYST:-180,PYT:-240,RET:240,ROTT:-180,SAKT:660,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SLST:330,SRET:660,SRT:-180,SST:480,SYOT:180,TAHT:-600,THA:420,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TOT:780,TVT:720,UCT:0,ULAT:480,USZ1:120,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-240,VLAT:600,VOLT:240,VOST:360,VUT:660,WAKT:720,WAST:120,WAT:60,WEDT:60,WEST:60,WET:0,WIT:420,WST:480,YAKT:540,YEKT:300},bD={zone:bx,year:by,meridiem:{am:0,pm:12,"a.m.":0,"p.m.":12},month:{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12},dayname:{sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},digit:{}},b_={MONTHNAME:"january|february|march|april|may|june|july|august|september|october|november|december|jan\\.?|feb\\.?|mar\\.?|apr\\.?|may\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|oct\\.?|nov\\.?|dec\\.?",DAYNAME:"sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun\\.?|mon\\.?|tue\\.?|wed\\.?|thu\\.?|fri\\.?|sat\\.?",ZONE:"\\(?(?:"+Object.keys(bx).join("|")+")\\)?",MERIDIEM:"am|pm|a.m.|p.m.",ORDINAL:"st|nd|rd|th|\\.",YEAR:"\\d{4}|\\d{2}",YEAR2:"\\d{2}",YEAR4:"\\d{4}",YEAR6:"-\\d{6}|\\+?\\d{5,6}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",OFFSET:"(?:GMT)?[\xb1−+-](?:[01]\\d[0-5]\\d|[01]\\d:[0-5]\\d|[01]?\\d)",H24:"[01]\\d|2[0-3]",H12:"0?[1-9]|1[012]",MIN:"[0-5]\\d",SEC:"[0-5]\\d|60",MS:"\\d{9}|\\d{6}|\\d{1,3}",GAP:"[\\s/.,-]{1,}"},bk={...b_,YEAR:"*{4}|*{2}",YEAR4:"*{4}",YEAR6:"-*{6}|\\+?*{5,6}",MONTH:"*{1,2}",MONTH2:"*{2}",DAY:"*{1,2}",DAY2:"*{2}",OFFSET:"(?:GMT)?[\xb1−+-](?:*{4}|*{2}:*{2}|*{1,2})",H24:"*{2}",H12:"*{1,2}",MIN:"*{2}",SEC:"*{2}",MS:"*{9}|*{6}|*{3}"},bS={},bC=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=bh){return bS[t.toLowerCase()]||(bS[t.toLowerCase()]=new e(t)),bS[t.toLowerCase()]}constructor(e=bh){this.locale=e,this.lookups={...bD},this.vars={...b_};const t=new Intl.NumberFormat(this.locale);this.numberingSystem=t.resolvedOptions().numberingSystem,this.dateOptions=new Intl.DateTimeFormat(this.locale).resolvedOptions(),this.baseName=new Intl.Locale(this.locale).baseName,this.build()}toInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;if("latn"===this.numberingSystem&&!this.baseName.startsWith("zh")){let t=parseInt(e,10);if(!isNaN(t))return t}let t="";for(let n=0;n<e.length;n++)t+=String(this.lookups.digit[e[n]]);return parseInt(t,10)}millisecondToInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;let t=e.slice(0,3);return 1===t.length?100*this.toInt(t):2===t.length?10*this.toInt(t):this.toInt(t)}monthNameToInt(e){if("string"!=typeof e)return;let t=e.toLocaleLowerCase(this.locale).replace(/\.$/,"");return this.lookups.month[t]||12}h12ToInt(e,t){if("string"!=typeof e)return;let n=this.lookups.meridiem[t?.toLowerCase()]||0,r=this.toInt(e);return r<12&&12===n&&(r+=12),12===r&&0===n&&(r=0),r}zoneToOffset(e){if("string"==typeof e)return e=e.replace(/[^a-z\s]/gi,""),this.lookups.zone[e]}offsetToMinutes(e){if("string"!=typeof e)return;let t=e.match(/^(?:GMT)?([±−+-])(..?):?(..)?$/);if(t){let[,e,n,r]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(n)+this.toInt(r||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=bw:this.buildNumbers(),!/^en/i.test(this.locale)&&(this.buildMonthNames(),this.buildDaynames(),/zh/i.test(this.locale)||this.buildMeridiems())}buildNumbers(){let{group:e,lookup:t}=function(e){if(bE[e])return bE[e];if("fullwide"===e||"hanidec"===e)return{group:bb,lookup:{...bw}};let t=bv[e];if(!t)return{group:"\\d",lookup:{...bw}};let n=String.fromCharCode(t),r=String.fromCharCode(t+9),a={};for(let e=0;e<10;e++)a[String.fromCharCode(t+e)]=e;return bE[e]={group:`[${n}-${r}]`,lookup:a},bE[e]}(this.numberingSystem);for(let n in this.lookups.digit=t,bk)bk.hasOwnProperty(n)&&(this.vars[n]=bk[n].replace(/\*/g,e))}buildMonthNames(){let e={},t={};if(/^fi/i.test(this.locale))"tammi|helmi|maalis|huhti|touko|kes\xe4|hein\xe4|elo|syys|loka|marras|joulu".split("|").forEach((n,r)=>{["","k","kuu","kuuta"].forEach((a,o)=>{e[n+a+(o<2?"\\.?":"")]=!0,t[n+a]=r+1})});else{let n=[],r=e=>"month"===e.type;for(let e=0;e<12;e++)n.push(new Date(2017,e,1));for(let a of["full","long","medium"]){let o=Intl.DateTimeFormat(this.locale,{dateStyle:a});for(let i=0;i<12;i++){let s=o.formatToParts(n[i]).find(r).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===a?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=i+1)}}let a=Intl.DateTimeFormat(this.locale,{month:"short"});for(let o=0;o<12;o++){let i=a.formatToParts(n[o]).find(r).value.toLocaleLowerCase(this.locale);i=i.replace(/\.$/,""),e[`${i}\\.?`]=!0,t[i]=o+1}}this.vars.MONTHNAME=Object.keys(e).join("|"),this.lookups.month=t}buildDaynames(){let e=[],t=e=>"weekday"===e.type;for(let t=0;t<7;t++)e.push(new Date(2017,0,t+1));let n=[],r={};for(let a of["long","short"]){let o=Intl.DateTimeFormat(this.locale,{weekday:a});for(let i=0;i<7;i++){let s=o.formatToParts(e[i]).find(t).value.toLocaleLowerCase(this.locale);"short"===a?(s=s.replace(/\.$/,""),n.push(`${s}\\.?`)):n.push(s),r[s]=i}}this.vars.DAYNAME=n.join("|"),this.lookups.dayname=r}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,n=[],r={},a=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let o=0;o<2;o++){let i=a.formatToParts(e[o]).find(t);if(!i)return;let s=i.value.toLocaleLowerCase(this.locale);n.push(s),r[s]=12*o}this.vars.MERIDIEM=n.join("|"),this.lookups.meridiem=r}compile(e){return RegExp(e.replace(/_([A-Z0-9]+)_/g,(e,t)=>{if(!this.vars[t])throw Error(`Template string contains invalid variable _${t}_`);return this.vars[t]}),"i")}},bP=["ee-TG","en-AS","en-CA","en-FM","en-GH","en-GU","en-KE","en-KY","en-MH","en-MP","en-US","en-VI","en-WS","jp-JP","sm-AS","sm-SM"],bR={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},bT=()=>new Date;function b$(e){return function(t){let n={};for(let r=0,a=e.length;r<a;r++){let a=e[r];a&&(n[a]=t[r])}return n}}var bO=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:n,formatter:r}){this.doneChecker=e,this.fallback=t,this.patterns=n,this.formatter=r}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),n={},r=!1;for(let e of this.patterns){let a=t.match(e.regex);if(!a)continue;r=!0;let o=e.handler(a);if(o){for(let[e,t]of Object.entries(o))e in n||void 0===t||(n[e]=t);if(t=(t=t.slice(0,a.index)+t.slice(a.index+a[0].length+1)).trim(),this.doneChecker(n,t))break}}return r?this.formatter(n):this.fallback(e)}},bN=["year","month","day","hour","minute","second","millisecond","offset"],bA={};function bI(e,t){return""===t||/^\s+$/.test(t)||"year"in e&&("month"in e||"monthname"in e)&&"day"in e&&"hour"in e&&"minute"in e&&"second"in e&&"millisecond"in e&&("zone"in e||"offset"in e)}var bj=[[/([^\d.]+)(\d{1,2})\.(\d{2})\.(\d{2})(\D|$)/,"$1$2:$3:$4$5"],[/([^\d.]+)(\d{1,2})\.(\d{2})(\D|$)/,"$1$2:$3$4"]],bM={ar:[[/ /g," "]],bn:[[/,/g,""]],zh:[[/早上\s*([\d:]+)/,"$1am"],[/凌晨\s*([\d:]+)/,"$1am"],[/上午\s*([\d:]+)/,"$1am"],[/下午\s*([\d:]+)/,"$1pm"],[/晚上\s*([\d:]+)/,"$1pm"]],he:[[/ב/gi,""]],de:[[/ um /g," "]],pt:[[/\sde /gi," "]],es:[[/\sde /gi," "]],da:[[/\sden /gi," "],...bj],ru:[[/ г\./g,""]],th:[[/\s*นาฬิกา\s*/i,":"],[/\s*นาที\s*/i,":"],[/\s*วินาที\s*/i," "]],ko:[[/\s*시\s*/,":"],[/\s*분\s*/,":"],[/\s*초\s*/,""],[/(오전|오후)\s*([\d:]+)/,"$2$1"],[/(\d{4})\. (\d{1,2})\. (\d{1,2})\./,"$1-$2-$3"]],fi:bj,id:bj,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function bL(e,t=bh){let n=function(e){if(!bA[e]){var t,n;let r,a,o=bC.factory(e);bA[e]=new bO({doneChecker:bI,fallback:(t=e,function(e){let n=String(e).slice(0,50);return""===n&&(n="(empty string)"),{invalid:`Unable to parse "${n}" with locale "${t}"`}}),patterns:(r=[{name:"timestampWithOffset",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:b$(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:b$(["","year","month","day","hour","minute","second","millisecond","zone"])},{name:"timestampWithOffsetAndZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? (_OFFSET_|Z)\\s*(_ZONE_)$"),handler:b$(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:o.compile(`^(${bb}{2,4})\\s*\u5E74\\s*(${bb}{1,2})\\s*\u6708\\s*(${bb}{1,2})\\s*\u65E5$`),handler:b$(["","year","month","day"])},{name:"korean",regex:o.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:b$(["","year","month","day"])},{name:"twitter",regex:/^(?:sun|mon|tue|wed|thu|fri|sat) (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) (\d{2}) (\d{2}):(\d{2}):(\d{2}) ([+-]\d{4}) (\d{4})$/i,handler:b$(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=bT(),n=e[0].toLowerCase(),r={now:0,today:0,tomorrow:864e5,yesterday:-864e5}[n];0!==r&&t.setTime(t.getTime()+r);let a={year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()};return"now"===n?{...a,hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()}:a}},{name:"ago",regex:/^(\+|-|in|) ?([\d.]+) ?(years?|months?|weeks?|days?|hours?|minutes?|seconds?|milliseconds?|ms|s|m|h|w|d|M|y)( ago)?$/i,handler:function([,e,t,n,r]){t=parseFloat(t),"week"===(n=n.length<=2?bR[n]:(n=n.replace(/s$/,"")).toLowerCase())&&(n="day",t*=7),("-"===e||r)&&(t*=-1);let a=bT();return"millisecond"===n?a.setUTCMilliseconds(a.getUTCMilliseconds()+t):"second"===n?a.setUTCSeconds(a.getUTCSeconds()+t):"minute"===n?a.setUTCMinutes(a.getUTCMinutes()+t):"hour"===n?a.setUTCHours(a.getUTCHours()+t):"day"===n?a.setUTCDate(a.getUTCDate()+t):"month"===n?a.setUTCMonth(a.getUTCMonth()+t):"year"===n&&a.setUTCFullYear(a.getUTCFullYear()+t),{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate(),hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds()}}},{name:"atSeconds",regex:/^@(\d+)$/,handler:function(e){let t=new Date(1e3*parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}},{name:"microsoftJson",regex:/^\/Date\((\d+)([+-]\d{4})?\)\/$/,handler:function(e){let t=new Date(parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds(),offset:e[2]}}},{name:"full24",regex:o.compile("(?:^|[\\sT])(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?(Z)?$"),handler:b$(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:b$(["","hour","minute","second","millisecond","zone"])},{name:"hms12WithOffset",regex:o.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)\\s*(_OFFSET_)"),handler:b$(["","hour","minute","second","meridiem","offset"])},{name:"hms12",regex:o.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:b$(["","hour","minute","second","meridiem"])},{name:"hms24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:b$(["","hour","minute","second","millisecond"])},{name:"hm12",regex:o.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:b$(["","hour","minute","meridiem"])},{name:"hm24",regex:o.compile("(_H24_):(_MIN_)"),handler:b$(["","hour","minute"])},{name:"h12",regex:o.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:b$(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:b$(["","year","month","day"])},{name:"yearMonthnameDay",regex:o.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:b$(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:o.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:b$(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:o.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:b$(["","monthname","day","","year"])},{name:"dayMonthname",regex:o.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:b$(["","day","","monthname"])},{name:"monthnameDay",regex:o.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:b$(["","monthname","day"])},{name:"hmsNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:b$(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:b$(["","hour","minute"])},{name:"ymd",regex:o.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:b$(["","year","","month","day"])},{name:"mdy",regex:o.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:b$(["","month","","day","year"])},{name:"dmy",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:b$(["","day","month","year"])},{name:"yearLoose",regex:o.compile("_YEAR4_"),handler:b$(["year"])},{name:"dayMonthnameLoose",regex:o.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:b$(["","day","monthname"])},{name:"monthnameDayLoose",regex:o.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:b$(["","monthname","day"])},{name:"monthname",regex:o.compile("_MONTHNAME_"),handler:b$(["monthname"])},{name:"year4",regex:o.compile("_YEAR4_"),handler:b$(["year"])},{name:"md",regex:o.compile("(_MONTH_)[/-](_DAY_)"),handler:b$(["","month","day"])},{name:"dm",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:b$(["","day","month"])},{name:"day",regex:o.compile("_DAY_"),handler:b$(["day"])},{name:"year2",regex:o.compile("_YEAR2_"),handler:b$(["year"])},{name:"onlyZone",regex:o.compile("_ZONE_"),handler:b$(["zone"])},{name:"onlyOffset",regex:o.compile("_OFFSET_"),handler:b$(["offset"])}],a=o.baseName.slice(0,5),bP.includes(a)?r:r.filter(e=>!["mdy","md"].includes(e.name))),formatter:(n=o,function(e){let t={};for(let[r,a]of Object.entries(e))if("monthname"===r){if(a){let e=n.monthNameToInt(a);void 0!==e&&(t.month=e)}}else if("hour"===r&&e.meridiem){let r=n.h12ToInt(a,e.meridiem);void 0!==r&&(t.hour=r)}else if("zone"===r){if(a){let e=n.zoneToOffset(a);void 0!==e&&(t.offset=e)}}else if("offset"===r){let e=n.offsetToMinutes(a);void 0!==e&&(t.offset=e)}else if("millisecond"===r){let e=n.millisecondToInt(a);"number"==typeof e&&(t.millisecond=e)}else if(bN.includes(r)){let e=n.toInt(a);"number"==typeof e&&(t[r]=e)}return t.year<100&&(t.year=by[t.year]),t.year&&"buddhist"===n.dateOptions.calendar&&(t.year-=543),t})})}return bA[e]}(t),r=function(e,t){let n=bM[t.slice(0,2).toLowerCase()];if(!n)return e;for(let[t,r]of n)e=e.replace(t,r);return e}(e,t);return n.attempt(r)}function bF(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new bg(e.year,e.month-1,e.day,e.hour||0,e.minute||0,e.second||0,e.millisecond||0);return"number"==typeof e.offset?new bg(t.valueOf()-60*e.offset*1e3):t}function bB(e,t=bh){let n=bL(e,t),r=n.invalid?new bg(NaN):bF(n);return r.isValid()||(r.invalid=`Unable to parse date "${e}"`),r}function bV(e,t=bh){return e instanceof Date?new bg(e.valueOf()):"number"==typeof e?new bg(e):bB(e,t)}Date.fromString=bg.fromString=bB,Date.fromAny=bg.fromAny=bV,"u">typeof window&&(window.anyDateParser={fromString:bB,fromAny:bV,fromObject:bF,attempt:bL});var bU=n(5238),bW=n(3826);let bH=function(e){return null==e};function bz(e,t){var n=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return n.get?n.get.call(e):n.value}cc().extend(cd),cc().extend(bW),cc().extend(bU);let bK="YYYY-MM-DDTHH:mm:ss.SSSZZ";function bG(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&cc()(e,bK).isValid()}function bZ(e){return cc()(e).isToday()}function bY(e){return bG(e)?cc()(e,bK).toDate():null}function bq(e,t=!1){let n=cc()(e);return t&&(n=n.utc()),n.format(bK)}function bJ(e){return cc()(e).toDate()}var bX=new WeakMap;let bQ=new class{register(e,t){bz(this,bX).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(bz(this,bX).has(t))return bz(this,bX).get(t)}if(e.language&&bz(this,bX).has(e.language))return bz(this,bX).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return bz(this,bX).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}(this,bX,{writable:!0,value:new Map})}};function b0(e,t){bQ.register(e,t)}function b1(e){let t=e??bf();return bQ.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let b4={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function b2(e,t={}){let n=bL(e,bf());if(n.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!bH(n.day)&&bH(n.month)&&(n=Object.assign({},tj(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},tj(n,"day"),{date:n.day}));let r=cc()().set(n).toDate();return bH(n.year)&&(t.year=!1),bH(n.month)&&(t.month=!1),bH(n.date)&&(t.day=!1),b3(r,t)}function b3(e,t){let n,r=t?.locale??bf(),a=new Intl.Locale(r),{calendar:o,mode:i,time:s,day:l,month:u,year:c,noToday:d,numberingSystem:m}={...b4,...{noToday:"am"===a.language},...t},p={calendar:o??b1(a),year:c?"numeric":void 0,month:u?"short":void 0,day:l?"2-digit":void 0,numberingSystem:m},f=cc()(e).isToday();if(f&&!d)n=(n=new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(r)+n.slice(1);else{"en"===a.language&&(r="en-GB");let t=new Intl.DateTimeFormat(r,p).formatToParts(e);("en"===a.language||"am"===a.language)&&"standard"==i&&c&&l&&(t=t.map(b6("-"))),"wide"==i&&(t=t.map(b6(" — "))),"ethiopic"===p.calendar&&(t=t.filter((e,t,n)=>"era"!==e.type&&("literal"!==e.type||!(t<n.length-1)||"era"!==n[t+1].type))),n=t.map(e=>e.value).join("")}return(!0===s||f&&"for today"===s)&&(n+=`, ${b5(e)}`),n}let b6=e=>(t,n,r)=>"literal"!==t.type||" "!==t.value||n<r.length-1&&"era"===r[n+1].type?t:{type:"literal",value:e};function b5(e){return e.toLocaleTimeString(bf(),{hour:"2-digit",minute:"2-digit"})}function b9(e,t){return b3(e,{...t,time:!0})}function b8(e,t){let n=b1("string"==typeof t?new Intl.Locale(t):t);return n?hg(e,gZ(n)):e}function b7(e,t){return new Intl.DurationFormat(bf(),t).format(e)}function we(e,t){if(null==e)return null;if("string"==typeof e){let n=bL(e,bf());return n.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(n.day&&!n.month&&(n={...tj(n,"day"),...{month:n.day}}),n.month&&(n.month-=1),n.day&&(n={...tj(n,"day"),...{date:n.day}}),cc()(t).set(n))}return cc()(e)}let wt=["years","months","days","hours","minutes","seconds"],wn={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},wr={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function wa(e,t=cc()(),n){let r,a=cc()(t),o=we(e,a);if(null==o)return null;if("string"==typeof n){let e=wn[n]??n;return{[e]:a.diff(o,e)}}let{thresholds:i,largestUnit:s,smallestUnit:l}=n??{};if(void 0!==s||void 0!==l){let e,t=l?wn[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,n){let r=wt.indexOf(n);for(let a=0;a<wt.length;a++){let o=wt[a];if(t.diff(e,o)>0)return a<=r?o:n}return n}(o,a,t??"seconds"):wn[s]??s,function(e,t,n,r){let a=wt.indexOf(n),o=wt.indexOf(r),i=wt.slice(a,o+1),s={},l=e;for(let e of i){let n=t.diff(l,e);s[e]=n,l=l.add(n,e)}return s}(o,a,e,t??e)}let u=(r=function(e){let t={...wr};if(e)for(let[n,r]of Object.entries(e))void 0!==r&&(t[wn[n]??n]=r);return t}(i),a.diff(o,"seconds")<r.seconds?"seconds":a.diff(o,"minutes")<r.minutes?"minutes":a.diff(o,"hours")<r.hours?"hours":a.diff(o,"days")<r.days?"days":a.diff(o,"months")<r.months?"months":"years");return{[u]:a.diff(o,u)}}let wo={style:"short",localeMatcher:"lookup"};function wi(e,t=cc()(),n){let r=wa(e,t,n);return null==r?null:b7(r,"object"==typeof n&&n.formatOptions?{...wo,...n.formatOptions}:wo)}let ws=(0,lT.createContext)(null);function wl(){let e=uR({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,lT.useMemo)(()=>{let t=bf();return e[t]&&(t=e[t]),t},[window.i18next.language]),n=(0,lT.useMemo)(()=>{let e=b1(t);return void 0!==e?gZ(e):void 0},[t]),r=(0,lT.useMemo)(()=>new Intl.Locale(t,{calendar:n?.identifier}),[t,n]),a=(0,lT.useMemo)(()=>n?hg(h_(hP()),n):h_(hP()),[n]);return{calendar:n,intlLocale:r,today_:a}}let wu=new f7(1793,1,1);var wc={};function wd(){return"u">typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}wc={"ar-AE":{decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:"حقل رقمي"},"bg-BG":{decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:"Номер на полето"},"cs-CZ":{decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"da-DK":{decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:"Talfelt"},"de-DE":{decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:"Nummernfeld"},"el-GR":{decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"},"en-US":{decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"},"es-ES":{decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"et-EE":{decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri v\xe4li"},"fi-FI":{decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:"Numerokentt\xe4"},"fr-FR":{decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"},"he-IL":{decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:"שדה מספר"},"hr-HR":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"hu-HU":{decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:"Sz\xe1mmező"},"it-IT":{decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"},"ja-JP":{decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:"数値フィールド"},"ko-KR":{decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:"번호 필드"},"lt-LT":{decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"},"lv-LV":{decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:"Skaitļu lauks"},"nb-NO":{decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:"Tallfelt"},"nl-NL":{decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"},"pl-PL":{decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:"Pole numeru"},"pt-BR":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"pt-PT":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo num\xe9rico"},"ro-RO":{decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:"C\xe2mp numeric"},"ru-RU":{decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:"Числовое поле"},"sk-SK":{decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"sl-SI":{decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:"Številčno polje"},"sr-SP":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"sv-SE":{decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:"Nummerf\xe4lt"},"tr-TR":{decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:"Sayı alanı"},"uk-UA":{decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:"Поле номера"},"zh-CN":{decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:"数字字段"},"zh-TW":{decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:"數字欄位"}};var wm=n(137);function wp(e={}){let{locale:t}=fN();return(0,lT.useMemo)(()=>new(0,wm.K)(t,e),[t,e])}var wf={};function wh(e){var t;let n=(0,lT.useRef)(void 0),{value:r,textValue:a,minValue:o,maxValue:i,isDisabled:s,isReadOnly:l,isRequired:u,onIncrement:c,onIncrementPage:d,onDecrement:m,onDecrementPage:p,onDecrementToMin:f,onIncrementToMax:h}=e,g=hW((t=wf)&&t.__esModule?t.default:t,"@react-aria/spinbutton");(0,lT.useEffect)(()=>()=>clearTimeout(n.current),[]);let y=(0,lT.useRef)(!1),v=()=>{y.current=!0},b=()=>{y.current=!1},w=""===a?g.format("Empty"):(a||`${r}`).replace("-","−");(0,lT.useEffect)(()=>{y.current&&(mX&&mX.clear("assertive"),mQ(w,"assertive"))},[w]);let E=mP(e=>{clearTimeout(n.current),null==c||c(),n.current=window.setTimeout(()=>{(void 0===i||isNaN(i)||void 0===r||isNaN(r)||r<i)&&E(60)},e)}),x=mP(e=>{clearTimeout(n.current),null==m||m(),n.current=window.setTimeout(()=>{(void 0===o||isNaN(o)||void 0===r||isNaN(r)||r>o)&&x(60)},e)}),D=e=>{e.preventDefault()},{addGlobalListener:_,removeAllGlobalListeners:k}=pN();return{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===r||isNaN(r)?void 0:r,"aria-valuetext":w,"aria-valuemin":o,"aria-valuemax":i,"aria-disabled":s||void 0,"aria-readonly":l||void 0,"aria-required":u||void 0,onKeyDown:e=>{if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!l)switch(e.key){case"PageUp":if(d){e.preventDefault(),null==d||d();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),null==c||c());break;case"PageDown":if(p){e.preventDefault(),null==p||p();break}case"ArrowDown":case"Down":m&&(e.preventDefault(),null==m||m());break;case"Home":f&&(e.preventDefault(),null==f||f());break;case"End":h&&(e.preventDefault(),null==h||h())}},onFocus:v,onBlur:b},incrementButtonProps:{onPressStart:()=>{E(400),_(window,"contextmenu",D)},onPressEnd:()=>{clearTimeout(n.current),k()},onFocus:v,onBlur:b},decrementButtonProps:{onPressStart:()=>{x(400),_(window,"contextmenu",D)},onPressEnd:()=>{clearTimeout(n.current),k()},onFocus:v,onBlur:b}}}wf={"ar-AE":{Empty:"فارغ"},"bg-BG":{Empty:"Изпразни"},"cs-CZ":{Empty:"Pr\xe1zdn\xe9"},"da-DK":{Empty:"Tom"},"de-DE":{Empty:"Leer"},"el-GR":{Empty:"Άδειο"},"en-US":{Empty:"Empty"},"es-ES":{Empty:"Vac\xedo"},"et-EE":{Empty:"T\xfchjenda"},"fi-FI":{Empty:"Tyhj\xe4"},"fr-FR":{Empty:"Vide"},"he-IL":{Empty:"ריק"},"hr-HR":{Empty:"Prazno"},"hu-HU":{Empty:"\xdcres"},"it-IT":{Empty:"Vuoto"},"ja-JP":{Empty:"空"},"ko-KR":{Empty:"비어 있음"},"lt-LT":{Empty:"Tuščias"},"lv-LV":{Empty:"Tukšs"},"nb-NO":{Empty:"Tom"},"nl-NL":{Empty:"Leeg"},"pl-PL":{Empty:"Pusty"},"pt-BR":{Empty:"Vazio"},"pt-PT":{Empty:"Vazio"},"ro-RO":{Empty:"Gol"},"ru-RU":{Empty:"Не заполнено"},"sk-SK":{Empty:"Pr\xe1zdne"},"sl-SI":{Empty:"Prazen"},"sr-SP":{Empty:"Prazno"},"sv-SE":{Empty:"Tomt"},"tr-TR":{Empty:"Boş"},"uk-UA":{Empty:"Пусто"},"zh-CN":{Empty:"空"},"zh-TW":{Empty:"空白"}};var wg=n(7120);function wy(e,t,n){let r="+"===e?t+n:t-n;if(t%1!=0||n%1!=0){let a=t.toString().split("."),o=n.toString().split("."),i=Math.pow(10,Math.max(a[1]&&a[1].length||0,o[1]&&o[1].length||0));t=Math.round(t*i),n=Math.round(n*i),r=("+"===e?t+n:t-n)/i}return r}let wv=(0,lT.createContext)(null),wb=(0,lT.createContext)(null),ww=(0,lT.forwardRef)(function(e,t){var n,r;[e,t]=mZ(e,t,wv);let{validationBehavior:a}=mG(vD)||{},o=null!=(r=null!=(n=e.validationBehavior)?n:a)?r:"native",{locale:i}=fN(),s=function(e){let{minValue:t,maxValue:n,step:r,formatOptions:a,value:o,defaultValue:i=NaN,onChange:s,locale:l,isDisabled:u,isReadOnly:c}=e;null===o&&(o=NaN),void 0===o||isNaN(o)||(o=void 0===r||isNaN(r)?vR(o,t,n):v$(o,t,n,r)),isNaN(i)||(i=void 0===r||isNaN(r)?vR(i,t,n):v$(i,t,n,r));let[d,m]=g4(o,isNaN(i)?NaN:i,s),[p,f]=(0,lT.useState)(()=>isNaN(d)?"":new(0,wm.K)(l,a).format(d)),h=(0,lT.useMemo)(()=>new(0,wg.d)(l,a),[l,a]),g=(0,lT.useMemo)(()=>h.getNumberingSystem(p),[h,p]),y=(0,lT.useMemo)(()=>new(0,wm.K)(l,{...a,numberingSystem:g}),[l,a,g]),v=(0,lT.useMemo)(()=>y.resolvedOptions(),[y]),b=(0,lT.useCallback)(e=>isNaN(e)||null===e?"":y.format(e),[y]),w=yq({...e,value:d}),E=void 0===r||isNaN(r)?1:r;"percent"===v.style&&(void 0===r||isNaN(r))&&(E=.01);let[x,D]=(0,lT.useState)(d),[_,k]=(0,lT.useState)(l),[S,C]=(0,lT.useState)(a);Object.is(d,x)&&l===_&&a===S||(f(b(d)),D(d),k(l),C(a));let P=(0,lT.useMemo)(()=>h.parse(p),[h,p]),R=(e,r=0)=>{if(isNaN(P))return v$(isNaN(r)?0:r,t,n,E);{let r=v$(P,t,n,E);return"+"===e&&r>P||"-"===e&&r<P?r:v$(wy(e,P,E),t,n,E)}},T=(0,lT.useMemo)(()=>!u&&!c&&(isNaN(P)||void 0===n||isNaN(n)||v$(P,t,n,E)>P||wy("+",P,E)<=n),[u,c,t,n,E,P]),$=(0,lT.useMemo)(()=>!u&&!c&&(isNaN(P)||void 0===t||isNaN(t)||v$(P,t,n,E)<P||wy("-",P,E)>=t),[u,c,t,n,E,P]);return{...w,validate:e=>h.isValidPartialNumber(e,t,n),increment:()=>{let e=R("+",t);e===d&&f(b(e)),m(e),w.commitValidation()},incrementToMax:()=>{null!=n&&(m(v$(n,t,n,E)),w.commitValidation())},decrement:()=>{let e=R("-",n);e===d&&f(b(e)),m(e),w.commitValidation()},decrementToMin:()=>{null!=t&&(m(t),w.commitValidation())},canIncrement:T,canDecrement:$,minValue:t,maxValue:n,numberValue:P,setNumberValue:m,setInputValue:f,inputValue:p,commit:()=>{let e;if(!p.length){m(NaN),f(void 0===o?"":b(d));return}isNaN(P)?f(b(d)):(e=void 0===r||isNaN(r)?vR(P,t,n):v$(P,t,n,r),m(e=h.parse(b(e))),f(b(void 0===o?e:d)))}}}({...e,locale:i,validationBehavior:o}),l=(0,lT.useRef)(null),[u,c]=mY(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:m,inputProps:p,incrementButtonProps:f,decrementButtonProps:h,descriptionProps:g,errorMessageProps:y,...v}=function(e,t,n){var r,a;let o,{id:i,decrementAriaLabel:s,incrementAriaLabel:l,isDisabled:u,isReadOnly:c,isRequired:d,minValue:m,maxValue:p,autoFocus:f,label:h,formatOptions:g,onBlur:y=()=>{},onFocus:v,onFocusChange:b,onKeyDown:w,onKeyUp:E,description:x,errorMessage:D,isWheelDisabled:_,...k}=e,{increment:S,incrementToMax:C,decrement:P,decrementToMin:R,numberValue:T,inputValue:$,commit:O,commitValidation:N}=t,A=hW((a=wc)&&a.__esModule?a.default:a,"@react-aria/numberfield"),I=mB(i),{focusProps:j}=fr({onBlur(){O()}}),M=wp(g),L=(0,lT.useMemo)(()=>M.resolvedOptions(),[M]),F=wp({...g,currencySign:void 0}),B=(0,lT.useMemo)(()=>isNaN(T)?"":F.format(T),[F,T]),{spinButtonProps:V,incrementButtonProps:U,decrementButtonProps:W}=wh({isDisabled:u,isReadOnly:c,isRequired:d,maxValue:p,minValue:m,onIncrement:S,onIncrementToMax:C,onDecrement:P,onDecrementToMin:R,value:T,textValue:B}),[H,z]=(0,lT.useState)(!1),{focusWithinProps:K}=fs({isDisabled:u,onFocusWithinChange:z});!function(e,t){let{onScroll:n,isDisabled:r}=e,a=(0,lT.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),n&&n({deltaX:e.deltaX,deltaY:e.deltaY}))},[n]);h7(t,"wheel",r?void 0:a)}({onScroll:(0,lT.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?S():e.deltaY<0&&P())},[P,S]),isDisabled:_||u||c||!H},n);let G=(null!=(r=L.maximumFractionDigits)?r:0)>0,Z=void 0===t.minValue||isNaN(t.minValue)||t.minValue<0,Y="numeric";pp()?Z?Y="text":G&&(Y="decimal"):pv()&&(Z?Y="numeric":G&&(Y="decimal"));let q=m6(e),J=(0,lT.useCallback)(e=>{"Enter"===e.key?(O(),N()):e.continuePropagation()},[O,N]),{isInvalid:X,validationErrors:Q,validationDetails:ee}=t.displayValidation,{labelProps:et,inputProps:en,descriptionProps:er,errorMessageProps:ea}=function(e,t,n){let r=mP(e=>{let r=n.current;if(!r)return;let a=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":a=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentForward":a=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentBackward":a=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":a=r.value.slice(r.selectionStart);break;default:null!=e.data&&(a=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}null!=a&&t.validate(a)||e.preventDefault()});(0,lT.useEffect)(()=>{if(!wd()||!n.current)return;let e=n.current;return e.addEventListener("beforeinput",r,!1),()=>{e.removeEventListener("beforeinput",r,!1)}},[n,r]);let a=wd()?null:e=>{let n=e.target.value.slice(0,e.target.selectionStart)+e.data+e.target.value.slice(e.target.selectionEnd);t.validate(n)||e.preventDefault()},{labelProps:o,inputProps:i,descriptionProps:s,errorMessageProps:l,...u}=function(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:a=!1,isReadOnly:o=!1,type:i="text",validationBehavior:s="aria"}=e,[l,u]=g4(e.value,e.defaultValue||"",e.onChange),{focusableProps:c}=fi(e,t),d=yq({...e,value:l}),{isInvalid:m,validationErrors:p,validationDetails:f}=d.displayValidation,{labelProps:h,fieldProps:g,descriptionProps:y,errorMessageProps:v}=yL({...e,isInvalid:m,errorMessage:e.errorMessage||p}),b=m6(e,{labelable:!0}),w={type:i,pattern:e.pattern};return yM(t,l,u),yF(e,d,t),(0,lT.useEffect)(()=>{if(t.current instanceof pn(t.current).HTMLTextAreaElement){let e=t.current;Object.defineProperty(e,"defaultValue",{get:()=>e.value,set:()=>{},configurable:!0})}},[t]),{labelProps:h,inputProps:mW(b,"input"===n?w:void 0,{disabled:r,readOnly:o,required:a&&"native"===s,"aria-required":a&&"aria"===s||void 0,"aria-invalid":m||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:l,onChange:e=>u(e.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(l$().version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...c,...g}),descriptionProps:y,errorMessageProps:v,isInvalid:m,validationErrors:p,validationDetails:f}}(e,n),c=(0,lT.useRef)(null);return{inputProps:mW(i,{onBeforeInput:a,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:r}=n.current;c.current={value:e,selectionStart:t,selectionEnd:r}},onCompositionEnd(){if(n.current&&!t.validate(n.current.value)){let{value:e,selectionStart:r,selectionEnd:a}=c.current;n.current.value=e,n.current.setSelectionRange(r,a),t.setInputValue(e)}}}),labelProps:o,descriptionProps:s,errorMessageProps:l,...u}}({...k,...q,name:void 0,label:h,autoFocus:f,isDisabled:u,isReadOnly:c,isRequired:d,validate:void 0,[yY]:t,value:$,defaultValue:void 0,autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:I,type:"text",inputMode:Y,onChange:e=>{t.validate(e)&&t.setInputValue(e)},onBlur:y,onFocus:v,onFocusChange:b,onKeyDown:(0,lT.useMemo)(()=>mS(J,w),[J,w]),onKeyUp:E,description:x,errorMessage:D},t,n);yM(n,t.numberValue,t.setNumberValue);let eo=mW(V,j,en,{role:null,"aria-roledescription":ph()?null:A.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(eo["aria-required"]=void 0);let ei=e=>{var t;document.activeElement!==n.current&&("mouse"===e.pointerType?null==(t=n.current)||t.focus():e.target.focus())},es=e["aria-label"]||("string"==typeof e.label?e.label:"");es||(o=null!=e.label?et.id:e["aria-labelledby"]);let el=mB(),eu=mB(),ec=mW(U,{"aria-label":l||A.format("increase",{fieldLabel:es}).trim(),id:o&&!l?el:null,"aria-labelledby":o&&!l?`${el} ${o}`:null,"aria-controls":I,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:ei}),ed=mW(W,{"aria-label":s||A.format("decrease",{fieldLabel:es}).trim(),id:o&&!s?eu:null,"aria-labelledby":o&&!s?`${eu} ${o}`:null,"aria-controls":I,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:ei});return{groupProps:{...K,role:"group","aria-disabled":u,"aria-invalid":X?"true":void 0},labelProps:et,inputProps:eo,incrementButtonProps:ec,decrementButtonProps:ed,errorMessageProps:ea,descriptionProps:er,isInvalid:X,validationErrors:Q,validationDetails:ee}}({...mq(e),label:c,validationBehavior:o},s,l),b=mK({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:v.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),w=m6(e);return delete w.id,l$().createElement(mz,{values:[[wb,s],[yc,m],[ym,{...p,ref:l}],[v_,{...d,ref:u}],[fy,{slots:{increment:f,decrement:h}}],[fw,{slots:{description:g,errorMessage:y}}],[vw,v]]},l$().createElement("div",{...w,...b,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":v.isInvalid||void 0}),e.name&&l$().createElement("input",{type:"hidden",name:e.name,value:isNaN(s.numberValue)?"":s.numberValue}))});function wE(e,t){return Number.parseInt(b3(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let wx=(0,lT.forwardRef)(function(e,t){let{className:n}=e,r=(0,lT.useContext)(ye),a=(0,lT.useContext)(yt),o=r??a,i=(0,lT.useContext)(ws),s=hP(),l=b3(o.visibleRange.start.toDate(s),{calendar:i.calendar,locale:i.baseName,day:!1,year:!1,noToday:!0}),u=wE(o.visibleRange.start.toDate(s),i),c=o.maxValue?wE(o.maxValue.toDate(s),i):void 0,d=o.minValue?wE(o.minValue.toDate(s),i):void 0,m=(0,lT.useCallback)(e=>{o.setFocusedDate(o.focusedDate.cycle("year",e-o.focusedDate.year))},[]);return o&&(0,c$.jsxs)("span",{ref:t,className:n,children:[(0,c$.jsx)("span",{children:l}),(0,c$.jsxs)(ww,{formatOptions:{useGrouping:!1},maxValue:c,minValue:d,onChange:m,value:u,children:[(0,c$.jsx)(yp,{}),(0,c$.jsxs)(yd,{children:[(0,c$.jsx)(fv,{slot:"increment",children:(0,c$.jsx)(c7,{size:8})}),(0,c$.jsx)(fv,{slot:"decrement",children:(0,c$.jsx)(c5,{size:8})})]})]})]})}),wD="-esm-stock-management__datepicker-module__inputGroup___-wpzr",w_="-esm-stock-management__datepicker-module__inputSegment___ocu7L",wk="-esm-stock-management__datepicker-module__dateInputWrapper___909Km",wS="-esm-stock-management__datepicker-module__invalidText___oHJHi",wC="-esm-stock-management__datepicker-module__flatButton___i9LDo",wP="-esm-stock-management__datepicker-module__flatButtonMd___VZMkc",wR="-esm-stock-management__datepicker-module__flatButtonSm___VA5wy",wT="-esm-stock-management__datepicker-module__flatButtonLg___MnYLl";function w$({children:e}){let t=(0,lT.useContext)(bo),n=(0,lT.useContext)(bi),r=t??n,a=u8(()=>r?.close());return(0,c$.jsx)(vb,{className:"-esm-stock-management__datepicker-module__dialog___2pADb",ref:a,children:e})}let wO=(0,lT.forwardRef)(function({variant:e,today_:t,minDate:n,maxDate:r},a){let o="range"===e;return(0,c$.jsx)(be,{ref:a,className:"-esm-stock-management__datepicker-module__popover___pb58i",placement:"bottom start",offset:1,isNonModal:!0,children:(0,c$.jsx)(w$,{children:(0,c$.jsxs)(o?yr:yn,{...o?{minValue:n,maxValue:r,className:"cds--date-picker__calendar"}:{},children:[(0,c$.jsxs)("header",{className:"-esm-stock-management__datepicker-module__header___+fi16",children:[(0,c$.jsx)(fv,{className:cN()(wC,wP),slot:"previous",children:(0,c$.jsx)(ds,{size:16})}),(0,c$.jsx)(wx,{className:"-esm-stock-management__datepicker-module__monthYear___mGhot"}),(0,c$.jsx)(fv,{className:cN()(wC,wP),slot:"next",children:(0,c$.jsx)(dl,{size:16})})]}),(0,c$.jsx)(yo,{className:"-esm-stock-management__datepicker-module__calendarGrid___z07wV",children:e=>(0,c$.jsx)(yu,{className:cN()("cds--date-picker__day",{"-esm-stock-management__datepicker-module__today___dNc4M":0===t.compare(e)}),date:e},e.toString())})]})})})}),wN=(0,lT.forwardRef)(function(e,t){let n=(0,lT.useContext)(bo),[r,a]=mZ({slot:e.slot},t,vs),{locale:o}=fN(),i=vo({...r,locale:o,createCalendar:gZ}),s=(0,lT.useRef)(null),{fieldProps:l,inputProps:u}=yW({...r,inputRef:s},i,a),c=(0,lT.useCallback)(()=>{i.isDisabled||n.toggle()},[]);return(0,c$.jsxs)(mz,{values:[[vl,i],[ym,{...u,ref:s}],[yc,{...l,ref:a,isInvalid:i.isInvalid}]],children:[(0,c$.jsx)(yd,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:i.isDisabled,isInvalid:i.isInvalid,onClick:c,children:i.segments.map((t,n)=>(0,lT.cloneElement)(e.children(t),{key:n}))}),(0,c$.jsx)(yp,{})]})}),wA=(0,lT.forwardRef)(function(e,t){let n=(0,lT.useContext)(bo),r=(0,lT.useContext)(bi);return(n??r).isInvalid?(0,c$.jsx)(mh,{ref:t,size:16,...e}):(0,c$.jsx)(c6,{ref:t,size:16,...e})});class wI{of(e){return this.dictionary.getStringForLocale(e,this.locale)}constructor(e,t){this.locale=e,this.dictionary=t}}let wj=new Map,wM=(0,lT.forwardRef)(function({segment:e,...t},n){let r=(0,lT.useContext)(vl),a=mk(n),{segmentProps:o}=function(e,t,n){let r,a,o,i,s=(0,lT.useRef)(""),{locale:l,direction:u}=fN(),c=function(){var e;let{locale:t}=fN(),n=hU((e=yf)&&e.__esModule?e.default:e,"@react-aria/datepicker");return(0,lT.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new wI(t,n)}},[t,n])}(),{ariaLabel:d,ariaLabelledBy:m,ariaDescribedBy:p,focusManager:f}=yB.get(t),h=e.isPlaceholder?"":e.text,g=(0,lT.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),y=hJ({month:"long",timeZone:g.timeZone}),v=hJ({hour:"numeric",hour12:g.hour12,timeZone:g.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(h=v.format(t.dateValue));else{let e=y.format(t.dateValue);h=e!==h?`${h} \u{2013} ${e}`:e}let{spinButtonProps:b}=wh({value:e.value,textValue:h,minValue:e.minValue,maxValue:e.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!e.isEditable,isRequired:t.isRequired,onIncrement:()=>{s.current="",t.increment(e.type)},onDecrement:()=>{s.current="",t.decrement(e.type)},onIncrementPage:()=>{s.current="",t.incrementPage(e.type)},onDecrementPage:()=>{s.current="",t.decrementPage(e.type)},onIncrementToMax:()=>{s.current="",void 0!==e.maxValue&&t.setSegment(e.type,e.maxValue)},onDecrementToMin:()=>{s.current="",void 0!==e.minValue&&t.setSegment(e.type,e.minValue)}}),w=(0,lT.useMemo)(()=>new(0,wg.d)(l,{maximumFractionDigits:0}),[l]),E=()=>{if(e.text===e.placeholder&&f.focusPrevious(),!w.isValidPartialNumber(e.text)||t.isReadOnly||e.isPlaceholder)"dayPeriod"===e.type&&t.clearSegment(e.type);else{let n=e.text.slice(0,-1),r=w.parse(n);0===(n=0===r?"":n).length||0===r?t.clearSegment(e.type):t.setSegment(e.type,r),s.current=n}},{startsWith:x}=(r=function(e){let{locale:t}=fN(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(wj.has(n))return wj.get(n);let r=new Intl.Collator(t,e);return wj.set(n,r),r}({usage:"search",sensitivity:"base"}),a=(0,lT.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===r.compare(e.slice(0,t.length),t)),[r]),o=(0,lT.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===r.compare(e.slice(-t.length),t)),[r]),i=(0,lT.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let n=0,a=(t=t.normalize("NFC")).length;for(;n+a<=e.length;n++){let o=e.slice(n,n+a);if(0===r.compare(t,o))return!0}return!1},[r]),(0,lT.useMemo)(()=>({startsWith:a,endsWith:o,contains:i}),[a,o,i])),D=hJ({hour:"numeric",hour12:!0}),_=(0,lT.useMemo)(()=>{let e=new Date;return e.setHours(0),D.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[D]),k=(0,lT.useMemo)(()=>{let e=new Date;return e.setHours(12),D.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[D]),S=hJ({year:"numeric",era:"narrow",timeZone:"UTC"}),C=(0,lT.useMemo)(()=>{if("era"!==e.type)return[];let n=hg(new f7(1,1,1),t.calendar),r=t.calendar.getEras().map(e=>{let t=n.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:S.formatToParts(t).find(e=>"era"===e.type).value}}),a=function(e){e.sort();let t=e[0],n=e[e.length-1];for(let e=0;e<t.length;e++)if(t[e]!==n[e])return e;return 0}(r.map(e=>e.formatted));if(a)for(let e of r)e.formatted=e.formatted.slice(a);return r},[S,t.calendar,e.type]),P=n=>{if(t.isDisabled||t.isReadOnly)return;let r=s.current+n;switch(e.type){case"dayPeriod":if(x(_,n))t.setSegment("dayPeriod",0);else if(x(k,n))t.setSegment("dayPeriod",12);else break;f.focusNext();break;case"era":{let e=C.find(e=>x(e.formatted,n));e&&(t.setSegment("era",e.era),f.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!w.isValidPartialNumber(r))return;let a=w.parse(r),o=a,i=0===e.minValue;if("hour"===e.type&&t.dateFormatter.resolvedOptions().hour12){switch(t.dateFormatter.resolvedOptions().hourCycle){case"h11":a>11&&(o=w.parse(n));break;case"h12":i=!1,a>12&&(o=w.parse(n))}void 0!==e.value&&e.value>=12&&a>1&&(a+=12)}else void 0!==e.maxValue&&a>e.maxValue&&(o=w.parse(n));if(isNaN(a))return;let l=0!==o||i;l&&t.setSegment(e.type,o),void 0!==e.maxValue&&(Number(a+"0")>e.maxValue||r.length>=String(e.maxValue).length)?(s.current="",l&&f.focusNext()):s.current=r}}};h7((0,lT.useRef)("u">typeof document?document:null),"selectionchange",()=>{var e;let t=window.getSelection();(null==t?void 0:t.anchorNode)&&(null==(e=n.current)?void 0:e.contains(null==t?void 0:t.anchorNode))&&t.collapse(n.current)});let R=(0,lT.useRef)("");h7(n,"beforeinput",r=>{if(n.current)switch(r.preventDefault(),r.inputType){case"deleteContentBackward":case"deleteContentForward":w.isValidPartialNumber(e.text)&&!t.isReadOnly&&E();break;case"insertCompositionText":R.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:null!=r.data&&P(r.data)}}),h7(n,"input",e=>{let{inputType:t,data:r}=e;"insertCompositionText"===t&&(n.current&&(n.current.textContent=R.current),null!=r&&(x(_,r)||x(k,r))&&P(r))}),mC(()=>{let e=n.current;return()=>{document.activeElement===e&&(f.focusPrevious()||f.focusNext())}},[n,f]);let T=ph()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,lT.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])||t.isInvalid||(p=void 0);let $=mB(),O=!t.isDisabled&&!t.isReadOnly&&e.isEditable,N="literal"===e.type?"":c.of(e.type),A=h6({"aria-label":`${N}${d?`, ${d}`:""}${m?", ":""}`,"aria-labelledby":m});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let I={caretColor:"transparent"};if("rtl"===u){I.unicodeBidi="embed";let t=g[e.type];("numeric"===t||"2-digit"===t)&&(I.direction="ltr")}return{segmentProps:mW(b,A,{id:$,...T,"aria-invalid":t.isInvalid?"true":void 0,"aria-describedby":p,"aria-readonly":t.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:O,suppressContentEditableWarning:O,spellCheck:O?"false":void 0,autoCorrect:O?"off":void 0,[parseInt(l$().version,10)>=17?"enterKeyHint":"enterkeyhint"]:O?"next":void 0,inputMode:t.isDisabled||"dayPeriod"===e.type||"era"===e.type||!O?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:e=>{if("a"===e.key&&(pm()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),E()}},onFocus:()=>{s.current="",n.current&&go(n.current,{containingElement:gi(n.current)});let e=window.getSelection();null==e||e.collapse(n.current)},style:I,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}(e,r,a),{focusProps:i,isFocused:s,isFocusVisible:l}=fl(),{hoverProps:u,isHovered:c}=fp({...t,isDisabled:r.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:i,values:s}=e;return(0,lT.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:a}):t,l="function"==typeof n?n({...s,defaultStyle:i||{}}):n,u="function"==typeof r?r({...s,defaultChildren:o}):null==r?o:r,{className:e??a,style:l||i?{...i,...l}:void 0,children:u??o,"data-rac":""}},[t,n,r,a,o,i,s])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:r.isInvalid,isDisabled:r.isDisabled,isHovered:c,isFocused:s,isFocusVisible:l},defaultChildren:e.text}),m=(0,lT.useCallback)(e=>{e.stopPropagation()},[]);return(0,c$.jsx)("span",{...mW(m6(t),o,i,u),...d,ref:a,style:o.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":r.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":r.isDisabled||void 0,"data-type":e.type,"data-hovered":c||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0,onClick:m})}),wL={short:!1,size:"md"},wF=(0,lT.forwardRef)(function(e,t){let{className:n,defaultValue:r,isDisabled:a,invalid:o,invalidText:i,isInvalid:s,label:l,labelText:u,light:c,maxDate:d,minDate:m,onChange:p,onChangeRaw:f,short:h,size:g,value:y,...v}={...wL,...e},{calendar:b,intlLocale:w,today_:E}=wl(),x=(0,lT.useId)(),D=!!(u??l),_=(0,lT.useMemo)(()=>bc(r,b),[r,b]),k=(0,lT.useMemo)(()=>bc(y,b,!0),[y,b]),S=(0,lT.useMemo)(()=>bc(d,b),[d,b]),C=(0,lT.useMemo)(()=>bc(m??wu,b),[m,b]),P=(0,lT.useMemo)(()=>o||s,[o,s]),R=(0,lT.useMemo)(()=>(f&&p&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),f??(e=>p?.(bd(e)))),[f,p]);return(0,c$.jsx)(bu,{locale:w.toString(),children:(0,c$.jsx)("div",{className:cN()("cds--form-item",n),children:(0,c$.jsx)(mz,{values:[[ws,w]],children:(0,c$.jsxs)(bs,{className:cN()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":h,"cds--date-picker--light":c}),defaultValue:_,isDisabled:a,isInvalid:P,maxValue:S,minValue:C,value:k,shouldForceLeadingZeros:"en"===w.language||void 0,...v,onChange:R,children:[(0,c$.jsxs)("div",{className:"cds--date-picker-container",children:[D&&(0,c$.jsx)(vk,{className:cN()("cds--label",{"cds--label--disabled":a}),htmlFor:x,children:u??l}),(0,c$.jsxs)(yd,{className:wD,children:[(0,c$.jsx)(wN,{id:D?x:void 0,ref:t,className:cN()("cds--date-picker-input__wrapper","-esm-stock-management__datepicker-module__inputWrapper___MHJAy",{"-esm-stock-management__datepicker-module__inputWrapperSm___esx4E":"sm"===g,"-esm-stock-management__datepicker-module__inputWrapperMd___VQbzP":"md"===g||!g||0===g.length,"-esm-stock-management__datepicker-module__inputWrapperLg___Rk9Ce":"lg"===g}),children:e=>"era"!==e.type?(0,c$.jsx)(wM,{className:w_,segment:e}):(0,c$.jsx)(l$().Fragment,{})}),(0,c$.jsx)(fv,{className:cN()(wC,{[wR]:"sm"===g,[wP]:"md"===g||!g||0===g.length,[wT]:"lg"===g}),children:(0,c$.jsx)(wA,{})})]}),(0,c$.jsx)(vE,{className:wS,children:i})]}),(0,c$.jsx)(wO,{variant:"single",today_:E})]})})})})}),wB=(0,lT.forwardRef)(function({className:e,defaultValue:t,invalid:n,invalidText:r,isDisabled:a,isInvalid:o,label:i,labelText:s,light:l,maxDate:u,minDate:c,onChange:d,onChangeRaw:m,size:p="md",value:f,...h},g){let{calendar:y,intlLocale:v,today_:b}=wl(),w=(0,lT.useId)(),E=!!(s??i),x=(0,lT.useMemo)(()=>{if(f)return{start:bc(f[0],y,!1),end:bc(f[1],y,!1)}},[f,y]),D=(0,lT.useMemo)(()=>{if(t)return{start:bc(t[0],y,!1),end:bc(t[1],y,!1)}},[t,y]),_=(0,lT.useMemo)(()=>bc(c??wu,y,!0),[c,y]),k=(0,lT.useMemo)(()=>bc(u,y,!0),[u,y]),S=(0,lT.useMemo)(()=>n||o,[n,o]),C=(0,lT.useMemo)(()=>(m&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),m??(e=>d?.([bd(e.start),bd(e.end)]))),[m,d]);return(0,c$.jsx)(bu,{locale:v.toString(),children:(0,c$.jsx)("div",{className:cN()("cds--form-item",e),children:(0,c$.jsx)(mz,{values:[[ws,v]],children:(0,c$.jsx)(bl,{id:E?w:void 0,className:cN()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":a}),isInvalid:S,shouldForceLeadingZeros:"en"===v.language||void 0,maxValue:k,minValue:_,value:x,defaultValue:D,ref:g,isDisabled:a,...h,onChange:C,children:(0,c$.jsxs)("div",{className:"cds--date-picker-container",children:[E&&(0,c$.jsx)(vk,{className:cN()("cds--label",{"cds--label--disabled":a}),htmlFor:w,children:s??i}),(0,c$.jsxs)(yd,{className:wD,children:[(0,c$.jsxs)("div",{className:cN()("-esm-stock-management__datepicker-module__inputsWrapper___UyGoG",{"-esm-stock-management__datepicker-module__inputsWrapperSm___qrGsA":"sm"===p,"-esm-stock-management__datepicker-module__inputsWrapperMd___pofu4":"md"===p||!p||0===p.length,"-esm-stock-management__datepicker-module__inputsWrapperLg___eF1Im":"lg"===p}),children:[(0,c$.jsx)(vc,{className:cN()("cds--date-picker-input__wrapper","-esm-stock-management__datepicker-module__startInput___C8vnM",wk),slot:"start",children:e=>(0,c$.jsx)(wM,{className:w_,segment:e})}),(0,c$.jsx)("div",{className:"-esm-stock-management__datepicker-module__separator___vHLFZ",children:(0,c$.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,c$.jsx)(vc,{className:cN()("cds--date-picker-input__wrapper","-esm-stock-management__datepicker-module__endInput___25OF9",wk),slot:"end",children:e=>(0,c$.jsx)(wM,{className:w_,segment:e})})]}),(0,c$.jsx)(fv,{className:cN()(wC,{[wR]:"sm"===p,[wP]:"md"===p||!p||0===p.length,[wT]:"lg"===p}),children:(0,c$.jsx)(wA,{})})]}),(0,c$.jsx)(vE,{className:wS,children:r}),(0,c$.jsx)(wO,{variant:"range",today_:b,minDate:_,maxDate:k})]})})})})})}),wV=({diagnoses:e})=>{let{diagnosisTags:t}=uR({externalModuleName:"@openmrs/esm-styleguide"});return(0,c$.jsx)("div",{className:"-esm-stock-management__diagnosis-tags-module__container___l7XiW",children:e.map(e=>{let{rank:n,uuid:r,display:a}=e,o=t[1===n?"primaryColor":"secondaryColor"];return(0,c$.jsx)(cL.Tag,{type:o,children:a},r)})})},wU={action:"-esm-stock-management__empty-card-module__action___l4wUo",content:"-esm-stock-management__empty-card-module__content___XbsSJ",desktopHeading:"-esm-stock-management__empty-card-module__desktopHeading___0EPXX",tabletHeading:"-esm-stock-management__empty-card-module__tabletHeading___unl1F",tile:"-esm-stock-management__empty-card-module__tile___vS3Sj"},wW=({width:e="64",height:t="64"})=>(0,c$.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,c$.jsx)("use",{href:"#omrs-empty-data-illustration"})}),wH=e=>{let t="tablet"===u4(),n=e.launchForm;return(0,c$.jsx)(cL.Layer,{className:wU.layer,children:(0,c$.jsxs)(cL.Tile,{className:wU.tile,children:[(0,c$.jsx)("div",{className:t?wU.tabletHeading:wU.desktopHeading,children:(0,c$.jsx)("h4",{children:e.headerTitle})}),(0,c$.jsx)(wW,{}),(0,c$.jsx)("p",{className:wU.content,children:a3("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,c$.jsx)("p",{className:wU.action,children:n&&(0,c$.jsx)(cL.Button,{onClick:()=>n(),kind:"ghost",size:t?"lg":"sm",children:a3("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},wz=({error:e,headerTitle:t})=>{let n="tablet"===u4();return(0,c$.jsx)(cL.Layer,{children:(0,c$.jsxs)(cL.Tile,{className:"-esm-stock-management__error-state-module__tile___hHM56",children:[(0,c$.jsx)("div",{className:n?"-esm-stock-management__error-state-module__tabletHeading___W7a4U":"-esm-stock-management__error-state-module__desktopHeading___VL8Rv",children:(0,c$.jsx)("h4",{children:t})}),(0,c$.jsxs)("p",{className:"-esm-stock-management__error-state-module__errorMessage___IytZy",children:[a3("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,c$.jsx)("p",{className:"-esm-stock-management__error-state-module__errorCopy___E1yZO",children:a3("errorCopy")})]})})},wK=wz,wG=l$().forwardRef((e,t)=>{let{slotName:n,basePath:r,componentContext:a,state:o}=u6(),i=window.location??{pathname:""},s=lz(n??"");return e.isChildOfHeader&&n&&s.length>0?(0,c$.jsxs)(cL.SideNav,{"aria-label":a3("leftNavigation","Left navigation"),className:"-esm-stock-management__left-nav-module__leftNav___ZqLpw",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,c$.jsx)(lZ,{name:"global-nav-menu-slot"}),n?(0,c$.jsx)(ub,{value:a,fallback:(0,c$.jsx)(lZ,{name:n,state:{basePath:r,currentPath:i,...o}}),children:(0,c$.jsx)(lO.Provider,{value:a,children:(0,c$.jsx)(lZ,{name:n,state:{basePath:r,currentPath:i,...o}})})}):null]}):null}),wZ=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:n,locationsPerRequest:r=50,onChange:a})=>{let[o,i]=(0,lT.useState)(""),s=(0,lT.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:n,error:r,isLoading:a}=uN()(t,od,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,lT.useMemo)(()=>({location:n?.data?.entry?n.data.entry[0]:null,error:t?r:null,isLoading:!!t&&a}),[n,a,r,t])}(t),{locations:u,isLoading:c,hasMore:d,loadingNewData:m,error:p,setPage:f}=function(e,t=0,n=""){let r=u$(n),{data:a,isLoading:o,isValidating:i,setSize:s,error:l}=uZ()(function(n,a){if(a){let e=a.data?.link?.find(e=>"next"===e.relation);if(!e)return null;let t=new URL(e.url);return t.origin===window.location.origin?e.url:new URL(`${t.pathname}${t.search?`?${t.search}`:""}`,window.location.origin).toString()}let o=`${ol}/Location?`,i=new URLSearchParams;return i.append("_summary","data"),t&&i.append("_count",""+t),n&&i.append("_getpagesoffset",""+n*t),e&&i.append("_tag",e),"string"==typeof r&&""!==r&&i.append("name:contains",r),o+i.toString()},od);return(0,lT.useMemo)(()=>({locations:a?.length?a?.flatMap(e=>e?.data?.entry??[]):[],isLoading:o,totalResults:a?.[0]?.data?.total,hasMore:!!a?.length&&a?.[a.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:i,error:l||null,setPage:s}),[o,a,i,s,l])}(n,r,o),h=(0,lT.useMemo)(()=>l&&!o&&t?[l,...u.filter(({resource:e})=>e.id!==t)]:u??[],[l,u,t,o]),g=(0,lT.useCallback)(e=>{a(),i(e.trim())},[a]),y=u7((0,lT.useCallback)(()=>{!m&&d&&f(e=>e+1)},[m,d,f])),v=d?Math.max(0,Math.floor(h.length-r/2)):-1;return(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsx)(cL.Search,{"aria-describedby":p?`${s}-error`:void 0,labelText:a3("searchForLocation"),id:s,placeholder:a3("searchForLocation"),onChange:e=>g(e.target.value),size:"lg"}),p&&(0,c$.jsx)("div",{className:"-esm-stock-management__location-picker-module__errorNotification___MBWvf",id:`${s}-error`,children:(0,c$.jsx)(cL.InlineNotification,{kind:"error",subtitle:a3("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:a3("error","Error")})}),(0,c$.jsx)("div",{className:"-esm-stock-management__location-picker-module__searchResults___aCL93",children:c?(0,c$.jsx)("div",{className:"-esm-stock-management__location-picker-module__loadingContainer___Vn1H0",children:Array.from({length:5}).map((e,t)=>(0,c$.jsx)(cL.RadioButtonSkeleton,{className:"-esm-stock-management__location-picker-module__radioButtonSkeleton___RKMHj",role:"progressbar"},t))}):(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsx)("div",{className:"-esm-stock-management__location-picker-module__locationResultsContainer___5yuvs",children:h.length>0?(0,c$.jsx)(cL.RadioButtonGroup,{name:"loginLocations",onChange:e=>{a(e?.toString())},orientation:"vertical",valueSelected:e,children:h.map((e,t)=>(0,c$.jsx)(cL.RadioButton,{className:"-esm-stock-management__location-picker-module__locationRadioButton___b52LI",id:e.resource.id,labelText:(0,c$.jsx)("span",{ref:t===v?y:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,c$.jsx)("div",{className:"-esm-stock-management__location-picker-module__emptyState___qiPqQ",children:(0,c$.jsx)("p",{className:"-esm-stock-management__location-picker-module__locationNotFound___tKDOJ",children:a3("noResultsToDisplay")})})}),m&&(0,c$.jsx)("div",{className:"-esm-stock-management__location-picker-module__loadingIcon___PGwvc",children:(0,c$.jsx)(cL.InlineLoading,{description:a3("loading")})})]})})]})},wY=F("modalState",{modalContainer:null,modalStack:[]}),wq=0;async function wJ(e,t,n={}){let r=ls(t),a=null;if(e){if(!r)throw Error(`No modal named '${t}' has been registered.`);let{load:o}=r,i=await o(),s=wq++;a=await lS({...i,name:`${t}-${s}`},{...n,domElement:e})}else S(`Failed to launch modal. Please notify your administrator. Modal name: ${t}`);return a}function wX(e){return"TO_BE_DELETED"===e.state||"DELETED"===e.state}function wQ(e,t){t?.unmount&&(t.unmountPromise?.catch(()=>{}),t.unmount().catch(t=>{console.error(`The modal '${e}' failed to unmount`,t)}))}function w0(e){return e.find(e=>!wX(e))}function w1(e,t){e.container&&(e.container.style.visibility=t?"unset":"hidden")}let w4=window.getComputedStyle(document.body).overflow;function w2({modalStack:e,modalContainer:t}){if(t)if(e.length){t.style.visibility||(addEventListener("keydown",w6),document.body.style.overflow="hidden",t.style.visibility="unset");let n=w0(e);e.forEach(e=>{switch(e.state){case"NEW":{let n=function({size:e}){let t=document.createElement("div");return t.className=`cds--modal-container cds--modal-container--${e}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}({size:e.props?.size??"md"});e.container=n,e.state="MOUNTING",wJ(n,e.modalName,e.props).then(r=>{wX(e)?wQ(e.modalName,r):r?(e.parcel=r,t.prepend(n),w1(e,w0(wY.getState().modalStack)===e),r.mountPromise.then(()=>{wX(e)||(e.state="MOUNTED")},t=>{S(t),e.parcel=null,w3(e)})):w3(e)},t=>{S(t),w3(e)});break}case"MOUNTING":case"MOUNTED":w1(e,e===n);break;case"TO_BE_DELETED":e.state="DELETED",e.onClose(),wQ(e.modalName,e.parcel),e.container?.remove(),setTimeout(()=>{let t=wY.getState();wY.setState({...t,modalStack:t.modalStack.filter(t=>t!==e)})},0)}})}else t.style.removeProperty("visibility"),document.body.style.overflow=w4,removeEventListener("keydown",w6)}function w3(e){if(wX(e))return;e.state="TO_BE_DELETED";let t=wY.getState();wY.setState({...t,modalStack:[...t.modalStack]})}function w6(e){"Escape"===e.key&&function(){let[e]=wY.getState().modalStack;e&&w3(e)}()}function w5(e){wY.subscribe(w2),wY.setState({...wY.getState(),modalContainer:e})}function w9(e,t={},n=()=>{}){let r=()=>{let e=wY.getState().modalStack.find(e=>e.onClose===n);e&&w3(e)};if(ls(e)){var a;let o,i;a={state:"NEW",onClose:n,modalName:e,props:{close:r,...t}},i=[a,...(o=wY.getState()).modalStack],wY.setState({...o,modalStack:i})}else S(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return r}var w8=n(6401);let w7=({notification:e})=>{let{description:t,action:n,kind:r,critical:a,title:o,onAction:i}=e;return(0,c$.jsx)(cL.ActionableNotification,{actionButtonLabel:n,kind:r||"info",lowContrast:a,subtitle:t,title:o||"",inline:!0,onActionButtonClick:i})},Ee=({subject:e})=>{let[t,n]=(0,lT.useState)([]);return(0,lT.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.action!==e.action||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,c$.jsx)(c$.Fragment,{children:t.map(e=>(0,c$.jsx)(w7,{notification:e},e.id))})},Et=({notification:e})=>{let{actionButtonLabel:t,onActionButtonClick:n=()=>{},subtitle:r,kind:a,title:o,critical:i,progressActionLabel:s,id:l,...u}=e,[c,d]=(0,lT.useState)(t);return(0,c$.jsx)(cL.ActionableNotification,{kind:a||"info",actionButtonLabel:c,ariaLabel:a3("closesActionableNotification","Closes actionable notification"),onActionButtonClick:()=>{n(),s&&d(s)},statusIconDescription:a3("actionableNotification","Actionable notification"),subtitle:r,title:o,lowContrast:i,inline:!0,...u})},En=({subject:e})=>{let[t,n]=(0,lT.useState)([]);return(0,lT.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,c$.jsx)(c$.Fragment,{children:t.map(e=>(0,c$.jsx)(Et,{notification:e},e.id))})};class Er{subscribe(e){return this.listeners.add(e),{unsubscribe:()=>{this.listeners.delete(e)}}}next(e){for(let t of[...this.listeners])t(e)}constructor(){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"listeners",new Set)}}let Ea=new Er,Eo=0,Ei=new Er,Es=0;function El(e){e&&(0,lY.createRoot)(e).render((0,c$.jsx)(Ee,{subject:Ea}))}function Eu(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!(0,w8.A)(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{Ea.next({...e,id:Eo++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function Ec(e){e&&(0,lY.createRoot)(e).render((0,c$.jsx)(En,{subject:Ei}))}function Ed(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!(0,w8.A)(t))?setTimeout(()=>{Ei.next({...e,id:Es++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let Em=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],Ep=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"],Ef={container:"-esm-stock-management__numeric-observation-module__container___+Kqi9",card:"-esm-stock-management__numeric-observation-module__card___Q-ECG","abnormal-value":"-esm-stock-management__numeric-observation-module__abnormal-value___bx1h9","critical-value":"-esm-stock-management__numeric-observation-module__critical-value___nSKSX",cell:"-esm-stock-management__numeric-observation-module__cell___wc90e","critically-high":"-esm-stock-management__numeric-observation-module__critically-high___fmZfJ","critically-low":"-esm-stock-management__numeric-observation-module__critically-low___h9797",high:"-esm-stock-management__numeric-observation-module__high___0-YpP",low:"-esm-stock-management__numeric-observation-module__low___TuqAk","label-container":"-esm-stock-management__numeric-observation-module__label-container___FtozC","value-container":"-esm-stock-management__numeric-observation-module__value-container___R9qoY",label:"-esm-stock-management__numeric-observation-module__label___0DGA5",value:"-esm-stock-management__numeric-observation-module__value___ohqoh",units:"-esm-stock-management__numeric-observation-module__units___xvMd3","pad-right":"-esm-stock-management__numeric-observation-module__pad-right___umcen","off-scale-low":"-esm-stock-management__numeric-observation-module__off-scale-low___my+0i","off-scale-high":"-esm-stock-management__numeric-observation-module__off-scale-high___so9dv",arrow:"-esm-stock-management__numeric-observation-module__arrow___Agoh9"},Eh=({value:e,unit:t,label:n,interpretation:r,referenceRange:a,conceptUuid:o,variant:i="card",patientUuid:s})=>{let l=(0,lT.useId)(),{referenceRange:u,isLoading:c}=function(e,t){let n=null;e&&(n=t?`${os}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${os}/conceptreferencerange/?concept=${e}&v=full`);let{data:r,error:a,isLoading:o}=uN()(n,od),i=r?.data?.results?.[0];return{referenceRange:i?{hiNormal:i.hiNormal??null,hiAbsolute:i.hiAbsolute??null,hiCritical:i.hiCritical??null,lowNormal:i.lowNormal??null,lowAbsolute:i.lowAbsolute??null,lowCritical:i.lowCritical??null}:void 0,error:a,isLoading:o}}(a||r?void 0:o,s),d=a??u,m=(0,lT.useMemo)(()=>{if(r)return r?"--"===r?"normal":Em.includes(r)?r.toLowerCase():Ep.includes(r)?r:"normal":void 0;if(d&&!c){if(!d||null==e||""===e)return"normal";let t="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(t)?"normal":null!==d.hiAbsolute&&void 0!==d.hiAbsolute&&t>d.hiAbsolute?"off_scale_high":null!==d.hiCritical&&void 0!==d.hiCritical&&t>=d.hiCritical?"critically_high":null!==d.hiNormal&&void 0!==d.hiNormal&&t>d.hiNormal?"high":null!==d.lowAbsolute&&void 0!==d.lowAbsolute&&t<d.lowAbsolute?"off_scale_low":null!==d.lowCritical&&void 0!==d.lowCritical&&t<=d.lowCritical?"critically_low":null!==d.lowNormal&&void 0!==d.lowNormal&&t<d.lowNormal?"low":"normal"}return"normal"},[r,d,e,c])??"normal",p="critically_low"===m||"critically_high"===m||"off_scale_low"===m||"off_scale_high"===m,f="normal"!==m,h=n?`omrs-numeric-obs-label-${n.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,g=`omrs-numeric-obs-value-${l}`,y=`omrs-numeric-obs-unit-${l}`,v=null!=e&&""!==e,b=v?e:a3("notAvailable","Not available"),w=cN()({[Ef["critically-low"]]:"critically_low"===m||"off_scale_low"===m,[Ef["critically-high"]]:"critically_high"===m||"off_scale_high"===m,[Ef.low]:"low"===m,[Ef.high]:"high"===m,[Ef["off-scale-low"]]:"off_scale_low"===m,[Ef["off-scale-high"]]:"off_scale_high"===m}),E=cN()({[Ef.container]:!0,[Ef.card]:!0,[Ef["critical-value"]]:p,[Ef["abnormal-value"]]:f&&!p}),x=cN()({[Ef.cell]:!0,[w]:!0});return"cell"===i?(0,c$.jsxs)("div",{className:x,children:[b,v&&t?` ${t}`:""]}):(0,c$.jsxs)("section",{className:E,"data-testid":"numeric-observation-card",children:[n&&(0,c$.jsxs)("div",{className:Ef["label-container"],children:[(0,c$.jsx)("span",{id:h,className:Ef.label,children:n}),f&&(0,c$.jsx)("span",{className:Ef[m.replace("_","-")],title:a3("abnormalValue","Abnormal value")})]}),(0,c$.jsxs)("div",{className:Ef["value-container"],children:[(0,c$.jsx)("span",{id:g,"aria-labelledby":h&&y?`${h} ${y}`:h||y||void 0,className:Ef.value,children:b}),v&&t&&(0,c$.jsx)("span",{id:y,className:Ef.units,children:t})]})]})},Eg="-esm-stock-management__page-header-module__pageHeader___XNJYe",Ey=e=>{if("children"in e){let{children:t,className:n,...r}=e;return(0,c$.jsx)("div",{className:cN()(Eg,n),...r,children:t})}{let{title:t,illustration:n,className:r,...a}=e;return(0,c$.jsx)("div",{className:cN()(Eg,r),...a,children:(0,c$.jsx)(Ev,{title:t,illustration:n})})}},Ev=({title:e,illustration:t,className:n})=>{let[r,a]=(0,lT.useState)(null);return(0,lT.useEffect)(()=>{ng("@openmrs/esm-styleguide").then(e=>{a(e)})},[]),(0,c$.jsxs)("div",{className:cN()("-esm-stock-management__page-header-module__pageHeaderContent___V-mTz",n),children:[t,(0,c$.jsxs)("div",{className:"-esm-stock-management__page-header-module__pageLabels___vGJvg",children:[r?.implementationName&&(0,c$.jsx)("p",{children:a3(r.implementationName)}),(0,c$.jsx)("p",{className:"-esm-stock-management__page-header-module__pageName___+eYMc",children:e})]})]})},Eb=({totalItems:e,pageSize:t,onPageNumberChange:n,pageNumber:r,dashboardLinkUrl:a,currentItems:o,dashboardLinkLabel:i})=>{let{pageSizes:s,pageItemsCount:l}=cn(t,e,r,o),u="tablet"===u4(),c=a3("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,c$.jsx)(c$.Fragment,{children:e>0&&(0,c$.jsxs)("div",{className:cN()({"-esm-stock-management__pagination-module__tablet___DdaYk":u,"-esm-stock-management__pagination-module__desktop___rSwlo":!u}),children:[(0,c$.jsxs)("div",{children:[c,a&&(0,c$.jsx)(lN,{to:a,className:"-esm-stock-management__pagination-module__configurableLink___cTCLf",children:i??a3("seeAll","See all")})]}),(0,c$.jsx)(cL.Pagination,{className:"-esm-stock-management__pagination-module__pagination___U6anZ",page:r,pageSize:t,pageSizes:s,totalItems:e,onChange:n,pageRangeText:(e,t)=>a3("paginationOfPages","of {{count}} pages",{count:t}),size:u?"lg":"sm"})]})})};function Ew(e){return Ex(E_(e,"usual","official"))}function EE(e){return Ew(e)}function Ex(e){var t;let n;return e?e.text??(n=(t=e).given??[],(t.family?n.concat(t.family):n).join(" ")):""}function ED(e){return Ex(e)}function E_(e,...t){for(let n of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,r;return t=e,r=n,t.use?t.use===r:"usual"===r});if(t)return t}}function Ek(e,t=cc()()){let n=cc()(t),r=we(e,n);if(null==r)return null;let a=n.diff(r,"hours"),o=n.diff(r,"days"),i=n.diff(r,"weeks"),s=n.diff(r,"months"),l=n.diff(r,"years"),u={};if(a<2)u.minutes=n.diff(r,"minutes");else if(o<2)u.hours=a;else if(i<4)u.days=o;else if(l<1){let e=n.subtract(i,"weeks").diff(r,"days");u.weeks=i,u.days=e}else if(l<2){let e=n.subtract(s,"months").diff(r,"days");u.months=s,u.days=e}else if(l<18){let e=n.subtract(l,"year").diff(r,"months");u.years=l,u.months=e}else u.years=l;return u}function ES(e,t=cc()()){let n=Ek(e,t);if(null==n)return null;let r={style:"short",localeMatcher:"lookup"};return"minutes"in n&&0===n.minutes&&(r.minutesDisplay="always"),b7(n,r)}let EC={container:"-esm-stock-management__patient-banner-patient-info-module__container___WV40g",activePatientContainer:"-esm-stock-management__patient-banner-patient-info-module__activePatientContainer___YBgYK",patientBanner:"-esm-stock-management__patient-banner-patient-info-module__patientBanner___o-DQc",patientName:"-esm-stock-management__patient-banner-patient-info-module__patientName___KWLAJ",patientAvatar:"-esm-stock-management__patient-banner-patient-info-module__patientAvatar___gG4I3",patientAvatarButton:"-esm-stock-management__patient-banner-patient-info-module__patientAvatarButton___by4L9",patientInfo:"-esm-stock-management__patient-banner-patient-info-module__patientInfo___VU1fL",demographics:"-esm-stock-management__patient-banner-patient-info-module__demographics___xDHsd",row:"-esm-stock-management__patient-banner-patient-info-module__row___MlVwp",flexRow:"-esm-stock-management__patient-banner-patient-info-module__flexRow___9Aj3s",tagsSlot:"-esm-stock-management__patient-banner-patient-info-module__tagsSlot___PqCHJ",identifiers:"-esm-stock-management__patient-banner-patient-info-module__identifiers___bbREn",identifier:"-esm-stock-management__patient-banner-patient-info-module__identifier___HQzz8",primaryIdentifier:"-esm-stock-management__patient-banner-patient-info-module__primaryIdentifier___ocKCs",secondaryIdentifier:"-esm-stock-management__patient-banner-patient-info-module__secondaryIdentifier___4MLDH",value:"-esm-stock-management__patient-banner-patient-info-module__value___tkQTC",tag:"-esm-stock-management__patient-banner-patient-info-module__tag___u7Kco",gender:"-esm-stock-management__patient-banner-patient-info-module__gender___7eQuO",separator:"-esm-stock-management__patient-banner-patient-info-module__separator___CZBA8",tooltipPadding:"-esm-stock-management__patient-banner-patient-info-module__tooltipPadding___UQr5s",tooltipSmallText:"-esm-stock-management__patient-banner-patient-info-module__tooltipSmallText___MRUhY",actionsButtonText:"-esm-stock-management__patient-banner-patient-info-module__actionsButtonText___8ZC1R"};function EP({showIdentifierLabel:e,type:t,value:n}){return(0,c$.jsx)("span",{className:EC.primaryIdentifier,children:(0,c$.jsxs)(cL.Tag,{className:EC.tag,type:"gray",children:[e&&t?.text&&(0,c$.jsxs)("span",{className:EC.label,children:[t.text,": "]}),(0,c$.jsx)("span",{className:EC.value,children:n})]})})}function ER({showIdentifierLabel:e,type:t,value:n}){return(0,c$.jsxs)(cL.FormLabel,{className:EC.secondaryIdentifier,id:`patient-banner-identifier-${n}`,children:[e&&(0,c$.jsxs)("span",{className:EC.label,children:[t?.text,": "]}),(0,c$.jsx)("span",{className:EC.value,children:n})]})}function ET({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:n}=uR(),{primaryIdentifierCode:r}=co(),a=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!n?.uuids.includes(t)})??[];return(0,c$.jsx)(c$.Fragment,{children:a?.length?a.map(({value:e,type:n},o)=>(0,c$.jsxs)(l$().Fragment,{children:[(0,c$.jsx)("span",{className:EC.identifier,children:n?.coding?.[0]?.code===r?(0,c$.jsx)(EP,{showIdentifierLabel:t,type:n,value:e}):(0,c$.jsx)(ER,{showIdentifierLabel:t,type:n,value:e})}),o<a.length-1&&(0,c$.jsx)("span",{className:EC.separator,children:"\xb7"})]},e)):""})}let E$={Female:dw,Male:dE,Other:dx,Unknown:dD},EO=({gender:e})=>{let t=E$[e];return t?(0,c$.jsx)(t,{fill:"#525252"}):null},EN={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function EA({patient:e,renderedFrom:t}){var n;let r,a,o=Ew(e),i=e?.gender&&(a=EN[r=(n=e.gender).toLowerCase()]??"Unknown",{displayText:a3(r,n),iconKey:a}),s=(0,lT.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,c$.jsxs)("div",{className:EC.patientInfo,children:[(0,c$.jsx)("div",{className:cN()(EC.row,EC.patientNameRow),children:(0,c$.jsxs)("div",{className:EC.flexRow,children:[(0,c$.jsx)("span",{className:EC.patientName,children:o}),i&&(0,c$.jsxs)("div",{className:EC.gender,children:[(0,c$.jsx)(EO,{gender:i.iconKey}),(0,c$.jsx)("span",{children:i.displayText})]}),(0,c$.jsx)(lZ,{className:EC.tagsSlot,name:"patient-banner-tags-slot",state:s})]})}),(0,c$.jsxs)("div",{className:EC.demographics,children:[e.birthDate&&(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsx)("span",{children:ES(e.birthDate)}),(0,c$.jsx)("span",{className:EC.separator,children:"\xb7"}),(0,c$.jsx)("span",{children:b2(e.birthDate,{time:!1})}),(0,c$.jsx)("span",{className:EC.separator,children:"\xb7"})]}),(0,c$.jsx)(ET,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,c$.jsx)(lZ,{className:EC.extensionSlot,name:"patient-banner-bottom-slot",state:s})]})]})}var EI=n(1673);function Ej({patient:e,patientUuid:t,actionsSlotName:n,additionalActionsSlotState:r}){let[a,o]=(0,lT.useState)(!1),{extensions:i}=lK(n),s="tablet"===u4(),l=u8(()=>o(!1),a),u=(0,lT.useRef)(null),c=(0,lT.useRef)(null),d=(0,lT.useId)(),m=`patient-actions-menu-trigger-${d}`,p=`patient-actions-menu-${d}`,f=(0,lT.useCallback)(()=>o(e=>!e),[]),h=(0,lT.useCallback)(()=>{o(!1),u.current?.focus()},[]),g=(0,lT.useCallback)(e=>{if("Escape"===e.key&&a){e.stopPropagation(),h();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&a){e.preventDefault();let t=c.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,r=Array.from(t).indexOf(n);if(-1===r)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let a=r+("ArrowDown"===e.key?1:-1),o=a<0?t.length-1:a>=t.length?0:a;t[o]?.focus()}},[h,a]);(0,lT.useEffect)(()=>{if(a&&c.current){let e=c.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[a]);let y=(0,lT.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:h,...r}),[t,e,h,r]);return 0===i.length?null:(0,c$.jsx)("div",{className:"-esm-stock-management__patient-banner-actions-menu-module__overflowMenuContainer___7eCLh",children:(0,c$.jsxs)("div",{"data-overflow-menu":!0,className:cN()("cds--overflow-menu",cV),ref:l,children:[(0,c$.jsxs)("button",{className:cN()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":a},cH),"aria-controls":p,"aria-expanded":a,"aria-haspopup":"true",id:m,onClick:f,onKeyDown:g,ref:u,children:[(0,c$.jsx)("span",{className:"-esm-stock-management__patient-banner-actions-menu-module__actionsButtonText___TbM5a",children:a3("actions","Actions")})," ",(0,c$.jsx)(EI.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,c$.jsxs)("div",{className:cN()("cds--overflow-menu-options","cds--overflow-menu--flip",cU,{[cW]:a}),"aria-labelledby":m,"data-floating-menu-direction":"bottom",id:p,onKeyDown:g,ref:c,role:"menu",tabIndex:-1,children:[(0,c$.jsx)("ul",{className:cN()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":s}),children:(0,c$.jsx)(lZ,{name:n,state:y},n)}),(0,c$.jsx)("span",{})]})]})})}var EM=n(6767),EL=n.n(EM);function EF(e){let{patientPhotoConceptUuid:t}=uR({externalModuleName:"@openmrs/esm-styleguide"}),n=t?`${os}/obs?patient=${e}&concept=${t}&v=full`:null,{data:r,error:a,isLoading:o}=ut()(e?n:null,od),i=r?.data?.results[0];return{data:i?{dateTime:i?.obsDatetime,imageSrc:i?.value?.links?.uri}:null,error:a,isLoading:o}}let EB=({width:e=56,height:t=56,"aria-label":n})=>{let{t:r}=(0,l7.useTranslation)();return(0,c$.jsxs)("svg",{"aria-label":n??r("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,c$.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,c$.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"})]})},EV="-esm-stock-management__patient-photo-module__avatar___R93LX";function EU({patientUuid:e,patientName:t,alt:n}){let{data:r,isLoading:a}=EF(e),[o,i]=(0,lT.useState)(null),[s,l]=(0,lT.useState)(!1),u=(0,lT.useMemo)(()=>EL().generate(e),[e]);(0,lT.useEffect)(()=>{if(r?.imageSrc){let e=new URL(r.imageSrc,window.location.origin).pathname;l(!0);let t=!1,n=new Image;return n.onload=()=>{t||(i(e),l(!1))},n.onerror=()=>{t||(i(null),l(!1))},n.src=e,()=>{t=!0}}i(null),l(!1)},[r?.imageSrc]);let c=(0,lT.useMemo)(()=>n||(o?a3("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):a3("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[n,o,t]);return a||s?(0,c$.jsx)(cL.SkeletonIcon,{className:"-esm-stock-management__patient-photo-module__skeleton___I-6iq","data-testid":"skeleton-icon"}):r?.imageSrc&&!o?(0,c$.jsx)(EB,{"aria-label":a3("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):o?(0,c$.jsx)("div",{"aria-label":c,children:(0,c$.jsx)("img",{className:EV,src:o,alt:c,title:t})}):(0,c$.jsx)("div",{"aria-label":c,children:(0,c$.jsx)("div",{className:EV,title:t,style:{backgroundImage:u.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,c$.jsx)("span",{className:"-esm-stock-management__patient-photo-module__initials___JnUBD",children:function(e,t=3){return e.split(/\s+/).filter(Boolean).slice(0,t).map(e=>e[0]).join("")}(t)})})})}let EW=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-ct-scan","omrs-pict-dentistry","omrs-pict-digital-trust","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-metadata-export","omrs-pict-obstetrics","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],EH=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),Ez=EH,EK=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),EG=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),EZ=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),EY=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),Eq=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),EJ=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),EX=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),EQ=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),E0=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),E1=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),E4=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),E2=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),E3=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),E6=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),E5=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-metadata-export",pictogramProps:e})})),E9=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),E8=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),E7=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),xe=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),xt=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),xn=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),xr=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),xa=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),xo=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),xi=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),xs=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),xl=(0,lT.memo)((0,lT.forwardRef)(function(e,t){return(0,c$.jsx)(xm,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),xu=E0,xc=E7,xd=(0,lT.memo)((0,lT.forwardRef)(function({pictogram:e,fallback:t,...n},r){let a=(0,lT.useRef)(document.getElementById(e));return(0,lT.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(a.current=document.getElementById(e))});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,c$.jsx)(ub,{value:a.current,fallback:t,children:(0,c$.jsx)(xm,{ref:r,pictogram:e,pictogramProps:n})})})),xm=(0,lT.memo)((0,lT.forwardRef)(function({pictogram:e,pictogramProps:t},n){let{className:r,size:a}=Object.assign({},{size:92},t);return(a<=26||a>144)&&(console.error(`Invalid size '${a}' specified for ${e}. Defaulting to 92.`),a=92),(0,c$.jsx)("svg",{ref:n,className:cN()("-esm-stock-management__pictograms-module__pictogram___LTPzD",r),height:a,width:a,children:(0,c$.jsx)("use",{href:`#${e}`})})})),xp=({children:e})=>"tablet"===u4()?(0,c$.jsx)(cL.Layer,{children:e}):(0,c$.jsx)(c$.Fragment,{children:e}),xf=({snackbar:e,closeSnackbar:t})=>{let{actionButtonLabel:n="",kind:r="success",onActionButtonClick:a=()=>{},isLowContrast:o="error"!==r,progressActionLabel:i,subtitle:s="",timeoutInMs:l=5e3,autoClose:u="error"!==r,title:c,id:d,...m}=e,[p,f]=(0,lT.useState)(n),[h,g]=(0,lT.useState)(!0),[y,v]=(0,lT.useState)(!1),b=(0,lT.useCallback)(()=>{setTimeout(t,250)},[t]),w=(0,lT.useCallback)(()=>{v(!0),b()},[b]);return(0,lT.useEffect)(()=>{if(u){let e=setTimeout(w,l);return()=>clearTimeout(e)}},[l,u,w]),(0,lT.useEffect)(()=>{g(!1),window.setTimeout(()=>{g(!0)},0)},[]),(0,c$.jsx)(cL.ActionableNotification,{actionButtonLabel:p,"aria-label":a3("closeSnackbar","Close snackbar"),className:cN()("-esm-stock-management__snackbar-module__slideIn___TqSN-",{"-esm-stock-management__snackbar-module__animated___+XPKT":h,"-esm-stock-management__snackbar-module__slideOut___1cFIY":y}),kind:r,lowContrast:o,onActionButtonClick:()=>{a(),w(),i&&f(i)},onClose:b,statusIconDescription:a3("snackbarNotification","Snackbar notification"),subtitle:s,title:c,...m})},xh=({subject:e})=>{let[t,n]=(0,lT.useState)([]),r=(0,lT.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,lT.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,c$.jsx)(c$.Fragment,{children:t.map(e=>(0,c$.jsx)(xf,{snackbar:e,closeSnackbar:()=>r(e)},e.id))})},xg=new Er,xy=0;function xv(e){e&&(0,lY.createRoot)(e).render((0,c$.jsx)(xh,{subject:xg}))}function xb(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{xg.next({...e,id:xy++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let xw=({toast:e,closeToast:t})=>{let{description:n,kind:r,critical:a,title:o,actionButtonLabel:i,onActionButtonClick:s=()=>{}}=e,l=(0,lT.useCallback)(()=>{s(),t()},[t,s]);return(0,c$.jsx)("div",{children:(0,c$.jsx)(cL.ActionableNotification,{actionButtonLabel:i,kind:r||"info",lowContrast:a,subtitle:n,title:o||"",onActionButtonClick:l,onClose:t})})},xE=({subject:e})=>{let[t,n]=(0,lT.useState)([]),r=(0,lT.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,lT.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.kind!==e.kind||t.title!==e.title||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick),e]));return()=>t.unsubscribe()},[e]),(0,c$.jsx)(c$.Fragment,{children:t.map(e=>(0,c$.jsx)(xw,{toast:e,closeToast:()=>r(e)},e.id))})},xx=new Er,xD=0;function x_(e){e&&(0,lY.createRoot)(e).render((0,c$.jsx)(xE,{subject:xx}))}function xk(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!(0,w8.A)(t))?setTimeout(()=>{xx.next({...e,id:xD++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}function xS(e,t=!1){if(t)return!0;let n=x$[e];return!n||!n()}function xC(e,t){let n=xF.getState()?.workspaceGroup,r=n?.name;r&&e===r&&xW(()=>{let r=xZ(e);r&&(r.setState({},!0),r.subscribe(()=>{})()),"function"==typeof n?.cleanup&&n.cleanup(),xF.setState(e=>({...e,workspaceGroup:void 0})),"function"==typeof t&&t()},r?e=>e.currentWorkspaceGroup===r:()=>!0)}function xP(e,t){let{name:n,additionalProps:r}=t;lp(n);let a=()=>{xj(e.name,{ignoreChanges:!0,onWorkspaceClose:()=>xR(n,r),closeWorkspaceGroup:!1})};xS(e.name)?a():xz("closing-workspace-launching-new-workspace",a,e.title??e.name)}function xR(e,t){let n=lp(e),r=xF.getState().workspaceGroup;if(r&&!r.members?.includes(e))return void xC(r.name,()=>{xR(e,t)});let a=xF.getState().workspaceGroup?.name,o={...n,title:xK(n,t),closeWorkspace:(t={})=>xj(e,t),closeWorkspaceWithSavedChanges:t=>xj(e,{ignoreChanges:!0,...t}),promptBeforeClosing:t=>{var n,r;return n=e,r=t,void(x$[n]=r)},setTitle:(t,n)=>{o.title=t,o.titleNode=n,xF.setState(t=>{let n=t.openWorkspaces.map(t=>t.name===e?o:t);return{...t,openWorkspaces:n}})},currentWorkspaceGroup:a,additionalProps:t??{}};function i(e,t){xF.setState(n=>{let r=[e,...t??n.openWorkspaces],a=xU(e);return{...n,openWorkspaces:r,workspaceWindowState:a}})}a&&xZ(a,t);let s=xF.getState().openWorkspaces,l=s.findIndex(t=>t.name===e),u=s.find(e=>e.type==o.type);if(0===s.length)i(o);else if(s[0].canHide||0===l)if(l>=0){let t=s[l];i({...t,additionalProps:o.additionalProps,...t.title===xK(t,t.additionalProps)&&{title:xK(o,o.additionalProps)}},s.filter(t=>t.name!=e))}else u?(i(u,xF.getState().openWorkspaces.filter(e=>e.type!=o.type)),xP(u,{name:e,additionalProps:t})):i(o);else xP(s[0],{name:e,additionalProps:t})}function xT({targetUrl:e,contextKey:t,workspaceName:n,additionalProps:r}){xM(t),xR(n,r),a9({to:e})}let x$={};function xO(e,t){x$[e]=t}function xN(e){return x$[e]}function xA(){let e=xF.getState();xF.setState({...e,prompt:null})}let xI={ignoreChanges:!1,onWorkspaceClose:()=>{},closeWorkspaceGroup:!0};function xj(e,t={}){t={...xI,...t};let n=()=>{let n=xF.getState();n.openWorkspaces.find(t=>t.name===e);let r=n.openWorkspaces.filter(t=>t.name!=e),a=xF.getState().workspaceGroup?.name;a&&t.closeWorkspaceGroup&&xC(a),x$[e]=()=>!1,xF.setState(e=>({...e,prompt:null,openWorkspaces:r,workspaceWindowState:xU(r?.[0])})),t?.onWorkspaceClose?.()};return xS(e,t?.ignoreChanges)?(n(),!0):(xz("closing-workspace",n,lp(e).title??e),!1)}function xM(e){xF.getState().context!=e&&xF.setState({context:e,openWorkspaces:[],prompt:null})}let xL={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},xF=F("workspace",xL);function xB(){return xF}function xV(e){let t=xF.getState();xF.setState({...t,workspaceWindowState:e})}function xU(e){return e?.preferredWindowSize??"normal"}function xW(e=()=>{},t=()=>!0){let n=xF.getState().openWorkspaces.filter(t).every(({name:e})=>xS(e)),r=()=>{xG(),e?.()};n?r():xz("closing-all-workspaces",r)}function xH(){let{workspaceWindowState:e,openWorkspaces:t,prompt:n,workspaceGroup:r}=lL(xF);return(0,lT.useMemo)(()=>({active:t.length>0,prompt:n,workspaceWindowState:e,workspaces:t,workspaceGroup:r}),[t,e,n,r])}function xz(e,t=()=>{},n=""){let r;switch(e){case"closing-workspace":r={title:a3("unsavedChangesTitleText","Unsaved changes"),body:a3("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:()=>{t?.()},confirmText:a3("discard","Discard")};break;case"closing-all-workspaces":{let e=xF.getState().openWorkspaces.filter(({name:e})=>!xS(e)).map(({title:e},t)=>`${t+1}. ${e}`);r={title:a3("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:a3("closingAllWorkspacesPromptBody","There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",{workspaceNames:e.join(",")}),onConfirm:()=>{t?.()},confirmText:a3("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:e.length})};break}case"closing-workspace-launching-new-workspace":r={title:a3("unsavedChangesTitleText","Unsaved changes"),body:a3("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:n}),onConfirm:()=>{xF.setState(e=>({...e,prompt:null})),t?.()},confirmText:a3("openAnyway","Open anyway")};break;default:console.error(`Workspace system trying to open unknown prompt type "${e}" in function "showWorkspacePrompts"`),t?.();return}xF.setState(e=>({...e,prompt:r}))}function xK(e,t){return t?.workspaceTitle??e.title}function xG(){xF.setState(xL)}function xZ(e,t={}){if(!e||"default"===e)return;let n=V(e,{});return t&&n.setState(e=>({...e,...t})),n}let xY="-esm-stock-management__action-menu-button-module__container___Uwne-",xq="-esm-stock-management__action-menu-button-module__elementContainer___vWkQO",xJ="-esm-stock-management__action-menu-button-module__active___D7Idw";function xX({getIcon:e,formOpenInTheBackground:t,tagContent:n}){return(0,c$.jsxs)(c$.Fragment,{children:[e({size:16}),t?(0,c$.jsx)("span",{className:"-esm-stock-management__action-menu-button-module__interruptedTag___7undI",children:"!"}):(0,c$.jsx)("span",{className:"-esm-stock-management__action-menu-button-module__countTag___XJRiM",children:n})]})}let xQ=({getIcon:e,label:t,iconDescription:n,handler:r,type:a,tagContent:o})=>{let i=u4(),{workspaces:s,workspaceWindowState:l}=xH(),u=s?.findIndex(({type:e})=>e===a)??-1,c="hidden"!==l&&0===u,d=u>0||0===u&&"hidden"===l;return"tablet"===i||"phone"===i?(0,c$.jsxs)(cL.Button,{className:cN()(xY,{[xJ]:c}),iconDescription:n,kind:"ghost",onClick:r,role:"button",tabIndex:0,size:"md",children:[(0,c$.jsx)("span",{className:xq,children:(0,c$.jsx)(xX,{formOpenInTheBackground:d,getIcon:e,tagContent:o})}),(0,c$.jsx)("span",{children:t})]}):(0,c$.jsx)(cL.IconButton,{align:"left","aria-label":n,className:cN()(xY,{[xJ]:c}),enterDelayMs:300,kind:"ghost",label:t,onClick:r,size:"md",children:(0,c$.jsx)("div",{className:xq,children:(0,c$.jsx)(xX,{formOpenInTheBackground:d,getIcon:e,tagContent:o})})})};var x0=n(4535),x1=n(771),x4=n(4898),x2=/[\\^$.*+?()[\]{}|]/g,x3=RegExp(x2.source);let x6=function(e){return(e=(0,x4.A)(e))&&x3.test(e)?e.replace(x2,"\\$&"):e};function x5({contextKey:e}){let{prompt:t}=xH();return(0,lT.useEffect)(()=>{RegExp(`/${x6(e)}(/|$)`).test(window.location.pathname)||console.warn(`WorkspaceContainer has provided an invalid context key: "${e}". The context key must be part of the URL path, with no initial or trailing slash.`)},[]),(0,lT.useEffect)(()=>(xM(e),()=>{xM(null)}),[e]),(0,lT.useEffect)(()=>{let t=t=>{let{detail:{cancelNavigation:n,newUrl:r}}=t,a=RegExp(`/${x6(e)}(/|$)`),o=new URL(r),i=a.test(o.pathname),s=xF.getState().openWorkspaces.every(({name:e})=>xS(e));i||(s?xG():(n?.(),xW(()=>{a9({to:r})})))};return window.addEventListener("single-spa:before-routing-event",t),()=>{window.removeEventListener("single-spa:before-routing-event",t)}},[]),null!=t?(0,c$.jsxs)(cL.ComposedModal,{open:!0,onClose:xA,children:[(0,c$.jsx)(cL.ModalHeader,{title:t.title}),(0,c$.jsx)(cL.ModalBody,{children:(0,c$.jsx)("p",{className:"-esm-stock-management__workspace-notification-module__messageBody___M3IAD",children:t.body})}),(0,c$.jsxs)(cL.ModalFooter,{children:[(0,c$.jsx)(cL.Button,{kind:"secondary",onClick:xA,children:t.cancelText??a3("cancel")}),(0,c$.jsx)(cL.Button,{kind:"danger",onClick:t.onConfirm,children:t.confirmText??a3("confirm")})]})]}):null}function x9(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 x8(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x9(Object(n),!0).forEach(function(t){De(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x9(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x7(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function De(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dt(e){return(Dt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Dn(e,t){return(Dn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dr(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Da=function(e){var t=lT.Component;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),t&&Dn(i,t);var n,r,a,o=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=Dt(i);e=n?Reflect.construct(t,arguments,Dt(this).constructor):t.apply(this,arguments);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return Dr(this)});function i(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),De(Dr(t=o.call(this,e)),"handleRef",function(e){t.el=e}),De(Dr(t),"addThingToDo",function(e,n){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then(function(){if(!t.unmounted||"unmount"===e)return n.apply(void 0,arguments)}).catch(function(n){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),n&&n.message&&(n.message="During '".concat(e,"', parcel threw an error: ").concat(n.message)),t.props.handleError?t.props.handleError(n):setTimeout(function(){throw n}),n}))}),De(Dr(t),"getParcelProps",function(){var e=x8(x8({},t.props),{},{domElement:t.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e}),t.state={hasError:!1},!e.config)throw Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return t}return r=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var t,n=e.props.mountParcel||e.mountParcel;if(!n)throw Error("\n <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop \n ");return e.el?t=e.el:(e.createdDomElement=t=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach(function(n){t.style[n]=e.props.wrapStyle[n]}),e.props.appendTo.appendChild(t)),e.parcel=n(e.props.config,x8({domElement:t},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return l1&&l1.Consumer?lT.createElement(l1.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):null;var t=l1&&l1.Consumer?lT.createElement(l1.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):void 0;return lT.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}],x7(i.prototype,r),a&&x7(i,a),i}();De(Da,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});function Do({workspace:e,additionalPropsFromPage:t}){let[n,r]=(0,lT.useState)(),a=function(e){let[t,n]=(0,lT.useState)({}),[r,a]=(0,lT.useState)(e);return(0,lT.useEffect)(()=>{r!==e&&a(e)},[e]),(0,lT.useEffect)(()=>{let e,t=xZ(r);return t&&(n(t.getState()),e=t.subscribe(n)),()=>{t&&e?.()}},[r]),t}(e.currentWorkspaceGroup);(0,lT.useEffect)(()=>{let t=!0;return e.load().then(e=>{t&&r(e)}),()=>{t=!1}},[e]);let o=(0,lT.useMemo)(()=>e&&{closeWorkspace:e.closeWorkspace,closeWorkspaceWithSavedChanges:e.closeWorkspaceWithSavedChanges,promptBeforeClosing:e.promptBeforeClosing,setTitle:e.setTitle,...t,...a,...e.additionalProps},[e,t,a]);return n?(0,c$.jsx)(Da,{config:n,mountParcel:lP,...o},e.name):(0,c$.jsx)(cL.InlineLoading,{className:"-esm-stock-management__workspace-module__loader___v7QFg",description:`${a3("loading","Loading")} ...`})}function Di({isWithinWorkspace:e,name:t,actionMenuProps:n={}}){let[r,a]=(0,lT.useState)(!1),o=(0,lT.useRef)(window.innerHeight),{featureName:i}=(0,lT.useContext)(lO),s=u4();(0,lT.useEffect)(()=>{let e=()=>{a(!u2(s)&&o.current>window.innerHeight),o.current!=window.innerHeight&&(o.current=window.innerHeight)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o]);let l=`action-menu-${t&&"default"!=t?t:i}-items-slot`;return(0,c$.jsx)("aside",{className:cN()("-esm-stock-management__action-menu-module__sideRail___Aa96v",{"-esm-stock-management__action-menu-module__withinWorkspace___2bJET":e,"-esm-stock-management__action-menu-module__sideRailHidden___Yb0w9":r,"-esm-stock-management__action-menu-module__sideRailVisible___XIAk7":!r}),children:(0,c$.jsx)("div",{className:"-esm-stock-management__action-menu-module__container___mzfAh",children:(0,c$.jsx)(lZ,{className:"-esm-stock-management__action-menu-module__chartExtensions___DiJtm",name:l,state:n})})})}function Ds({contextKey:e,overlay:t,showSiderailAndBottomNav:n,additionalWorkspaceProps:r,actionMenuProps:a}){let o=u4(),{workspaces:i,workspaceWindowState:s,workspaceGroup:l}=xH(),u=l?.name,c=i[0],d="hidden"===s||null==c,m=c?.width??(t?"wider":"narrow"),p=(0,lT.useMemo)(()=>n||u&&!d,[u,d,n]);return uS(!d&&!u2(o)),(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsxs)("div",{className:n?"-esm-stock-management__workspace-module__workspaceContainerWithActionMenu___6x1qS":"-esm-stock-management__workspace-module__workspaceContainerWithoutActionMenu___TJHnt",children:[(0,c$.jsx)("aside",{className:cN()(t?"-esm-stock-management__workspace-module__workspaceOverlayOuterContainer___4y++2":"-esm-stock-management__workspace-module__workspaceWindowSpacer___6kF9R",{"-esm-stock-management__workspace-module__hiddenRelative___qqT-4":d,"-esm-stock-management__workspace-module__narrowWorkspace___MMI1u":"narrow"===m,"-esm-stock-management__workspace-module__widerWorkspace___be-UT":"wider"===m,"-esm-stock-management__workspace-module__extraWideWorkspace___JmWmj":"extra-wide"===m}),children:(0,c$.jsx)("div",{className:cN()("-esm-stock-management__workspace-module__workspaceFixedContainer___TfJP7",{"-esm-stock-management__workspace-module__maximizedWindow___71jv4":"maximized"===s,"-esm-stock-management__workspace-module__hiddenFixed___48wS9":d}),children:i.map((e,t)=>(0,c$.jsx)("div",{className:cN()("-esm-stock-management__workspace-module__workspaceInnerContainer___h3oyO",{"-esm-stock-management__workspace-module__hiddenExtraWorkspace___AP+Vj":0!==t}),children:(0,c$.jsx)(lT.Suspense,{fallback:null,children:(0,c$.jsx)(l7.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName,children:(0,c$.jsx)(Dl,{workspaceInstance:e,additionalWorkspaceProps:r})})})},`workspace-container-${e?e.name:`empty-${t}`}`))})}),(0,c$.jsx)(x5,{contextKey:e})]}),p&&(0,c$.jsx)(Di,{name:u,isWithinWorkspace:!n,actionMenuProps:a})]})}function Dl({workspaceInstance:e,additionalWorkspaceProps:t}){let{t:n}=(0,l7.useTranslation)(),r=u4(),{workspaceWindowState:a,workspaceGroup:o}=xH(),i=o?.name,s="maximized"===a;(0,lT.useEffect)(()=>{let t=n(e.title);t!==e.title&&e.setTitle(t)},[e.title,n,e.setTitle]);let{featureName:l}=(0,lT.useContext)(lO),u=(0,lT.useCallback)(()=>{xV(s?"normal":"maximized")},[s]),{canHide:c=!1,canMaximize:d=!1,currentWorkspaceGroup:m="",closeWorkspace:p}=(0,lT.useMemo)(()=>e??{},[e]),f=(0,lT.useMemo)(()=>({...t,...e?.additionalProps}),[t,e]);return e&&(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsxs)(cL.Header,{"aria-label":a3("workspaceHeader","Workspace Header"),className:"-esm-stock-management__workspace-module__header___nACZO",children:[!u2(r)&&!c&&(0,c$.jsx)(cL.HeaderMenuButton,{"aria-label":a3("close","Close"),renderMenuIcon:(0,c$.jsx)(c0,{}),onClick:()=>p()}),(0,c$.jsx)(cL.HeaderName,{prefix:"",children:e.titleNode??n(e.title)}),(0,c$.jsx)("div",{className:"-esm-stock-management__workspace-module__overlayHeaderSpacer___HBnr+"}),(0,c$.jsxs)(cL.HeaderGlobalBar,{className:"-esm-stock-management__workspace-module__headerButtons___heP0Q",children:[(0,c$.jsx)(lZ,{name:`workspace-header-group-${e.currentWorkspaceGroup}-slot`,state:f}),(0,c$.jsx)(lZ,{name:`workspace-header-type-${e.type}-slot`,state:f}),(0,c$.jsx)(lZ,{name:`workspace-header-${l}-slot`,state:f}),u2(r)&&(0,c$.jsxs)(c$.Fragment,{children:[(d||s)&&(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":s?a3("minimize","Minimize"):a3("maximize","Maximize"),onClick:u,children:s?(0,c$.jsx)(x0.Xj,{}):(0,c$.jsx)(x0.hz,{})}),c&&!i?(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":a3("hide","Hide"),onClick:()=>xV("hidden"),children:(0,c$.jsx)(c1,{})}):(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":a3("close","Close"),onClick:()=>p?.(),children:(0,c$.jsx)(dc,{})})]}),"tablet"===r&&c&&(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":a3("close","Close"),onClick:()=>p?.(),children:(0,c$.jsx)(x1.d3,{})})]})]}),(0,c$.jsx)("div",{className:cN()("-esm-stock-management__workspace-module__workspaceContent___oYdxI",{"-esm-stock-management__workspace-module__marginWorkspaceContent___7hwHu":!!m}),children:(0,c$.jsx)(Do,{workspace:e,additionalPropsFromPage:t},e.name)})]})}let Du="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Dc=new Uint8Array(16),Dd=[];for(let e=0;e<256;++e)Dd.push((e+256).toString(16).slice(1));let Dm=function(e,t,n){if(Du&&!t&&!e)return Du();let r=(e=e||{}).random??e.rng?.()??function(){if(!c){if("u"<typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");c=crypto.getRandomValues.bind(crypto)}return c(Dc)}();if(r.length<16)throw Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(Dd[e[t+0]]+Dd[e[t+1]]+Dd[e[t+2]]+Dd[e[t+3]]+"-"+Dd[e[t+4]]+Dd[e[t+5]]+"-"+Dd[e[t+6]]+Dd[e[t+7]]+"-"+Dd[e[t+8]]+Dd[e[t+9]]+"-"+Dd[e[t+10]]+Dd[e[t+11]]+Dd[e[t+12]]+Dd[e[t+13]]+Dd[e[t+14]]+Dd[e[t+15]]).toLowerCase()}(r)};async function Dp(e,t){let{openedGroup:n}=lh.getState();if(n){if(n.groupName===e&&Dg(n.props,t))return!0;else if(!await Dy({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return lh.setState(n=>({...n,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function Df(e){let{openedGroup:t,openedWindows:n}=lh.getState();if(t){if(n.length>0&&!(e||await Dy({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;lh.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function Dh(e,t=null,n=null,r=null){let a=lh.getState();if(!a.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let o=lg(e);if(!o)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:i}=a,{name:s}=o,l=ly(s);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${o.name} is not registered to a workspace group`);let u=lv(e);if(i&&(i.groupName!==l.name||!Dg(i.props,r)))return!!await Dy({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(lh.setState({...a,openedGroup:{groupName:l.name,props:r},openedWindows:[{windowName:s,openedWorkspaces:[Dx(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(u>=0){let r=a.openedWindows[u],o=a.openedGroup?.props??{},i=a.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:c}=r;if(Dg(r.props,n)){let d=c.find(t=>t.workspaceName===e);return d&&Dg(d.props,t)?((i||u!==a.openedWindows.length-1)&&lh.setState(Dv.restoreWindow(a,s)),!0):!!await Dy({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})&&(lh.setState({...a,openedGroup:{groupName:l.name,props:a?.openedGroup?.props??o},openedWindows:[...a.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[Dx(e,t)],props:r?.props??n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await Dy({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})&&(lh.setState({...a,openedGroup:{groupName:l.name,props:o??a?.openedGroup?.props},openedWindows:[...a.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[Dx(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(lh.setState({...a,openedGroup:{groupName:l.name,props:r??a?.openedGroup?.props??null},openedWindows:[...a.openedWindows,{windowName:s,openedWorkspaces:[Dx(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await Dy({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:o.name})&&(lh.setState({...a,openedGroup:{groupName:l.name,props:r??a?.openedGroup?.props??null},openedWindows:[{windowName:s,openedWorkspaces:[Dx(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function Dg(e,t){return null==e||null==t||R(e,t)}function Dy(e){function t(e,t){let n=[];for(let r=e.openedWorkspaces.length-1;r>=0;r--){let a=e.openedWorkspaces[r];if(a.hasUnsavedChanges&&n.push(a),t&&a.workspaceName===t)break}return n}let{openedWindows:n,workspaceTitleByWorkspaceName:r}=lh.getState(),a=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":a=n.flatMap(e=>t(e));break;case"CLOSE_WINDOW":{let r=n.find(t=>t.windowName===e.windowName);if(!r)throw Error(`Window ${e.windowName} not found in opened windows.`);a=t(r);break}case"CLOSE_WORKSPACE":{let r=n.find(t=>t.windowName===e.windowName);if(!r)throw Error(`Window ${e.windowName} not found in opened windows.`);a=t(r,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":a=n.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>t(e))}return 0===a.length?Promise.resolve(!0):new Promise(e=>{let t=w9("workspace2-close-prompt",{size:"sm",onConfirm:()=>{t(),e(!0)},onCancel:()=>{t(),e(!1)},affectedWorkspaceTitles:a.map(e=>r[e.workspaceName])})})}let Dv={setWindowMaximized(e,t,n){let r=e.openedWindows.findIndex(e=>e.windowName===t),a=[...e.openedWindows],o={...a[r],maximized:n};return a[r]=o,{...e,openedWindows:a}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let n=e.openedWindows.findIndex(e=>e.windowName===t),r=e.openedWindows[n],a=[...e.openedWindows.filter((e,t)=>t!==n),r];return{...e,openedWindows:a,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let n=lv(t);if(n<0)return e;let r={...e.openedWindows[n]},a=r.openedWorkspaces.findIndex(e=>e.workspaceName===t),o=[...e.openedWindows];r.openedWorkspaces=r.openedWorkspaces.slice(0,a);let i=e.isMostRecentlyOpenedWindowHidden;if(0===r.openedWorkspaces.length){let t=n===e.openedWindows.length-1;o.splice(n,1),t&&o.length>0&&(i=!1)}else o[n]=r;return{...e,openedWindows:o,isMostRecentlyOpenedWindowHidden:i}},openChildWorkspace(e,t,n,r){let a=e.registeredWorkspacesByName[n];if(!a)throw Error(`No workspace named "${n}" registered`);let o=e.registeredWorkspacesByName[t];if(!o)throw Error(`No workspace named "${t}" registered`);if(o.window!==a.window)throw Error(`Child workspace ${n} does not belong to the same workspace window as parent workspace ${t}`);let i=e.openedWindows.findIndex(e=>e.windowName===a.window);if(-1==i)throw Error(`Cannot open child workspace ${n} as window ${a.window} is not opened`);let{openedWorkspaces:s}=e.openedWindows[i],l=s.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${n} from parent workspace ${t} as the parent is not opened within the workspace window`);let u=s.slice(0,l+1);return{openedWindows:e.openedWindows.map((e,t)=>t==i?{...e,openedWorkspaces:[...u,Dx(n,r)]}:e)}},setHasUnsavedChanges(e,t,n){let r=lv(t);if(r<0)return e;let a={...e.openedWindows[r]},o=a.openedWorkspaces.findIndex(e=>e.workspaceName===t);if(o<0)return e;a.openedWorkspaces[o]={...a.openedWorkspaces[o],hasUnsavedChanges:n};let i=[...e.openedWindows];return i[r]=a,{...e,openedWindows:i}},setWorkspaceTitle(e,t,n){let r={...e.workspaceTitleByWorkspaceName};return null===n?delete r[t]:r[t]=n,{...e,workspaceTitleByWorkspaceName:r}}};function Db(){return lF(lh,Dv)}let Dw=()=>(0,lT.useContext)(l1),DE=()=>Object.keys(lh.getState().registeredWorkspacesByName);function Dx(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:Dm()}}let DD={workspaceOuterContainer:"-esm-stock-management__workspace2-module__workspaceOuterContainer___DLiCR",narrowWorkspace:"-esm-stock-management__workspace2-module__narrowWorkspace___VL0kF",widerWorkspace:"-esm-stock-management__workspace2-module__widerWorkspace___3QgrA",extraWideWorkspace:"-esm-stock-management__workspace2-module__extraWideWorkspace___s7nnh",workspaceMiddleContainer:"-esm-stock-management__workspace2-module__workspaceMiddleContainer___mTGNN",maximized:"-esm-stock-management__workspace2-module__maximized___-yo9l",hidden:"-esm-stock-management__workspace2-module__hidden___K2ryM",workspaceInnerContainer:"-esm-stock-management__workspace2-module__workspaceInnerContainer___o3zVl",workspaceSpacer:"-esm-stock-management__workspace2-module__workspaceSpacer___N6-ox",loader:"-esm-stock-management__workspace2-module__loader___29hpw",hiddenExtraWorkspace:"-esm-stock-management__workspace2-module__hiddenExtraWorkspace___-W7TY",header:"-esm-stock-management__workspace2-module__header___p0kuD",headerButtons:"-esm-stock-management__workspace2-module__headerButtons___hMydG",workspaceContent:"-esm-stock-management__workspace2-module__workspaceContent___uROr7",overlayHeaderSpacer:"-esm-stock-management__workspace2-module__overlayHeaderSpacer___zdrhx",isActionMenuOpened:"-esm-stock-management__workspace2-module__isActionMenuOpened___Wc1Il",showActionMenu:"-esm-stock-management__workspace2-module__showActionMenu___qCVQ-",marginWorkspaceContent:"-esm-stock-management__workspace2-module__marginWorkspaceContent___A+20C",workspaceContainerWithActionMenu:"-esm-stock-management__workspace2-module__workspaceContainerWithActionMenu___S98dq",workspaceFixedContainer:"-esm-stock-management__workspace2-module__workspaceFixedContainer___c9Uny",workspaceContainerWithoutActionMenu:"-esm-stock-management__workspace2-module__workspaceContainerWithoutActionMenu___u8FbT"},D_=({title:e,children:t,hasUnsavedChanges:n=!1})=>{let r=u4(),{setWindowMaximized:a,hideWindow:o,setHasUnsavedChanges:i,openedWindows:s,openedGroup:l,registeredGroupsByName:u,registeredWindowsByName:c,registeredWorkspacesByName:d,workspaceTitleByWorkspaceName:m,setWorkspaceTitle:p,isMostRecentlyOpenedWindowHidden:f}=Db(),{workspaceName:h,isRootWorkspace:g,closeWorkspace:y,showActionMenu:v}=Dw(),b=lv(h),w=s[b],E=w?.openedWorkspaces.find(e=>e.workspaceName===h);if((0,lT.useEffect)(()=>{E?.hasUnsavedChanges!=n&&i(h,n??!1)},[E?.hasUnsavedChanges,n,h,i]),(0,lT.useEffect)(()=>{m[h]!==e&&p(h,e)},[m,h,e,p]),b<0||null==l||null==E)return null;let x=u[l.groupName];if(!x)throw Error(`Cannot find registered workspace group ${l.groupName}`);let D=d[h].window,_=c[D];if(!_)throw Error(`Cannot find registered workspace window ${D}`);let{icon:k,canMaximize:S}=_,C="closable"===x.persistence,P=!!k&&!C,{maximized:R}=w,T=_?.width??"narrow",$=Object.values(c).some(e=>e.group===l.groupName&&void 0!==e.icon),O=b<s.length-1||f;return(0,c$.jsxs)("div",{className:cN()(DD.workspaceOuterContainer,{[DD.narrowWorkspace]:"narrow"===T,[DD.widerWorkspace]:"wider"===T,[DD.extraWideWorkspace]:"extra-wide"===T,[DD.isActionMenuOpened]:$}),children:[(0,c$.jsx)("div",{className:cN()(DD.workspaceSpacer,{[DD.hidden]:O})}),(0,c$.jsx)("div",{className:cN()(DD.workspaceMiddleContainer,{[DD.maximized]:R,[DD.hidden]:O,[DD.isRootWorkspace]:g,[DD.showActionMenu]:v}),children:(0,c$.jsxs)("div",{className:cN()(DD.workspaceInnerContainer,{[DD.maximized]:R,[DD.hidden]:O,[DD.isRootWorkspace]:g}),children:[(0,c$.jsxs)(cL.Header,{"aria-label":a3("workspaceHeader"),className:DD.header,children:[(0,c$.jsx)(cL.HeaderName,{prefix:"",children:e}),(0,c$.jsx)("div",{className:DD.overlayHeaderSpacer}),(0,c$.jsx)(cL.HeaderGlobalBar,{className:DD.headerButtons,children:u2(r)?(0,c$.jsxs)(c$.Fragment,{children:[(S||R)&&(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":R?a3("minimize"):a3("maximize"),onClick:()=>a(D,!R),children:R?(0,c$.jsx)(x0.Xj,{}):(0,c$.jsx)(x0.hz,{})}),P&&(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":a3("hide"),onClick:()=>o(),children:(0,c$.jsx)(c1,{})}),!C&&(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":a3("close"),onClick:()=>y({closeWindow:!0}),children:(0,c$.jsx)(dc,{})})]}):(0,c$.jsxs)(c$.Fragment,{children:[P&&(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":a3("hide"),onClick:()=>o(),children:(0,c$.jsx)(x1.d3,{})}),(0,c$.jsx)(cL.HeaderGlobalAction,{"aria-label":a3("close"),onClick:()=>{C?Df():y({closeWindow:!0})},children:(0,c$.jsx)(dc,{})})]})})]}),(0,c$.jsx)("div",{className:cN()(DD.workspaceContent),children:t})]})})]})},Dk="-esm-stock-management__action-menu-button2-module__container___gYRoa",DS="-esm-stock-management__action-menu-button2-module__elementContainer___vBViO",DC="-esm-stock-management__action-menu-button2-module__active___uRJRA",DP="-esm-stock-management__action-menu-button2-module__focused___D4VYB";function DR({getIcon:e,hasUnsavedChanges:t,tagContent:n}){return(0,c$.jsxs)(c$.Fragment,{children:[e({size:16}),t?(0,c$.jsx)("span",{className:"-esm-stock-management__action-menu-button2-module__interruptedTag___35fO7",children:"!"}):(0,c$.jsx)("span",{className:"-esm-stock-management__action-menu-button2-module__countTag___l8lfc",children:n})]})}let DT=({icon:e,label:t,tagContent:n,workspaceToLaunch:r,onBeforeWorkspaceLaunch:a})=>{let o=u4(),{openedWindows:i,restoreWindow:s,hideWindow:l,isMostRecentlyOpenedWindowHidden:u}=Db(),{extension:c}=(0,lT.useContext)(lO),d=i.findIndex(e=>e.windowName===c?.extensionId),m=i[d],p=null!=m,f=p&&(d<i.length-1||u),h=p&&!f,g=m?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,y=async()=>{if(p)f?s(m.windowName):l();else if(await (a?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:n}=r;Dh(e,t,n)}};return"tablet"===o||"phone"===o?(0,c$.jsxs)(cL.Button,{className:cN()(Dk,{[DC]:p&&!h,[DP]:h}),iconDescription:t,kind:"ghost",onClick:y,role:"button",tabIndex:0,size:"md",children:[(0,c$.jsx)("span",{className:DS,children:(0,c$.jsx)(DR,{hasUnsavedChanges:g,getIcon:e,tagContent:n})}),(0,c$.jsx)("span",{children:t})]}):(0,c$.jsx)(cL.IconButton,{align:"left","aria-label":t,className:cN()(Dk,{[DC]:p&&!h,[DP]:h}),enterDelayMs:300,kind:"ghost",label:t,onClick:y,size:"md",children:(0,c$.jsx)("div",{className:DS,children:(0,c$.jsx)(DR,{hasUnsavedChanges:g,getIcon:e,tagContent:n})})})};function D$({showContactDetails:e,toggleContactDetails:t,className:n}){return(0,c$.jsx)(cL.Button,{className:n,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?du:di,children:e?a3("showLess","Show less"):a3("showMore","Show more")})}let DO={contactDetails:"-esm-stock-management__patient-banner-contact-details-module__contactDetails___AvROu",deceased:"-esm-stock-management__patient-banner-contact-details-module__deceased___DDd39",heading:"-esm-stock-management__patient-banner-contact-details-module__heading___GGJyV",row:"-esm-stock-management__patient-banner-contact-details-module__row___8JcKK",col:"-esm-stock-management__patient-banner-contact-details-module__col___ct1O9",relationship:"-esm-stock-management__patient-banner-contact-details-module__relationship___GTTsg"},DN=({patientUuid:e})=>{let{cohorts:t=[],isLoading:n}=function(e){let t=e?`${os}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:n,isLoading:r}=ut()(t,od),a=n?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,lT.useMemo)(()=>({cohorts:a,isLoading:r}),[r,a])}(e);return(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsxs)("p",{className:DO.heading,children:[a3("patientLists","Patient Lists")," (",t?.length??0,")"]}),n?(0,c$.jsx)(cL.InlineLoading,{description:`${a3("loading","Loading")} ...`,role:"progressbar"}):(0,c$.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>bJ(e?.startDate).getTime()-bJ(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,c$.jsx)("li",{children:(0,c$.jsx)(lN,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,c$.jsx)("li",{children:"--"})})(),t.length>3&&(0,c$.jsx)("li",{className:DO.link,children:(0,c$.jsx)(lN,{to:`${window.spaBase}/home/patient-lists`,children:a3("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},DA=({patientId:e})=>{let{patient:t,isLoading:n}=ca(e),r=t?.address?.find(e=>"home"===e.use),a=e=>e.split("#")[1];return n?(0,c$.jsx)(cL.InlineLoading,{description:`${a3("loading","Loading")} ...`,role:"progressbar"}):(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsx)("p",{className:DO.heading,children:a3("address","Address")}),(0,c$.jsx)("ul",{children:r?Object.entries(r).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?r.extension?.[0]?.extension?.map((t,n)=>(0,c$.jsxs)("li",{children:[a3(a(t.url),a(t.url)),": ",t.valueString]},`address-${e}-${n}`)):(0,c$.jsxs)("li",{children:[a3(e,e),": ",t]},`address-${e}`)):(0,c$.jsx)("li",{children:"--"})})]})},DI=({patientUuid:e})=>{let{isLoading:t,contactAttributes:n}=(e=>{let{contactAttributeTypes:t=[]}=uR({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:n,error:r,isLoading:a}=(e=>{let{data:t,error:n,isLoading:r}=uN()(`${os}/patient/${e}?v=custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))`,od);return{isLoading:r,attributes:t?.data.person.attributes??[],error:n}})(e);return{contactAttributes:(0,lT.useMemo)(()=>n.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[n,t]),isLoading:a,error:r}})(e),r=(0,lT.useMemo)(()=>n?[...n?.map(e=>[e.attributeType.display?a3(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[n]);return(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsx)("p",{className:DO.heading,children:a3("contactDetails","Contact Details")}),t?(0,c$.jsx)(cL.InlineLoading,{description:`${a3("loading","Loading")} ...`,role:"progressbar"}):(0,c$.jsx)("ul",{children:r.length?r.map(([e,t],n)=>(0,c$.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${n}`)):(0,c$.jsx)("li",{children:"--"})})]})},Dj=({patientId:e})=>{let{data:t,isLoading:n}=function(e){let t=`${os}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:n,error:r,isLoading:a,isValidating:o}=ut()(e?t:null,od),i=n?.data?.results?.length?function(e,t){let n=[];for(let r of t)e===r.personA.uuid?n.push({uuid:`${r.uuid}`,display:r.personB.display,relativeAge:r.personB.age,relativeUuid:r.personB.uuid,relationshipType:r.relationshipType.bIsToA}):n.push({uuid:`${r.uuid}`,display:r.personA.display,relativeAge:r.personA.age,relativeUuid:r.personA.uuid,relationshipType:r.relationshipType.aIsToB});return n}(e,n.data.results):null;return{data:n?i:null,error:r,isLoading:a,isValidating:o}}(e);return(0,c$.jsxs)(c$.Fragment,{children:[(0,c$.jsx)("p",{className:DO.heading,children:a3("relationships","Relationships")}),n?(0,c$.jsx)(cL.InlineLoading,{description:`${a3("loading","Loading")} ...`,role:"progressbar"}):(0,c$.jsx)("ul",{children:t&&t.length>0?(0,c$.jsx)(c$.Fragment,{children:t.map(e=>(0,c$.jsxs)("li",{className:DO.relationship,children:[(0,c$.jsx)("div",{children:(0,c$.jsx)(lN,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,c$.jsx)("div",{children:e.relationshipType}),(0,c$.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?a3("yearAbbreviation","yr"):a3("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,c$.jsx)("li",{children:"--"})})]})};function DM({patientId:e,deceased:t}){return(0,c$.jsxs)("div",{className:cN()(DO.contactDetails,{[DO.deceased]:t}),children:[(0,c$.jsxs)("div",{className:DO.row,children:[(0,c$.jsx)("div",{className:DO.col,children:(0,c$.jsx)(DA,{patientId:e})}),(0,c$.jsx)("div",{className:DO.col,children:(0,c$.jsx)(DI,{patientUuid:e})})]}),(0,c$.jsxs)("div",{className:DO.row,children:[(0,c$.jsx)("div",{className:DO.col,children:(0,c$.jsx)(Dj,{patientId:e})}),(0,c$.jsx)("div",{className:DO.col,children:(0,c$.jsx)(DN,{patientUuid:e})})]})]})}function DL(e){let t=document.querySelector("template#loading-spinner");if(t){let n=t.content.cloneNode(!0),r=Array.prototype.map.call(n.childNodes,e=>e);return e.appendChild(n),()=>r.forEach(e=>e.remove())}return()=>{}}let DF="-esm-stock-management__action-menu2-module__container___4aX3S";function DB({workspaceGroup:e,groupProps:t}){let n=u4(),{persistence:r}=e;return(0,c$.jsx)("aside",{className:"-esm-stock-management__action-menu2-module__sideRail___a7qg9",children:(0,c$.jsxs)("div",{className:DF,children:["closable"==r&&u2(n)&&(0,c$.jsx)(cL.IconButton,{align:"left",onClick:()=>Df(),label:a3("close"),kind:"ghost",children:(0,c$.jsx)(dc,{})}),(0,c$.jsx)(lO.Provider,{value:{moduleName:e.moduleName,featureName:e.name},children:(0,c$.jsx)(lZ,{className:DF,name:e.name,state:{groupProps:t}})})]})})}function DV(e){let t=new URL(e,window.location.origin).pathname,n=new URL(window.getOpenmrsSpaBase?.()??"/",window.location.origin).pathname,r=n.endsWith("/")?n.slice(0,-1):n,a=null;return r?r===t?a="/":t.startsWith(`${r}/`)&&(a=t.slice(r.length)):a=t,{full:t,spaRelative:a}}let DU=({lifeCycle:e,openedWorkspace:t,openedWindow:n,isRootWorkspace:r,isLeafWorkspace:a,showActionMenu:o})=>{let{openedGroup:i,closeWorkspace:s,openChildWorkspace:l}=Db(),u=(0,lT.useMemo)(()=>t&&{closeWorkspace:async(e={})=>{let{closeWindow:r=!1,discardUnsavedChanges:a=!1}=e;return r?!!(a||await Dy({reason:"CLOSE_WINDOW",explicit:!0,windowName:n.windowName}))&&(s(n.openedWorkspaces[0].workspaceName),!0):!!(a||await Dy({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:n.windowName,workspaceName:t.workspaceName}))&&(s(t.workspaceName),!0)},launchChildWorkspace:async(e,r)=>{let a=t.workspaceName,{openedWorkspaces:o}=n,i=o.findIndex(e=>e.workspaceName===a);-1===i||i!==o.length-1&&o.slice(i+1).some(e=>e.hasUnsavedChanges)&&!await Dy({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:n.windowName,workspaceName:o[i+1].workspaceName})||l(a,e,r||{})},workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:n.props,groupProps:i&&i.props?i.props:null,workspaceMeta:lh.getState().registeredWorkspacesByName[t.workspaceName]?.meta??{},isRootWorkspace:r,isLeafWorkspace:a,windowName:n.windowName,showActionMenu:o},[t,s,i,n]);if(!e){let{registeredWorkspacesByName:e}=lh.getState(),n=e[t.workspaceName],a=n&&n.window?n.window:void 0,{registeredWindowsByName:s}=lh.getState(),l=a?s[a]:void 0,u=l&&l.width?l.width:"narrow",c=Object.values(s).some(e=>e.group===i?.groupName&&void 0!==e.icon);return(0,c$.jsxs)("div",{className:cN()(DD.workspaceOuterContainer,{[DD.narrowWorkspace]:"narrow"===u,[DD.widerWorkspace]:"wider"===u,[DD.extraWideWorkspace]:"extra-wide"===u,[DD.isActionMenuOpened]:c}),children:[(0,c$.jsx)("div",{className:DD.workspaceSpacer}),(0,c$.jsx)("div",{className:cN()(DD.workspaceMiddleContainer,{[DD.isRootWorkspace]:r,[DD.showActionMenu]:o}),children:(0,c$.jsx)("div",{className:cN()(DD.workspaceInnerContainer,{[DD.isRootWorkspace]:r}),children:(0,c$.jsx)(cL.InlineLoading,{className:DD.loader,description:`${a3("loading")} ...`})})})]})}return(0,c$.jsx)(Da,{config:e,mountParcel:lP,...u},t.workspaceName)},DW=({openedWindow:e,showActionMenu:t})=>{let{openedWorkspaces:n}=e,[r,a]=(0,lT.useState)({}),{registeredWorkspacesByName:o}=lh.getState();return(0,lT.useEffect)(()=>{let e=!1;return Promise.all(n.map(async e=>{let{moduleName:t,component:n}=o[e.workspaceName];return[e.uuid,await cw(t,n)]})).then(t=>{e||a(Object.fromEntries(t))}),()=>{e=!0}},[n]),(0,c$.jsx)(c$.Fragment,{children:n.map((a,o)=>(0,c$.jsx)(DU,{openedWorkspace:a,openedWindow:e,lifeCycle:r[a.uuid],isRootWorkspace:0===o,isLeafWorkspace:o===n.length-1,showActionMenu:t},a.uuid))})};function DH(e){e&&(0,lY.createRoot)(e).render((0,c$.jsx)(Dz,{}))}function Dz(){let{openedGroup:e,openedWindows:t,registeredGroupsByName:n,registeredWindowsByName:r}=Db();if((0,lT.useEffect)(()=>iR("before-page-changed",t=>{let{newPage:r,cancelNavigation:a,oldUrl:o,newUrl:i}=t;if(!e)return;if(r)return void a(Df().then(e=>!e));let s=n[e.groupName],l=s?.scopePattern;l&&function(e,t,n){try{let r=new RegExp(e),a=DV(t),o=DV(n);if(null===a.spaRelative||null===o.spaRelative)return!0;let i=r.exec(a.spaRelative),s=r.exec(o.spaRelative);if(i&&s||(i=r.exec(a.full),s=r.exec(o.full)),!i||!s)return!0;if(i.length>1)return!i.slice(1).every((e,t)=>e===s[t+1]);return!1}catch{return!0}}(l,o,i)&&a(Df().then(e=>!e))}),[e,n]),!e)return null;let a=n[e.groupName],o=t.some(e=>e.maximized),{name:i}=a,s=Object.values(r).filter(e=>e.group===i&&void 0!==e.icon).sort((e,t)=>(e.order??Number.MAX_VALUE)-(t.order??Number.MAX_VALUE)).length>0;return(0,c$.jsxs)("div",{className:cN()("-esm-stock-management__workspace-windows-and-menu-module__workspaceWindowsAndMenuContainer___crgqC",{"-esm-stock-management__workspace-windows-and-menu-module__overlay___FCMKG":a.overlay,"-esm-stock-management__workspace-windows-and-menu-module__hasMaximizedWindow___gk319":o}),children:[(0,c$.jsx)("div",{className:"-esm-stock-management__workspace-windows-and-menu-module__workspaceWindowsContainer___MrLlf",children:t.map(e=>(0,c$.jsx)(DW,{openedWindow:e,showActionMenu:s},e.windowName))}),s&&(0,c$.jsx)(DB,{workspaceGroup:a,groupProps:e.props})]})}function DK(e,t,n){if(null==e)return n;let r=bm(e);if(!r)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),n;let a=[];for(let e of t){let t=bm(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}a.push({canonical:t,original:e})}let o=r;for(;o;){let e=a.find(e=>e.canonical===o);if(e)return e.original;let t=o+"-",n=a.find(e=>e.canonical.startsWith(t));if(n)return n.original;if("ht"===o){o="fr-HT";continue}let r=o.lastIndexOf("-");if(-1===r)break;let i=(o=o.slice(0,r)).lastIndexOf("-");-1!==i&&o.length-i==2&&(o=o.slice(0,i))}return n}function DG(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function DZ(e){return!!e&&e.constructor===Object}var DY=n(7638);function Dq(e){let[t,n,r]=e.split(".");return`${t}.${n}.${r}`}function DJ(e,t){return DY(function(e){let t=e.indexOf("-");if(t>=0){let n=Dq(e.slice(0,t)),r=e.slice(t+1);return`${n}-${r}`}return Dq(e)}(t),e,{includePrerelease:!0})}async function DX(e,t={}){let n,{shouldRetry:r,getDelay:a,onError:o}=t;r=r??(e=>e<=5),a=a??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let i=0;do try{return await DQ(a(i)),await e()}catch(e){o?.(e,i),n=e}while(r(i++));throw n}async function DQ(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}function D0(e,t,n,r){}function D1(e){}function D4(e){return Promise.resolve([])}function D2(e){return Promise.resolve([])}function D3(e){return Promise.resolve({success:!1,result:void 0,error:"No service worker has been registered. Offline-related features have been removed from the framework."})}function D6(e){return()=>{}}function D5(){return!0}}}]);
|
|
30
|
+
To fix this, ensure that you define the "name" field inside the feature flag definition.`,t);else console.warn(`A feature flag for ${e} could not be registered as it does not appear to have the required properties`,t)})}})(e,t))}function cC(){ck.sort((e,t)=>e.appName.localeCompare(t.appName,"en"));let e=new Map;for(let t of ck){e.has(t.appName)?e.set(t.appName,e.get(t.appName)+1):e.set(t.appName,0);let n=e.get(t.appName),r=`${t.appName}-page-${n}`,a=t.containerDomId??"omrs-apps-container",o=document.getElementById(a),i=`single-spa-application:${r}`;if(o){let e=document.createElement("div");e.id=i,o?.appendChild(e)}else throw Error(`${t.appName} ${t.component} cannot be mounted to "${a}"; DOM element does not exist.`);!function(e,t){let n=void 0!==t.route?t.route:void 0!==t.routeRegex&&new RegExp(t.routeRegex);!1===n?console.warn(`A registered page definition is missing a route and thus cannot be registered.
|
|
31
|
+
To fix this, ensure that you define the "route" (or alternatively the "routeRegex") field inside the extension definition.`,e):t.component?r7(e,()=>cE(t.appName,t.component),function(e,{featureFlag:t}){return t?n=>!!sv(t)&&e(n):e}(function e(t){if(Array.isArray(t)){let n=t.map(e);return e=>n.some(t=>t(e))}return"string"==typeof t?ao(window.getOpenmrsSpaBase()+t):t instanceof RegExp?e=>t.test(e.pathname.replace(window.getOpenmrsSpaBase(),"")):()=>t}(n),t)):console.warn(`A registered page definition is missing a component and thus cannot be registered.
|
|
32
|
+
To fix this, ensure that you define the "component" field inside the page definition.`,e)}(r,t)}}let cP={PHONE_MIN:0,PHONE_MAX:600,TABLET_MIN:601,TABLET_MAX:1023,SMALL_DESKTOP_MIN:1024,SMALL_DESKTOP_MAX:1439,LARGE_DESKTOP_MIN:1440,LARGE_DESKTOP_MAX:Number.MAX_SAFE_INTEGER};function cR(){document.body.classList.toggle("omrs-breakpoint-lt-tablet",window.innerWidth<cP.TABLET_MIN),document.body.classList.toggle("omrs-breakpoint-gt-phone",window.innerWidth>cP.PHONE_MAX),document.body.classList.toggle("omrs-breakpoint-gt-tablet",window.innerWidth>cP.TABLET_MAX),document.body.classList.toggle("omrs-breakpoint-lt-desktop",window.innerWidth<cP.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-small-desktop",window.innerWidth<cP.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-large-desktop",window.innerWidth<cP.LARGE_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-gt-small-desktop",window.innerWidth>cP.SMALL_DESKTOP_MAX)}let cT=!1;function c$(){cT||(window.addEventListener("resize",cR),cR(),cT=!0)}var cO=n(4848),cN=n(6942),cA=n.n(cN);function cI({title:e,children:t}){let n="tablet"===u2();return(0,cO.jsxs)("div",{className:cA()({"-esm-stock-management__card-header-module__tabletHeader___rUYi0":n,"-esm-stock-management__card-header-module__desktopHeader___CDa37":!n}),children:[(0,cO.jsx)("h4",{children:e}),t]})}let cj=["red","magenta","purple","blue","teal","cyan","gray","green","warm-gray","cool-gray","high-contrast","outline"],cM={primaryColor:{_type:tL.String,_description:"The color for displaying primary diagnoses tags",_default:"red",_validators:[nH.oneOf(cj)]},secondaryColor:{_type:tL.String,_description:"The color for displaying secondary diagnoses tags",_default:"blue",_validators:[nH.oneOf(cj)]}},cL={"Brand color #1":{_default:"#005d5d",_type:tL.String},"Brand color #2":{_default:"#004144",_type:tL.String},"Brand color #3":{_default:"#007d79",_type:tL.String},excludePatientIdentifierCodeTypes:{uuids:{_type:tL.Array,_description:"List of UUIDs of patient identifier types to exclude from rendering in the patient banner",_default:[],_elements:{_type:tL.UUID}}},implementationName:{_type:tL.String,_description:"A name of the place (or authority) where all possible locations a user can choose are located.",_default:"Clinic"},logo:{src:{_type:tL.String,_default:"",_description:"The path or URL to the logo shown on the login page and while the server is starting up. If set to an empty string, the default OpenMRS logo is used.",_validators:[nH.isUrl]},alt:{_type:tL.String,_default:"Logo",_description:"The alternative text for the logo image, displayed when the image cannot be loaded or on hover."}},patientPhotoConceptUuid:{_type:tL.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:tL.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[nH.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}},preferredDateLocale:{_type:tL.Object,_description:"Allows setting the locale used for date formatting for any browser locale. Does not affect time formatting. Keys should be locale codes, and values should be the preferred locale for formatting dates. For example, {'en': 'en-US', 'fr-CA': 'en-CA'}.",_default:{en:"en-GB"},_elements:{_type:tL.String}},diagnosisTags:cM};var cF=n(9284);let cB={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},cV=e=>(0,cO.jsx)(cF.TableBatchActions,{translateWithId:(e,t)=>{let n=cB[e];return n?a6(n,e,t):e},...e}),cU="-esm-stock-management__custom-overflow-menu-module__container___lY3iq",cW="-esm-stock-management__custom-overflow-menu-module__menu___dReHr",cH="-esm-stock-management__custom-overflow-menu-module__show___48R0e",cz="-esm-stock-management__custom-overflow-menu-module__overflowMenuButton___tsY8r",cK=(0,l$.createContext)(null);function cG(){let e=(0,l$.useContext)(cK);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function cZ({menuTitle:e,children:t}){let[n,r]=lO().useState(!1),a=u7(()=>r(!1),n),o="tablet"===u2(),i=(0,l$.useCallback)(()=>r(e=>!e),[]),s=(0,l$.useRef)(null),l=(0,l$.useRef)(null),u=(0,l$.useId)(),c=`custom-overflow-menu-trigger-${u}`,d=`custom-overflow-menu-${u}`,m=(0,l$.useCallback)(()=>{r(!1),s.current?.focus()},[]),p=(0,l$.useMemo)(()=>({closeMenu:m}),[m]),f=(0,l$.useCallback)(e=>{"Escape"===e.key&&n&&(e.stopPropagation(),m())},[m,n]),h=l$.Children.toArray(t);(0,l$.useEffect)(()=>{if(n&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[n]);let g=(0,l$.useCallback)(({currentIndex:e,direction:t})=>{let n=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!n?.length)return;let r=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,a=Array.from(n).indexOf(r);if(-1===a)return void n[t>0?0:n.length-1]?.focus();let o=a+t,i=o<0?n.length-1:o>=n.length?0:o;n[i]?.focus()},[]),y=h.map((e,t)=>(0,l$.isValidElement)(e)?(0,l$.cloneElement)(e,{closeMenu:m,handleOverflowMenuItemFocus:g,index:t}):e);return(0,cO.jsxs)("div",{"data-overflow-menu":!0,className:cA()("cds--overflow-menu",cU),ref:a,children:[(0,cO.jsx)("button",{className:cA()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":n},cz),"aria-controls":d,"aria-expanded":n,"aria-haspopup":"true",id:c,onClick:i,onKeyDown:f,ref:s,children:e}),(0,cO.jsxs)("div",{className:cA()("cds--overflow-menu-options","cds--overflow-menu--flip",cW,{[cH]:n}),"aria-labelledby":c,"data-floating-menu-direction":"bottom",id:d,onKeyDown:f,ref:l,role:"menu",tabIndex:-1,children:[(0,cO.jsx)("ul",{className:cA()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":o}),children:(0,cO.jsx)(cK.Provider,{value:p,children:y})}),(0,cO.jsx)("span",{})]})]})}function cY(e){let t=(0,l$.useContext)(cK);return(0,cO.jsx)(cF.OverflowMenuItem,{...e,closeMenu:t?.closeMenu})}var cq=n(7283);let cJ=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-chart-line","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-mobile-check","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-two-factor-authentication","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],cX=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),cQ=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-add",iconProps:e})})),c0=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),c1=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),c4=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),c2=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),c3=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),c6=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),c5=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),c9=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),c8=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),c7=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),de=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),dt=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),dn=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),dr=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),da=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),di=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),ds=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),dl=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),du=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),dc=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),dd=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-close",iconProps:e})})),dm=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),dp=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),df=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-document",iconProps:e})})),dh=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),dg=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-download",iconProps:e})})),dy=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),dv=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),db=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),dw=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-events",iconProps:e})})),dE=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),dx=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),dD=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),d_=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),dk=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),dS=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-group",iconProps:e})})),dC=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),dP=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),dR=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),dT=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-information",iconProps:e})})),d$=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),dO=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),dN=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),dA=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),dI=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),dj=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-location",iconProps:e})})),dM=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),dL=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),dF=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),dB=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),dV=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),dU=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),dW=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-money",iconProps:e})})),dH=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),dz=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),dK=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),dG=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),dZ=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-password",iconProps:e})})),dY=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),dq=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),dJ=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),dX=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),dQ=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),d0=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),d1=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),d4=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-report",iconProps:e})})),d2=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),d3=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-save",iconProps:e})})),d6=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-search",iconProps:e})})),d5=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),d9=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),d8=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),d7=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),me=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),mt=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),mn=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),mr=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-table",iconProps:e})})),ma=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-time",iconProps:e})})),mo=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),mi=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),ms=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),ml=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),mu=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),mc=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),md=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),mm=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),mp=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-user",iconProps:e})})),mf=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),mh=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-view",iconProps:e})})),mg=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(mD,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),my=mg,mv=dh,mb=dI,mw=dR,mE=d7,mx=(0,l$.memo)((0,l$.forwardRef)(function({icon:e,fallback:t,...n},r){let a=(0,l$.useRef)(e?document.getElementById(e):void 0);return(0,l$.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(a.current=e?document.getElementById(e):void 0)});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,cO.jsx)(uw,{value:a.current,fallback:t,children:(0,cO.jsx)(mD,{ref:r,icon:e,iconProps:n})})})),mD=(0,l$.memo)((0,l$.forwardRef)(function({icon:e,iconProps:t},n){let{className:r,fill:a,size:o}=Object.assign({},{fill:"currentColor",size:20},t);(o<=0||o>72)&&(console.error(`Invalid size '${o}' specified for ${e}. Defaulting to 20.`),o=20);let i=(0,l$.useRef)(null);return(0,l$.useImperativeHandle)(n,()=>i.current),(0,l$.useEffect)(()=>{i.current&&"currentColor"!==a&&i.current.style.setProperty("--omrs-icon-fill",a)},[]),(0,cO.jsx)("svg",{ref:i,className:cA()("omrs-icon","-esm-stock-management__icons-module__icon___sq7Qp",r),height:o,width:o,viewBox:"0 0 16 16",children:(0,cO.jsx)("use",{href:`#${e}`})})})),m_=({path:e,title:t,basePath:n,icon:r})=>{let{t:a}=(0,ue.useTranslation)(),o=(0,cq.useLocation)(),i=(0,l$.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let n=t.split("/").map(e=>decodeURIComponent(e)),r=(o.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return r.some((e,t)=>n.every((e,n)=>r[t+n]===e))},[o.pathname,e]);return(0,cO.jsx)("div",{children:(0,cO.jsx)(lA,{className:cA()("cds--side-nav__link",{"active-left-nav-link":i}),to:`${n}/${encodeURIComponent(e)}`,children:(0,cO.jsxs)("span",{className:"-esm-stock-management__dashboard-module__menu___Lg1M+",children:[(0,cO.jsx)(mx,{icon:r,className:"-esm-stock-management__dashboard-module__icon___Y2DxK",size:16}),(0,cO.jsx)("span",{children:a(t)})]})})},e)};function mk(e){return function({basePath:t}){return(0,cO.jsx)(cq.BrowserRouter,{children:(0,cO.jsx)(m_,{basePath:t,...e})})}}function mS(e){let t=(0,l$.useRef)(null);return(0,l$.useMemo)(()=>({get current(){return t.current},set current(value){t.current=value,"function"==typeof e?e(value):e&&(e.current=value)}}),[e])}function mC(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let mP="u">typeof document?lO().useLayoutEffect:()=>{};function mR(e){let t=(0,l$.useRef)(null);return mP(()=>{t.current=e},[e]),(0,l$.useCallback)((...e)=>{let n=t.current;return null==n?void 0:n(...e)},[])}let mT={prefix:String(Math.round(1e10*Math.random())),current:0},m$=lO().createContext(mT),mO=lO().createContext(!1),mN=("u">typeof window&&window.document&&window.document.createElement,new WeakMap),mA="function"==typeof lO().useId?function(e){let t=lO().useId(),[n]=(0,l$.useState)(mL()),r=n?"react-aria":`react-aria${mT.prefix}`;return e||`${r}-${t}`}:function(e){let t=(0,l$.useContext)(m$),n=function(e=!1){let t=(0,l$.useContext)(m$),n=(0,l$.useRef)(null);if(null===n.current&&!e){var r,a;let e=null==(a=lO().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)||null==(r=a.ReactCurrentOwner)?void 0:r.current;if(e){let n=mN.get(e);null==n?mN.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,mN.delete(e))}n.current=++t.current}return n.current}(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`};function mI(){return!1}function mj(){return!0}function mM(e){return()=>{}}function mL(){return"function"==typeof lO().useSyncExternalStore?lO().useSyncExternalStore(mM,mI,mj):(0,l$.useContext)(mO)}let mF=!!("u">typeof window&&window.document&&window.document.createElement),mB=new Map;function mV(e){let[t,n]=(0,l$.useState)(e),r=(0,l$.useRef)(null),a=mA(t),o=(0,l$.useRef)(null);if(s&&s.register(o,a),mF){let e=mB.get(a);e&&!e.includes(r)?e.push(r):mB.set(a,[r])}return mP(()=>()=>{s&&s.unregister(o),mB.delete(a)},[a]),(0,l$.useEffect)(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),a}function mU(e=[]){let t=mV(),[n,r]=function(e){let[t,n]=(0,l$.useState)(e),r=(0,l$.useRef)(null),a=mR(()=>{if(!r.current)return;let e=r.current.next();if(e.done){r.current=null;return}t===e.value?a():n(e.value)});mP(()=>{r.current&&a()});let o=mR(e=>{r.current=e(t),a()});return[t,o]}(t),a=(0,l$.useCallback)(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return mP(a,[t,a,...e]),n}"u">typeof FinalizationRegistry&&(s=new FinalizationRegistry(e=>{mB.delete(e)}));let mW=function(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=function e(t){var n,r,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(a&&(a+=" "),a+=r)}else for(r in t)t[r]&&(a&&(a+=" "),a+=r);return a}(e))&&(r&&(r+=" "),r+=t);return r};function mH(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],a=r[e];"function"==typeof n&&"function"==typeof a&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&90>=e.charCodeAt(2)?t[e]=mC(n,a):("className"===e||"UNSAFE_className"===e)&&"string"==typeof n&&"string"==typeof a?t[e]=mW(n,a):"id"===e&&n&&a?t.id=function(e,t){if(e===t)return e;let n=mB.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=mB.get(t);return r?(r.forEach(t=>t.current=e),e):t}(n,a):t[e]=void 0!==a?a:n}}return t}let mz=Symbol("default");function mK({values:e,children:t}){for(let[n,r]of e)t=lO().createElement(n.Provider,{value:r},t);return t}function mG(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:i,values:s}=e;return(0,l$.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:a}):t,l="function"==typeof n?n({...s,defaultStyle:i||{}}):n,u="function"==typeof r?r({...s,defaultChildren:o}):null==r?o:r,{className:null!=e?e:a,style:l||i?{...i,...l}:void 0,children:null!=u?u:o,"data-rac":""}},[t,n,r,a,o,i,s])}function mZ(e,t){let n=(0,l$.useContext)(e);if(null===t)return null;if(n&&"object"==typeof n&&"slots"in n&&n.slots){let e=t||mz;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:"A slot prop is required.";throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function mY(e,t,n){let{ref:r,...a}=mZ(n,e.slot)||{},o=mS((0,l$.useMemo)(()=>(function(...e){return 1===e.length&&e[0]?e[0]:t=>{for(let n of e)"function"==typeof n?n(t):null!=n&&(n.current=t)}})(t,r),[t,r])),i=mH(a,e);return"style"in a&&a.style&&"style"in e&&e.style&&("function"==typeof a.style||"function"==typeof e.style?i.style=t=>{let n="function"==typeof a.style?a.style(t):a.style,r={...t.defaultStyle,...n},o="function"==typeof e.style?e.style({...t,defaultStyle:r}):e.style;return{...r,...o}}:i.style={...a.style,...e.style}),[i,o]}function mq(e=!0){let[t,n]=(0,l$.useState)(e),r=(0,l$.useRef)(!1),a=(0,l$.useCallback)(e=>{r.current=!0,n(!!e)},[]);return mP(()=>{r.current||n(!1)},[]),[a,t]}function mJ(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}let mX=(0,l$.createContext)(null),mQ=null;function m0(e,t="assertive",n=7e3){mQ?mQ.announce(e,t,n):(mQ=new m1,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?mQ.announce(e,t,n):setTimeout(()=>{(null==mQ?void 0:mQ.isAttached())&&(null==mQ||mQ.announce(e,t,n))},100))}class m1{isAttached(){var e;return null==(e=this.node)?void 0:e.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",n=7e3){var r,a;if(!this.node)return;let o=document.createElement("div");"object"==typeof e?(o.setAttribute("role","img"),o.setAttribute("aria-labelledby",e["aria-labelledby"])):o.textContent=e,"assertive"===t?null==(r=this.assertiveLog)||r.appendChild(o):null==(a=this.politeLog)||a.appendChild(o),""!==e&&setTimeout(()=>{o.remove()},n)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"u">typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}let m4=new Set(["id"]),m2=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),m3=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),m6=/^(data-.*)$/;function m5(e,t={}){let{labelable:n,isLink:r,propNames:a}=t,o={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(m4.has(t)||n&&m2.has(t)||r&&m3.has(t)||(null==a?void 0:a.has(t))||m6.test(t))&&(o[t]=e[t]);return o}let m9=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])'],m8=m9.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";m9.push('[tabindex]:not([tabindex="-1"]):not([disabled])');let m7=m9.join(':not([hidden]):not([tabindex="-1"]),');function pe(e){return e.matches(m8)}function pt(e){return e.matches(m7)}let pn=e=>{var t;return null!=(t=null==e?void 0:e.ownerDocument)?t:document},pr=e=>e&&"window"in e&&e.window===e?e:pn(e).defaultView||window;function pa(e){if(function(){if(null==po){po=!1;try{document.createElement("div").focus({get preventScroll(){return po=!0,!0}})}catch{}}return po}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let po=null;function pi(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function ps(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function pl(e){let t=(0,l$.useRef)({isFocused:!1,observer:null});mP(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]);let n=mR(t=>{null==e||e(t)});return(0,l$.useCallback)(e=>{if(e.target instanceof HTMLButtonElement||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLSelectElement){t.current.isFocused=!0;let r=e.target;r.addEventListener("focusout",e=>{t.current.isFocused=!1,r.disabled&&n(pi(e)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&r.disabled){var e;null==(e=t.current.observer)||e.disconnect();let n=r===document.activeElement?null:document.activeElement;r.dispatchEvent(new FocusEvent("blur",{relatedTarget:n})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:n}))}}),t.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let pu=!1;function pc(e){var t;return!("u"<typeof window)&&null!=window.navigator&&((null==(t=window.navigator.userAgentData)?void 0:t.brands.some(t=>e.test(t.brand)))||e.test(window.navigator.userAgent))}function pd(e){var t;return"u">typeof window&&null!=window.navigator&&e.test((null==(t=window.navigator.userAgentData)?void 0:t.platform)||window.navigator.platform)}function pm(e){let t=null;return()=>(null==t&&(t=e()),t)}let pp=pm(function(){return pd(/^Mac/i)}),pf=pm(function(){return pd(/^iPhone/i)}),ph=pm(function(){return pd(/^iPad/i)||pp()&&navigator.maxTouchPoints>1}),pg=pm(function(){return pf()||ph()});pm(function(){return pp()||pg()});let py=pm(function(){return pc(/AppleWebKit/i)&&!pv()}),pv=pm(function(){return pc(/Chrome/i)}),pb=pm(function(){return pc(/Android/i)}),pw=pm(function(){return pc(/Firefox/i)}),pE=new Map,px=new Set;function pD(){if("u"<typeof window)return;function e(e){return"propertyName"in e}let t=n=>{if(!e(n)||!n.target)return;let r=pE.get(n.target);if(r&&(r.delete(n.propertyName),0===r.size&&(n.target.removeEventListener("transitioncancel",t),pE.delete(n.target)),0===pE.size)){for(let e of px)e();px.clear()}};document.body.addEventListener("transitionrun",n=>{if(!e(n)||!n.target)return;let r=pE.get(n.target);r||(r=new Set,pE.set(n.target,r),n.target.addEventListener("transitioncancel",t,{once:!0})),r.add(n.propertyName)}),document.body.addEventListener("transitionend",t)}function p_(e){requestAnimationFrame(()=>{0===pE.size?e():px.add(e)})}"u">typeof document&&("loading"!==document.readyState?pD():document.addEventListener("DOMContentLoaded",pD));let pk="default",pS="",pC=new WeakMap;function pP(e){if(pg())"disabled"===pk&&(pk="restoring",setTimeout(()=>{p_(()=>{if("restoring"===pk){let t=pn(e);"none"===t.documentElement.style.webkitUserSelect&&(t.documentElement.style.webkitUserSelect=pS||""),pS="",pk="default"}})},300));else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&pC.has(e)){let t=pC.get(e),n="userSelect"in e.style?"userSelect":"webkitUserSelect";"none"===e.style[n]&&(e.style[n]=t),""===e.getAttribute("style")&&e.removeAttribute("style"),pC.delete(e)}}let pR=lO().createContext({register:()=>{}});function pT(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function p$(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}function pO(e,t,n){var r=pT(e,t,"set");if(r.set)r.set.call(e,n);else{if(!r.writable)throw TypeError("attempted to set read only private field");r.value=n}return n}function pN(e,t){mP(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function pA(){let e=(0,l$.useRef)(new Map),t=(0,l$.useCallback)((t,n,r,a)=>{let o=(null==a?void 0:a.once)?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:o,options:a}),t.addEventListener(n,o,a)},[]),n=(0,l$.useCallback)((t,n,r,a)=>{var o;let i=(null==(o=e.current.get(r))?void 0:o.fn)||r;t.removeEventListener(n,i,a),e.current.delete(r)},[]),r=(0,l$.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,l$.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}pR.displayName="PressResponderContext";function pI(e,t){return!!t&&!!e&&e.contains(t)}function pj(e){return e.target}function pM(e,t,n=!0){var r,a;let{metaKey:o,ctrlKey:i,altKey:s,shiftKey:l}=t;pw()&&(null==(a=window.event)||null==(r=a.type)?void 0:r.startsWith("key"))&&"_blank"===e.target&&(pp()?o=!0:i=!0);let u=py()&&pp()&&!ph()&&1?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:o,ctrlKey:i,altKey:s,shiftKey:l}):new MouseEvent("click",{metaKey:o,ctrlKey:i,altKey:s,shiftKey:l,bubbles:!0,cancelable:!0});pM.isOpening=n,pa(e),e.dispatchEvent(u),pM.isOpening=!1}function pL(e){return 0===e.mozInputSource&&!!e.isTrusted||(pb()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}pM.isOpening=!1;var pF=n(5747),pB=n.n(pF),pV=new WeakMap;class pU{continuePropagation(){pO(this,pV,!1)}get shouldStopPropagation(){var e;return e=pT(this,pV,"get"),e.get?e.get.call(this):e.value}constructor(e,t,n,r){var a;p$(this,pV,{writable:!0,value:void 0}),pO(this,pV,!0);let o=null!=(a=null==r?void 0:r.target)?a:n.currentTarget;const i=null==o?void 0:o.getBoundingClientRect();let s,l=0,u,c=null;null!=n.clientX&&null!=n.clientY&&(u=n.clientX,c=n.clientY),i&&(null!=u&&null!=c?(s=u-i.left,l=c-i.top):(s=i.width/2,l=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=s,this.y=l}}let pW=Symbol("linkClicked");function pH(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:a,onPressUp:o,onClick:i,isDisabled:s,isPressed:l,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:m,...p}=function(e){let t=(0,l$.useContext)(pR);if(t){let{register:n,...r}=t;e=mH(r,e),n()}return pN(t,e.ref),e}(e),[f,h]=(0,l$.useState)(!1),g=(0,l$.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:y,removeAllGlobalListeners:v}=pA(),b=mR((e,t)=>{let a=g.current;if(s||a.didFirePressStart)return!1;let o=!0;if(a.isTriggeringEvent=!0,r){let n=new pU("pressstart",t,e);r(n),o=n.shouldStopPropagation}return n&&n(!0),a.isTriggeringEvent=!1,a.didFirePressStart=!0,h(!0),o}),w=mR((e,r,o=!0)=>{let i=g.current;if(!i.didFirePressStart)return!1;i.didFirePressStart=!1,i.isTriggeringEvent=!0;let l=!0;if(a){let t=new pU("pressend",r,e);a(t),l=t.shouldStopPropagation}if(n&&n(!1),h(!1),t&&o&&!s){let n=new pU("press",r,e);t(n),l&&(l=n.shouldStopPropagation)}return i.isTriggeringEvent=!1,l}),E=mR((e,t)=>{let n=g.current;if(s)return!1;if(o){n.isTriggeringEvent=!0;let r=new pU("pressup",t,e);return o(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0}),x=mR(e=>{let t=g.current;if(t.isPressed&&t.target){for(let n of(t.didFirePressStart&&null!=t.pointerType&&w(pG(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,v(),d||pP(t.target),t.disposables))n();t.disposables=[]}}),D=mR(e=>{c&&x(e)}),_=mR(e=>{null==i||i(e)}),k=mR((e,t)=>{if(i){let n=new MouseEvent("click",e);ps(n,t),i(pi(n))}}),S=(0,l$.useMemo)(()=>{let e=g.current,t={onKeyDown(t){if(pK(t.nativeEvent,t.currentTarget)&&pI(t.currentTarget,pj(t.nativeEvent))){var r;pZ(pj(t.nativeEvent),t.key)&&t.preventDefault();let a=!0;if(!e.isPressed&&!t.repeat){e.target=t.currentTarget,e.isPressed=!0,e.pointerType="keyboard",a=b(t,"keyboard");let r=t.currentTarget;y(pn(t.currentTarget),"keyup",mC(t=>{pK(t,r)&&!t.repeat&&pI(r,pj(t))&&e.target&&E(pG(e.target,t),"keyboard")},n),!0)}a&&t.stopPropagation(),t.metaKey&&pp()&&(null==(r=e.metaKeyEvents)||r.set(t.key,t.nativeEvent))}else"Meta"===t.key&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||pI(t.currentTarget,pj(t.nativeEvent)))&&t&&0===t.button&&!e.isTriggeringEvent&&!pM.isOpening){let n=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&("virtual"===e.pointerType||pL(t.nativeEvent))){let e=b(t,"virtual"),r=E(t,"virtual"),a=w(t,"virtual");_(t),n=e&&r&&a}else if(e.isPressed&&"keyboard"!==e.pointerType){let r=e.pointerType||t.nativeEvent.pointerType||"virtual";n=w(pG(t.currentTarget,t),r,!0),e.isOverTarget=!1,_(t),x(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{var n,r,a;if(e.isPressed&&e.target&&pK(t,e.target)){pZ(pj(t),t.key)&&t.preventDefault();let n=pj(t),a=pI(e.target,pj(t));w(pG(e.target,t),"keyboard",a),a&&k(t,e.target),v(),"Enter"!==t.key&&pz(e.target)&&pI(e.target,n)&&!t[pW]&&(t[pW]=!0,pM(e.target,t,!1)),e.isPressed=!1,null==(r=e.metaKeyEvents)||r.delete(t.key)}else if("Meta"===t.key&&(null==(n=e.metaKeyEvents)?void 0:n.size)){let t=e.metaKeyEvents;for(let n of(e.metaKeyEvents=void 0,t.values()))null==(a=e.target)||a.dispatchEvent(new KeyboardEvent("keyup",n))}};if("u">typeof PointerEvent){t.onPointerDown=t=>{var a;if(0!==t.button||!pI(t.currentTarget,pj(t.nativeEvent)))return;if(a=t.nativeEvent,!pb()&&0===a.width&&0===a.height||1===a.width&&1===a.height&&0===a.pressure&&0===a.detail&&"mouse"===a.pointerType){e.pointerType="virtual";return}e.pointerType=t.pointerType;let o=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,d||function(e){if(pg()){if("default"===pk){let t=pn(e);pS=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}pk="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";pC.set(e,e.style[t]),e.style[t]="none"}}(e.target),o=b(t,e.pointerType);let a=pj(t.nativeEvent);"releasePointerCapture"in a&&a.releasePointerCapture(t.pointerId),y(pn(t.currentTarget),"pointerup",n,!1),y(pn(t.currentTarget),"pointercancel",r,!1)}o&&t.stopPropagation()},t.onMouseDown=t=>{if(pI(t.currentTarget,pj(t.nativeEvent))&&0===t.button){if(u){let n=function(e){for(;e&&!pe(e);)e=e.parentElement;let t=pr(e),n=t.document.activeElement;if(!n||n===e)return;pu=!0;let r=!1,a=e=>{(e.target===n||r)&&e.stopImmediatePropagation()},o=t=>{(t.target===n||r)&&(t.stopImmediatePropagation(),e||r||(r=!0,pa(n),l()))},i=t=>{(t.target===e||r)&&t.stopImmediatePropagation()},s=t=>{(t.target===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,pa(n),l()))};t.addEventListener("blur",a,!0),t.addEventListener("focusout",o,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",i,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener("blur",a,!0),t.removeEventListener("focusout",o,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",i,!0),pu=!1,r=!1},u=requestAnimationFrame(l);return l}(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{pI(t.currentTarget,pj(t.nativeEvent))&&"virtual"!==e.pointerType&&0===t.button&&E(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!0,b(pG(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!1,w(pG(e.target,t),e.pointerType,!1),D(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&e.target){if(pI(e.target,pj(t))&&null!=e.pointerType){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?x(t):(pa(e.target),e.target.click()))},80);y(t.currentTarget,"click",()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else x(t);e.isOverTarget=!1}},r=e=>{x(e)};t.onDragStart=e=>{pI(e.currentTarget,pj(e.nativeEvent))&&x(e)}}return t},[y,s,u,v,d,x,D,w,b,E,_,k]);return(0,l$.useEffect)(()=>{let e=null==m?void 0:m.current;e&&e instanceof pr(e).Element&&"auto"===pr(e).getComputedStyle(e).touchAction&&(e.style.touchAction="pan-x pan-y pinch-zoom")},[m]),(0,l$.useEffect)(()=>{let e=g.current;return()=>{var t;for(let n of(d||pP(null!=(t=e.target)?t:void 0),e.disposables))n();e.disposables=[]}},[d]),{isPressed:l||f,pressProps:mH(p,S)}}function pz(e){return"A"===e.tagName&&e.hasAttribute("href")}function pK(e,t){let{key:n,code:r}=e,a=t.getAttribute("role");return("Enter"===n||" "===n||"Spacebar"===n||"Space"===r)&&!(t instanceof pr(t).HTMLInputElement&&!pq(t,n)||t instanceof pr(t).HTMLTextAreaElement||t.isContentEditable)&&!(("link"===a||!a&&pz(t))&&"Enter"!==n)}function pG(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r}}function pZ(e,t){return e instanceof HTMLInputElement?!pq(e,t):!(e instanceof HTMLInputElement)&&(e instanceof HTMLButtonElement?"submit"!==e.type&&"reset"!==e.type:!pz(e))}let pY=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function pq(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:pY.has(e.type)}let pJ=null,pX=new Set,pQ=new Map,p0=!1,p1=!1,p4={Tab:!0,Escape:!0};function p2(e,t){for(let n of pX)n(e,t)}function p3(e){p0=!0,e.metaKey||!pp()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(pJ="keyboard",p2("keyboard",e))}function p6(e){pJ="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(p0=!0,p2("pointer",e))}function p5(e){pL(e)&&(p0=!0,pJ="virtual")}function p9(e){e.target!==window&&e.target!==document&&!pu&&e.isTrusted&&(p0||p1||(pJ="virtual",p2("virtual",e)),p0=!1,p1=!1)}function p8(){pu||(p0=!1,p1=!0)}function p7(e){if("u"<typeof window||pQ.get(pr(e)))return;let t=pr(e),n=pn(e),r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){p0=!0,r.apply(this,arguments)},n.addEventListener("keydown",p3,!0),n.addEventListener("keyup",p3,!0),n.addEventListener("click",p5,!0),t.addEventListener("focus",p9,!0),t.addEventListener("blur",p8,!1),"u">typeof PointerEvent&&(n.addEventListener("pointerdown",p6,!0),n.addEventListener("pointermove",p6,!0),n.addEventListener("pointerup",p6,!0)),t.addEventListener("beforeunload",()=>{fe(e)},{once:!0}),pQ.set(t,{focus:r})}let fe=(e,t)=>{let n=pr(e),r=pn(e);t&&r.removeEventListener("DOMContentLoaded",t),pQ.has(n)&&(n.HTMLElement.prototype.focus=pQ.get(n).focus,r.removeEventListener("keydown",p3,!0),r.removeEventListener("keyup",p3,!0),r.removeEventListener("click",p5,!0),n.removeEventListener("focus",p9,!0),n.removeEventListener("blur",p8,!1),"u">typeof PointerEvent&&(r.removeEventListener("pointerdown",p6,!0),r.removeEventListener("pointermove",p6,!0),r.removeEventListener("pointerup",p6,!0)),pQ.delete(n))};function ft(){return"pointer"!==pJ}"u">typeof document&&("loading"!==(m=pn(void 0)).readyState?p7(void 0):m.addEventListener("DOMContentLoaded",()=>{p7(void 0)}));let fn=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function fr(e){let t=pn(e),n=((e=document)=>e.activeElement)(t);"virtual"===pJ?p_(()=>{((e=document)=>e.activeElement)(t)===n&&e.isConnected&&pa(e)}):pa(e)}function fa(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:a}=e,o=(0,l$.useCallback)(e=>{if(e.target===e.currentTarget)return r&&r(e),a&&a(!1),!0},[r,a]),i=pl(o),s=(0,l$.useCallback)(e=>{let t=pn(e.target),r=t?((e=document)=>e.activeElement)(t):((e=document)=>e.activeElement)();e.target===e.currentTarget&&r===pj(e.nativeEvent)&&(n&&n(e),a&&a(!0),i(e))},[a,n,i]);return{focusProps:{onFocus:!t&&(n||a||r)?s:void 0,onBlur:!t&&(r||a)?o:void 0}}}function fo(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented:()=>n.isDefaultPrevented(),stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped:()=>t}),t&&n.stopPropagation()}}let fi=lO().createContext(null);function fs(e,t){let{focusProps:n}=fa(e),{keyboardProps:r}={keyboardProps:e.isDisabled?{}:{onKeyDown:fo(e.onKeyDown),onKeyUp:fo(e.onKeyUp)}},a=mH(n,r),o=function(e){let t=(0,l$.useContext)(fi)||{};pN(t,e);let{ref:n,...r}=t;return r}(t),i=e.isDisabled?{}:o,s=(0,l$.useRef)(e.autoFocus);(0,l$.useEffect)(()=>{s.current&&t.current&&fr(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:mH({...a,tabIndex:l},i)}}function fl(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:a}=e,o=(0,l$.useRef)({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:s}=pA(),l=(0,l$.useCallback)(e=>{e.currentTarget.contains(e.target)&&o.current.isFocusWithin&&!e.currentTarget.contains(e.relatedTarget)&&(o.current.isFocusWithin=!1,s(),n&&n(e),a&&a(!1))},[n,a,o,s]),u=pl(l),c=(0,l$.useCallback)(e=>{if(!e.currentTarget.contains(e.target))return;let t=pn(e.target),n=((e=document)=>e.activeElement)(t);if(!o.current.isFocusWithin&&n===pj(e.nativeEvent)){r&&r(e),a&&a(!0),o.current.isFocusWithin=!0,u(e);let n=e.currentTarget;i(t,"focus",e=>{if(o.current.isFocusWithin&&!pI(n,e.target)){let r=new t.defaultView.FocusEvent("blur",{relatedTarget:e.target});ps(r,n),l(pi(r))}},{capture:!0})}},[r,a,u,i,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}function fu(e={}){var t;let{autoFocus:n=!1,isTextInput:r,within:a}=e,o=(0,l$.useRef)({isFocused:!1,isFocusVisible:n||ft()}),[i,s]=(0,l$.useState)(!1),[l,u]=(0,l$.useState)(()=>o.current.isFocused&&o.current.isFocusVisible),c=(0,l$.useCallback)(()=>u(o.current.isFocused&&o.current.isFocusVisible),[]),d=(0,l$.useCallback)(e=>{o.current.isFocused=e,s(e),c()},[c]);t={isTextInput:r},p7(),(0,l$.useEffect)(()=>{let e=(e,n)=>{var r;let a,i,s,l,u;r=!!(null==t?void 0:t.isTextInput),a=pn(null==n?void 0:n.target),i="u">typeof window?pr(null==n?void 0:n.target).HTMLInputElement:HTMLInputElement,s="u">typeof window?pr(null==n?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l="u">typeof window?pr(null==n?void 0:n.target).HTMLElement:HTMLElement,u="u">typeof window?pr(null==n?void 0:n.target).KeyboardEvent:KeyboardEvent,(r=r||a.activeElement instanceof i&&!fn.has(a.activeElement.type)||a.activeElement instanceof s||a.activeElement instanceof l&&a.activeElement.isContentEditable)&&"keyboard"===e&&n instanceof u&&!p4[n.key]||(e=>{o.current.isFocusVisible=e,c()})(ft())};return pX.add(e),()=>{pX.delete(e)}},[]);let{focusProps:m}=fa({isDisabled:a,onFocusChange:d}),{focusWithinProps:p}=fl({isDisabled:!a,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:l,focusProps:a?p:m}}lO().forwardRef(function(e,t){let{children:n,...r}=e,a=mS(t),o={...r,ref:a};return lO().createElement(fi.Provider,{value:o},n)});let fc=!1,fd=0;function fm(e){"touch"===e.pointerType&&(fc=!0,setTimeout(()=>{fc=!1},50))}function fp(){if("u">typeof document)return"u">typeof PointerEvent&&document.addEventListener("pointerup",fm),fd++,()=>{!(--fd>0)&&"u">typeof PointerEvent&&document.removeEventListener("pointerup",fm)}}function ff(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:a}=e,[o,i]=(0,l$.useState)(!1),s=(0,l$.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,l$.useEffect)(fp,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=pA(),{hoverProps:c,triggerHoverEnd:d}=(0,l$.useMemo)(()=>{let e=(e,t)=>{let a=s.target;s.pointerType="",s.target=null,"touch"!==t&&s.isHovered&&a&&(s.isHovered=!1,u(),r&&r({type:"hoverend",target:a,pointerType:t}),n&&n(!1),i(!1))},o={};return"u">typeof PointerEvent&&(o.onPointerEnter=r=>{fc&&"mouse"===r.pointerType||((r,o)=>{if(s.pointerType=o,a||"touch"===o||s.isHovered||!r.currentTarget.contains(r.target))return;s.isHovered=!0;let u=r.currentTarget;s.target=u,l(pn(r.target),"pointerover",t=>{s.isHovered&&s.target&&!pI(s.target,t.target)&&e(t,t.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:u,pointerType:o}),n&&n(!0),i(!0)})(r,r.pointerType)},o.onPointerLeave=t=>{!a&&t.currentTarget.contains(t.target)&&e(t,t.pointerType)}),{hoverProps:o,triggerHoverEnd:e}},[t,n,r,a,s,l,u]);return(0,l$.useEffect)(()=>{a&&d({currentTarget:s.target},s.pointerType)},[a]),{hoverProps:c,isHovered:o}}if("u">typeof HTMLTemplateElement){let e=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild").get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:e.call(this)}})}let fh=(0,l$.createContext)(!1);function fg(e){let t=(t,n)=>(0,l$.useContext)(fh)?null:e(t,n);return t.displayName=e.displayName||e.name,(0,l$.forwardRef)(t)}let fy=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),fv=(0,l$.createContext)({}),fb=fg(function(e,t){var n;[e,t]=mY(e,t,fv);let r=((n=e).isPending&&(n.onPress=void 0,n.onPressStart=void 0,n.onPressEnd=void 0,n.onPressChange=void 0,n.onPressUp=void 0,n.onKeyDown=void 0,n.onKeyUp=void 0,n.onClick=void 0,n.href=void 0),e=n),{isPending:a}=r,{buttonProps:o,isPressed:i}=function(e,t){let n,{elementType:r="button",isDisabled:a,onPress:o,onPressStart:i,onPressEnd:s,onPressUp:l,onPressChange:u,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:m,href:p,target:f,rel:h,type:g="button"}=e;n="button"===r?{type:g,disabled:a}:{role:"button",href:"a"!==r||a?void 0:p,target:"a"===r?f:void 0,type:"input"===r?g:void 0,disabled:"input"===r?a:void 0,"aria-disabled":a&&"input"!==r?a:void 0,rel:"a"===r?h:void 0};let{pressProps:y,isPressed:v}=pH({onPressStart:i,onPressEnd:s,onPressChange:u,onPress:o,onPressUp:l,onClick:m,isDisabled:a,preventFocusOnPress:c,ref:t}),{focusableProps:b}=fs(e,t);d&&(b.tabIndex=a?-1:b.tabIndex);let w=mH(b,y,m5(e,{labelable:!0}));return{isPressed:v,buttonProps:mH(n,w,{"aria-haspopup":e["aria-haspopup"],"aria-expanded":e["aria-expanded"],"aria-controls":e["aria-controls"],"aria-pressed":e["aria-pressed"],"aria-current":e["aria-current"]})}}(e,t),{focusProps:s,isFocused:l,isFocusVisible:u}=fu(e),{hoverProps:c,isHovered:d}=ff({...e,isDisabled:e.isDisabled||a}),m={isHovered:d,isPressed:(r.isPressed||i)&&!a,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:null!=a&&a},p=mG({...e,values:m,defaultClassName:"react-aria-Button"}),f=mV(o.id),h=mV(),g=o["aria-labelledby"];a&&(g?g=`${g} ${h}`:o["aria-label"]&&(g=`${f} ${h}`));let y=(0,l$.useRef)(a);return(0,l$.useEffect)(()=>{let e={"aria-labelledby":g||f};!y.current&&l&&a?m0(e,"assertive"):y.current&&l&&!a&&m0(e,"assertive"),y.current=a},[a,l,g,f]),lO().createElement("button",{...m5(e,{propNames:fy}),...mH(o,s,c),...p,type:"submit"===o.type&&a?"button":o.type,id:f,ref:t,"aria-labelledby":g,slot:e.slot||void 0,"aria-disabled":a?"true":o["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":m.isPressed||void 0,"data-hovered":d||void 0,"data-focused":l||void 0,"data-pending":a||void 0,"data-focus-visible":u||void 0},lO().createElement(mX.Provider,{value:{id:h}},p.children))});(0,l$.createContext)(null),(0,l$.createContext)(null),(0,l$.createContext)(null),(0,l$.createContext)(null),(0,l$.createContext)(null);let fw=(0,l$.createContext)({}),fE=(0,l$.createContext)({}),fx=(0,l$.forwardRef)(function(e,t){[e,t]=mY(e,t,fE);let{elementType:n="span",...r}=e;return lO().createElement(n,{className:"react-aria-Text",...r,ref:t})}),fD=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),f_=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function fk(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),n="function"==typeof t.getTextInfo?t.getTextInfo():t.textInfo;if(n)return"rtl"===n.direction;if(t.script)return fD.has(t.script)}let t=e.split("-")[0];return f_.has(t)}let fS=Symbol.for("react-aria.i18n.locale");function fC(){let e="u">typeof window&&window[fS]||"u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:fk(e)?"rtl":"ltr"}}let fP=fC(),fR=new Set;function fT(){for(let e of(fP=fC(),fR))e(fP)}function f$(){let e=mL(),[t,n]=(0,l$.useState)(fP);return((0,l$.useEffect)(()=>(0===fR.size&&window.addEventListener("languagechange",fT),fR.add(n),()=>{fR.delete(n),0===fR.size&&window.removeEventListener("languagechange",fT)}),[]),e)?{locale:"en-US",direction:"ltr"}:t}let fO=lO().createContext(null);function fN(e){let{locale:t,children:n}=e,r=f$(),a=lO().useMemo(()=>t?{locale:t,direction:fk(t)?"rtl":"ltr"}:r,[r,t]);return lO().createElement(fO.Provider,{value:a},n)}function fA(){let e=f$();return(0,l$.useContext)(fO)||e}var fI={};function fj(e,t){return e-t*Math.floor(e/t)}function fM(e,t,n,r){let a=(t=fF(e,t))-1,o=-2;return n<=2?o=0:fL(t)&&(o=-1),1721425+365*a+Math.floor(a/4)-Math.floor(a/100)+Math.floor(a/400)+Math.floor((367*n-362)/12+o+r)}function fL(e){return e%4==0&&(e%100!=0||e%400==0)}function fF(e,t){return"BC"===e?1-t:t}function fB(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}fI={"ar-AE":{dateRange:e=>`${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,dateSelected:e=>`${e.date} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}`,finishRangeSelectionPrompt:"انقر لإنهاء عملية تحديد نطاق التاريخ",maximumDate:"آخر تاريخ متاح",minimumDate:"أول تاريخ متاح",next:"التالي",previous:"السابق",selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.dateRange}`,startRangeSelectionPrompt:"انقر لبدء عملية تحديد نطاق التاريخ",todayDate:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date}`,todayDateSelected:e=>`\u{627}\u{644}\u{64A}\u{648}\u{645}\u{60C} ${e.date} \u{645}\u{62D}\u{62F}\u{62F}`},"bg-BG":{dateRange:e=>`${e.startDate} \u{434}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{435} ${e.date}`,finishRangeSelectionPrompt:"Натиснете, за да довършите избора на времеви интервал",maximumDate:"Последна налична дата",minimumDate:"Първа налична дата",next:"Напред",previous:"Назад",selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Натиснете, за да пристъпите към избора на времеви интервал",todayDate:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date}`,todayDateSelected:e=>`\u{414}\u{43D}\u{435}\u{441}, ${e.date} \u{441}\u{430} \u{438}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{438}`},"cs-CZ":{dateRange:e=>`${e.startDate} a\u{17E} ${e.endDate}`,dateSelected:e=>`Vybr\xe1no ${e.date}`,finishRangeSelectionPrompt:"Kliknut\xedm dokonč\xedte v\xfdběr rozsahu dat",maximumDate:"Posledn\xed dostupn\xe9 datum",minimumDate:"Prvn\xed dostupn\xe9 datum",next:"Dalš\xed",previous:"Předchoz\xed",selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknut\xedm zah\xe1j\xedte v\xfdběr rozsahu dat",todayDate:e=>`Dnes, ${e.date}`,todayDateSelected:e=>`Dnes, vybr\xe1no ${e.date}`},"da-DK":{dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klik for at fuldf\xf8re valg af datoomr\xe5de",maximumDate:"Sidste ledige dato",minimumDate:"F\xf8rste ledige dato",next:"N\xe6ste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.dateRange}`,startRangeSelectionPrompt:"Klik for at starte valg af datoomr\xe5de",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`},"de-DE":{dateRange:e=>`${e.startDate} bis ${e.endDate}`,dateSelected:e=>`${e.date} ausgew\xe4hlt`,finishRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beenden",maximumDate:"Letztes verf\xfcgbares Datum",minimumDate:"Erstes verf\xfcgbares Datum",next:"Weiter",previous:"Zur\xfcck",selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.dateRange}`,startRangeSelectionPrompt:"Klicken, um die Auswahl des Datumsbereichs zu beginnen",todayDate:e=>`Heute, ${e.date}`,todayDateSelected:e=>`Heute, ${e.date} ausgew\xe4hlt`},"el-GR":{dateRange:e=>`${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,dateSelected:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3B8}\u{3B7}\u{3BA}\u{3B5} ${e.date}`,finishRangeSelectionPrompt:"Κάντε κλικ για να ολοκληρώσετε την επιλογή εύρους ημερομηνιών",maximumDate:"Τελευταία διαθέσιμη ημερομηνία",minimumDate:"Πρώτη διαθέσιμη ημερομηνία",next:"Επόμενο",previous:"Προηγούμενο",selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.dateRange}`,startRangeSelectionPrompt:"Κάντε κλικ για να ξεκινήσετε την επιλογή εύρους ημερομηνιών",todayDate:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, ${e.date}`,todayDateSelected:e=>`\u{3A3}\u{3AE}\u{3BC}\u{3B5}\u{3C1}\u{3B1}, \u{3B5}\u{3C0}\u{3B9}\u{3BB}\u{3AD}\u{3C7}\u{3C4}\u{3B7}\u{3BA}\u{3B5} ${e.date}`},"en-US":{previous:"Previous",next:"Next",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.dateRange}`,todayDate:e=>`Today, ${e.date}`,todayDateSelected:e=>`Today, ${e.date} selected`,dateSelected:e=>`${e.date} selected`,startRangeSelectionPrompt:"Click to start selecting date range",finishRangeSelectionPrompt:"Click to finish selecting date range",minimumDate:"First available date",maximumDate:"Last available date",dateRange:e=>`${e.startDate} to ${e.endDate}`},"es-ES":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} seleccionado`,finishRangeSelectionPrompt:"Haga clic para terminar de seleccionar rango de fechas",maximumDate:"\xdaltima fecha disponible",minimumDate:"Primera fecha disponible",next:"Siguiente",previous:"Anterior",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo seleccionado: ${e.dateRange}`,startRangeSelectionPrompt:"Haga clic para comenzar a seleccionar un rango de fechas",todayDate:e=>`Hoy, ${e.date}`,todayDateSelected:e=>`Hoy, ${e.date} seleccionado`},"et-EE":{dateRange:e=>`${e.startDate} kuni ${e.endDate}`,dateSelected:e=>`${e.date} valitud`,finishRangeSelectionPrompt:"Kl\xf5psake kuup\xe4evavahemiku valimise l\xf5petamiseks",maximumDate:"Viimane saadaolev kuup\xe4ev",minimumDate:"Esimene saadaolev kuup\xe4ev",next:"J\xe4rgmine",previous:"Eelmine",selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.dateRange}`,startRangeSelectionPrompt:"Kl\xf5psake kuup\xe4evavahemiku valimiseks",todayDate:e=>`T\xe4na, ${e.date}`,todayDateSelected:e=>`T\xe4na, ${e.date} valitud`},"fi-FI":{dateRange:e=>`${e.startDate} \u{2013} ${e.endDate}`,dateSelected:e=>`${e.date} valittu`,finishRangeSelectionPrompt:"Lopeta p\xe4iv\xe4m\xe4\xe4r\xe4alueen valinta napsauttamalla t\xe4t\xe4.",maximumDate:"Viimeinen varattavissa oleva p\xe4iv\xe4m\xe4\xe4r\xe4",minimumDate:"Ensimm\xe4inen varattavissa oleva p\xe4iv\xe4m\xe4\xe4r\xe4",next:"Seuraava",previous:"Edellinen",selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.dateRange}`,startRangeSelectionPrompt:"Aloita p\xe4iv\xe4m\xe4\xe4r\xe4alueen valinta napsauttamalla t\xe4t\xe4.",todayDate:e=>`T\xe4n\xe4\xe4n, ${e.date}`,todayDateSelected:e=>`T\xe4n\xe4\xe4n, ${e.date} valittu`},"fr-FR":{dateRange:e=>`${e.startDate} \xe0 ${e.endDate}`,dateSelected:e=>`${e.date} s\xe9lectionn\xe9`,finishRangeSelectionPrompt:"Cliquer pour finir de s\xe9lectionner la plage de dates",maximumDate:"Derni\xe8re date disponible",minimumDate:"Premi\xe8re date disponible",next:"Suivant",previous:"Pr\xe9c\xe9dent",selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.dateRange}`,startRangeSelectionPrompt:"Cliquer pour commencer \xe0 s\xe9lectionner la plage de dates",todayDate:e=>`Aujourd'hui, ${e.date}`,todayDateSelected:e=>`Aujourd\u{2019}hui, ${e.date} s\xe9lectionn\xe9`},"he-IL":{dateRange:e=>`${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,dateSelected:e=>`${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`,finishRangeSelectionPrompt:"חץ כדי לסיים את בחירת טווח התאריכים",maximumDate:"תאריך פנוי אחרון",minimumDate:"תאריך פנוי ראשון",next:"הבא",previous:"הקודם",selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.dateRange}`,startRangeSelectionPrompt:"לחץ כדי להתחיל בבחירת טווח התאריכים",todayDate:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date}`,todayDateSelected:e=>`\u{5D4}\u{5D9}\u{5D5}\u{5DD}, ${e.date} \u{5E0}\u{5D1}\u{5D7}\u{5E8}`},"hr-HR":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} odabran`,finishRangeSelectionPrompt:"Kliknite da dovršite raspon odabranih datuma",maximumDate:"Posljednji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sljedeći",previous:"Prethodni",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete raspon odabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, odabran ${e.date}`},"hu-HU":{dateRange:e=>`${e.startDate}\u{2013}${e.endDate}`,dateSelected:e=>`${e.date} kiv\xe1lasztva`,finishRangeSelectionPrompt:"Kattintson a d\xe1tumtartom\xe1ny kijel\xf6l\xe9s\xe9nek befejez\xe9s\xe9hez",maximumDate:"Utols\xf3 el\xe9rhető d\xe1tum",minimumDate:"Az első el\xe9rhető d\xe1tum",next:"K\xf6vetkező",previous:"Előző",selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.dateRange}`,startRangeSelectionPrompt:"Kattintson a d\xe1tumtartom\xe1ny kijel\xf6l\xe9s\xe9nek ind\xedt\xe1s\xe1hoz",todayDate:e=>`Ma, ${e.date}`,todayDateSelected:e=>`Ma, ${e.date} kijel\xf6lve`},"it-IT":{dateRange:e=>`Da ${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selezionata`,finishRangeSelectionPrompt:"Fai clic per completare la selezione dell’intervallo di date",maximumDate:"Ultima data disponibile",minimumDate:"Prima data disponibile",next:"Successivo",previous:"Precedente",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: ${e.dateRange}`,startRangeSelectionPrompt:"Fai clic per selezionare l’intervallo di date",todayDate:e=>`Oggi, ${e.date}`,todayDateSelected:e=>`Oggi, ${e.date} selezionata`},"ja-JP":{dateRange:e=>`${e.startDate} \u{304B}\u{3089} ${e.endDate}`,dateSelected:e=>`${e.date} \u{3092}\u{9078}\u{629E}`,finishRangeSelectionPrompt:"クリックして日付範囲の選択を終了",maximumDate:"最終利用可能日",minimumDate:"最初の利用可能日",next:"次へ",previous:"前へ",selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.dateRange}`,startRangeSelectionPrompt:"クリックして日付範囲の選択を開始",todayDate:e=>`\u{672C}\u{65E5}\u{3001}${e.date}`,todayDateSelected:e=>`\u{672C}\u{65E5}\u{3001}${e.date} \u{3092}\u{9078}\u{629E}`},"ko-KR":{dateRange:e=>`${e.startDate} ~ ${e.endDate}`,dateSelected:e=>`${e.date} \u{C120}\u{D0DD}\u{B428}`,finishRangeSelectionPrompt:"날짜 범위 선택을 완료하려면 클릭하십시오.",maximumDate:"마지막으로 사용 가능한 일자",minimumDate:"처음으로 사용 가능한 일자",next:"다음",previous:"이전",selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.dateRange}`,startRangeSelectionPrompt:"날짜 범위 선택을 시작하려면 클릭하십시오.",todayDate:e=>`\u{C624}\u{B298}, ${e.date}`,todayDateSelected:e=>`\u{C624}\u{B298}, ${e.date} \u{C120}\u{D0DD}\u{B428}`},"lt-LT":{dateRange:e=>`Nuo ${e.startDate} iki ${e.endDate}`,dateSelected:e=>`Pasirinkta ${e.date}`,finishRangeSelectionPrompt:"Spustelėkite, kad baigtumėte pasirinkti datų intervalą",maximumDate:"Paskutinė galima data",minimumDate:"Pirmoji galima data",next:"Paskesnis",previous:"Ankstesnis",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: ${e.dateRange}`,startRangeSelectionPrompt:"Spustelėkite, kad pradėtumėte pasirinkti datų intervalą",todayDate:e=>`\u{160}iandien, ${e.date}`,todayDateSelected:e=>`\u{160}iandien, pasirinkta ${e.date}`},"lv-LV":{dateRange:e=>`No ${e.startDate} l\u{12B}dz ${e.endDate}`,dateSelected:e=>`Atlas\u{12B}ts: ${e.date}`,finishRangeSelectionPrompt:"Noklikšķiniet, lai pabeigtu datumu diapazona atlasi",maximumDate:"Pēdējais pieejamais datums",minimumDate:"Pirmais pieejamais datums",next:"Tālāk",previous:"Atpakaļ",selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: ${e.dateRange}`,startRangeSelectionPrompt:"Noklikšķiniet, lai sāktu datumu diapazona atlasi",todayDate:e=>`\u{160}odien, ${e.date}`,todayDateSelected:e=>`Atlas\u{12B}ta \u{161}odiena, ${e.date}`},"nb-NO":{dateRange:e=>`${e.startDate} til ${e.endDate}`,dateSelected:e=>`${e.date} valgt`,finishRangeSelectionPrompt:"Klikk for \xe5 fullf\xf8re valg av datoomr\xe5de",maximumDate:"Siste tilgjengelige dato",minimumDate:"F\xf8rste tilgjengelige dato",next:"Neste",previous:"Forrige",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.dateRange}`,startRangeSelectionPrompt:"Klikk for \xe5 starte valg av datoomr\xe5de",todayDate:e=>`I dag, ${e.date}`,todayDateSelected:e=>`I dag, ${e.date} valgt`},"nl-NL":{dateRange:e=>`${e.startDate} tot ${e.endDate}`,dateSelected:e=>`${e.date} geselecteerd`,finishRangeSelectionPrompt:"Klik om de selectie van het datumbereik te voltooien",maximumDate:"Laatste beschikbare datum",minimumDate:"Eerste beschikbare datum",next:"Volgende",previous:"Vorige",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.dateRange}`,startRangeSelectionPrompt:"Klik om het datumbereik te selecteren",todayDate:e=>`Vandaag, ${e.date}`,todayDateSelected:e=>`Vandaag, ${e.date} geselecteerd`},"pl-PL":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`Wybrano ${e.date}`,finishRangeSelectionPrompt:"Kliknij, aby zakończyć wyb\xf3r zakresu dat",maximumDate:"Ostatnia dostępna data",minimumDate:"Pierwsza dostępna data",next:"Dalej",previous:"Wstecz",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknij, aby rozpocząć wyb\xf3r zakresu dat",todayDate:e=>`Dzisiaj, ${e.date}`,todayDateSelected:e=>`Dzisiaj wybrano ${e.date}`},"pt-BR":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para concluir a sele\xe7\xe3o do intervalo de datas",maximumDate:"\xdaltima data dispon\xedvel",minimumDate:"Primeira data dispon\xedvel",next:"Pr\xf3ximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para iniciar a sele\xe7\xe3o do intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`},"pt-PT":{dateRange:e=>`${e.startDate} a ${e.endDate}`,dateSelected:e=>`${e.date} selecionado`,finishRangeSelectionPrompt:"Clique para terminar de selecionar o intervalo de datas",maximumDate:"\xdaltima data dispon\xedvel",minimumDate:"Primeira data dispon\xedvel",next:"Pr\xf3ximo",previous:"Anterior",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.dateRange}`,startRangeSelectionPrompt:"Clique para come\xe7ar a selecionar o intervalo de datas",todayDate:e=>`Hoje, ${e.date}`,todayDateSelected:e=>`Hoje, ${e.date} selecionado`},"ro-RO":{dateRange:e=>`De la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,dateSelected:e=>`${e.date} selectat\u{103}`,finishRangeSelectionPrompt:"Apăsaţi pentru a finaliza selecţia razei pentru dată",maximumDate:"Ultima dată disponibilă",minimumDate:"Prima dată disponibilă",next:"Următorul",previous:"\xcenainte",selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: ${e.dateRange}`,startRangeSelectionPrompt:"Apăsaţi pentru a \xeencepe selecţia razei pentru dată",todayDate:e=>`Ast\u{103}zi, ${e.date}`,todayDateSelected:e=>`Azi, ${e.date} selectat\u{103}`},"ru-RU":{dateRange:e=>`\u{421} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,dateSelected:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:"Щелкните, чтобы завершить выбор диапазона дат",maximumDate:"Последняя доступная дата",minimumDate:"Первая доступная дата",next:"Далее",previous:"Назад",selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Щелкните, чтобы начать выбор диапазона дат",todayDate:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{435}\u{433}\u{43E}\u{434}\u{43D}\u{44F}, \u{432}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`},"sk-SK":{dateRange:e=>`Od ${e.startDate} do ${e.endDate}`,dateSelected:e=>`Vybrat\xfd d\xe1tum ${e.date}`,finishRangeSelectionPrompt:"Kliknut\xedm dokonč\xedte v\xfdber rozsahu d\xe1tumov",maximumDate:"Posledn\xfd dostupn\xfd d\xe1tum",minimumDate:"Prv\xfd dostupn\xfd d\xe1tum",next:"Nasleduj\xface",previous:"Predch\xe1dzaj\xface",selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknut\xedm spust\xedte v\xfdber rozsahu d\xe1tumov",todayDate:e=>`Dnes ${e.date}`,todayDateSelected:e=>`Vybrat\xfd dne\u{161}n\xfd d\xe1tum ${e.date}`},"sl-SI":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izbrano`,finishRangeSelectionPrompt:"Kliknite za dokončanje izbire datumskega obsega",maximumDate:"Zadnji razpoložljivi datum",minimumDate:"Prvi razpoložljivi datum",next:"Naprej",previous:"Nazaj",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite za začetek izbire datumskega obsega",todayDate:e=>`Danes, ${e.date}`,todayDateSelected:e=>`Danes, ${e.date} izbrano`},"sr-SP":{dateRange:e=>`${e.startDate} do ${e.endDate}`,dateSelected:e=>`${e.date} izabran`,finishRangeSelectionPrompt:"Kliknite da dovršite opseg izabranih datuma",maximumDate:"Zadnji raspoloživi datum",minimumDate:"Prvi raspoloživi datum",next:"Sledeći",previous:"Prethodni",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani period: ${e.dateRange}`,startRangeSelectionPrompt:"Kliknite da započnete opseg izabranih datuma",todayDate:e=>`Danas, ${e.date}`,todayDateSelected:e=>`Danas, izabran ${e.date}`},"sv-SE":{dateRange:e=>`${e.startDate} till ${e.endDate}`,dateSelected:e=>`${e.date} har valts`,finishRangeSelectionPrompt:"Klicka f\xf6r att avsluta val av datumintervall",maximumDate:"Sista tillg\xe4ngliga datum",minimumDate:"F\xf6rsta tillg\xe4ngliga datum",next:"N\xe4sta",previous:"F\xf6reg\xe5ende",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.dateRange}`,startRangeSelectionPrompt:"Klicka f\xf6r att v\xe4lja datumintervall",todayDate:e=>`Idag, ${e.date}`,todayDateSelected:e=>`Idag, ${e.date} har valts`},"tr-TR":{dateRange:e=>`${e.startDate} - ${e.endDate}`,dateSelected:e=>`${e.date} se\xe7ildi`,finishRangeSelectionPrompt:"Tarih aralığı se\xe7imini tamamlamak i\xe7in tıklayın",maximumDate:"Son m\xfcsait tarih",minimumDate:"İlk m\xfcsait tarih",next:"Sonraki",previous:"\xd6nceki",selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.dateRange}`,startRangeSelectionPrompt:"Tarih aralığı se\xe7imini başlatmak i\xe7in tıklayın",todayDate:e=>`Bug\xfcn, ${e.date}`,todayDateSelected:e=>`Bug\xfcn, ${e.date} se\xe7ildi`},"uk-UA":{dateRange:e=>`${e.startDate} \u{2014} ${e.endDate}`,dateSelected:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`,finishRangeSelectionPrompt:"Натисніть, щоб завершити вибір діапазону дат",maximumDate:"Остання доступна дата",minimumDate:"Перша доступна дата",next:"Наступний",previous:"Попередній",selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.dateRange}`,startRangeSelectionPrompt:"Натисніть, щоб почати вибір діапазону дат",todayDate:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, ${e.date}`,todayDateSelected:e=>`\u{421}\u{44C}\u{43E}\u{433}\u{43E}\u{434}\u{43D}\u{456}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E} ${e.date}`},"zh-CN":{dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9009}\u{62E9} ${e.date}`,finishRangeSelectionPrompt:"单击以完成选择日期范围",maximumDate:"最后一个可用日期",minimumDate:"第一个可用日期",next:"下一页",previous:"上一页",selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:"单击以开始选择日期范围",todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9009}\u{62E9}\u{4ECA}\u{5929}\u{FF0C}\u{5373} ${e.date}`},"zh-TW":{dateRange:e=>`${e.startDate} \u{81F3} ${e.endDate}`,dateSelected:e=>`\u{5DF2}\u{9078}\u{53D6} ${e.date}`,finishRangeSelectionPrompt:"按一下以完成選取日期範圍",maximumDate:"最後一個可用日期",minimumDate:"第一個可用日期",next:"下一頁",previous:"上一頁",selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.dateRange}`,startRangeSelectionPrompt:"按一下以開始選取日期範圍",todayDate:e=>`\u{4ECA}\u{5929}\u{FF0C}${e.date}`,todayDateSelected:e=>`\u{5DF2}\u{9078}\u{53D6}\u{4ECA}\u{5929}\u{FF0C}${e.date}`}};let fV={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class fU{fromJulianDay(e){let t=e-1721426,n=Math.floor(t/146097),r=fj(t,146097),a=Math.floor(r/36524),o=fj(r,36524),i=Math.floor(o/1461),s=Math.floor(fj(o,1461)/365),[l,u]=fB(400*n+100*a+4*i+s+ +(4!==a&&4!==s)),c=e-fM(l,u,1,1),d=2;e<fM(l,u,3,1)?d=0:fL(u)&&(d=1);let m=Math.floor(((c+d)*12+373)/367),p=e-fM(l,u,m,1)+1;return new he(l,u,m,p)}toJulianDay(e){return fM(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return fV[fL(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return fL(e.year)?366:365}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return"BC"===e.era}balanceDate(e){e.year<=0&&(e.era="BC"===e.era?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}function fW(e,t){let n=e.copy(),r="hour"in n?fQ(n,t):0;fH(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,fz(n),fK(n),n.day+=7*(t.weeks||0),n.day+=t.days||0,n.day+=r,function(e){for(;e.day<1;)e.month--,fz(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,fz(e)}(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let a=n.calendar.getYearsInEra(n);if(n.year>a){var o,i;let e=null==(o=(i=n.calendar).isInverseEra)?void 0:o.call(i,n);n.year=a,n.month=e?1:n.calendar.getMonthsInYear(n),n.day=e?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function fH(e,t){var n,r;(null==(n=(r=e.calendar).isInverseEra)?void 0:n.call(r,e))&&(t=-t),e.year+=t}function fz(e){for(;e.month<1;)fH(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,fH(e,1)}function fK(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function fG(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),fK(e)}function fZ(e){let t={};for(let n in e)"number"==typeof e[n]&&(t[n]=-e[n]);return t}function fY(e,t){let n=e.copy();return null!=t.era&&(n.era=t.era),null!=t.year&&(n.year=t.year),null!=t.month&&(n.month=t.month),null!=t.day&&(n.day=t.day),fG(n),n}function fq(e,t){let n=e.copy();return null!=t.hour&&(n.hour=t.hour),null!=t.minute&&(n.minute=t.minute),null!=t.second&&(n.second=t.second),null!=t.millisecond&&(n.millisecond=t.millisecond),fJ(n),n}function fJ(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function fX(e,t){let n=e%t;return n<0&&(n+=t),n}function fQ(e,t){let n;return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,e.second+=Math.floor(e.millisecond/1e3),e.millisecond=fX(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=fX(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=fX(e.minute,60),n=Math.floor(e.hour/24),e.hour=fX(e.hour,24),n}function f0(e,t){let n=e.copy();return fQ(n,t),n}function f1(e,t,n,r){let a=e.copy();switch(t){case"era":{let t=e.calendar.getEras(),o=t.indexOf(e.era);if(o<0)throw Error("Invalid era: "+e.era);o=f2(o,n,0,t.length-1,null==r?void 0:r.round),a.era=t[o],fG(a);break}case"year":var o,i;(null==(o=(i=a.calendar).isInverseEra)?void 0:o.call(i,a))&&(n=-n),a.year=f2(e.year,n,-1/0,9999,null==r?void 0:r.round),a.year===-1/0&&(a.year=1),a.calendar.balanceYearMonth&&a.calendar.balanceYearMonth(a,e);break;case"month":a.month=f2(e.month,n,1,e.calendar.getMonthsInYear(e),null==r?void 0:r.round);break;case"day":a.day=f2(e.day,n,1,e.calendar.getDaysInMonth(e),null==r?void 0:r.round);break;default:throw Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(a),fG(a),a}function f4(e,t,n,r){let a=e.copy();switch(t){case"hour":{let t=e.hour,o=0,i=23;if((null==r?void 0:r.hourCycle)===12){let e=t>=12;o=12*!!e,i=e?23:11}a.hour=f2(t,n,o,i,null==r?void 0:r.round);break}case"minute":a.minute=f2(e.minute,n,0,59,null==r?void 0:r.round);break;case"second":a.second=f2(e.second,n,0,59,null==r?void 0:r.round);break;case"millisecond":a.millisecond=f2(e.millisecond,n,0,999,null==r?void 0:r.round);break;default:throw Error("Unsupported field "+t)}return a}function f2(e,t,n,r,a=!1){if(a){(e+=Math.sign(t))<n&&(e=r);let a=Math.abs(t);(e=t>0?Math.ceil(e/a)*a:Math.floor(e/a)*a)>r&&(e=n)}else(e+=t)<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}function f3(e,t){let n;return n=(null!=t.years&&0!==t.years||null!=t.months&&0!==t.months||null!=t.weeks&&0!==t.weeks||null!=t.days&&0!==t.days?hm(fW(hg(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):hs(e)-e.offset)+(t.milliseconds||0),n+=1e3*(t.seconds||0),n+=6e4*(t.minutes||0),hy(hf(n+=36e5*(t.hours||0),e.timeZone),e.calendar)}function f6(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function f5(e){let t,n=hy(e,new fU);return t="BC"===n.era?1===n.year?"0000":"-"+String(Math.abs(1-n.year)).padStart(6,"00"):String(n.year).padStart(4,"0"),`${t}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`}function f9(e){return`${f5(e)}T${f6(e)}`}function f8(e){let t,n="object"==typeof e[0]?e.shift():new fU;if("string"==typeof e[0])t=e.shift();else{let e=n.getEras();t=e[e.length-1]}return[n,t,e.shift(),e.shift(),e.shift()]}var f7=new WeakMap;class he{copy(){return this.era?new he(this.calendar,this.era,this.year,this.month,this.day):new he(this.calendar,this.year,this.month,this.day)}add(e){return fW(this,e)}subtract(e){return fW(this,fZ(e))}set(e){return fY(this,e)}cycle(e,t,n){return f1(this,e,t,n)}toDate(e){return hp(this,e)}toString(){return f5(this)}compare(e){return hS(this,e)}constructor(...e){p$(this,f7,{writable:!0,value:void 0});let[t,n,r,a,o]=f8(e);this.calendar=t,this.era=n,this.year=r,this.month=a,this.day=o,fG(this)}}var ht=new WeakMap;class hn{copy(){return new hn(this.hour,this.minute,this.second,this.millisecond)}add(e){return f0(this,e)}subtract(e){return f0(this,fZ(e))}set(e){return fq(this,e)}cycle(e,t,n){return f4(this,e,t,n)}toString(){return f6(this)}compare(e){var t,n;return t=this,n=e,hC(t)-hC(n)}constructor(e=0,t=0,n=0,r=0){p$(this,ht,{writable:!0,value:void 0}),this.hour=e,this.minute=t,this.second=n,this.millisecond=r,fJ(this)}}var hr=new WeakMap;class ha{copy(){return this.era?new ha(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new ha(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return fW(this,e)}subtract(e){return fW(this,fZ(e))}set(e){return fY(fq(this,e),e)}cycle(e,t,n){switch(e){case"era":case"year":case"month":case"day":return f1(this,e,t,n);default:return f4(this,e,t,n)}}toDate(e,t){return hp(this,e,t)}toString(){return f9(this)}compare(e){var t,n;let r=hS(this,e);return 0===r?(t=this,n=hg(e),hC(t)-hC(n)):r}constructor(...e){p$(this,hr,{writable:!0,value:void 0});let[t,n,r,a,o]=f8(e);this.calendar=t,this.era=n,this.year=r,this.month=a,this.day=o,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,fG(this)}}var ho=new WeakMap;class hi{copy(){return this.era?new hi(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new hi(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return f3(this,e)}subtract(e){return f3(this,fZ(e))}set(e,t){let n,r;return 0===(r=fq(fY(n=hg(this),e),e)).compare(n)?this:hy(hf(hm(r,this.timeZone,t),this.timeZone),this.calendar)}cycle(e,t,n){return function(e,t,n,r){switch(t){case"hour":{let t=0,a=23;if((null==r?void 0:r.hourCycle)===12){let n=e.hour>=12;t=12*!!n,a=n?23:11}let o=hg(e),i=hy(fq(o,{hour:t}),new fU),s=[hm(i,e.timeZone,"earlier"),hm(i,e.timeZone,"later")].filter(t=>hf(t,e.timeZone).day===i.day)[0],l=hy(fq(o,{hour:a}),new fU),u=[hm(l,e.timeZone,"earlier"),hm(l,e.timeZone,"later")].filter(t=>hf(t,e.timeZone).day===l.day).pop(),c=hs(e)-e.offset,d=Math.floor(c/36e5),m=c%36e5;return hy(hf(c=36e5*f2(d,n,Math.floor(s/36e5),Math.floor(u/36e5),null==r?void 0:r.round)+m,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return f4(e,t,n,r);case"era":case"year":case"month":case"day":return hy(hf(hm(f1(hg(e),t,n,r),e.timeZone),e.timeZone),e.calendar);default:throw Error("Unsupported field "+t)}}(this,e,t,n)}toDate(){var e;return e=this,new Date(hs(e)-e.offset)}toString(){var e;let t,n,r;return`${f9(this)}${t=0>Math.sign(e=this.offset)?"-":"+",n=Math.floor((e=Math.abs(e))/36e5),r=e%36e5/6e4,`${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}[${this.timeZone}]`}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-(function(e,t){if(e instanceof hi){var n,r;return e.timeZone===t?e:(n=e,r=t,hy(hf(hs(n)-n.offset,r),n.calendar))}return hf(hm(e,t,void 0),t)})(e,this.timeZone).toDate().getTime()}constructor(...e){p$(this,ho,{writable:!0,value:void 0});let[t,n,r,a,o]=f8(e),i=e.shift(),s=e.shift();this.calendar=t,this.era=n,this.year=r,this.month=a,this.day=o,this.timeZone=i,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,fG(this)}}function hs(e){return hl(fF((e=hy(e,new fU)).era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function hl(e,t,n,r,a,o,i){let s=new Date;return s.setUTCHours(r,a,o,i),s.setUTCFullYear(e,t-1,n),s.getTime()}function hu(e,t){if("UTC"===t)return 0;if(e>0&&t===hR())return -6e4*new Date(e).getTimezoneOffset();let{year:n,month:r,day:a,hour:o,minute:i,second:s}=hd(e,t);return hl(n,r,a,o,i,s,0)-1e3*Math.floor(e/1e3)}let hc=new Map;function hd(e,t){let n=hc.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),hc.set(t,n));let r=n.formatToParts(new Date(e)),a={};for(let e of r)"literal"!==e.type&&(a[e.type]=e.value);return{year:"BC"===a.era||"B"===a.era?-a.year+1:+a.year,month:+a.month,day:+a.day,hour:"24"===a.hour?0:+a.hour,minute:+a.minute,second:+a.second}}function hm(e,t,n="compatible"){var r,a,o;let i=hg(e);if("UTC"===t)return hs(i);if(t===hR()&&"compatible"===n){i=hy(i,new fU);let e=new Date,t=fF(i.era,i.year);return e.setFullYear(t,i.month-1,i.day),e.setHours(i.hour,i.minute,i.second,i.millisecond),e.getTime()}let s=hs(i),l=hu(s-864e5,t),u=hu(s+864e5,t),c=(r=i,((a=s-l)==(o=s-u)?[a]:[a,o]).filter(e=>{var n;let a;return n=r,a=hd(e,t),n.year===a.year&&n.month===a.month&&n.day===a.day&&n.hour===a.hour&&n.minute===a.minute&&n.second===a.second}));if(1===c.length)return c[0];if(c.length>1)switch(n){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(s-l,s-u);case"compatible":case"later":return Math.max(s-l,s-u);case"reject":throw RangeError("No such absolute time found")}}function hp(e,t,n="compatible"){return new Date(hm(e,t,n))}function hf(e,t){let n=hu(e,t),r=new Date(e+n),a=r.getUTCFullYear();return new hi(a<1?"BC":"AD",a<1?-a+1:a,r.getUTCMonth()+1,r.getUTCDate(),t,n,r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())}function hh(e){return new he(e.calendar,e.era,e.year,e.month,e.day)}function hg(e,t){let n=0,r=0,a=0,o=0;if("timeZone"in e)({hour:n,minute:r,second:a,millisecond:o}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:a,millisecond:o}=t),new ha(e.calendar,e.era,e.year,e.month,e.day,n,r,a,o)}function hy(e,t){if(hE(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,fG(r),r}let hv={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function hb(e,t){return t=hy(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function hw(e,t){return hE(e.calendar,t.calendar)&&hb(e,t)}function hE(e,t){var n,r,a,o;return null!=(o=null!=(a=null==(n=e.isEqual)?void 0:n.call(e,t))?a:null==(r=t.isEqual)?void 0:r.call(t,e))?o:e.identifier===t.identifier}let hx={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function hD(e,t,n){let r,a=Math.ceil(e.calendar.toJulianDay(e)+1-(n?hx[n]:(r=function(e){if(Intl.Locale){let t=hN.get(e);return!t&&(t=new Intl.Locale(e).maximize().region)&&hN.set(e,t),t}let t=e.split("-")[1];return"u"===t?void 0:t}(t))&&hv[r]||0))%7;return a<0&&(a+=7),a}function h_(e){return hf(Date.now(),e)}function hk(e){return hh(h_(e))}function hS(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function hC(e){return 36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}let hP=null;function hR(){return null==hP&&(hP=new Intl.DateTimeFormat().resolvedOptions().timeZone),hP}function hT(e){return e.subtract({days:e.day-1})}function h$(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function hO(e,t,n){let r=hD(e,t,n);return e.subtract({days:r})}let hN=new Map;function hA(e,t){return e&&t?0>=e.compare(t)?e:t:e||t}function hI(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}let hj=Symbol.for("react-aria.i18n.locale"),hM=Symbol.for("react-aria.i18n.strings");class hL{getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,n="en-US"){var r;if(t[e])return t[e];let a=(r=e,Intl.Locale?new Intl.Locale(r).language:r.split("-")[0]);if(t[a])return t[a];for(let e in t)if(e.startsWith(a+"-"))return t[e];return t[n]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if("u"<typeof window)return null;let t=window[hj];if(void 0===p){let e=window[hM];if(!e)return null;for(let n in p={},e)p[n]=new hL({[t]:e[n]},t)}let n=null==p?void 0:p[e];if(!n)throw Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return n}constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}}let hF=new Map,hB=new Map;class hV{format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return"function"==typeof n?n(t,this):n}plural(e,t,n="cardinal"){let r=t["="+e];if(r)return"function"==typeof r?r():r;let a=this.locale+":"+n,o=hF.get(a);return o||(o=new Intl.PluralRules(this.locale,{type:n}),hF.set(a,o)),"function"==typeof(r=t[o.select(e)]||t.other)?r():r}number(e){let t=hB.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),hB.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return"function"==typeof n?n():n}constructor(e,t){this.locale=e,this.strings=t}}let hU=new WeakMap;function hW(e,t){let n;return t&&hL.getGlobalDictionaryForPackage(t)||((n=hU.get(e))||(n=new hL(e),hU.set(e,n)),n)}function hH(e,t){let{locale:n}=fA(),r=hW(e,t);return(0,l$.useMemo)(()=>new hV(n,r),[n,r])}let hz=new Map;class hK{format(e){return this.formatter.format(e)}formatToParts(e){return this.formatter.formatToParts(e)}formatRange(e,t){if("function"==typeof this.formatter.formatRange)return this.formatter.formatRange(e,t);if(t<e)throw RangeError("End date must be >= start date");return`${this.formatter.format(e)} \u{2013} ${this.formatter.format(t)}`}formatRangeToParts(e,t){if("function"==typeof this.formatter.formatRangeToParts)return this.formatter.formatRangeToParts(e,t);if(t<e)throw RangeError("End date must be >= start date");let n=this.formatter.formatToParts(e),r=this.formatter.formatToParts(t);return[...n.map(e=>({...e,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return null==hq&&(hq="h12"===new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle),hq&&(this.resolvedHourCycle||(this.resolvedHourCycle=function(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,"");let n=hZ(e+=(e.includes("-u-")?"":"-u")+"-nu-latn",{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(e=>"hour"===e.type).value,10),a=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(e=>"hour"===e.type).value,10);if(0===r&&23===a)return"h23";if(24===r&&23===a)return"h24";if(0===r&&11===a)return"h11";if(12===r&&11===a)return"h12";throw Error("Unexpected hour cycle result")}(e.locale,this.options)),e.hourCycle=this.resolvedHourCycle,e.hour12="h11"===this.resolvedHourCycle||"h12"===this.resolvedHourCycle),"ethiopic-amete-alem"===e.calendar&&(e.calendar="ethioaa"),e}constructor(e,t={}){this.formatter=hZ(e,t),this.options=t}}let hG={true:{ja:"h11"},false:{}};function hZ(e,t={}){if("boolean"==typeof t.hour12&&(null==hY&&(hY="24"===new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))),hY)){let n=hG[String((t={...t}).hour12)][e.split("-")[0]],r=t.hour12?"h12":"h23";t.hourCycle=null!=n?n:r,delete t.hour12}let n=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(hz.has(n))return hz.get(n);let r=new Intl.DateTimeFormat(e,t);return hz.set(n,r),r}let hY=null,hq=null;function hJ(e,t){let n=(0,l$.useRef)(null);return e&&n.current&&t(e,n.current)&&(e=n.current),n.current=e,e}function hX(e){e=hJ(null!=e?e:{},hQ);let{locale:t}=fA();return(0,l$.useMemo)(()=>new hK(t,e),[t,e])}function hQ(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(t[r]!==e[r])return!1;return!0}function h0(e){return e&&e.__esModule?e.default:e}let h1=new WeakMap;function h4(e){return(null==e?void 0:e.calendar.identifier)==="gregory"&&"BC"===e.era?"short":void 0}function h2(e,t,n,r){let a=hH(h0(fI),"@react-aria/calendar"),o=h4(e)||h4(t),i=hX({month:"long",year:"numeric",era:o,calendar:e.calendar.identifier,timeZone:n}),s=hX({month:"long",year:"numeric",day:"numeric",era:o,calendar:e.calendar.identifier,timeZone:n});return(0,l$.useMemo)(()=>{if(hb(e,hT(e))){let o=e,s=t;if(e.calendar.getFormattableMonth&&(o=e.calendar.getFormattableMonth(e)),t.calendar.getFormattableMonth&&(s=t.calendar.getFormattableMonth(t)),hb(t,h$(e)))return i.format(o.toDate(n));if(hb(t,h$(t)))return r?h3(i,a,o,s,n):i.formatRange(o.toDate(n),s.toDate(n))}return r?h3(s,a,e,t,n):s.formatRange(e.toDate(n),t.toDate(n))},[e,t,i,s,a,n,r])}function h3(e,t,n,r,a){let o=e.formatRangeToParts(n.toDate(a),r.toDate(a)),i=-1;for(let e=0;e<o.length;e++){let t=o[e];if("shared"===t.source&&"literal"===t.type)i=e;else if("endRange"===t.source)break}let s="",l="";for(let e=0;e<o.length;e++)e<i?s+=o[e].value:e>i&&(l+=o[e].value);return t.format("dateRange",{startDate:s,endDate:l})}function h6(e,t){let n=(0,l$.useRef)(!0),r=(0,l$.useRef)(null);(0,l$.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),(0,l$.useEffect)(()=>{let a=r.current;n.current?n.current=!1:(!a||t.some((e,t)=>!Object.is(e,a[t])))&&e(),r.current=t},t)}function h5(e,t){let{id:n,"aria-label":r,"aria-labelledby":a}=e;return n=mV(n),a&&r?a=[...new Set([n,...a.trim().split(/\s+/)])].join(" "):a&&(a=a.trim().split(/\s+/).join(" ")),r||a||!t||(r=t),{id:n,"aria-label":r,"aria-labelledby":a}}function h9(e,t){var n,r;let a,o,i,s,l,u=hH((n=fI)&&n.__esModule?n.default:n,"@react-aria/calendar"),c=m5(e),d=h2(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),m=h2(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);h6(()=>{t.isFocused||m0(m)},[m]);let p=(i=hH(h0(fI),"@react-aria/calendar"),"highlightedRange"in t?{start:a,end:o}=t.highlightedRange||{}:a=o=null!=(r=t.value)?r:void 0,s=hX({weekday:"long",month:"long",year:"numeric",day:"numeric",era:h4(a)||h4(o),timeZone:t.timeZone}),l="anchorDate"in t?t.anchorDate:null,(0,l$.useMemo)(()=>{if(!l&&a&&o)if(hb(a,o)){let e=s.format(a.toDate(t.timeZone));return i.format("selectedDateDescription",{date:e})}else{let e=h3(s,i,a,o,t.timeZone);return i.format("selectedRangeDescription",{dateRange:e})}return""},[a,o,l,t.timeZone,i,s]));h6(()=>{p&&m0(p,"polite",4e3)},[p]);let f=mU([!!e.errorMessage,e.isInvalid,e.validationState]);h1.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:f,selectedDateDescription:p});let[h,g]=(0,l$.useState)(!1),y=e.isDisabled||t.isNextVisibleRangeInvalid();y&&h&&(g(!1),t.setFocused(!0));let[v,b]=(0,l$.useState)(!1),w=e.isDisabled||t.isPreviousVisibleRangeInvalid();return w&&v&&(b(!1),t.setFocused(!0)),{calendarProps:mH(c,h5({id:e.id,"aria-label":[e["aria-label"],m].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]}),{role:"application","aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":u.format("next"),isDisabled:y,onFocusChange:g},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":u.format("previous"),isDisabled:w,onFocusChange:b},errorMessageProps:{id:f},title:d}}let h8={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function h7(e){let{children:t,elementType:n="div",isFocusable:r,style:a,...o}=e,{visuallyHiddenProps:i}=function(e={}){let{style:t,isFocusable:n}=e,[r,a]=(0,l$.useState)(!1),{focusWithinProps:o}=fl({isDisabled:!n,onFocusWithinChange:e=>a(e)}),i=(0,l$.useMemo)(()=>r?t:t?{...h8,...t}:h8,[r]);return{visuallyHiddenProps:{...o,style:i}}}(e);return lO().createElement(n,mH(o,i),t)}function ge(e,t,n,r){let a=mR(n),o=null==n;(0,l$.useEffect)(()=>{if(o||!e.current)return;let n=e.current;return n.addEventListener(t,a,r),()=>{n.removeEventListener(t,a,r)}},[e,t,r,o,a])}let gt=0,gn=new Map;function gr(e){let[t,n]=(0,l$.useState)();return mP(()=>{if(!e)return;let t=gn.get(e);if(t)n(t.element.id);else{let r=`react-aria-description-${gt++}`;n(r);let a=document.createElement("div");a.id=r,a.style.display="none",a.textContent=e,document.body.appendChild(a),t={refCount:0,element:a},gn.set(e,t)}return t.refCount++,()=>{t&&0==--t.refCount&&(t.element.remove(),gn.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function ga(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}function go(e,t,n){let r="left"===n?"offsetLeft":"offsetTop",a=0;for(;t.offsetParent&&(a+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){a-=e[r];break}t=t.offsetParent}return a}function gi(e,t){if(e&&document.contains(e)){let i=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(i).overflow)for(let t of function(e){let t=[];for(;e&&e!==document.documentElement;)ga(e,void 0)&&t.push(e),e=e.parentElement;return t}(e))!function(e,t){let n=go(e,t,"left"),r=go(e,t,"top"),a=t.offsetWidth,o=t.offsetHeight,i=e.scrollLeft,s=e.scrollTop,{borderTopWidth:l,borderLeftWidth:u,scrollPaddingTop:c,scrollPaddingRight:d,scrollPaddingBottom:m,scrollPaddingLeft:p}=getComputedStyle(e),f=i+parseInt(u,10),h=s+parseInt(l,10),g=f+e.clientWidth,y=h+e.clientHeight,v=parseInt(c,10)||0,b=parseInt(m,10)||0,w=parseInt(d,10)||0,E=parseInt(p,10)||0;n<=i+E?i=n-parseInt(u,10)-E:n+a>g-w&&(i+=n+a-g+w),r<=h+v?s=r-parseInt(l,10)-v:r+o>y-b&&(s+=r+o-y+b),e.scrollLeft=i,e.scrollTop=s}(t,e);else{var n,r,a,o;let{left:i,top:s}=e.getBoundingClientRect();null==e||null==(n=e.scrollIntoView)||n.call(e,{block:"nearest"});let{left:l,top:u}=e.getBoundingClientRect();(Math.abs(i-l)>1||Math.abs(s-u)>1)&&(null==t||null==(a=t.containingElement)||null==(r=a.scrollIntoView)||r.call(a,{block:"center",inline:"center"}),null==(o=e.scrollIntoView)||o.call(e,{block:"nearest"}))}}}function gs(e,t){let n=e;for(ga(n,t)&&(n=n.parentElement);n&&!ga(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}class gl extends fU{fromJulianDay(e){let t=super.fromJulianDay(e);return new he(this,fF(t.era,t.year)- -543,t.month,t.day)}toJulianDay(e){return super.toJulianDay(gu(e))}getEras(){return["BE"]}getDaysInMonth(e){return super.getDaysInMonth(gu(e))}balanceDate(){}constructor(...e){super(...e),this.identifier="buddhist"}}function gu(e){let[t,n]=fB(e.year+-543);return new he(t,n,e.month,e.day)}function gc(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1}function gd(e,t){let n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-gc(e,n,1,1))/30),a=t+1-gc(e,n,r,1);return[n,r,a]}function gm(e){return Math.floor(e%4/3)}function gp(e,t){return t%13!=0?30:gm(e)+5}class gf{fromJulianDay(e){let[t,n,r]=gd(1723856,e),a="AM";return t<=0&&(a="AA",t+=5500),new he(this,a,t,n,r)}toJulianDay(e){let t=e.year;return"AA"===e.era&&(t-=5500),gc(1723856,t,e.month,e.day)}getDaysInMonth(e){return gp(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+gm(e.year)}getYearsInEra(e){return"AA"===e.era?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class gh extends gf{fromJulianDay(e){let[t,n,r]=gd(1723856,e);return new he(this,"AA",t+=5500,n,r)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier="ethioaa"}}class gg extends gf{fromJulianDay(e){let[t,n,r]=gd(1824665,e),a="CE";return t<=0&&(a="BCE",t=1-t),new he(this,a,t,n,r)}toJulianDay(e){let t=e.year;return"BCE"===e.era&&(t=1-t),gc(1824665,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return"BCE"===e.era&&(t=1-t),gp(t,e.month)}isInverseEra(e){return"BCE"===e.era}balanceDate(e){e.year<=0&&(e.era="BCE"===e.era?"CE":"BCE",e.year=1-e.year)}getEras(){return["BCE","CE"]}getYearsInEra(e){return"BCE"===e.era?9999:9715}constructor(...e){super(...e),this.identifier="coptic"}}let gy=765433;function gv(e){return 7>fj(7*e+1,19)}function gb(e){let t=Math.floor((235*e-234)/19),n=29*t+Math.floor((12084+13753*t)/25920);return 3>fj(3*(n+1),7)&&(n+=1),n}function gw(e){let t,n;return gb(e)+(t=gb(e-1),n=gb(e),gb(e+1)-n==356?2:+(n-t==382))}function gE(e){return gw(e+1)-gw(e)}function gx(e,t){if(t>=6&&!gv(e)&&t++,4===t||7===t||9===t||11===t||13===t)return 29;let n=function(e){let t=gE(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}(e);return 2===t?2===n?30:29:3===t?0===n?29:30:6===t?30*!!gv(e):30}class gD{fromJulianDay(e){let t=e-347997,n=Math.floor((25920*t/gy*19+234)/235)+1,r=gw(n),a=Math.floor(t-r);for(;a<1;)a=Math.floor(t-(r=gw(--n)));let o=1,i=0;for(;i<a;)i+=gx(n,o),o++;let s=a-(i-=gx(n,--o));return new he(this,n,o,s)}toJulianDay(e){let t=gw(e.year);for(let n=1;n<e.month;n++)t+=gx(e.year,n);return t+e.day+347997}getDaysInMonth(e){return gx(e.year,e.month)}getMonthsInYear(e){return gv(e.year)?13:12}getDaysInYear(e){return gE(e.year)}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(e,t){t.year!==e.year&&(gv(t.year)&&!gv(e.year)&&t.month>6?e.month--:!gv(t.year)&&gv(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier="hebrew"}}class g_ extends fU{fromJulianDay(e){let t,n,r,a=super.fromJulianDay(e),o=a.year-78,i=e-fM(a.era,a.year,1,1);if(i<80?(o--,i+=(t=fL(a.year-1)?31:30)+155+90+10):(t=fL(a.year)?31:30,i-=80),i<t)n=1,r=i+1;else{let e=i-t;e<155?(n=Math.floor(e/31)+2,r=e%31+1):(e-=155,n=Math.floor(e/30)+7,r=e%30+1)}return new he(this,o,n,r)}toJulianDay(e){let t,n,[r,a]=fB(e.year+78);return(fL(a)?(t=31,n=fM(r,a,3,21)):(t=30,n=fM(r,a,3,22)),1===e.month)?n+e.day-1:(n+=t+31*Math.min(e.month-2,5),e.month>=8&&(n+=(e.month-7)*30),n+=e.day-1)}getDaysInMonth(e){return 1===e.month&&fL(e.year+78)||e.month>=2&&e.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...e){super(...e),this.identifier="indian"}}function gk(e,t,n,r){return r+Math.ceil(29.5*(n-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function gS(e,t,n){let r=Math.floor((30*(n-t)+10646)/10631),a=Math.min(12,Math.ceil((n-(29+gk(t,r,1,1)))/29.5)+1),o=n-gk(t,r,a,1)+1;return new he(e,r,a,o)}function gC(e){return(14+11*e)%30<11}class gP{fromJulianDay(e){return gS(this,1948440,e)}toJulianDay(e){return gk(1948440,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return 12===e.month&&gC(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return gC(e.year)?355:354}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class gR extends gP{fromJulianDay(e){return gS(this,1948439,e)}toJulianDay(e){return gk(1948439,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier="islamic-tbla"}}function gT(e){return 460322+u[e-1300]}function g$(e,t){return(l[e-1300]&1<<11-(t-1))==0?29:30}function gO(e,t){let n=gT(e);for(let r=1;r<t;r++)n+=g$(e,r);return n}function gN(e){return u[e+1-1300]-u[e-1300]}class gA extends gP{fromJulianDay(e){let t=e-1948440,n=gT(1300),r=gT(1600);if(t<n||t>r)return super.fromJulianDay(e);{let e=1299,n=1,r=1;for(;r>0;){r=t-gT(++e)+1;let a=gN(e);if(r===a){n=12;break}if(r<a){let t=g$(e,n);for(n=1;r>t;)r-=t,t=g$(e,++n);break}}return new he(this,e,n,t-gO(e,n)+1)}}toJulianDay(e){return e.year<1300||e.year>1600?super.toJulianDay(e):1948440+gO(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<1300||e.year>1600?super.getDaysInMonth(e):g$(e.year,e.month)}getDaysInYear(e){return e.year<1300||e.year>1600?super.getDaysInYear(e):gN(e.year)}constructor(){if(super(),this.identifier="islamic-umalqura",l||(l=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),e=>e.charCodeAt(0)).buffer)),!u){u=new Uint32Array(301);let e=0;for(let t=1300;t<=1600;t++){u[t-1300]=e;for(let n=1;n<=12;n++)e+=g$(t,n)}}}}let gI=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],gj=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],gM=[1867,1911,1925,1988,2018],gL=["meiji","taisho","showa","heisei","reiwa"];function gF(e){let t=gI.findIndex(([t,n,r])=>!!(e.year<t)||e.year===t&&!!(e.month<n)||e.year===t&&e.month===n&&!!(e.day<r));return -1===t?gI.length-1:0===t?0:t-1}function gB(e){let t=gM[gL.indexOf(e.era)];if(!t)throw Error("Unknown era: "+e.era);return new he(e.year+t,e.month,e.day)}class gV extends fU{fromJulianDay(e){let t=super.fromJulianDay(e),n=gF(t);return new he(this,gL[n],t.year-gM[n],t.month,t.day)}toJulianDay(e){return super.toJulianDay(gB(e))}balanceDate(e){let t=gB(e),n=gF(t);gL[n]!==e.era&&(e.era=gL[n],e.year=t.year-gM[n]),this.constrainDate(e)}constrainDate(e){let t=gL.indexOf(e.era),n=gj[t];if(null!=n){let[r,a,o]=n,i=r-gM[t];e.year=Math.max(1,Math.min(i,e.year)),e.year===i&&(e.month=Math.min(a,e.month),e.month===a&&(e.day=Math.min(o,e.day)))}if(1===e.year&&t>=0){let[,n,r]=gI[t];e.month=Math.max(n,e.month),e.month===n&&(e.day=Math.max(r,e.day))}}getEras(){return gL}getYearsInEra(e){let t=gL.indexOf(e.era),n=gI[t],r=gI[t+1];if(null==r)return 9999-n[0]+1;let a=r[0]-n[0];return(e.month<r[1]||e.month===r[1]&&e.day<r[2])&&a++,a}getDaysInMonth(e){return super.getDaysInMonth(gB(e))}getMinimumMonthInYear(e){let t=gU(e);return t?t[1]:1}getMinimumDayInMonth(e){let t=gU(e);return t&&e.month===t[1]?t[2]:1}constructor(...e){super(...e),this.identifier="japanese"}}function gU(e){if(1===e.year)return gI[gL.indexOf(e.era)]}let gW=[0,31,62,93,124,155,186,216,246,276,306,336];class gH{fromJulianDay(e){let t=e-1948320,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),a=r<216?Math.floor(r/31):Math.floor((r-6)/30),o=r-gW[a]+1;return new he(this,n,a+1,o)}toJulianDay(e){let t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=gW[e.month-1],t+=e.day}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||8>fj(25*e.year+11,33)?30:29}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}function gz(e){return"minguo"===e.era?e.year+1911:1-e.year+1911}function gK(e){let t=e-1911;return t>0?["minguo",t]:["before_minguo",1-t]}class gG extends fU{fromJulianDay(e){let t=super.fromJulianDay(e),[n,r]=gK(fF(t.era,t.year));return new he(this,n,r,t.month,t.day)}toJulianDay(e){return super.toJulianDay(gZ(e))}getEras(){return["before_minguo","minguo"]}balanceDate(e){let[t,n]=gK(gz(e));e.era=t,e.year=n}isInverseEra(e){return"before_minguo"===e.era}getDaysInMonth(e){return super.getDaysInMonth(gZ(e))}getYearsInEra(e){return"before_minguo"===e.era?9999:8088}constructor(...e){super(...e),this.identifier="roc"}}function gZ(e){let[t,n]=fB(gz(e));return new he(t,n,e.month,e.day)}function gY(e){switch(e){case"buddhist":return new gl;case"ethiopic":return new gf;case"ethioaa":return new gh;case"coptic":return new gg;case"hebrew":return new gD;case"indian":return new g_;case"islamic-civil":return new gP;case"islamic-tbla":return new gR;case"islamic-umalqura":return new gA;case"japanese":return new gV;case"persian":return new gH;case"roc":return new gG;default:return new fU}}function gq(e,t,n){return null!=t&&0>e.compare(t)||null!=n&&e.compare(n)>0}function gJ(e,t,n,r,a){let o={};for(let e in t)o[e]=Math.floor(t[e]/2),o[e]>0&&t[e]%2==0&&o[e]--;let i=gX(e,t,n).subtract(o);return g0(e,i,t,n,r,a)}function gX(e,t,n,r,a){let o=e;if(t.years)o=hT(e.subtract({months:e.month-1}));else t.months?o=hT(e):t.weeks&&(o=hO(e,n));return g0(e,o,t,n,r,a)}function gQ(e,t,n,r,a){let o={...t};o.days?o.days--:o.weeks?o.weeks--:o.months?o.months--:o.years&&o.years--;let i=gX(e,t,n).subtract(o);return g0(e,i,t,n,r,a)}function g0(e,t,n,r,a,o){if(a&&e.compare(a)>=0){let e=hI(t,gX(hh(a),n,r));e&&(t=e)}if(o&&0>=e.compare(o)){let e=hA(t,gQ(hh(o),n,r));e&&(t=e)}return t}function g1(e,t,n){if(t){let n=hI(e,hh(t));n&&(e=n)}if(n){let t=hA(e,hh(n));t&&(e=t)}return e}function g4(e,t,n){if(!n)return e;for(;e.compare(t)>=0&&n(e);)e=e.subtract({days:1});return e.compare(t)>=0?e:null}function g2(e,t,n){let[r,a]=(0,l$.useState)(e||t),o=(0,l$.useRef)(void 0!==e),i=void 0!==e;(0,l$.useEffect)(()=>{o.current,o.current=i},[i]);let s=i?e:r,l=(0,l$.useCallback)((e,...t)=>{let r=(e,...t)=>{n&&!Object.is(s,e)&&n(e,...t),i||(s=e)};"function"==typeof e?a((n,...a)=>{let o=e(i?s:n,...a);return(r(o,...t),i)?n:o}):(i||a(e),r(e,...t))},[i,s,n]);return[s,l]}function g3(e){var t,n,r;let a=(0,l$.useMemo)(()=>new hK(e.locale),[e.locale]),o=(0,l$.useMemo)(()=>a.resolvedOptions(),[a]),{locale:i,createCalendar:s,visibleDuration:l={months:1},minValue:u,maxValue:c,selectionAlignment:d,isDateUnavailable:m,pageBehavior:p="visible",firstDayOfWeek:f}=e,h=(0,l$.useMemo)(()=>s(o.calendar),[s,o.calendar]),[g,y]=g2(e.value,null!=(t=e.defaultValue)?t:null,e.onChange),v=(0,l$.useMemo)(()=>g?hy(hh(g),h):null,[g,h]),b=(0,l$.useMemo)(()=>g&&"timeZone"in g?g.timeZone:o.timeZone,[g,o.timeZone]),[w,E]=g2((0,l$.useMemo)(()=>e.focusedValue?g1(hy(hh(e.focusedValue),h),u,c):void 0,[e.focusedValue,h,u,c]),(0,l$.useMemo)(()=>g1(e.defaultFocusedValue?hy(hh(e.defaultFocusedValue),h):v||hy(hk(b),h),u,c),[e.defaultFocusedValue,v,b,h,u,c]),e.onFocusChange),[x,D]=(0,l$.useState)(()=>{switch(d){case"start":return gX(w,l,i,u,c);case"end":return gQ(w,l,i,u,c);default:return gJ(w,l,i,u,c)}}),[_,k]=(0,l$.useState)(e.autoFocus||!1),S=(0,l$.useMemo)(()=>{let e={...l};return e.days?e.days--:e.days=-1,x.add(e)},[x,l]),[C,P]=(0,l$.useState)(h);if(!hE(h,C)){let e=hy(w,h);D(gJ(e,l,i,u,c)),E(e),P(h)}function R(e){E(e=g1(e,u,c))}function T(t){if(!e.isDisabled&&!e.isReadOnly){let e=t;if(null===e)return void y(null);(e=g4(e=g1(e,u,c),x,m))&&(e=hy(e,(null==g?void 0:g.calendar)||new fU),g&&"hour"in g?y(g.set(e)):y(e))}}gq(w,u,c)?E(g1(w,u,c)):0>w.compare(x)?D(gQ(w,l,i,u,c)):w.compare(S)>0&&D(gX(w,l,i,u,c));let $=(0,l$.useMemo)(()=>!!v&&(!!(m&&m(v))||gq(v,u,c)),[v,m,u,c]),O=e.isInvalid||"invalid"===e.validationState||$,N=(0,l$.useMemo)(()=>"visible"===p?l:g6(l),[p,l]);return{isDisabled:null!=(n=e.isDisabled)&&n,isReadOnly:null!=(r=e.isReadOnly)&&r,value:v,setValue:T,visibleRange:{start:x,end:S},minValue:u,maxValue:c,focusedDate:w,timeZone:b,validationState:O?"invalid":null,isValueInvalid:O,setFocusedDate(e){R(e),k(!0)},focusNextDay(){R(w.add({days:1}))},focusPreviousDay(){R(w.subtract({days:1}))},focusNextRow(){l.days?this.focusNextPage():(l.weeks||l.months||l.years)&&R(w.add({weeks:1}))},focusPreviousRow(){l.days?this.focusPreviousPage():(l.weeks||l.months||l.years)&&R(w.subtract({weeks:1}))},focusNextPage(){let e=x.add(N);E(g1(w.add(N),u,c)),D(gX(g0(w,e,N,i,u,c),N,i))},focusPreviousPage(){let e=x.subtract(N);E(g1(w.subtract(N),u,c)),D(gX(g0(w,e,N,i,u,c),N,i))},focusSectionStart(){l.days?R(x):l.weeks?R(hO(w,i)):(l.months||l.years)&&R(hT(w))},focusSectionEnd(){l.days?R(S):l.weeks?R(hO(w,i,void 0).add({days:6})):(l.months||l.years)&&R(h$(w))},focusNextSection(e){e||l.days?l.days?this.focusNextPage():l.weeks?R(w.add({months:1})):(l.months||l.years)&&R(w.add({years:1})):R(w.add(g6(l)))},focusPreviousSection(e){e||l.days?l.days?this.focusPreviousPage():l.weeks?R(w.subtract({months:1})):(l.months||l.years)&&R(w.subtract({years:1})):R(w.subtract(g6(l)))},selectFocusedDate(){m&&m(w)||T(w)},selectDate(e){T(e)},isFocused:_,setFocused:k,isInvalid:e=>gq(e,u,c),isSelected(e){return null!=v&&hb(e,v)&&!this.isCellDisabled(e)&&!this.isCellUnavailable(e)},isCellFocused:e=>_&&w&&hb(e,w),isCellDisabled(t){return e.isDisabled||0>t.compare(x)||t.compare(S)>0||this.isInvalid(t)},isCellUnavailable:t=>!!e.isDateUnavailable&&e.isDateUnavailable(t),isPreviousVisibleRangeInvalid(){let e=x.subtract({days:1});return hb(e,x)||this.isInvalid(e)},isNextVisibleRangeInvalid(){let e=S.add({days:1});return hb(e,S)||this.isInvalid(e)},getDatesInWeek(e,t=x){let n=t.add({weeks:e}),r=[],a=hD(n=hO(n,i,f),i,f);for(let e=0;e<a;e++)r.push(null);for(;r.length<7;){r.push(n);let e=n.add({days:1});if(hb(n,e))break;n=e}for(;r.length<7;)r.push(null);return r}}}function g6(e){let t={...e};for(let n in e)t[n]=1;return t}function g5(e,t){return e&&t?(0>t.compare(e)&&([e,t]=[t,e]),{start:hh(e),end:hh(t)}):null}function g9(e,t){return(e=hy(e,(null==t?void 0:t.calendar)||new fU),t&&"hour"in t)?t.set(e):e}function g8(e,t,n){let r=e.add({days:n});for(;(n<0?r.compare(t.visibleRange.start)>=0:0>=r.compare(t.visibleRange.end))&&!t.isCellUnavailable(r);)r=r.add({days:n});if(t.isCellUnavailable(r))return r.add({days:-n})}let g7=(0,l$.createContext)(null),ye=(0,l$.createContext)(null),yt=(0,l$.createContext)(null),yn=(0,l$.createContext)(null),yr=(0,l$.forwardRef)(function(e,t){[e,t]=mY(e,t,g7);let{locale:n}=fA(),r=g3({...e,locale:n,createCalendar:e.createCalendar||gY}),{calendarProps:a,prevButtonProps:o,nextButtonProps:i,errorMessageProps:s,title:l}=h9(e,r),u=mG({...e,values:{state:r,isDisabled:e.isDisabled||!1,isInvalid:r.isValueInvalid},defaultClassName:"react-aria-Calendar"});return lO().createElement("div",{...u,...a,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":r.isValueInvalid||void 0},lO().createElement(mK,{values:[[fv,{slots:{previous:o,next:i}}],[fw,{"aria-hidden":!0,level:2,children:l}],[yt,r],[g7,e],[fE,{slots:{errorMessage:s}}]]},lO().createElement(h7,null,lO().createElement("h2",null,a["aria-label"])),u.children,lO().createElement(h7,null,lO().createElement("button",{"aria-label":i["aria-label"],disabled:i.isDisabled,onClick:()=>r.focusNextPage(),tabIndex:-1}))))}),ya=(0,l$.forwardRef)(function(e,t){var n,r;let a,o,i;[e,t]=mY(e,t,ye);let{locale:s}=fA(),l=function(e){let{value:t,defaultValue:n,onChange:r,createCalendar:a,locale:o,visibleDuration:i={months:1},minValue:s,maxValue:l,...u}=e,[c,d]=g2(t,n||null,r),[m,p]=(0,l$.useState)(null),f="center";if(c&&c.start&&c.end){let e=gJ(hh(c.start),i,o,s,l).add(i).subtract({days:1});c.end.compare(e)>0&&(f="start")}let h=(0,l$.useRef)(null),[g,y]=(0,l$.useState)(null),v=(0,l$.useMemo)(()=>hI(s,null==g?void 0:g.start),[s,g]),b=(0,l$.useMemo)(()=>hA(l,null==g?void 0:g.end),[l,g]),w=g3({...u,value:c&&c.start,createCalendar:a,locale:o,visibleDuration:i,minValue:v,maxValue:b,selectionAlignment:f}),E=t=>{t&&e.isDateUnavailable&&!e.allowsNonContiguousRanges?(h.current={start:g8(t,w,-1),end:g8(t,w,1)},y(h.current)):(h.current=null,y(null))},[x,D]=(0,l$.useState)(w.visibleRange);hw(w.visibleRange.start,x.start)&&hw(w.visibleRange.end,x.end)||(E(m),D(w.visibleRange));let _=e=>{e?(p(e),E(e)):(p(null),E(null))},k=m?g5(m,w.focusedDate):c&&g5(c.start,c.end),S=t=>{if(e.isReadOnly)return;let n=g4(g1(t,v,b),w.visibleRange.start,e.isDateUnavailable);if(n)if(m){let e=g5(m,n);e&&d({start:g9(e.start,null==c?void 0:c.start),end:g9(e.end,null==c?void 0:c.end)}),_(null)}else _(n)},[C,P]=(0,l$.useState)(!1),{isDateUnavailable:R}=e,T=(0,l$.useMemo)(()=>!!c&&!m&&(!!(R&&(R(c.start)||R(c.end)))||gq(c.start,s,l)||gq(c.end,s,l)),[R,c,m,s,l]),$=e.isInvalid||"invalid"===e.validationState||T;return{...w,value:c,setValue:d,anchorDate:m,setAnchorDate:_,highlightedRange:k,validationState:$?"invalid":null,isValueInvalid:$,selectFocusedDate(){S(w.focusedDate)},selectDate:S,highlightDate(e){m&&w.setFocusedDate(e)},isSelected:e=>!!(k&&e.compare(k.start)>=0&&0>=e.compare(k.end)&&!w.isCellDisabled(e)&&!w.isCellUnavailable(e)),isInvalid(e){var t,n;return w.isInvalid(e)||gq(e,null==(t=h.current)?void 0:t.start,null==(n=h.current)?void 0:n.end)},isDragging:C,setDragging:P}}({...e,locale:s,createCalendar:e.createCalendar||gY}),{calendarProps:u,prevButtonProps:c,nextButtonProps:d,errorMessageProps:m,title:p}=(n=e,r=t,a=h9(n,l),o=(0,l$.useRef)(!1),ge(i=(0,l$.useRef)("u">typeof window?window:null),"pointerdown",e=>{o.current=0===e.width&&0===e.height}),ge(i,"pointerup",e=>{if(o.current){o.current=!1;return}if(l.setDragging(!1),!l.anchorDate)return;let t=e.target;r.current&&r.current.contains(document.activeElement)&&(!r.current.contains(t)||!t.closest('button, [role="button"]'))&&l.selectFocusedDate()}),a.calendarProps.onBlur=e=>{r.current&&(e.relatedTarget&&r.current.contains(e.relatedTarget)||!l.anchorDate||l.selectFocusedDate())},ge(r,"touchmove",e=>{l.isDragging&&e.preventDefault()},{passive:!1,capture:!0}),a),f=mG({...e,values:{state:l,isDisabled:e.isDisabled||!1,isInvalid:l.isValueInvalid},defaultClassName:"react-aria-RangeCalendar"});return lO().createElement("div",{...f,...u,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":l.isValueInvalid||void 0},lO().createElement(mK,{values:[[fv,{slots:{previous:c,next:d}}],[fw,{"aria-hidden":!0,level:2,children:p}],[yn,l],[ye,e],[fE,{slots:{errorMessage:m}}]]},lO().createElement(h7,null,lO().createElement("h2",null,u["aria-label"])),f.children,lO().createElement(h7,null,lO().createElement("button",{"aria-label":d["aria-label"],disabled:d.isDisabled,onClick:()=>l.focusNextPage(),tabIndex:-1}))))}),yo=(0,l$.createContext)(null),yi=(0,l$.forwardRef)(function(e,t){var n,r;let a=(0,l$.useContext)(yt),o=(0,l$.useContext)(yn),i=mZ(g7),s=mZ(ye),l=null!=a?a:o,u=l.visibleRange.start;e.offset&&(u=u.add(e.offset));let c=null!=(n=null==i?void 0:i.firstDayOfWeek)?n:null==s?void 0:s.firstDayOfWeek,{gridProps:d,headerProps:m,weekDays:p,weeksInMonth:f}=function(e,t){let n,{startDate:r=t.visibleRange.start,endDate:a=t.visibleRange.end,firstDayOfWeek:o}=e,{direction:i}=fA(),s=h2(r,a,t.timeZone,!0),{ariaLabel:l,ariaLabelledBy:u}=h1.get(t),c=h5({"aria-label":[l,s].filter(Boolean).join(", "),"aria-labelledby":u}),d=hX({weekday:e.weekdayStyle||"narrow",timeZone:t.timeZone}),{locale:m}=fA(),p=(0,l$.useMemo)(()=>{let e=hO(hk(t.timeZone),m,o);return[...Array(7).keys()].map(n=>{let r=e.add({days:n}).toDate(t.timeZone);return d.format(r)})},[m,t.timeZone,d,o]),f=(n=r.calendar.getDaysInMonth(r),Math.ceil((hD(hT(r),m,o)+n)/7));return{gridProps:mH(c,{role:"grid","aria-readonly":t.isReadOnly||void 0,"aria-disabled":t.isDisabled||void 0,"aria-multiselectable":"highlightedRange"in t||void 0,onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),t.selectFocusedDate();break;case"PageUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousSection(e.shiftKey);break;case"PageDown":e.preventDefault(),e.stopPropagation(),t.focusNextSection(e.shiftKey);break;case"End":e.preventDefault(),e.stopPropagation(),t.focusSectionEnd();break;case"Home":e.preventDefault(),e.stopPropagation(),t.focusSectionStart();break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),"rtl"===i?t.focusNextDay():t.focusPreviousDay();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousRow();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===i?t.focusPreviousDay():t.focusNextDay();break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),t.focusNextRow();break;case"Escape":"setAnchorDate"in t&&(e.preventDefault(),t.setAnchorDate(null))}},onFocus:()=>t.setFocused(!0),onBlur:()=>t.setFocused(!1)}),headerProps:{"aria-hidden":!0},weekDays:p,weeksInMonth:f}}({startDate:u,endDate:h$(u),weekdayStyle:e.weekdayStyle,firstDayOfWeek:c},l);return lO().createElement(yo.Provider,{value:{headerProps:m,weekDays:p,startDate:u,weeksInMonth:f}},lO().createElement("table",{...m5(e),...d,ref:t,style:e.style,className:null!=(r=e.className)?r:"react-aria-CalendarGrid"},"function"!=typeof e.children?e.children:lO().createElement(lO().Fragment,null,lO().createElement(ys,null,e=>lO().createElement(yl,null,e)),lO().createElement(yu,null,e.children))))}),ys=(0,l$.forwardRef)(function(e,t){let{children:n,style:r,className:a}=e,{headerProps:o,weekDays:i}=(0,l$.useContext)(yo);return lO().createElement("thead",{...m5(e),...o,ref:t,style:r,className:a||"react-aria-CalendarGridHeader"},lO().createElement("tr",null,i.map((e,t)=>lO().cloneElement(n(e),{key:t}))))}),yl=(0,l$.forwardRef)(function(e,t){let{children:n,style:r,className:a}=e;return lO().createElement("th",{...m5(e),ref:t,style:r,className:a||"react-aria-CalendarHeaderCell"},n)}),yu=(0,l$.forwardRef)(function(e,t){let{children:n,style:r,className:a}=e,o=(0,l$.useContext)(yt),i=(0,l$.useContext)(yn),s=null!=o?o:i,{startDate:l,weeksInMonth:u}=(0,l$.useContext)(yo);return lO().createElement("tbody",{...m5(e),ref:t,style:r,className:a||"react-aria-CalendarGridBody"},[...Array(u).keys()].map(e=>lO().createElement("tr",{key:e},s.getDatesInWeek(e,l).map((e,t)=>e?lO().cloneElement(n(e),{key:t}):lO().createElement("td",{key:t})))))}),yc=(0,l$.forwardRef)(function({date:e,...t},n){var r,a,o;let i=(0,l$.useContext)(yt),s=(0,l$.useContext)(yn),l=null!=i?i:s,{startDate:u}=null!=(r=(0,l$.useContext)(yo))?r:{startDate:l.visibleRange.start},c=(0,l$.useRef)(null),{cellProps:d,buttonProps:m,...p}=function(e,t,n){var r;let a,{date:o,isDisabled:i}=e,{errorMessageId:s,selectedDateDescription:l}=h1.get(t),u=hH((r=fI)&&r.__esModule?r.default:r,"@react-aria/calendar"),c=hX({weekday:"long",day:"numeric",month:"long",year:"numeric",era:h4(o),timeZone:t.timeZone}),d=t.isSelected(o),m=t.isCellFocused(o);i=i||t.isCellDisabled(o);let p=t.isCellUnavailable(o),f=!i&&!p,h=t.isValueInvalid&&!!("highlightedRange"in t?!t.anchorDate&&t.highlightedRange&&o.compare(t.highlightedRange.start)>=0&&0>=o.compare(t.highlightedRange.end):t.value&&hb(t.value,o));h&&(d=!0),o=hJ(o,hw);let g=(0,l$.useMemo)(()=>o.toDate(t.timeZone),[o,t.timeZone]),y=hb(o,hk(t.timeZone)),v=(0,l$.useMemo)(()=>{let e="";return"highlightedRange"in t&&t.value&&!t.anchorDate&&(hb(o,t.value.start)||hb(o,t.value.end))&&(e=l+", "),e+=c.format(g),y?e=u.format(d?"todayDateSelected":"todayDate",{date:e}):d&&(e=u.format("dateSelected",{date:e})),t.minValue&&hb(o,t.minValue)?e+=", "+u.format("minimumDate"):t.maxValue&&hb(o,t.maxValue)&&(e+=", "+u.format("maximumDate")),e},[c,g,u,d,y,o,t,l]),b="";"anchorDate"in t&&m&&!t.isReadOnly&&f&&(b=t.anchorDate?u.format("finishRangeSelectionPrompt"):u.format("startRangeSelectionPrompt"));let w=gr(b),E=(0,l$.useRef)(!1),x=(0,l$.useRef)(!1),D=(0,l$.useRef)(void 0),{pressProps:_,isPressed:k}=pH({shouldCancelOnPointerExit:"anchorDate"in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!f||t.isReadOnly,onPressStart(e){if(t.isReadOnly)return void t.setFocusedDate(o);if("highlightedRange"in t&&!t.anchorDate&&("mouse"===e.pointerType||"touch"===e.pointerType)){if(t.highlightedRange&&!h){if(hb(o,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(o),t.setDragging(!0),x.current=!0;return}else if(hb(o,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(o),t.setDragging(!0),x.current=!0;return}}let n=()=>{t.setDragging(!0),D.current=void 0,t.selectDate(o),t.setFocusedDate(o),E.current=!0};"touch"===e.pointerType?D.current=setTimeout(n,200):n()}},onPressEnd(){x.current=!1,E.current=!1,clearTimeout(D.current),D.current=void 0},onPress(){"anchorDate"in t||t.isReadOnly||(t.selectDate(o),t.setFocusedDate(o))},onPressUp(e){if(!t.isReadOnly&&("anchorDate"in t&&D.current&&(t.selectDate(o),t.setFocusedDate(o)),"anchorDate"in t))if(x.current)t.setAnchorDate(o);else if(t.anchorDate&&!E.current)t.selectDate(o),t.setFocusedDate(o);else if("keyboard"!==e.pointerType||t.anchorDate)"virtual"===e.pointerType&&(t.selectDate(o),t.setFocusedDate(o));else{t.selectDate(o);let e=o.add({days:1});t.isInvalid(e)&&(e=o.subtract({days:1})),t.isInvalid(e)||t.setFocusedDate(e)}}});i||(a=hb(o,t.focusedDate)?0:-1),(0,l$.useEffect)(()=>{m&&n.current&&(pa(n.current),"pointer"!==pJ&&document.activeElement===n.current&&gi(n.current,{containingElement:gs(n.current)}))},[m,n]);let S=hX({day:"numeric",timeZone:t.timeZone,calendar:o.calendar.identifier}),C=(0,l$.useMemo)(()=>S.formatToParts(g).find(e=>"day"===e.type).value,[S,g]);return{cellProps:{role:"gridcell","aria-disabled":!f||void 0,"aria-selected":d||void 0,"aria-invalid":h||void 0},buttonProps:mH(_,{onFocus(){i||t.setFocusedDate(o)},tabIndex:a,role:"button","aria-disabled":!f||void 0,"aria-label":v,"aria-invalid":h||void 0,"aria-describedby":[h?s:void 0,w["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(e){"highlightDate"in t&&("touch"!==e.pointerType||t.isDragging)&&f&&t.highlightDate(o)},onPointerDown(e){"releasePointerCapture"in e.target&&e.target.releasePointerCapture(e.pointerId)},onContextMenu(e){e.preventDefault()}}),isPressed:k,isFocused:m,isSelected:d,isDisabled:i,isUnavailable:p,isOutsideVisibleRange:0>o.compare(t.visibleRange.start)||o.compare(t.visibleRange.end)>0,isInvalid:h,formattedDate:C}}({date:e},l,c),{hoverProps:f,isHovered:h}=ff({...t,isDisabled:p.isDisabled}),{focusProps:g,isFocusVisible:y}=fu();y&&(y=p.isFocused);let v=(a=u,o=hy(o=e,a.calendar),a=hT(a),o=hT(o),a.era!==o.era||a.year!==o.year||a.month!==o.month),b=!1,w=!1;"highlightedRange"in l&&l.highlightedRange&&(b=hb(e,l.highlightedRange.start),w=hb(e,l.highlightedRange.end));let E=mG({...t,defaultChildren:p.formattedDate,defaultClassName:"react-aria-CalendarCell",values:{date:e,isHovered:h,isOutsideMonth:v,isFocusVisible:y,isSelectionStart:b,isSelectionEnd:w,...p}}),x={"data-focused":p.isFocused||void 0,"data-hovered":h||void 0,"data-pressed":p.isPressed||void 0,"data-unavailable":p.isUnavailable||void 0,"data-disabled":p.isDisabled||void 0,"data-focus-visible":y||void 0,"data-outside-visible-range":p.isOutsideVisibleRange||void 0,"data-outside-month":v||void 0,"data-selected":p.isSelected||void 0,"data-selection-start":b||void 0,"data-selection-end":w||void 0,"data-invalid":p.isInvalid||void 0};return lO().createElement("td",{...d,ref:n},lO().createElement("div",{...mH(m5(t),m,g,f,x,E),ref:c}))}),yd=(0,l$.createContext)({}),ym=(0,l$.forwardRef)(function(e,t){var n,r;[e,t]=mY(e,t,yd);let{isDisabled:a,isInvalid:o,onHoverStart:i,onHoverChange:s,onHoverEnd:l,...u}=e,{hoverProps:c,isHovered:d}=ff({onHoverStart:i,onHoverChange:s,onHoverEnd:l,isDisabled:a}),{isFocused:m,isFocusVisible:p,focusProps:f}=fu({within:!0});null!=a||(a=!!e["aria-disabled"]&&"false"!==e["aria-disabled"]),null!=o||(o=!!e["aria-invalid"]&&"false"!==e["aria-invalid"]);let h=mG({...e,values:{isHovered:d,isFocusWithin:m,isFocusVisible:p,isDisabled:a,isInvalid:o},defaultClassName:"react-aria-Group"});return lO().createElement("div",{...mH(u,f,c),...h,ref:t,role:null!=(n=e.role)?n:"group",slot:null!=(r=e.slot)?r:void 0,"data-focus-within":m||void 0,"data-hovered":d||void 0,"data-focus-visible":p||void 0,"data-disabled":a||void 0,"data-invalid":o||void 0},h.children)}),yp=(0,l$.createContext)({}),yf=fg(function(e,t){[e,t]=mY(e,t,yp);let{hoverProps:n,isHovered:r}=ff(e),{isFocused:a,isFocusVisible:o,focusProps:i}=fu({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e["aria-invalid"]&&"false"!==e["aria-invalid"],l=mG({...e,values:{isHovered:r,isFocused:a,isFocusVisible:o,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:"react-aria-Input"});return lO().createElement("input",{...mH((e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...a}=e;return a})(e),i,n),...l,ref:t,"data-focused":a||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":o||void 0,"data-invalid":s||void 0})});var yh={};yh={"ar-AE":{calendar:"التقويم",day:"يوم",dayPeriod:"ص/م",endDate:"تاريخ الانتهاء",era:"العصر",hour:"الساعات",minute:"الدقائق",month:"الشهر",second:"الثواني",selectedDateDescription:e=>`\u{62A}\u{627}\u{631}\u{64A}\u{62E} \u{645}\u{62D}\u{62F}\u{62F}: ${e.date}`,selectedRangeDescription:e=>`\u{627}\u{644}\u{645}\u{62F}\u{649} \u{627}\u{644}\u{632}\u{645}\u{646}\u{64A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.startDate} \u{625}\u{644}\u{649} ${e.endDate}`,selectedTimeDescription:e=>`\u{627}\u{644}\u{648}\u{642}\u{62A} \u{627}\u{644}\u{645}\u{62D}\u{62F}\u{62F}: ${e.time}`,startDate:"تاريخ البدء",timeZoneName:"التوقيت",weekday:"اليوم",year:"السنة"},"bg-BG":{calendar:"Календар",day:"ден",dayPeriod:"пр.об./сл.об.",endDate:"Крайна дата",era:"ера",hour:"час",minute:"минута",month:"месец",second:"секунда",selectedDateDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{434}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{418}\u{437}\u{431}\u{440}\u{430}\u{43D}\u{43E} \u{432}\u{440}\u{435}\u{43C}\u{435}: ${e.time}`,startDate:"Начална дата",timeZoneName:"часова зона",weekday:"ден от седмицата",year:"година"},"cs-CZ":{calendar:"Kalend\xe1ř",day:"den",dayPeriod:"č\xe1st dne",endDate:"Konečn\xe9 datum",era:"letopočet",hour:"hodina",minute:"minuta",month:"měs\xedc",second:"sekunda",selectedDateDescription:e=>`Vybran\xe9 datum: ${e.date}`,selectedRangeDescription:e=>`Vybran\xe9 obdob\xed: ${e.startDate} a\u{17E} ${e.endDate}`,selectedTimeDescription:e=>`Vybran\xfd \u{10D}as: ${e.time}`,startDate:"Poč\xe1tečn\xed datum",timeZoneName:"časov\xe9 p\xe1smo",weekday:"den v t\xfddnu",year:"rok"},"da-DK":{calendar:"Kalender",day:"dag",dayPeriod:"AM/PM",endDate:"Slutdato",era:"\xe6ra",hour:"time",minute:"minut",month:"m\xe5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt interval: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tidspunkt: ${e.time}`,startDate:"Startdato",timeZoneName:"tidszone",weekday:"ugedag",year:"\xe5r"},"de-DE":{calendar:"Kalender",day:"Tag",dayPeriod:"Tagesh\xe4lfte",endDate:"Enddatum",era:"Epoche",hour:"Stunde",minute:"Minute",month:"Monat",second:"Sekunde",selectedDateDescription:e=>`Ausgew\xe4hltes Datum: ${e.date}`,selectedRangeDescription:e=>`Ausgew\xe4hlter Bereich: ${e.startDate} bis ${e.endDate}`,selectedTimeDescription:e=>`Ausgew\xe4hlte Zeit: ${e.time}`,startDate:"Anfangsdatum",timeZoneName:"Zeitzone",weekday:"Wochentag",year:"Jahr"},"el-GR":{calendar:"Ημερολόγιο",day:"ημέρα",dayPeriod:"π.μ./μ.μ.",endDate:"Ημερομηνία λήξης",era:"περίοδος",hour:"ώρα",minute:"λεπτό",month:"μήνας",second:"δευτερόλεπτο",selectedDateDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3B7}\u{3BC}\u{3B5}\u{3C1}\u{3BF}\u{3BC}\u{3B7}\u{3BD}\u{3AF}\u{3B1}: ${e.date}`,selectedRangeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3BF} \u{3B5}\u{3CD}\u{3C1}\u{3BF}\u{3C2}: ${e.startDate} \u{3AD}\u{3C9}\u{3C2} ${e.endDate}`,selectedTimeDescription:e=>`\u{395}\u{3C0}\u{3B9}\u{3BB}\u{3B5}\u{3B3}\u{3BC}\u{3AD}\u{3BD}\u{3B7} \u{3CE}\u{3C1}\u{3B1}: ${e.time}`,startDate:"Ημερομηνία έναρξης",timeZoneName:"ζώνη ώρας",weekday:"καθημερινή",year:"έτος"},"en-US":{era:"era",year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",dayPeriod:"AM/PM",calendar:"Calendar",startDate:"Start Date",endDate:"End Date",weekday:"day of the week",timeZoneName:"time zone",selectedDateDescription:e=>`Selected Date: ${e.date}`,selectedRangeDescription:e=>`Selected Range: ${e.startDate} to ${e.endDate}`,selectedTimeDescription:e=>`Selected Time: ${e.time}`},"es-ES":{calendar:"Calendario",day:"d\xeda",dayPeriod:"a.\xa0m./p.\xa0m.",endDate:"Fecha final",era:"era",hour:"hora",minute:"minuto",month:"mes",second:"segundo",selectedDateDescription:e=>`Fecha seleccionada: ${e.date}`,selectedRangeDescription:e=>`Rango seleccionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora seleccionada: ${e.time}`,startDate:"Fecha de inicio",timeZoneName:"zona horaria",weekday:"d\xeda de la semana",year:"a\xf1o"},"et-EE":{calendar:"Kalender",day:"p\xe4ev",dayPeriod:"enne/p\xe4rast l\xf5unat",endDate:"L\xf5ppkuup\xe4ev",era:"ajastu",hour:"tund",minute:"minut",month:"kuu",second:"sekund",selectedDateDescription:e=>`Valitud kuup\xe4ev: ${e.date}`,selectedRangeDescription:e=>`Valitud vahemik: ${e.startDate} kuni ${e.endDate}`,selectedTimeDescription:e=>`Valitud aeg: ${e.time}`,startDate:"Alguskuup\xe4ev",timeZoneName:"ajav\xf6\xf6nd",weekday:"n\xe4dalap\xe4ev",year:"aasta"},"fi-FI":{calendar:"Kalenteri",day:"p\xe4iv\xe4",dayPeriod:"vuorokaudenaika",endDate:"P\xe4\xe4ttymisp\xe4iv\xe4",era:"aikakausi",hour:"tunti",minute:"minuutti",month:"kuukausi",second:"sekunti",selectedDateDescription:e=>`Valittu p\xe4iv\xe4m\xe4\xe4r\xe4: ${e.date}`,selectedRangeDescription:e=>`Valittu aikav\xe4li: ${e.startDate} \u{2013} ${e.endDate}`,selectedTimeDescription:e=>`Valittu aika: ${e.time}`,startDate:"Alkamisp\xe4iv\xe4",timeZoneName:"aikavy\xf6hyke",weekday:"viikonp\xe4iv\xe4",year:"vuosi"},"fr-FR":{calendar:"Calendrier",day:"jour",dayPeriod:"cadran",endDate:"Date de fin",era:"\xe8re",hour:"heure",minute:"minute",month:"mois",second:"seconde",selectedDateDescription:e=>`Date s\xe9lectionn\xe9e\xa0: ${e.date}`,selectedRangeDescription:e=>`Plage s\xe9lectionn\xe9e\xa0: ${e.startDate} au ${e.endDate}`,selectedTimeDescription:e=>`Heure choisie\xa0: ${e.time}`,startDate:"Date de d\xe9but",timeZoneName:"fuseau horaire",weekday:"jour de la semaine",year:"ann\xe9e"},"he-IL":{calendar:"לוח שנה",day:"יום",dayPeriod:"לפנה״צ/אחה״צ",endDate:"תאריך סיום",era:"תקופה",hour:"שעה",minute:"דקה",month:"חודש",second:"שנייה",selectedDateDescription:e=>`\u{5EA}\u{5D0}\u{5E8}\u{5D9}\u{5DA} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.date}`,selectedRangeDescription:e=>`\u{5D8}\u{5D5}\u{5D5}\u{5D7} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.startDate} \u{5E2}\u{5D3} ${e.endDate}`,selectedTimeDescription:e=>`\u{5D6}\u{5DE}\u{5DF} \u{5E0}\u{5D1}\u{5D7}\u{5E8}: ${e.time}`,startDate:"תאריך התחלה",timeZoneName:"אזור זמן",weekday:"יום בשבוע",year:"שנה"},"hr-HR":{calendar:"Kalendar",day:"dan",dayPeriod:"AM/PM",endDate:"Datum završetka",era:"era",hour:"sat",minute:"minuta",month:"mjesec",second:"sekunda",selectedDateDescription:e=>`Odabrani datum: ${e.date}`,selectedRangeDescription:e=>`Odabrani raspon: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Odabrano vrijeme: ${e.time}`,startDate:"Datum početka",timeZoneName:"vremenska zona",weekday:"dan u tjednu",year:"godina"},"hu-HU":{calendar:"Napt\xe1r",day:"nap",dayPeriod:"napszak",endDate:"Befejező d\xe1tum",era:"\xe9ra",hour:"\xf3ra",minute:"perc",month:"h\xf3nap",second:"m\xe1sodperc",selectedDateDescription:e=>`Kijel\xf6lt d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Kijel\xf6lt tartom\xe1ny: ${e.startDate}\u{2013}${e.endDate}`,selectedTimeDescription:e=>`Kijel\xf6lt id\u{151}: ${e.time}`,startDate:"Kezdő d\xe1tum",timeZoneName:"időz\xf3na",weekday:"h\xe9t napja",year:"\xe9v"},"it-IT":{calendar:"Calendario",day:"giorno",dayPeriod:"AM/PM",endDate:"Data finale",era:"era",hour:"ora",minute:"minuto",month:"mese",second:"secondo",selectedDateDescription:e=>`Data selezionata: ${e.date}`,selectedRangeDescription:e=>`Intervallo selezionato: da ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Ora selezionata: ${e.time}`,startDate:"Data iniziale",timeZoneName:"fuso orario",weekday:"giorno della settimana",year:"anno"},"ja-JP":{calendar:"カレンダー",day:"日",dayPeriod:"午前/午後",endDate:"終了日",era:"時代",hour:"時",minute:"分",month:"月",second:"秒",selectedDateDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{65E5}\u{4ED8} : ${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{629E}\u{7BC4}\u{56F2} : ${e.startDate} \u{304B}\u{3089} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{629E}\u{3057}\u{305F}\u{6642}\u{9593} : ${e.time}`,startDate:"開始日",timeZoneName:"タイムゾーン",weekday:"曜日",year:"年"},"ko-KR":{calendar:"달력",day:"일",dayPeriod:"오전/오후",endDate:"종료일",era:"연호",hour:"시",minute:"분",month:"월",second:"초",selectedDateDescription:e=>`\u{C120}\u{D0DD} \u{C77C}\u{C790}: ${e.date}`,selectedRangeDescription:e=>`\u{C120}\u{D0DD} \u{BC94}\u{C704}: ${e.startDate} ~ ${e.endDate}`,selectedTimeDescription:e=>`\u{C120}\u{D0DD} \u{C2DC}\u{AC04}: ${e.time}`,startDate:"시작일",timeZoneName:"시간대",weekday:"요일",year:"년"},"lt-LT":{calendar:"Kalendorius",day:"diena",dayPeriod:"iki pietų / po pietų",endDate:"Pabaigos data",era:"era",hour:"valanda",minute:"minutė",month:"mėnuo",second:"sekundė",selectedDateDescription:e=>`Pasirinkta data: ${e.date}`,selectedRangeDescription:e=>`Pasirinktas intervalas: nuo ${e.startDate} iki ${e.endDate}`,selectedTimeDescription:e=>`Pasirinktas laikas: ${e.time}`,startDate:"Pradžios data",timeZoneName:"laiko juosta",weekday:"savaitės diena",year:"metai"},"lv-LV":{calendar:"Kalendārs",day:"diena",dayPeriod:"priekšpusdienā/pēcpusdienā",endDate:"Beigu datums",era:"ēra",hour:"stundas",minute:"minūtes",month:"mēnesis",second:"sekundes",selectedDateDescription:e=>`Atlas\u{12B}tais datums: ${e.date}`,selectedRangeDescription:e=>`Atlas\u{12B}tais diapazons: no ${e.startDate} l\u{12B}dz ${e.endDate}`,selectedTimeDescription:e=>`Atlas\u{12B}tais laiks: ${e.time}`,startDate:"Sākuma datums",timeZoneName:"laika josla",weekday:"nedēļas diena",year:"gads"},"nb-NO":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Sluttdato",era:"tidsalder",hour:"time",minute:"minutt",month:"m\xe5ned",second:"sekund",selectedDateDescription:e=>`Valgt dato: ${e.date}`,selectedRangeDescription:e=>`Valgt omr\xe5de: ${e.startDate} til ${e.endDate}`,selectedTimeDescription:e=>`Valgt tid: ${e.time}`,startDate:"Startdato",timeZoneName:"tidssone",weekday:"ukedag",year:"\xe5r"},"nl-NL":{calendar:"Kalender",day:"dag",dayPeriod:"a.m./p.m.",endDate:"Einddatum",era:"tijdperk",hour:"uur",minute:"minuut",month:"maand",second:"seconde",selectedDateDescription:e=>`Geselecteerde datum: ${e.date}`,selectedRangeDescription:e=>`Geselecteerd bereik: ${e.startDate} tot ${e.endDate}`,selectedTimeDescription:e=>`Geselecteerde tijd: ${e.time}`,startDate:"Startdatum",timeZoneName:"tijdzone",weekday:"dag van de week",year:"jaar"},"pl-PL":{calendar:"Kalendarz",day:"dzień",dayPeriod:"rano / po południu / wieczorem",endDate:"Data końcowa",era:"era",hour:"godzina",minute:"minuta",month:"miesiąc",second:"sekunda",selectedDateDescription:e=>`Wybrana data: ${e.date}`,selectedRangeDescription:e=>`Wybrany zakres: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Wybrany czas: ${e.time}`,startDate:"Data początkowa",timeZoneName:"strefa czasowa",weekday:"dzień tygodnia",year:"rok"},"pt-BR":{calendar:"Calend\xe1rio",day:"dia",dayPeriod:"AM/PM",endDate:"Data final",era:"era",hour:"hora",minute:"minuto",month:"m\xeas",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data inicial",timeZoneName:"fuso hor\xe1rio",weekday:"dia da semana",year:"ano"},"pt-PT":{calendar:"Calend\xe1rio",day:"dia",dayPeriod:"am/pm",endDate:"Data de T\xe9rmino",era:"era",hour:"hora",minute:"minuto",month:"m\xeas",second:"segundo",selectedDateDescription:e=>`Data selecionada: ${e.date}`,selectedRangeDescription:e=>`Intervalo selecionado: ${e.startDate} a ${e.endDate}`,selectedTimeDescription:e=>`Hora selecionada: ${e.time}`,startDate:"Data de In\xedcio",timeZoneName:"fuso hor\xe1rio",weekday:"dia da semana",year:"ano"},"ro-RO":{calendar:"Calendar",day:"zi",dayPeriod:"a.m/p.m.",endDate:"Dată final",era:"eră",hour:"oră",minute:"minut",month:"lună",second:"secundă",selectedDateDescription:e=>`Dat\u{103} selectat\u{103}: ${e.date}`,selectedRangeDescription:e=>`Interval selectat: de la ${e.startDate} p\xe2n\u{103} la ${e.endDate}`,selectedTimeDescription:e=>`Ora selectat\u{103}: ${e.time}`,startDate:"Dată \xeenceput",timeZoneName:"fus orar",weekday:"ziua din săptăm\xe2nă",year:"an"},"ru-RU":{calendar:"Календарь",day:"день",dayPeriod:"AM/PM",endDate:"Дата окончания",era:"эра",hour:"час",minute:"минута",month:"месяц",second:"секунда",selectedDateDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{430}\u{44F} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{44B}\u{439} \u{434}\u{438}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: \u{441} ${e.startDate} \u{43F}\u{43E} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{44B}\u{431}\u{440}\u{430}\u{43D}\u{43D}\u{43E}\u{435} \u{432}\u{440}\u{435}\u{43C}\u{44F}: ${e.time}`,startDate:"Дата начала",timeZoneName:"часовой пояс",weekday:"день недели",year:"год"},"sk-SK":{calendar:"Kalend\xe1r",day:"deň",dayPeriod:"AM/PM",endDate:"D\xe1tum ukončenia",era:"letopočet",hour:"hodina",minute:"min\xfata",month:"mesiac",second:"sekunda",selectedDateDescription:e=>`Vybrat\xfd d\xe1tum: ${e.date}`,selectedRangeDescription:e=>`Vybrat\xfd rozsah: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Vybrat\xfd \u{10D}as: ${e.time}`,startDate:"D\xe1tum začatia",timeZoneName:"časov\xe9 p\xe1smo",weekday:"deň t\xfdždňa",year:"rok"},"sl-SI":{calendar:"Koledar",day:"dan",dayPeriod:"dop/pop",endDate:"Datum konca",era:"doba",hour:"ura",minute:"minuta",month:"mesec",second:"sekunda",selectedDateDescription:e=>`Izbrani datum: ${e.date}`,selectedRangeDescription:e=>`Izbrano obmo\u{10D}je: ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izbrani \u{10D}as: ${e.time}`,startDate:"Datum začetka",timeZoneName:"časovni pas",weekday:"dan v tednu",year:"leto"},"sr-SP":{calendar:"Kalendar",day:"дан",dayPeriod:"пре подне/по подне",endDate:"Datum završetka",era:"ера",hour:"сат",minute:"минут",month:"месец",second:"секунд",selectedDateDescription:e=>`Izabrani datum: ${e.date}`,selectedRangeDescription:e=>`Izabrani opseg: od ${e.startDate} do ${e.endDate}`,selectedTimeDescription:e=>`Izabrano vreme: ${e.time}`,startDate:"Datum početka",timeZoneName:"временска зона",weekday:"дан у недељи",year:"година"},"sv-SE":{calendar:"Kalender",day:"dag",dayPeriod:"fm/em",endDate:"Slutdatum",era:"era",hour:"timme",minute:"minut",month:"m\xe5nad",second:"sekund",selectedDateDescription:e=>`Valt datum: ${e.date}`,selectedRangeDescription:e=>`Valt intervall: ${e.startDate} till ${e.endDate}`,selectedTimeDescription:e=>`Vald tid: ${e.time}`,startDate:"Startdatum",timeZoneName:"tidszon",weekday:"veckodag",year:"\xe5r"},"tr-TR":{calendar:"Takvim",day:"g\xfcn",dayPeriod:"\xd6\xd6/\xd6S",endDate:"Bitiş Tarihi",era:"\xe7ağ",hour:"saat",minute:"dakika",month:"ay",second:"saniye",selectedDateDescription:e=>`Se\xe7ilen Tarih: ${e.date}`,selectedRangeDescription:e=>`Se\xe7ilen Aral\u{131}k: ${e.startDate} - ${e.endDate}`,selectedTimeDescription:e=>`Se\xe7ilen Zaman: ${e.time}`,startDate:"Başlangı\xe7 Tarihi",timeZoneName:"saat dilimi",weekday:"haftanın g\xfcn\xfc",year:"yıl"},"uk-UA":{calendar:"Календар",day:"день",dayPeriod:"дп/пп",endDate:"Дата завершення",era:"ера",hour:"година",minute:"хвилина",month:"місяць",second:"секунда",selectedDateDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{430} \u{434}\u{430}\u{442}\u{430}: ${e.date}`,selectedRangeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{434}\u{456}\u{430}\u{43F}\u{430}\u{437}\u{43E}\u{43D}: ${e.startDate} \u{2014} ${e.endDate}`,selectedTimeDescription:e=>`\u{412}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{438}\u{439} \u{447}\u{430}\u{441}: ${e.time}`,startDate:"Дата початку",timeZoneName:"часовий пояс",weekday:"день тижня",year:"рік"},"zh-CN":{calendar:"日历",day:"日",dayPeriod:"上午/下午",endDate:"结束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{8303}\u{56F4}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9009}\u{5B9A}\u{7684}\u{65F6}\u{95F4}\u{FF1A}${e.time}`,startDate:"开始日期",timeZoneName:"时区",weekday:"工作日",year:"年"},"zh-TW":{calendar:"日曆",day:"日",dayPeriod:"上午/下午",endDate:"結束日期",era:"纪元",hour:"小时",minute:"分钟",month:"月",second:"秒",selectedDateDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{65E5}\u{671F}\u{FF1A}${e.date}`,selectedRangeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{7BC4}\u{570D}\u{FF1A}${e.startDate} \u{81F3} ${e.endDate}`,selectedTimeDescription:e=>`\u{9078}\u{5B9A}\u{7684}\u{6642}\u{9593}\u{FF1A}${e.time}`,startDate:"開始日期",timeZoneName:"时区",weekday:"工作日",year:"年"}};let yg=lO().createContext(null),yy="react-aria-focus-scope-restore",yv=null;function yb(e){var t,n,r,a,o,i,s,l,u,c;let d,m,p,f,{children:h,contain:g,restoreFocus:y,autoFocus:v}=e,b=(0,l$.useRef)(null),w=(0,l$.useRef)(null),E=(0,l$.useRef)([]),{parentNode:x}=(0,l$.useContext)(yg)||{},D=(0,l$.useMemo)(()=>new yA({scopeRef:E}),[E]);mP(()=>{let e=x||yI.root;if(yI.getTreeNode(e.scopeRef)&&yv&&!y_(yv,e.scopeRef)){let t=yI.getTreeNode(yv);t&&(e=t)}e.addChild(D),yI.addNode(D)},[D,x]),mP(()=>{let e=yI.getTreeNode(E);e&&(e.contain=!!g)},[g]),mP(()=>{var e;let t=null==(e=b.current)?void 0:e.nextSibling,n=[],r=e=>e.stopPropagation();for(;t&&t!==w.current;)n.push(t),t.addEventListener(yy,r),t=t.nextSibling;return E.current=n,()=>{for(let e of n)e.removeEventListener(yy,r)}},[h]),mP(()=>{if(n||r)return;let e=t.current,a=pn(e?e[0]:void 0),o=e=>{let n=pj(e);yx(n,t.current)?yv=t:yD(n)||(yv=null)};return a.addEventListener("focusin",o,!1),null==e||e.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{a.removeEventListener("focusin",o,!1),null==e||e.forEach(e=>e.removeEventListener("focusin",o,!1))}},[t=E,n=y,r=g]),a=E,o=g,d=(0,l$.useRef)(void 0),m=(0,l$.useRef)(void 0),mP(()=>{let e=a.current;if(!o){m.current&&(cancelAnimationFrame(m.current),m.current=void 0);return}let t=pn(e?e[0]:void 0),n=e=>{if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey||!yE(a)||e.isComposing)return;let n=((e=document)=>e.activeElement)(t),r=a.current;if(!r||!yx(n,r))return;let o=yT(yw(r),{tabbable:!0},r);if(!n)return;o.currentNode=n;let i=e.shiftKey?o.previousNode():o.nextNode();i||(o.currentNode=e.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,i=e.shiftKey?o.previousNode():o.nextNode()),e.preventDefault(),i&&yk(i,!0)},r=e=>{(!yv||y_(yv,a))&&yx(pj(e),a.current)?(yv=a,d.current=pj(e)):yE(a)&&!yD(pj(e),a)?d.current?d.current.focus():yv&&yv.current&&yC(yv.current):yE(a)&&(d.current=pj(e))},i=e=>{m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>{let n=pJ,r=("virtual"===n||null===n)&&pb()&&pv(),o=((e=document)=>e.activeElement)(t);if(!r&&o&&yE(a)&&!yD(o,a)){yv=a;let t=pj(e);if(t&&t.isConnected){var i;d.current=t,null==(i=d.current)||i.focus()}else yv.current&&yC(yv.current)}})};return t.addEventListener("keydown",n,!1),t.addEventListener("focusin",r,!1),null==e||e.forEach(e=>e.addEventListener("focusin",r,!1)),null==e||e.forEach(e=>e.addEventListener("focusout",i,!1)),()=>{t.removeEventListener("keydown",n,!1),t.removeEventListener("focusin",r,!1),null==e||e.forEach(e=>e.removeEventListener("focusin",r,!1)),null==e||e.forEach(e=>e.removeEventListener("focusout",i,!1))}},[a,o]),mP(()=>()=>{m.current&&cancelAnimationFrame(m.current)},[m]),i=E,s=y,l=g,p=(0,l$.useRef)("u">typeof document?((e=document)=>e.activeElement)(pn(i.current?i.current[0]:void 0)):null),mP(()=>{let e=i.current,t=pn(e?e[0]:void 0);if(!s||l)return;let n=()=>{(!yv||y_(yv,i))&&yx(((e=document)=>e.activeElement)(t),i.current)&&(yv=i)};return t.addEventListener("focusin",n,!1),null==e||e.forEach(e=>e.addEventListener("focusin",n,!1)),()=>{t.removeEventListener("focusin",n,!1),null==e||e.forEach(e=>e.removeEventListener("focusin",n,!1))}},[i,l]),mP(()=>{let e=pn(i.current?i.current[0]:void 0);if(!s)return;let t=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!yE(i)||t.isComposing)return;let n=e.activeElement;if(!yD(n,i)||!yP(i))return;let r=yI.getTreeNode(i);if(!r)return;let a=r.nodeToRestore,o=yT(e.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if(a&&a.isConnected&&a!==e.body||(a=void 0,r.nodeToRestore=void 0),(!s||!yD(s,i))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(yD(s,i));(t.preventDefault(),t.stopPropagation(),s)?yk(s,!0):yD(a)?yk(a,!0):n.blur()}};return l||e.addEventListener("keydown",t,!0),()=>{l||e.removeEventListener("keydown",t,!0)}},[i,s,l]),mP(()=>{var e;let t=pn(i.current?i.current[0]:void 0);if(!s)return;let n=yI.getTreeNode(i);if(n)return n.nodeToRestore=null!=(e=p.current)?e:void 0,()=>{let e=yI.getTreeNode(i);if(!e)return;let n=e.nodeToRestore,r=((e=document)=>e.activeElement)(t);if(s&&n&&(r&&yD(r,i)||r===t.body&&yP(i))){let e=yI.clone();requestAnimationFrame(()=>{if(t.activeElement===t.body){let t=e.getTreeNode(i);for(;t;){if(t.nodeToRestore&&t.nodeToRestore.isConnected)return void yR(t.nodeToRestore);t=t.parent}for(t=e.getTreeNode(i);t;){if(t.scopeRef&&t.scopeRef.current&&yI.getTreeNode(t.scopeRef))return void yR(yS(t.scopeRef.current,!0));t=t.parent}}})}}},[i,s]),u=E,c=v,f=lO().useRef(c),(0,l$.useEffect)(()=>{f.current&&(yv=u,!yx(((e=document)=>e.activeElement)(pn(u.current?u.current[0]:void 0)),yv.current)&&u.current&&yC(u.current)),f.current=!1},[u]),(0,l$.useEffect)(()=>{let e=((e=document)=>e.activeElement)(pn(E.current?E.current[0]:void 0)),t=null;if(yx(e,E.current)){for(let n of yI.traverse())n.scopeRef&&yx(e,n.scopeRef.current)&&(t=n);t===yI.getTreeNode(E)&&(yv=t.scopeRef)}},[E]),mP(()=>()=>{var e,t,n;let r=null!=(n=null==(t=yI.getTreeNode(E))||null==(e=t.parent)?void 0:e.scopeRef)?n:null;(E===yv||y_(E,yv))&&(!r||yI.getTreeNode(r))&&(yv=r),yI.removeTreeNode(E)},[E]);let _=(0,l$.useMemo)(()=>{var e;return e=E,{focusNext(t={}){var n;let r=e.current,{from:a,tabbable:o,wrap:i,accept:s}=t,l=a||((e=document)=>e.activeElement)(pn(null!=(n=r[0])?n:void 0)),u=r[0].previousElementSibling,c=yT(yw(r),{tabbable:o,accept:s},r);c.currentNode=yx(l,r)?l:u;let d=c.nextNode();return!d&&i&&(c.currentNode=u,d=c.nextNode()),d&&yk(d,!0),d},focusPrevious(t={}){var n;let r=e.current,{from:a,tabbable:o,wrap:i,accept:s}=t,l=a||((e=document)=>e.activeElement)(pn(null!=(n=r[0])?n:void 0)),u=r[r.length-1].nextElementSibling,c=yT(yw(r),{tabbable:o,accept:s},r);c.currentNode=yx(l,r)?l:u;let d=c.previousNode();return!d&&i&&(c.currentNode=u,d=c.previousNode()),d&&yk(d,!0),d},focusFirst(t={}){let n=e.current,{tabbable:r,accept:a}=t,o=yT(yw(n),{tabbable:r,accept:a},n);o.currentNode=n[0].previousElementSibling;let i=o.nextNode();return i&&yk(i,!0),i},focusLast(t={}){let n=e.current,{tabbable:r,accept:a}=t,o=yT(yw(n),{tabbable:r,accept:a},n);o.currentNode=n[n.length-1].nextElementSibling;let i=o.previousNode();return i&&yk(i,!0),i}}},[]),k=(0,l$.useMemo)(()=>({focusManager:_,parentNode:D}),[D,_]);return lO().createElement(yg.Provider,{value:k},lO().createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:b}),h,lO().createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:w}))}function yw(e){return e[0].parentElement}function yE(e){let t=yI.getTreeNode(yv);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function yx(e,t){return!!e&&!!t&&t.some(t=>t.contains(e))}function yD(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of yI.traverse(yI.getTreeNode(t)))if(n&&yx(e,n.current))return!0;return!1}function y_(e,t){var n;let r=null==(n=yI.getTreeNode(t))?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function yk(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{fr(e)}catch{}}function yS(e,t=!0){let n=e[0].previousElementSibling,r=yw(e),a=yT(r,{tabbable:t},e);a.currentNode=n;let o=a.nextNode();return t&&!o&&((a=yT(r=yw(e),{tabbable:!1},e)).currentNode=n,o=a.nextNode()),o}function yC(e,t=!0){yk(yS(e,t))}function yP(e){let t=yI.getTreeNode(yv);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null==t?void 0:t.scopeRef)===e}function yR(e){e.dispatchEvent(new CustomEvent(yy,{bubbles:!0,cancelable:!0}))&&yk(e)}function yT(e,t,n){var r,a,o;let i=(null==t?void 0:t.tabbable)?pt:pe,s=pn((null==e?void 0:e.nodeType)===Node.ELEMENT_NODE?e:null),l=(r=e||s,a=NodeFilter.SHOW_ELEMENT,o={acceptNode(e){var r;return(null==t||null==(r=t.from)?void 0:r.contains(e))?NodeFilter.FILTER_REJECT:i(e)&&function e(t,n){return"#comment"!==t.nodeName&&function(e){let t=pr(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,a="none"!==n&&"hidden"!==r&&"collapse"!==r;if(a){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);a="none"!==n&&"hidden"!==r&&"collapse"!==r}return a}(t)&&!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==t.nodeName||!n||"SUMMARY"===n.nodeName||t.hasAttribute("open"))&&(!t.parentElement||e(t.parentElement,t))}(e)&&(!n||yx(e,n))&&(!(null==t?void 0:t.accept)||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}},s.createTreeWalker(r,a,o));return(null==t?void 0:t.from)&&(l.currentNode=t.from),l}function y$(e,t={}){return{focusNext(n={}){let r=e.current;if(!r)return null;let{from:a,tabbable:o=t.tabbable,wrap:i=t.wrap,accept:s=t.accept}=n,l=a||((e=document)=>e.activeElement)(pn(r)),u=yT(r,{tabbable:o,accept:s});r.contains(l)&&(u.currentNode=l);let c=u.nextNode();return!c&&i&&(u.currentNode=r,c=u.nextNode()),c&&yk(c,!0),c},focusPrevious(n=t){let r=e.current;if(!r)return null;let{from:a,tabbable:o=t.tabbable,wrap:i=t.wrap,accept:s=t.accept}=n,l=a||((e=document)=>e.activeElement)(pn(r)),u=yT(r,{tabbable:o,accept:s});if(r.contains(l))u.currentNode=l;else{let e=yO(u);return e&&yk(e,!0),null!=e?e:null}let c=u.previousNode();if(!c&&i){u.currentNode=r;let e=yO(u);if(!e)return null;c=e}return c&&yk(c,!0),null!=c?c:null},focusFirst(n=t){let r=e.current;if(!r)return null;let{tabbable:a=t.tabbable,accept:o=t.accept}=n,i=yT(r,{tabbable:a,accept:o}).nextNode();return i&&yk(i,!0),i},focusLast(n=t){let r=e.current;if(!r)return null;let{tabbable:a=t.tabbable,accept:o=t.accept}=n,i=yO(yT(r,{tabbable:a,accept:o}));return i&&yk(i,!0),null!=i?i:null}}}function yO(e){let t,n;do(t=e.lastChild())&&(n=t);while(t);return n}class yN{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(null!=t?t:null);if(!r)return;let a=new yA({scopeRef:e});r.addChild(a),a.parent=r,this.fastMap.set(e,a),n&&(a.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&yx(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){var e,t;let n=new yN;for(let r of this.traverse())n.addTreeNode(r.scopeRef,null!=(t=null==(e=r.parent)?void 0:e.scopeRef)?t:null,r.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new yA({scopeRef:null}),this.fastMap.set(null,this.root)}}class yA{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let yI=new yN;function yj(e,t,n){let{direction:r}=fA(),a=(0,l$.useMemo)(()=>y$(t),[t]),o=()=>{var e;if(!t.current)return;let n=null==(e=window.event)?void 0:e.target,r=yT(t.current,{tabbable:!0});if(n&&(r.currentNode=n,n=r.previousNode()),!n){let e;do(e=r.lastChild())&&(n=e);while(e)}for(;null==n?void 0:n.hasAttribute("data-placeholder");){let e=r.previousNode();if(e&&e.hasAttribute("data-placeholder"))n=e;else break}n&&n.focus()},{pressProps:i}=pH({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(e){"mouse"===e.pointerType&&o()},onPress(e){"mouse"!==e.pointerType&&o()}});return mH(i,{onKeyDown:o=>{if(o.currentTarget.contains(o.target)&&(o.altKey&&("ArrowDown"===o.key||"ArrowUp"===o.key)&&"setOpen"in e&&(o.preventDefault(),o.stopPropagation(),e.setOpen(!0)),!n))switch(o.key){case"ArrowLeft":if(o.preventDefault(),o.stopPropagation(),"rtl"===r){if(t.current){let e=o.target,n=yM(t.current,e.getBoundingClientRect().left,-1);n&&n.focus()}}else a.focusPrevious();break;case"ArrowRight":if(o.preventDefault(),o.stopPropagation(),"rtl"===r){if(t.current){let e=o.target,n=yM(t.current,e.getBoundingClientRect().left,1);n&&n.focus()}}else a.focusNext()}}})}function yM(e,t,n){let r=yT(e,{tabbable:!0}),a=r.nextNode(),o=null,i=1/0;for(;a;){let e=a.getBoundingClientRect().left-t,s=Math.abs(e);Math.sign(e)===n&&s<i&&(o=a,i=s),a=r.nextNode()}return o}function yL(e,t,n){let r=(0,l$.useRef)(t),a=mR(()=>{n&&n(r.current)});(0,l$.useEffect)(()=>{var t;let n=null==e||null==(t=e.current)?void 0:t.form;return null==n||n.addEventListener("reset",a),()=>{null==n||n.removeEventListener("reset",a)}},[e,a])}function yF(e){let{description:t,errorMessage:n,isInvalid:r,validationState:a}=e,{labelProps:o,fieldProps:i}=function(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":a,labelElementType:o="label"}=e;t=mV(t);let i=mV(),s={};return n&&(r=r?`${i} ${r}`:i,s={id:i,htmlFor:"label"===o?t:void 0}),{labelProps:s,fieldProps:h5({id:t,"aria-label":a,"aria-labelledby":r})}}(e),s=mU([!!t,!!n,r,a]),l=mU([!!t,!!n,r,a]);return{labelProps:o,fieldProps:i=mH(i,{"aria-describedby":[s,l,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),descriptionProps:{id:s},errorMessageProps:{id:l}}}function yB(e,t,n){let{validationBehavior:r,focus:a}=e;mP(()=>{if("native"===r&&(null==n?void 0:n.current)&&!n.current.disabled){var e;let r,a=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(a),n.current.hasAttribute("title")||(n.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation({isInvalid:!(e=n.current).validity.valid,validationDetails:{badInput:(r=e.validity).badInput,customError:r.customError,patternMismatch:r.patternMismatch,rangeOverflow:r.rangeOverflow,rangeUnderflow:r.rangeUnderflow,stepMismatch:r.stepMismatch,tooLong:r.tooLong,tooShort:r.tooShort,typeMismatch:r.typeMismatch,valueMissing:r.valueMissing,valid:r.valid},validationErrors:e.validationMessage?[e.validationMessage]:[]})}});let o=mR(()=>{t.resetValidation()}),i=mR(e=>{var r,o;t.displayValidation.isInvalid||t.commitValidation();let i=null==n||null==(r=n.current)?void 0:r.form;!e.defaultPrevented&&n&&i&&function(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(!n.validity.valid)return n}return null}(i)===n.current&&(a?a():null==(o=n.current)||o.focus(),pJ="keyboard",p2("keyboard",null)),e.preventDefault()}),s=mR(()=>{t.commitValidation()});(0,l$.useEffect)(()=>{let e=null==n?void 0:n.current;if(!e)return;let t=e.form;return e.addEventListener("invalid",i),e.addEventListener("change",s),null==t||t.addEventListener("reset",o),()=>{e.removeEventListener("invalid",i),e.removeEventListener("change",s),null==t||t.removeEventListener("reset",o)}},[n,i,s,o,r])}let yV=new WeakMap,yU="__role_"+Date.now(),yW="__focusManager_"+Date.now();function yH(e,t,n){var r,a;let o,{isInvalid:i,validationErrors:s,validationDetails:l}=t.displayValidation,{labelProps:u,fieldProps:c,descriptionProps:d,errorMessageProps:m}=yF({...e,labelElementType:"span",isInvalid:i,errorMessage:e.errorMessage||s}),p=(0,l$.useRef)(null),{focusWithinProps:f}=fl({...e,onFocusWithin(n){var r;p.current=t.value,null==(r=e.onFocus)||r.call(e,n)},onBlurWithin:n=>{var r;t.confirmPlaceholder(),t.value!==p.current&&t.commitValidation(),null==(r=e.onBlur)||r.call(e,n)},onFocusWithinChange:e.onFocusChange}),h=hH((a=yh)&&a.__esModule?a.default:a,"@react-aria/datepicker"),g="hour"===t.maxGranularity?"selectedTimeDescription":"selectedDateDescription",y="hour"===t.maxGranularity?"time":"date",v=gr(t.value?h.format(g,{[y]:t.formatValue({month:"long"})}):""),b="presentation"===e[yU]?c["aria-describedby"]:[v["aria-describedby"],c["aria-describedby"]].filter(Boolean).join(" ")||void 0,w=e[yW],E=(0,l$.useMemo)(()=>w||y$(n),[w,n]),x=yj(t,n,"presentation"===e[yU]);yV.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:[u.id,e["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:b,focusManager:E});let D=(0,l$.useRef)(e.autoFocus);o="presentation"===e[yU]?{role:"presentation"}:mH(c,{role:"group","aria-disabled":e.isDisabled||void 0,"aria-describedby":b}),(0,l$.useEffect)(()=>{D.current&&E.focusFirst(),D.current=!1},[E]),yL(e.inputRef,t.value,t.setValue),yB({...e,focus(){E.focusFirst()}},t,e.inputRef);let _={type:"hidden",name:e.name,value:(null==(r=t.value)?void 0:r.toString())||"",disabled:e.isDisabled};"native"===e.validationBehavior&&(_.type="text",_.hidden=!0,_.required=e.isRequired,_.onChange=()=>{});let k=m5(e);return{labelProps:{...u,onClick:()=>{E.focusFirst()}},fieldProps:mH(k,o,x,f,{onKeyDown(t){e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){e.onKeyUp&&e.onKeyUp(t)},style:{unicodeBidi:"isolate"}}),inputProps:_,descriptionProps:d,errorMessageProps:m,isInvalid:i,validationErrors:s,validationDetails:l}}var yz={};yz={"ar-AE":{rangeOverflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.maxValue} \u{623}\u{648} \u{642}\u{628}\u{644} \u{630}\u{644}\u{643}.`,rangeReversed:"تاريخ البدء يجب أن يكون قبل تاريخ الانتهاء.",rangeUnderflow:e=>`\u{64A}\u{62C}\u{628} \u{623}\u{646} \u{62A}\u{643}\u{648}\u{646} \u{627}\u{644}\u{642}\u{64A}\u{645}\u{629} ${e.minValue} \u{623}\u{648} \u{628}\u{639}\u{62F} \u{630}\u{644}\u{643}.`,unavailableDate:"البيانات المحددة غير متاحة."},"bg-BG":{rangeOverflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.maxValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{440}\u{430}\u{43D}\u{43D}\u{430}.`,rangeReversed:"Началната дата трябва да е преди крайната.",rangeUnderflow:e=>`\u{421}\u{442}\u{43E}\u{439}\u{43D}\u{43E}\u{441}\u{442}\u{442}\u{430} \u{442}\u{440}\u{44F}\u{431}\u{432}\u{430} \u{434}\u{430} \u{435} ${e.minValue} \u{438}\u{43B}\u{438} \u{43F}\u{43E}-\u{43A}\u{44A}\u{441}\u{43D}\u{43E}.`,unavailableDate:"Избраната дата не е налична."},"cs-CZ":{rangeOverflow:e=>`Hodnota mus\xed b\xfdt ${e.maxValue} nebo d\u{159}\xedv\u{11B}j\u{161}\xed.`,rangeReversed:"Datum zah\xe1jen\xed mus\xed předch\xe1zet datu ukončen\xed.",rangeUnderflow:e=>`Hodnota mus\xed b\xfdt ${e.minValue} nebo pozd\u{11B}j\u{161}\xed.`,unavailableDate:"Vybran\xe9 datum nen\xed k dispozici."},"da-DK":{rangeOverflow:e=>`V\xe6rdien skal v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen skal v\xe6re f\xf8r slutdatoen.",rangeUnderflow:e=>`V\xe6rdien skal v\xe6re ${e.minValue} eller nyere.`,unavailableDate:"Den valgte dato er ikke tilg\xe6ngelig."},"de-DE":{rangeOverflow:e=>`Der Wert muss ${e.maxValue} oder fr\xfcher sein.`,rangeReversed:"Das Anfangsdatum muss vor dem Enddatum liegen.",rangeUnderflow:e=>`Der Wert muss ${e.minValue} oder sp\xe4ter sein.`,unavailableDate:"Das ausgew\xe4hlte Datum ist nicht verf\xfcgbar."},"el-GR":{rangeOverflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.maxValue} \u{3AE} \u{3C0}\u{3B1}\u{3BB}\u{3B1}\u{3B9}\u{3CC}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,rangeReversed:"Η ημερομηνία έναρξης πρέπει να είναι πριν από την ημερομηνία λήξης.",rangeUnderflow:e=>`\u{397} \u{3C4}\u{3B9}\u{3BC}\u{3AE} \u{3C0}\u{3C1}\u{3AD}\u{3C0}\u{3B5}\u{3B9} \u{3BD}\u{3B1} \u{3B5}\u{3AF}\u{3BD}\u{3B1}\u{3B9} ${e.minValue} \u{3AE} \u{3BC}\u{3B5}\u{3C4}\u{3B1}\u{3B3}\u{3B5}\u{3BD}\u{3AD}\u{3C3}\u{3C4}\u{3B5}\u{3C1}\u{3B7}.`,unavailableDate:"Η επιλεγμένη ημερομηνία δεν είναι διαθέσιμη."},"en-US":{rangeUnderflow:e=>`Value must be ${e.minValue} or later.`,rangeOverflow:e=>`Value must be ${e.maxValue} or earlier.`,rangeReversed:"Start date must be before end date.",unavailableDate:"Selected date unavailable."},"es-ES":{rangeOverflow:e=>`El valor debe ser ${e.maxValue} o anterior.`,rangeReversed:"La fecha de inicio debe ser anterior a la fecha de finalizaci\xf3n.",rangeUnderflow:e=>`El valor debe ser ${e.minValue} o posterior.`,unavailableDate:"Fecha seleccionada no disponible."},"et-EE":{rangeOverflow:e=>`V\xe4\xe4rtus peab olema ${e.maxValue} v\xf5i varasem.`,rangeReversed:"Alguskuup\xe4ev peab olema enne l\xf5ppkuup\xe4eva.",rangeUnderflow:e=>`V\xe4\xe4rtus peab olema ${e.minValue} v\xf5i hilisem.`,unavailableDate:"Valitud kuup\xe4ev pole saadaval."},"fi-FI":{rangeOverflow:e=>`Arvon on oltava ${e.maxValue} tai sit\xe4 aikaisempi.`,rangeReversed:"Aloitusp\xe4iv\xe4n on oltava ennen lopetusp\xe4iv\xe4\xe4.",rangeUnderflow:e=>`Arvon on oltava ${e.minValue} tai sit\xe4 my\xf6h\xe4isempi.`,unavailableDate:"Valittu p\xe4iv\xe4m\xe4\xe4r\xe4 ei ole k\xe4ytett\xe4viss\xe4."},"fr-FR":{rangeOverflow:e=>`La valeur doit \xeatre ${e.maxValue} ou ant\xe9rieure.`,rangeReversed:"La date de d\xe9but doit \xeatre ant\xe9rieure \xe0 la date de fin.",rangeUnderflow:e=>`La valeur doit \xeatre ${e.minValue} ou ult\xe9rieure.`,unavailableDate:"La date s\xe9lectionn\xe9e n’est pas disponible."},"he-IL":{rangeOverflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.maxValue} \u{5D0}\u{5D5} \u{5DE}\u{5D5}\u{5E7}\u{5D3}\u{5DD} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,rangeReversed:"תאריך ההתחלה חייב להיות לפני תאריך הסיום.",rangeUnderflow:e=>`\u{5D4}\u{5E2}\u{5E8}\u{5DA} \u{5D7}\u{5D9}\u{5D9}\u{5D1} \u{5DC}\u{5D4}\u{5D9}\u{5D5}\u{5EA} ${e.minValue} \u{5D0}\u{5D5} \u{5DE}\u{5D0}\u{5D5}\u{5D7}\u{5E8} \u{5D9}\u{5D5}\u{5EA}\u{5E8}.`,unavailableDate:"התאריך הנבחר אינו זמין."},"hr-HR":{rangeOverflow:e=>`Vrijednost mora biti ${e.maxValue} ili ranije.`,rangeReversed:"Datum početka mora biti prije datuma završetka.",rangeUnderflow:e=>`Vrijednost mora biti ${e.minValue} ili kasnije.`,unavailableDate:"Odabrani datum nije dostupan."},"hu-HU":{rangeOverflow:e=>`Az \xe9rt\xe9knek ${e.maxValue} vagy kor\xe1bbinak kell lennie.`,rangeReversed:"A kezdő d\xe1tumnak a befejező d\xe1tumn\xe1l kor\xe1bbinak kell lennie.",rangeUnderflow:e=>`Az \xe9rt\xe9knek ${e.minValue} vagy k\xe9s\u{151}bbinek kell lennie.`,unavailableDate:"A kiv\xe1lasztott d\xe1tum nem \xe9rhető el."},"it-IT":{rangeOverflow:e=>`Il valore deve essere ${e.maxValue} o precedente.`,rangeReversed:"La data di inizio deve essere antecedente alla data di fine.",rangeUnderflow:e=>`Il valore deve essere ${e.minValue} o successivo.`,unavailableDate:"Data selezionata non disponibile."},"ja-JP":{rangeOverflow:e=>`\u{5024}\u{306F} ${e.maxValue} \u{4EE5}\u{4E0B}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,rangeReversed:"開始日は終了日より前にする必要があります。",rangeUnderflow:e=>`\u{5024}\u{306F} ${e.minValue} \u{4EE5}\u{4E0A}\u{306B}\u{3059}\u{308B}\u{5FC5}\u{8981}\u{304C}\u{3042}\u{308A}\u{307E}\u{3059}\u{3002}`,unavailableDate:"選択した日付は使用できません。"},"ko-KR":{rangeOverflow:e=>`\u{AC12}\u{C740} ${e.maxValue} \u{C774}\u{C804}\u{C774}\u{C5B4}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,rangeReversed:"시작일은 종료일 이전이어야 합니다.",rangeUnderflow:e=>`\u{AC12}\u{C740} ${e.minValue} \u{C774}\u{C0C1}\u{C774}\u{C5B4}\u{C57C} \u{D569}\u{B2C8}\u{B2E4}.`,unavailableDate:"선택한 날짜를 사용할 수 없습니다."},"lt-LT":{rangeOverflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.maxValue} arba ankstesn\u{117}.`,rangeReversed:"Pradžios data turi būti ankstesnė nei pabaigos data.",rangeUnderflow:e=>`Reik\u{161}m\u{117} turi b\u{16B}ti ${e.minValue} arba naujesn\u{117}.`,unavailableDate:"Pasirinkta data nepasiekiama."},"lv-LV":{rangeOverflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.maxValue} vai agr\u{101}kai.`,rangeReversed:"Sākuma datumam ir jābūt pirms beigu datuma.",rangeUnderflow:e=>`V\u{113}rt\u{12B}bai ir j\u{101}b\u{16B}t ${e.minValue} vai v\u{113}l\u{101}kai.`,unavailableDate:"Atlasītais datums nav pieejams."},"nb-NO":{rangeOverflow:e=>`Verdien m\xe5 v\xe6re ${e.maxValue} eller tidligere.`,rangeReversed:"Startdatoen m\xe5 v\xe6re f\xf8r sluttdatoen.",rangeUnderflow:e=>`Verdien m\xe5 v\xe6re ${e.minValue} eller senere.`,unavailableDate:"Valgt dato utilgjengelig."},"nl-NL":{rangeOverflow:e=>`Waarde moet ${e.maxValue} of eerder zijn.`,rangeReversed:"De startdatum moet voor de einddatum liggen.",rangeUnderflow:e=>`Waarde moet ${e.minValue} of later zijn.`,unavailableDate:"Geselecteerde datum niet beschikbaar."},"pl-PL":{rangeOverflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.maxValue} lub wcze\u{15B}niejsz\u{105}.`,rangeReversed:"Data rozpoczęcia musi być wcześniejsza niż data zakończenia.",rangeUnderflow:e=>`Warto\u{15B}\u{107} musi mie\u{107} warto\u{15B}\u{107} ${e.minValue} lub p\xf3\u{17A}niejsz\u{105}.`,unavailableDate:"Wybrana data jest niedostępna."},"pt-BR":{rangeOverflow:e=>`O valor deve ser ${e.maxValue} ou anterior.`,rangeReversed:"A data inicial deve ser anterior \xe0 data final.",rangeUnderflow:e=>`O valor deve ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xedvel."},"pt-PT":{rangeOverflow:e=>`O valor tem de ser ${e.maxValue} ou anterior.`,rangeReversed:"A data de in\xedcio deve ser anterior \xe0 data de fim.",rangeUnderflow:e=>`O valor tem de ser ${e.minValue} ou posterior.`,unavailableDate:"Data selecionada indispon\xedvel."},"ro-RO":{rangeOverflow:e=>`Valoarea trebuie s\u{103} fie ${e.maxValue} sau anterioar\u{103}.`,rangeReversed:"Data de \xeenceput trebuie să fie anterioară datei de sf\xe2rșit.",rangeUnderflow:e=>`Valoarea trebuie s\u{103} fie ${e.minValue} sau ulterioar\u{103}.`,unavailableDate:"Data selectată nu este disponibilă."},"ru-RU":{rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{43F}\u{43E}\u{437}\u{436}\u{435} ${e.maxValue}.`,rangeReversed:"Дата начала должна предшествовать дате окончания.",rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{438}\u{435} \u{434}\u{43E}\u{43B}\u{436}\u{43D}\u{43E} \u{431}\u{44B}\u{442}\u{44C} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{44C}\u{448}\u{435} ${e.minValue}.`,unavailableDate:"Выбранная дата недоступна."},"sk-SK":{rangeOverflow:e=>`Hodnota mus\xed by\u{165} ${e.maxValue} alebo skor\u{161}ia.`,rangeReversed:"D\xe1tum začiatku mus\xed byť skorš\xed ako d\xe1tum konca.",rangeUnderflow:e=>`Hodnota mus\xed by\u{165} ${e.minValue} alebo neskor\u{161}ia.`,unavailableDate:"Vybrat\xfd d\xe1tum je nedostupn\xfd."},"sl-SI":{rangeOverflow:e=>`Vrednost mora biti ${e.maxValue} ali starej\u{161}a.`,rangeReversed:"Začetni datum mora biti pred končnim datumom.",rangeUnderflow:e=>`Vrednost mora biti ${e.minValue} ali novej\u{161}a.`,unavailableDate:"Izbrani datum ni na voljo."},"sr-SP":{rangeOverflow:e=>`Vrednost mora da bude ${e.maxValue} ili starija.`,rangeReversed:"Datum početka mora biti pre datuma završetka.",rangeUnderflow:e=>`Vrednost mora da bude ${e.minValue} ili novija.`,unavailableDate:"Izabrani datum nije dostupan."},"sv-SE":{rangeOverflow:e=>`V\xe4rdet m\xe5ste vara ${e.maxValue} eller tidigare.`,rangeReversed:"Startdatumet m\xe5ste vara f\xf6re slutdatumet.",rangeUnderflow:e=>`V\xe4rdet m\xe5ste vara ${e.minValue} eller senare.`,unavailableDate:"Det valda datumet \xe4r inte tillg\xe4ngligt."},"tr-TR":{rangeOverflow:e=>`De\u{11F}er, ${e.maxValue} veya \xf6ncesi olmal\u{131}d\u{131}r.`,rangeReversed:"Başlangı\xe7 tarihi bitiş tarihinden \xf6nce olmalıdır.",rangeUnderflow:e=>`De\u{11F}er, ${e.minValue} veya sonras\u{131} olmal\u{131}d\u{131}r.`,unavailableDate:"Se\xe7ilen tarih kullanılamıyor."},"uk-UA":{rangeOverflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{43F}\u{456}\u{437}\u{43D}\u{456}\u{448}\u{435} ${e.maxValue}.`,rangeReversed:"Дата початку має передувати даті завершення.",rangeUnderflow:e=>`\u{417}\u{43D}\u{430}\u{447}\u{435}\u{43D}\u{43D}\u{44F} \u{43C}\u{430}\u{454} \u{431}\u{443}\u{442}\u{438} \u{43D}\u{435} \u{440}\u{430}\u{43D}\u{456}\u{448}\u{435} ${e.minValue}.`,unavailableDate:"Вибрана дата недоступна."},"zh-CN":{rangeOverflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{65E5}\u{671F}\u{3002}`,rangeReversed:"开始日期必须早于结束日期。",rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{987B}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{65E5}\u{671F}\u{3002}`,unavailableDate:"所选日期不可用。"},"zh-TW":{rangeOverflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.maxValue} \u{6216}\u{66F4}\u{65E9}\u{3002}`,rangeReversed:"開始日期必須在結束日期之前。",rangeUnderflow:e=>`\u{503C}\u{5FC5}\u{9808}\u{662F} ${e.minValue} \u{6216}\u{66F4}\u{665A}\u{3002}`,unavailableDate:"所選日期無法使用。"}};let yK={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},yG={...yK,customError:!0,valid:!1},yZ={isInvalid:!1,validationDetails:yK,validationErrors:[]},yY=(0,l$.createContext)({}),yq="__formValidationState"+Date.now();function yJ(e){if(e[yq]){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:a,commitValidation:o}=e[yq];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:a,commitValidation:o}}return function(e){let{isInvalid:t,validationState:n,name:r,value:a,builtinValidation:o,validate:i,validationBehavior:s="aria"}=e;n&&(t||(t="invalid"===n));let l=void 0!==t?{isInvalid:t,validationErrors:[],validationDetails:yG}:null,u=(0,l$.useMemo)(()=>i&&null!=a?yQ(function(e,t){if("function"==typeof e){let n=e(t);if(n&&"boolean"!=typeof n)return yX(n)}return[]}(i,a)):null,[i,a]);(null==o?void 0:o.validationDetails.valid)&&(o=void 0);let c=(0,l$.useContext)(yY),d=(0,l$.useMemo)(()=>r?Array.isArray(r)?r.flatMap(e=>yX(c[e])):yX(c[r]):[],[c,r]),[m,p]=(0,l$.useState)(c),[f,h]=(0,l$.useState)(!1);c!==m&&(p(c),h(!1));let g=(0,l$.useMemo)(()=>yQ(f?[]:d),[f,d]),y=(0,l$.useRef)(yZ),[v,b]=(0,l$.useState)(yZ),w=(0,l$.useRef)(yZ),[E,x]=(0,l$.useState)(!1);return(0,l$.useEffect)(()=>{if(!E)return;x(!1);let e=u||o||y.current;y0(e,w.current)||(w.current=e,b(e))}),{realtimeValidation:l||g||u||o||yZ,displayValidation:"native"===s?l||g||v:l||g||u||o||v,updateValidation(e){"aria"!==s||y0(v,e)?y.current=e:b(e)},resetValidation(){y0(yZ,w.current)||(w.current=yZ,b(yZ)),"native"===s&&x(!1),h(!0)},commitValidation(){"native"===s&&x(!0),h(!0)}}}(e)}function yX(e){return e?Array.isArray(e)?e:[e]:[]}function yQ(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:yG}:null}function y0(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function y1(...e){let t=new Set,n=!1,r={...yK};for(let a of e){for(let e of a.validationErrors)t.add(e);for(let e in n||(n=a.isInvalid),r)r[e]||(r[e]=a.validationDetails[e])}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}let y4=new hL((X=yz)&&X.__esModule?X.default:X);function y2(){return"u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US"}function y3(e,t,n,r,a){let o=null!=e&&null!=n&&e.compare(n)>0,i=null!=e&&null!=t&&0>e.compare(t),s=null!=e&&(null==r?void 0:r(e))||!1,l=o||i||s,u=[];if(l){let e=y2(),r=new hV(e,hL.getGlobalDictionaryForPackage("@react-stately/datepicker")||y4),l=new hK(e,y9({},a)),c=l.resolvedOptions().timeZone;i&&null!=t&&u.push(r.format("rangeUnderflow",{minValue:l.format(t.toDate(c))})),o&&null!=n&&u.push(r.format("rangeOverflow",{maxValue:l.format(n.toDate(c))})),s&&u.push(r.format("unavailableDate"))}return{isInvalid:l,validationErrors:u,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:o,rangeUnderflow:i,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!l}}}let y6={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},y5={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function y9(e,t){var n;e={...t.shouldForceLeadingZeros?y5:y6,...e};let r=t.granularity||"minute",a=Object.keys(e),o=a.indexOf(null!=(n=t.maxGranularity)?n:"year");o<0&&(o=0);let i=a.indexOf(r);if(i<0&&(i=2),o>i)throw Error("maxGranularity must be greater than granularity");let s=a.slice(o,i+1).reduce((t,n)=>(t[n]=e[n],t),{});return null!=t.hourCycle&&(s.hour12=12===t.hourCycle),s.timeZone=t.timeZone||"UTC",("hour"===r||"minute"===r||"second"===r)&&t.timeZone&&!t.hideTimeZone&&(s.timeZoneName="short"),t.showEra&&0===o&&(s.era="short"),s}function y8(e){return e&&"hour"in e?e:new hn}function y7(e,t){return null===e?null:e?hy(e,t):void 0}function ve(e,t,n,r){if(e)return y7(e,n);let a=hy(h_(null!=r?r:hR()).set({hour:0,minute:0,second:0,millisecond:0}),n);return"year"===t||"month"===t||"day"===t?hh(a):r?a:hg(a)}function vt(e,t){let n=e&&"timeZone"in e?e.timeZone:void 0,r=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw Error("Invalid granularity "+t+" for value "+e.toString());let[a,o]=(0,l$.useState)([r,n]);return e&&(a[0]!==r||a[1]!==n)&&o([r,n]),t||(t=e?r:a[0]),[t,e?n:a[1]]}let vn=new hL({ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"ዓዓዓዓ",month:"ሚሜ",day:"ቀቀ"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"سنة",month:"شهر",day:"يوم"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"гггг",month:"мм",day:"дд"},bg:{year:"гггг",month:"мм",day:"дд"},bn:{year:"yyyy",month:"মিমি",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"ساڵ",month:"مانگ",day:"ڕۆژ"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"źź"},el:{year:"εεεε",month:"μμ",day:"ηη"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"سال",month:"ماه",day:"روز"},ff:{year:"hhhh",month:"ll",day:"\xf1\xf1"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"שנה",month:"חודש",day:"יום"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"\xe9\xe9\xe9\xe9",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:"年",month:"月",day:"日"},ka:{year:"წწწწ",month:"თთ",day:"რრ"},kk:{year:"жжжж",month:"аа",day:"кк"},kn:{year:"ವವವವ",month:"ಮಿಮೀ",day:"ದಿದಿ"},ko:{year:"연도",month:"월",day:"일"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"ປປປປ",month:"ດດ",day:"ວວ"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"വർഷം",month:"മാസം",day:"തീയതി"},ms:{year:"tttt",month:"mm",day:"hh"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},no:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"гггг",month:"мм",day:"дд"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"гггг",month:"мм",day:"дд"},sv:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"сссс",month:"мм",day:"рр"},th:{year:"ปปปป",month:"ดด",day:"วว"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"рррр",month:"мм",day:"дд"},"zh-CN":{year:"年",month:"月",day:"日"},"zh-TW":{year:"年",month:"月",day:"日"}},"en"),vr={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},va={year:5,month:2,day:7,hour:2,minute:15,second:15},vo={dayperiod:"dayPeriod"};function vi(e){var t,n;let{locale:r,createCalendar:a,hideTimeZone:o,isDisabled:i=!1,isReadOnly:s=!1,isRequired:l=!1,minValue:u,maxValue:c,isDateUnavailable:d}=e,m=e.value||e.defaultValue||e.placeholderValue||null,[p,f]=vt(m,e.granularity),h=f||"UTC";if(m&&!(p in m))throw Error("Invalid granularity "+p+" for value "+m.toString());let g=(0,l$.useMemo)(()=>new hK(r),[r]),y=(0,l$.useMemo)(()=>a(g.resolvedOptions().calendar),[a,g]),[v,b]=g2(e.value,null!=(t=e.defaultValue)?t:null,e.onChange),w=(0,l$.useMemo)(()=>{var e;return null!=(e=y7(v,y))?e:null},[v,y]),[E,x]=(0,l$.useState)(()=>ve(e.placeholderValue,p,y,f)),D="gregory"===y.identifier&&"BC"===(w||E).era,_=(0,l$.useMemo)(()=>{var t;return{granularity:p,maxGranularity:null!=(t=e.maxGranularity)?t:"year",timeZone:f,hideTimeZone:o,hourCycle:e.hourCycle,showEra:D,shouldForceLeadingZeros:e.shouldForceLeadingZeros}},[e.maxGranularity,p,e.hourCycle,e.shouldForceLeadingZeros,f,o,D]),k=(0,l$.useMemo)(()=>y9({},_),[_]),S=(0,l$.useMemo)(()=>new hK(r,k),[r,k]),C=(0,l$.useMemo)(()=>S.resolvedOptions(),[S]),P=(0,l$.useMemo)(()=>S.formatToParts(new Date).filter(e=>vr[e.type]).reduce((e,t)=>(e[t.type]=!0,e),{}),[S]),[R,T]=(0,l$.useState)(()=>e.value||e.defaultValue?{...P}:{}),$=(0,l$.useRef)(null),O=(0,l$.useRef)(y);(0,l$.useEffect)(()=>{hE(y,O.current)||(O.current=y,x(t=>Object.keys(R).length>0?hy(t,y):ve(e.placeholderValue,p,y,f)))},[y,p,R,f,e.placeholderValue]),v&&Object.keys(R).length<Object.keys(P).length&&T(R={...P}),null==v&&Object.keys(R).length===Object.keys(P).length&&(T(R={}),x(ve(e.placeholderValue,p,y,f)));let N=w&&Object.keys(R).length>=Object.keys(P).length?w:E,A=t=>{if(e.isDisabled||e.isReadOnly)return;let n=Object.keys(R),r=Object.keys(P);null==t?(b(null),x(ve(e.placeholderValue,p,y,f)),T({})):n.length>=r.length||n.length===r.length-1&&P.dayPeriod&&!R.dayPeriod&&"dayPeriod"!==$.current?b(t=hy(t,(null==m?void 0:m.calendar)||new fU)):x(t),$.current=null},I=(0,l$.useMemo)(()=>N.toDate(h),[N,h]),j=(0,l$.useMemo)(()=>(function(e,t,n,r,a,o,i,s){let l=["hour","minute","second"],u=n.formatToParts(e),c=[];for(let e of u){var d,m;let n=vr[e.type];"era"===e.type&&1===o.getEras().length&&(n=!1);let u=vr[e.type]&&!t[e.type],p=vr[e.type]?(d=e.type,m=e.value,"era"===d||"dayPeriod"===d?m:"year"===d||"month"===d||"day"===d?vn.getStringForLocale(d,i):"––"):null,f={type:vo[e.type]||e.type,text:u?p:e.value,...vs(a,e.type,r),isPlaceholder:u,placeholder:p,isEditable:n};"hour"===e.type?(c.push({type:"literal",text:"",...vs(a,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1}),c.push(f),e.type===s&&c.push({type:"literal",text:"",...vs(a,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):l.includes(e.type)&&e.type===s?(c.push(f),c.push({type:"literal",text:"",...vs(a,"literal",r),isPlaceholder:!1,placeholder:"",isEditable:!1})):c.push(f)}return c})(I,R,S,C,N,y,r,p),[I,R,S,C,N,y,r,p]);P.era&&R.year&&!R.era?(R.era=!0,T({...R})):!P.era&&R.era&&(delete R.era,T({...R}));let M=e=>{R[e]=!0,"year"===e&&P.era&&(R.era=!0),T({...R})},L=(e,t)=>{if(R[e])A(function(e,t,n,r){switch(t){case"era":case"year":case"month":case"day":return e.cycle(t,n,{round:"year"===t})}if("hour"in e)switch(t){case"dayPeriod":{let t=e.hour;return e.set({hour:t>=12?t-12:t+12})}case"hour":case"minute":case"second":return e.cycle(t,n,{round:"hour"!==t,hourCycle:r.hour12?12:24})}throw Error("Unknown segment: "+t)}(N,e,t,C));else{M(e);let t=Object.keys(R),n=Object.keys(P);(t.length>=n.length||t.length===n.length-1&&P.dayPeriod&&!R.dayPeriod)&&A(N)}},F=(0,l$.useMemo)(()=>y3(v,u,c,d,_),[v,u,c,d,_]),B=yJ({...e,value:v,builtinValidation:F}),V=B.displayValidation.isInvalid,U=e.validationState||(V?"invalid":null);return{...B,value:w,dateValue:I,calendar:y,setValue:A,segments:j,dateFormatter:S,validationState:U,isInvalid:V,granularity:p,maxGranularity:null!=(n=e.maxGranularity)?n:"year",isDisabled:i,isReadOnly:s,isRequired:l,increment(e){L(e,1)},decrement(e){L(e,-1)},incrementPage(e){L(e,va[e]||1)},decrementPage(e){L(e,-(va[e]||1))},setSegment(e,t){M(e),A(function(e,t,n,r){switch(t){case"day":case"month":case"year":case"era":return e.set({[t]:n})}if("hour"in e&&"number"==typeof n)switch(t){case"dayPeriod":{let t=e.hour,r=t>=12;if(n>=12===r)return e;return e.set({hour:r?t-12:t+12})}case"hour":if(r.hour12){let t=e.hour>=12;t||12!==n||(n=0),t&&n<12&&(n+=12)}case"minute":case"second":return e.set({[t]:n})}throw Error("Unknown segment: "+t)}(N,e,t,C))},confirmPlaceholder(){if(e.isDisabled||e.isReadOnly)return;let t=Object.keys(R),n=Object.keys(P);t.length===n.length-1&&P.dayPeriod&&!R.dayPeriod&&(T(R={...P}),A(N.copy()))},clearSegment(t){delete R[t],$.current=t,T({...R});let n=ve(e.placeholderValue,p,y,f),r=N;if("dayPeriod"===t&&"hour"in N&&"hour"in n){let e=N.hour>=12,t=n.hour>=12;e&&!t?r=N.set({hour:N.hour-12}):!e&&t&&(r=N.set({hour:N.hour+12}))}else"hour"===t&&"hour"in N&&N.hour>=12&&R.dayPeriod?r=N.set({hour:n.hour+12}):t in N&&(r=N.set({[t]:n[t]}));b(null),A(r)},formatValue:e=>w?new hK(r,y9(e,_)).format(I):"",getDateFormatter:(e,t)=>new hK(e,y9({},{..._,...t}))}}function vs(e,t,n){switch(t){case"era":{let t=e.calendar.getEras();return{value:t.indexOf(e.era),minValue:0,maxValue:t.length-1}}case"year":return{value:e.year,minValue:1,maxValue:e.calendar.getYearsInEra(e)};case"month":return{value:e.month,minValue:e.calendar.getMinimumMonthInYear?e.calendar.getMinimumMonthInYear(e):1,maxValue:e.calendar.getMonthsInYear(e)};case"day":return{value:e.day,minValue:e.calendar.getMinimumDayInMonth?e.calendar.getMinimumDayInMonth(e):1,maxValue:e.calendar.getDaysInMonth(e)}}if("hour"in e)switch(t){case"dayPeriod":return{value:12*(e.hour>=12),minValue:0,maxValue:12};case"hour":if(n.hour12){let t=e.hour>=12;return{value:e.hour,minValue:12*!!t,maxValue:t?23:11}}return{value:e.hour,minValue:0,maxValue:23};case"minute":return{value:e.minute,minValue:0,maxValue:59};case"second":return{value:e.second,minValue:0,maxValue:59}}return{}}let vl=(0,l$.createContext)(null),vu=(0,l$.createContext)(null),vc=(0,l$.createContext)(null),vd=(0,l$.forwardRef)(function(e,t){let n=(0,l$.useContext)(vu),r=(0,l$.useContext)(vc);return n||r?lO().createElement(vp,{...e,ref:t}):lO().createElement(vm,{...e,ref:t})}),vm=(0,l$.forwardRef)((e,t)=>{let[n,r]=mY({slot:e.slot},t,vl),{locale:a}=fA(),o=vi({...n,locale:a,createCalendar:gY}),i=(0,l$.useRef)(null),{fieldProps:s,inputProps:l}=yH({...n,inputRef:i},o,r);return lO().createElement(mK,{values:[[vu,o],[yp,{...l,ref:i}],[yd,{...s,ref:r,isInvalid:o.isInvalid,isDisabled:o.isDisabled}]]},lO().createElement(vp,e))}),vp=(0,l$.forwardRef)((e,t)=>{let{className:n,children:r}=e,a=(0,l$.useContext)(vu),o=(0,l$.useContext)(vc),i=null!=a?a:o;return lO().createElement(lO().Fragment,null,lO().createElement(ym,{...e,ref:t,slot:e.slot||void 0,className:null!=n?n:"react-aria-DateInput",isInvalid:i.isInvalid,isDisabled:i.isDisabled},i.segments.map((e,t)=>(0,l$.cloneElement)(r(e),{key:t}))),lO().createElement(yf,null))}),vf=(0,l$.createContext)({});function vh({children:e}){let t=(0,l$.useMemo)(()=>({register:()=>{}}),[]);return lO().createElement(pR.Provider,{value:t},e)}lO().forwardRef(({children:e,...t},n)=>{let r=(0,l$.useRef)(!1),a=(0,l$.useContext)(pR);n=mS(n||(null==a?void 0:a.ref));let o=mH(a||{},{...t,ref:n,register(){r.current=!0,a&&a.register()}});return pN(a,n),(0,l$.useEffect)(()=>{r.current||(r.current=!0)},[]),lO().createElement(pR.Provider,{value:o},e)});let vg=lO().createContext(null);function vy(e){var t;let n=mL(),{portalContainer:r=n?null:document.body,isExiting:a}=e,[o,i]=(0,l$.useState)(!1),s=(0,l$.useMemo)(()=>({contain:o,setContain:i}),[o,i]),{getContainer:l}=null!=(t=(0,l$.useContext)(vf))?t:{};if(!e.portalContainer&&l&&(r=l()),!r)return null;let u=e.children;return e.disableFocusManagement||(u=lO().createElement(yb,{restoreFocus:!0,contain:(e.shouldContainFocus||o)&&!a},u)),u=lO().createElement(vg.Provider,{value:s},lO().createElement(vh,null,u)),pB().createPortal(u,r)}let vv=(0,l$.createContext)(null),vb=(0,l$.createContext)(null),vw=(0,l$.forwardRef)(function(e,t){let n=e["aria-labelledby"];[e,t]=mY(e,t,vv);let{dialogProps:r,titleProps:a}=function(e,t){let n,r,{role:a="dialog"}=e,o=mU();o=e["aria-label"]?void 0:o;let i=(0,l$.useRef)(!1);return(0,l$.useEffect)(()=>{if(t.current&&!t.current.contains(document.activeElement)){fr(t.current);let e=setTimeout(()=>{document.activeElement===t.current&&(i.current=!0,t.current&&(t.current.blur(),fr(t.current)),i.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),mP(()=>{null==r||r(!0)},[r=null==(n=(0,l$.useContext)(vg))?void 0:n.setContain]),{dialogProps:{...m5(e,{labelable:!0}),role:a,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||o,onBlur:e=>{i.current&&e.stopPropagation()}},titleProps:{id:o}}}({...e,"aria-labelledby":n},t),o=(0,l$.useContext)(vb);r["aria-label"]||r["aria-labelledby"]||e["aria-labelledby"]&&(r["aria-labelledby"]=e["aria-labelledby"]);let i=mG({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(null==o?void 0:o.close)||(()=>{})}});return lO().createElement("section",{...m5(e),...r,...i,ref:t,slot:e.slot||void 0},lO().createElement(mK,{values:[[fw,{slots:{[mz]:{},title:{...a,level:2}}}],[fv,{slots:{[mz]:{},close:{onPress:()=>null==o?void 0:o.close()}}}]]},i.children))}),vE=(0,l$.createContext)(null),vx=(0,l$.forwardRef)(function(e,t){let n=(0,l$.useContext)(vE);return(null==n?void 0:n.isInvalid)?lO().createElement(vD,{...e,ref:t}):null}),vD=(0,l$.forwardRef)((e,t)=>{let n=(0,l$.useContext)(vE),r=m5(e),a=mG({...e,defaultClassName:"react-aria-FieldError",defaultChildren:0===n.validationErrors.length?void 0:n.validationErrors.join(" "),values:n});return null==a.children?null:lO().createElement(fx,{slot:"errorMessage",...r,...a,ref:t})}),v_=(0,l$.createContext)(null),vk=(0,l$.createContext)({}),vS=fg(function(e,t){[e,t]=mY(e,t,vk);let{elementType:n="label",...r}=e;return lO().createElement(n,{className:"react-aria-Label",...r,ref:t})}),vC=(0,l$.createContext)({placement:"bottom"}),vP=new WeakMap,vR=[];function vT(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}function v$(e,t){let n=e,r=t.toString(),a=r.indexOf("."),o=a>=0?r.length-a:0;if(o>0){let e=Math.pow(10,o);n=Math.round(n*e)/e}return n}function vO(e,t,n,r){t=Number(t),n=Number(n);let a=(e-(isNaN(t)?0:t))%r,o=v$(2*Math.abs(a)>=r?e+Math.sign(a)*(r-Math.abs(a)):e-a,r);return isNaN(t)?!isNaN(n)&&o>n&&(o=Math.floor(v$(n/r,r))*r):o<t?o=t:!isNaN(n)&&o>n&&(o=t+Math.floor(v$((n-t)/r,r))*r),o=v$(o,r)}let vN={top:"top",bottom:"top",left:"left",right:"left"},vA={top:"bottom",bottom:"top",left:"right",right:"left"},vI={top:"left",left:"top"},vj={top:"height",left:"width"},vM={width:"totalWidth",height:"totalHeight"},vL={},vF="u">typeof document?window.visualViewport:null;function vB(e){var t,n,r,a,o;let i=0,s=0,l=0,u=0,c=0,d=0,m={},p=(null!=(t=null==vF?void 0:vF.scale)?t:1)>1;if("BODY"===e.tagName){let t=document.documentElement;l=t.clientWidth,u=t.clientHeight,i=null!=(n=null==vF?void 0:vF.width)?n:l,s=null!=(r=null==vF?void 0:vF.height)?r:u,m.top=t.scrollTop||e.scrollTop,m.left=t.scrollLeft||e.scrollLeft,vF&&(c=vF.offsetTop,d=vF.offsetLeft)}else({width:i,height:s,top:c,left:d}=vz(e)),m.top=e.scrollTop,m.left=e.scrollLeft,l=i,u=s;return py()&&("BODY"===e.tagName||"HTML"===e.tagName)&&p&&(m.top=0,m.left=0,c=null!=(a=null==vF?void 0:vF.pageTop)?a:0,d=null!=(o=null==vF?void 0:vF.pageLeft)?o:0),{width:i,height:s,totalWidth:l,totalHeight:u,scroll:m,top:c,left:d}}function vV(e,t,n,r,a,o,i){var s;let l=null!=(s=a.scroll[e])?s:0,u=r[vj[e]],c=r.scroll[vN[e]]+o,d=u+r.scroll[vN[e]]-o,m=t-l+i[e]-r[vN[e]],p=t-l+n+i[e]-r[vN[e]];return m<c?c-m:p>d?Math.max(d-p,c-m):0}function vU(e){if(vL[e])return vL[e];let[t,n]=e.split(" "),r=vN[t]||"right",a=vI[r];vN[n]||(n="center");let o=vj[r],i=vj[a];return vL[e]={placement:t,crossPlacement:n,axis:r,crossAxis:a,size:o,crossSize:i},vL[e]}function vW(e,t,n,r,a,o,i,s,l,u){var c,d,m,p,f;let{placement:h,crossPlacement:g,axis:y,crossAxis:v,size:b,crossSize:w}=r,E={};E[v]=null!=(c=e[v])?c:0,"center"===g?E[v]+=((null!=(d=e[w])?d:0)-(null!=(m=n[w])?m:0))/2:g!==v&&(E[v]+=(null!=(p=e[w])?p:0)-(null!=(f=n[w])?f:0)),E[v]+=o;let x=e[v]-n[w]+l+u,D=e[v]+e[w]-l-u;if(E[v]=vT(E[v],x,D),h===y){let n=s?i[b]:t[vM[b]];E[vA[y]]=Math.floor(n-e[y]+a)}else E[y]=Math.floor(e[y]+e[b]+a);return E}function vH(e,t,n,r,a,o){var i,s,l;let{placement:u,axis:c,size:d}=o;return u===c?Math.max(0,n[c]-e[c]-(null!=(i=e.scroll[c])?i:0)+t[c]-(null!=(s=r[c])?s:0)-r[vA[c]]-a):Math.max(0,e[d]+e[c]+e.scroll[c]-t[c]-n[c]-n[d]-(null!=(l=r[c])?l:0)-r[vA[c]]-a)}function vz(e){let{top:t,left:n,width:r,height:a}=e.getBoundingClientRect(),{scrollTop:o,scrollLeft:i,clientTop:s,clientLeft:l}=document.documentElement;return{top:t+o-s,left:n+i-l,width:r,height:a}}function vK(e,t){let n,r=window.getComputedStyle(e);if("fixed"===r.position){let{top:t,left:r,width:a,height:o}=e.getBoundingClientRect();n={top:t,left:r,width:a,height:o}}else{n=vz(e);let r=vz(t),a=window.getComputedStyle(t);r.top+=(parseInt(a.borderTopWidth,10)||0)-t.scrollTop,r.left+=(parseInt(a.borderLeftWidth,10)||0)-t.scrollLeft,n.top-=r.top,n.left-=r.left}return n.top-=parseInt(r.marginTop,10)||0,n.left-=parseInt(r.marginLeft,10)||0,n}function vG(e){let t=window.getComputedStyle(e);return"none"!==t.transform||/transform|perspective/.test(t.willChange)||"none"!==t.filter||"paint"===t.contain||"backdropFilter"in t&&"none"!==t.backdropFilter||"WebkitBackdropFilter"in t&&"none"!==t.WebkitBackdropFilter}let vZ=new WeakMap;function vY(e){let{ref:t,box:n,onResize:r}=e;(0,l$.useEffect)(()=>{let e=null==t?void 0:t.current;if(e)if(void 0===window.ResizeObserver)return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)};else{let t=new window.ResizeObserver(e=>{e.length&&r()});return t.observe(e,{box:n}),()=>{e&&t.unobserve(e)}}},[r,t,n])}let vq="u">typeof document?window.visualViewport:null;function vJ(e,t){if(e.button>0)return!1;if(e.target){let t=e.target.ownerDocument;if(!t||!t.documentElement.contains(e.target)||e.target.closest("[data-react-aria-top-layer]"))return!1}return!!t.current&&!e.composedPath().includes(t.current)}let vX=[],vQ="u">typeof document&&window.visualViewport,v0=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),v1=0;function v4(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function v2(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function v3(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=gs(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect().top,r=n.getBoundingClientRect().top;r>t+n.clientHeight&&(e.scrollTop+=r-t)}n=e.parentElement}}var v6={};function v5(e){var t;let{onDismiss:n,...r}=e,a=h5(r,hH((t=v6)&&t.__esModule?t.default:t,"@react-aria/overlays").format("dismiss"));return lO().createElement(h7,null,lO().createElement("button",{...a,tabIndex:-1,onClick:()=>{n&&n()},style:{width:1,height:1}}))}function v9(e,t,n){mP(()=>{if(t&&e.current){if(!("getAnimations"in e.current))return void n();let t=e.current.getAnimations();if(0===t.length)return void n();let r=!1;return Promise.all(t.map(e=>e.finished)).then(()=>{r||(0,pF.flushSync)(()=>{n()})}).catch(()=>{}),()=>{r=!0}}},[e,t,n])}function v8(e){let[t,n]=g2(e.isOpen,e.defaultOpen||!1,e.onOpenChange),r=(0,l$.useCallback)(()=>{n(!0)},[n]),a=(0,l$.useCallback)(()=>{n(!1)},[n]),o=(0,l$.useCallback)(()=>{n(!t)},[n,t]);return{isOpen:t,setOpen:n,open:r,close:a,toggle:o}}v6={"ar-AE":{dismiss:"تجاهل"},"bg-BG":{dismiss:"Отхвърляне"},"cs-CZ":{dismiss:"Odstranit"},"da-DK":{dismiss:"Luk"},"de-DE":{dismiss:"Schlie\xdfen"},"el-GR":{dismiss:"Απόρριψη"},"en-US":{dismiss:"Dismiss"},"es-ES":{dismiss:"Descartar"},"et-EE":{dismiss:"L\xf5peta"},"fi-FI":{dismiss:"Hylk\xe4\xe4"},"fr-FR":{dismiss:"Rejeter"},"he-IL":{dismiss:"התעלם"},"hr-HR":{dismiss:"Odbaci"},"hu-HU":{dismiss:"Elutas\xedt\xe1s"},"it-IT":{dismiss:"Ignora"},"ja-JP":{dismiss:"閉じる"},"ko-KR":{dismiss:"무시"},"lt-LT":{dismiss:"Atmesti"},"lv-LV":{dismiss:"Nerādīt"},"nb-NO":{dismiss:"Lukk"},"nl-NL":{dismiss:"Negeren"},"pl-PL":{dismiss:"Zignoruj"},"pt-BR":{dismiss:"Descartar"},"pt-PT":{dismiss:"Dispensar"},"ro-RO":{dismiss:"Revocare"},"ru-RU":{dismiss:"Пропустить"},"sk-SK":{dismiss:"Zrušiť"},"sl-SI":{dismiss:"Opusti"},"sr-SP":{dismiss:"Odbaci"},"sv-SE":{dismiss:"Avvisa"},"tr-TR":{dismiss:"Kapat"},"uk-UA":{dismiss:"Скасувати"},"zh-CN":{dismiss:"取消"},"zh-TW":{dismiss:"關閉"}};let v7=(0,l$.createContext)(null),be=(0,l$.createContext)(null),bt=(0,l$.forwardRef)(function(e,t){[e,t]=mY(e,t,v7);let n=(0,l$.useContext)(vb),r=v8(e),a=null==e.isOpen&&null==e.defaultOpen&&n?n:r,o=function(e,t){let[n,r]=(0,l$.useState)(t?"open":"closed");switch(n){case"open":t||r("exiting");break;case"closed":case"exiting":t&&r("open")}let a="exiting"===n;return v9(e,a,(0,l$.useCallback)(()=>{r(e=>"exiting"===e?"closed":e)},[])),a}(t,a.isOpen)||e.isExiting||!1,i=(0,l$.useContext)(fh),{direction:s}=fA();if(i){let t=e.children;return"function"==typeof t&&(t=t({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),lO().createElement(lO().Fragment,null,t)}return!a||a.isOpen||o?lO().createElement(bn,{...e,triggerRef:e.triggerRef,state:a,popoverRef:t,isExiting:o,dir:s}):null});function bn({state:e,isExiting:t,UNSTABLE_portalContainer:n,...r}){var a,o;let i=(0,l$.useRef)(null),[s,l]=(0,l$.useState)(0),u=(0,l$.useRef)(null),d=(0,l$.useContext)(be),m=d&&"SubmenuTrigger"===r.trigger;mP(()=>{i.current&&e.isOpen&&l(i.current.getBoundingClientRect().width)},[e.isOpen,i]);let{popoverProps:p,underlayProps:f,arrowProps:h,placement:g}=function(e,t){let{triggerRef:n,popoverRef:r,groupRef:a,isNonModal:o,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s,...l}=e,u="SubmenuTrigger"===l.trigger,{overlayProps:d,underlayProps:m}=function(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:a,isDismissable:o=!1,isKeyboardDismissDisabled:i=!1,shouldCloseOnInteractOutside:s}=e;(0,l$.useEffect)(()=>{if(a&&!vX.includes(t))return vX.push(t),()=>{let e=vX.indexOf(t);e>=0&&vX.splice(e,1)}},[a,t]);let l=()=>{vX[vX.length-1]===t&&n&&n()};!function(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:a}=e,o=(0,l$.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),i=mR(e=>{n&&vJ(e,t)&&(a&&a(e),o.current.isPointerDown=!0)}),s=mR(e=>{n&&n(e)});(0,l$.useEffect)(()=>{let e=o.current;if(r)return;let n=pn(t.current);if("u">typeof PointerEvent){let r=n=>{e.isPointerDown&&vJ(n,t)&&s(n),e.isPointerDown=!1};return n.addEventListener("pointerdown",i,!0),n.addEventListener("pointerup",r,!0),()=>{n.removeEventListener("pointerdown",i,!0),n.removeEventListener("pointerup",r,!0)}}},[t,r,i,s])}({ref:t,onInteractOutside:o&&a?e=>{(!s||s(e.target))&&(vX[vX.length-1]===t&&(e.stopPropagation(),e.preventDefault()),l())}:void 0,onInteractOutsideStart:e=>{(!s||s(e.target))&&vX[vX.length-1]===t&&(e.stopPropagation(),e.preventDefault())}});let{focusWithinProps:u}=fl({isDisabled:!r,onBlurWithin:e=>{!(!e.relatedTarget||yD(e.relatedTarget,yv))&&(!s||s(e.relatedTarget))&&(null==n||n())}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||i||e.nativeEvent.isComposing||(e.stopPropagation(),e.preventDefault(),l())},...u},underlayProps:{onPointerDown:e=>{e.target===e.currentTarget&&e.preventDefault()}}}}({isOpen:t.isOpen,onClose:t.close,shouldCloseOnBlur:!0,isDismissable:!o||u,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:s},null!=a?a:r),{overlayProps:p,arrowProps:f,placement:h}=function(e){var t,n,r;let{direction:a}=fA(),{arrowSize:o=0,targetRef:i,overlayRef:s,scrollRef:l=s,placement:u="bottom",containerPadding:c=12,shouldFlip:d=!0,boundaryElement:m="u">typeof document?document.body:null,offset:p=0,crossOffset:f=0,shouldUpdatePosition:h=!0,isOpen:g=!0,onClose:y,maxHeight:v,arrowBoundaryOffset:b=0}=e,[w,E]=(0,l$.useState)(null),x=[h,u,s.current,i.current,l.current,c,d,m,p,f,g,a,v,b,o],D=(0,l$.useRef)(null==vq?void 0:vq.scale);(0,l$.useEffect)(()=>{g&&(D.current=null==vq?void 0:vq.scale)},[g]);let _=(0,l$.useCallback)(()=>{var e,t,n,r,y,w;if(!1===h||!g||!s.current||!i.current||!m||(null==vq?void 0:vq.scale)!==D.current)return;let x=null;if(l.current&&l.current.contains(document.activeElement)){let r=null==(e=document.activeElement)?void 0:e.getBoundingClientRect(),a=l.current.getBoundingClientRect();(x={type:"top",offset:(null!=(t=null==r?void 0:r.top)?t:0)-a.top}).offset>a.height/2&&(x.type="bottom",x.offset=(null!=(n=null==r?void 0:r.bottom)?n:0)-a.bottom)}let _=s.current;!v&&s.current&&(_.style.top="0px",_.style.bottom="",_.style.maxHeight=(null!=(y=null==(r=window.visualViewport)?void 0:r.height)?y:window.innerHeight)+"px");let k=function(e){var t,n,r,a;let o,{placement:i,targetNode:s,overlayNode:l,scrollNode:u,padding:c,shouldFlip:d,boundaryElement:m,offset:p,crossOffset:f,maxHeight:h,arrowSize:g=0,arrowBoundaryOffset:y=0}=e,v=l instanceof HTMLElement?function(e){let t=e.offsetParent;if(t&&t===document.body&&"static"===window.getComputedStyle(t).position&&!vG(t)&&(t=document.documentElement),null==t)for(t=e.parentElement;t&&!vG(t);)t=t.parentElement;return t||document.documentElement}(l):document.documentElement,b=v===document.documentElement,w=window.getComputedStyle(v).position,E=b?vz(s):vK(s,v);if(!b){let{marginTop:e,marginLeft:t}=window.getComputedStyle(s);E.top+=parseInt(e,10)||0,E.left+=parseInt(t,10)||0}let x=vz(l),D={top:parseInt((o=window.getComputedStyle(l)).marginTop,10)||0,bottom:parseInt(o.marginBottom,10)||0,left:parseInt(o.marginLeft,10)||0,right:parseInt(o.marginRight,10)||0};x.width+=(null!=(t=D.left)?t:0)+(null!=(n=D.right)?n:0),x.height+=(null!=(r=D.top)?r:0)+(null!=(a=D.bottom)?a:0);let _={top:u.scrollTop,left:u.scrollLeft,width:u.scrollWidth,height:u.scrollHeight},k=vB(m),S=vB(v),C="BODY"===m.tagName?vz(v):vK(v,m);return"HTML"===v.tagName&&"BODY"===m.tagName&&(S.scroll.top=0,S.scroll.left=0),function(e,t,n,r,a,o,i,s,l,u,c,d,m,p,f,h){var g,y,v,b,w,E,x,D,_,k,S,C,P,R;let T,$,O,N=vU(e),{size:A,crossAxis:I,crossSize:j,placement:M,crossPlacement:L}=N,F=vW(t,s,n,N,c,d,u,m,f,h),B=c,V=vH(s,u,t,a,o+c,N);if(i&&r[A]>V){let e=vU(`${vA[M]} ${L}`),r=vW(t,s,n,e,c,d,u,m,f,h);vH(s,u,t,a,o+c,e)>V&&(N=e,F=r,B=c)}let U="bottom";"top"===N.axis?"top"===N.placement?U="top":"bottom"===N.placement&&(U="bottom"):"top"===N.crossAxis&&("top"===N.crossPlacement?U="bottom":"bottom"===N.crossPlacement&&(U="top"));let W=vV(I,F[I],n[j],s,l,o,u);F[I]+=W;let H=(w=F,E=n.height,x=U,T=m?u.height:s[vM.height],$=null!=w.top?u.top+w.top:u.top+(T-(null!=(D=w.bottom)?D:0)-E),O="top"!==x?Math.max(0,s.height+s.top+(null!=(_=s.scroll.top)?_:0)-$-((null!=(k=a.top)?k:0)+(null!=(S=a.bottom)?S:0)+o)):Math.max(0,$+E-(s.top+(null!=(C=s.scroll.top)?C:0))-((null!=(P=a.top)?P:0)+(null!=(R=a.bottom)?R:0)+o)),Math.min(s.height-2*o,O));p&&p<H&&(H=p),n.height=Math.min(n.height,H),W=vV(I,(F=vW(t,s,n,N,B,d,u,m,f,h))[I],n[j],s,l,o,u),F[I]+=W;let z={},K=t[I]+.5*t[j]-F[I]-a[vN[I]],G=f/2+h,Z="left"===vN[I]?(null!=(g=a.left)?g:0)+(null!=(y=a.right)?y:0):(null!=(v=a.top)?v:0)+(null!=(b=a.bottom)?b:0),Y=n[j]-Z-f/2-h,q=vT(K,t[I]+f/2-(F[I]+a[vN[I]]),t[I]+t[j]-f/2-(F[I]+a[vN[I]]));return z[I]=vT(q,G,Y),{position:F,maxHeight:H,arrowOffsetLeft:z.left,arrowOffsetTop:z.top,placement:N.placement}}(i,E,x,_,D,c,d,k,S,C,p,f,!!w&&"static"!==w,h,g,y)}({placement:(w=u,"rtl"===a?w.replace("start","right").replace("end","left"):w.replace("start","left").replace("end","right")),overlayNode:s.current,targetNode:i.current,scrollNode:l.current||s.current,padding:c,shouldFlip:d,boundaryElement:m,offset:p,crossOffset:f,maxHeight:v,arrowSize:o,arrowBoundaryOffset:b});if(k.position){if(_.style.top="",_.style.bottom="",_.style.left="",_.style.right="",Object.keys(k.position).forEach(e=>_.style[e]=k.position[e]+"px"),_.style.maxHeight=null!=k.maxHeight?k.maxHeight+"px":"",x&&document.activeElement&&l.current){let e=document.activeElement.getBoundingClientRect(),t=l.current.getBoundingClientRect(),n=e[x.type]-t[x.type];l.current.scrollTop+=n-x.offset}E(k)}},x);mP(_,x),mP(()=>(window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}),[r=_]),vY({ref:s,onResize:_}),vY({ref:i,onResize:_});let k=(0,l$.useRef)(!1);mP(()=>{let e,t=()=>{k.current=!0,clearTimeout(e),e=setTimeout(()=>{k.current=!1},500),_()},n=()=>{k.current&&t()};return null==vq||vq.addEventListener("resize",t),null==vq||vq.addEventListener("scroll",n),()=>{null==vq||vq.removeEventListener("resize",t),null==vq||vq.removeEventListener("scroll",n)}},[_]);let S=(0,l$.useCallback)(()=>{k.current||null==y||y()},[y,k]);return!function(e){let{triggerRef:t,isOpen:n,onClose:r}=e;(0,l$.useEffect)(()=>{if(!n||null===r)return;let e=e=>{let n=e.target;if(!t.current||n instanceof Node&&!n.contains(t.current)||e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;let a=r||vZ.get(t.current);a&&a()};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[n,r,t])}({triggerRef:i,isOpen:g,onClose:y&&S}),{overlayProps:{style:{position:"absolute",zIndex:1e5,...null==w?void 0:w.position,maxHeight:null!=(t=null==w?void 0:w.maxHeight)?t:"100vh"}},placement:null!=(n=null==w?void 0:w.placement)?n:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:null==w?void 0:w.arrowOffsetLeft,top:null==w?void 0:w.arrowOffsetTop}},updatePosition:_}}({...l,targetRef:n,overlayRef:r,isOpen:t.isOpen,onClose:o&&!u?t.close:null});return!function(e={}){let{isDisabled:t}=e;mP(()=>{if(!t){let e,t,n,r;return 1==++v1&&(c=pg()?(n=null,r=mC(v2(document,"touchstart",n=>{((e=gs(n.target,!0))!==document.documentElement||e!==document.body)&&e instanceof HTMLElement&&"auto"===window.getComputedStyle(e).overscrollBehavior&&(t=v4(e,"overscrollBehavior","contain"))},{passive:!1,capture:!0}),v2(document,"touchmove",t=>{e&&e!==document.documentElement&&e!==document.body?e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault():t.preventDefault()},{passive:!1,capture:!0}),v2(document,"touchend",()=>{t&&t()},{passive:!1,capture:!0}),v2(document,"focus",e=>{var t;let r=e.target;((t=r)instanceof HTMLInputElement&&!v0.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable)&&((()=>{if(n)return;let e=window.pageXOffset,t=window.pageYOffset;n=mC(v2(window,"scroll",()=>{window.scrollTo(0,0)}),v4(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),v4(document.documentElement,"overflow","hidden"),v4(document.body,"marginTop",`-${t}px`),()=>{window.scrollTo(e,t)}),window.scrollTo(0,0)})(),r.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{r.style.transform="",vQ&&(vQ.height<window.innerHeight?requestAnimationFrame(()=>{v3(r)}):vQ.addEventListener("resize",()=>v3(r),{once:!0}))}))},!0)),()=>{null==t||t(),null==n||n(),r()}):mC(v4(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),v4(document.documentElement,"overflow","hidden"))),()=>{0==--v1&&c()}}},[t])}({isDisabled:o||!t.isOpen}),mP(()=>{if(t.isOpen&&r.current){if(!o)return function(e,t=document.body){let n=new Set(e),r=new Set,a=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(t);let t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),i=t(e);if(i===NodeFilter.FILTER_ACCEPT&&o(e),i!==NodeFilter.FILTER_REJECT){let e=a.nextNode();for(;null!=e;)o(e),e=a.nextNode()}},o=e=>{var t;let n=null!=(t=vP.get(e))?t:0;("true"!==e.getAttribute("aria-hidden")||0!==n)&&(0===n&&e.setAttribute("aria-hidden","true"),r.add(e),vP.set(e,n+1))};vR.length&&vR[vR.length-1].disconnect(),a(t);let i=new MutationObserver(e=>{for(let t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some(e=>e.contains(t.target))){for(let e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&("true"===e.dataset.liveAnnouncer||"true"===e.dataset.reactAriaTopLayer)?n.add(e):e instanceof Element&&a(e)}});i.observe(t,{childList:!0,subtree:!0});let s={visibleNodes:n,hiddenNodes:r,observe(){i.observe(t,{childList:!0,subtree:!0})},disconnect(){i.disconnect()}};return vR.push(s),()=>{for(let e of(i.disconnect(),r)){let t=vP.get(e);null!=t&&(1===t?(e.removeAttribute("aria-hidden"),vP.delete(e)):vP.set(e,t-1))}s===vR[vR.length-1]?(vR.pop(),vR.length&&vR[vR.length-1].observe()):vR.splice(vR.indexOf(s),1)}}([null!=(n=null==a?void 0:a.current)?n:r.current]);var e,n,i=null!=(e=null==a?void 0:a.current)?e:r.current;let t=vR[vR.length-1];return t&&!t.visibleNodes.has(i)?(t.visibleNodes.add(i),()=>{t.visibleNodes.delete(i)}):void 0}},[o,t.isOpen,r,a]),{popoverProps:mH(d,p),arrowProps:f,underlayProps:m,placement:h}}({...r,offset:null!=(a=r.offset)?a:8,arrowSize:s,groupRef:m?d:u},e),y=r.popoverRef,v=function(e,t=!0){let[n,r]=(0,l$.useState)(!0),a=n&&t;return mP(()=>{if(a&&e.current&&"getAnimations"in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,a]),v9(e,a,(0,l$.useCallback)(()=>r(!1),[])),a}(y,!!g)||r.isEntering||!1,b=mG({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:g,isEntering:v,isExiting:t}}),w=!r.isNonModal||"SubmenuTrigger"===r.trigger,[E,x]=(0,l$.useState)(!1);mP(()=>{y.current&&x(w&&!y.current.querySelector("[role=dialog]"))},[y,w]),(0,l$.useEffect)(()=>{E&&y.current&&!y.current.contains(document.activeElement)&&fr(y.current)},[E,y]);let D={...p.style,...b.style},_=lO().createElement("div",{...mH(m5(r),p),...b,role:E?"dialog":void 0,tabIndex:E?-1:void 0,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],ref:y,slot:r.slot||void 0,style:D,dir:r.dir,"data-trigger":r.trigger,"data-placement":g,"data-entering":v||void 0,"data-exiting":t||void 0},!r.isNonModal&&lO().createElement(v5,{onDismiss:e.close}),lO().createElement(vC.Provider,{value:{...h,placement:g,ref:i}},b.children),lO().createElement(v5,{onDismiss:e.close}));return m?lO().createElement(vy,{...r,shouldContainFocus:E,isExiting:t,portalContainer:null!=(o=null!=n?n:null==d?void 0:d.current)?o:void 0},_):lO().createElement(vy,{...r,shouldContainFocus:E,isExiting:t,portalContainer:n},!r.isNonModal&&e.isOpen&&lO().createElement("div",{"data-testid":"underlay",...f,style:{position:"fixed",inset:0}}),lO().createElement("div",{ref:u,style:{display:"contents"}},lO().createElement(be.Provider,{value:u},_)))}function br(e){return(null==e?void 0:e.start)!=null&&null!=e.end}let ba=(0,l$.createContext)(null),bo=(0,l$.createContext)(null),bi=(0,l$.createContext)(null),bs=(0,l$.createContext)(null),bl=(0,l$.forwardRef)(function(e,t){var n,r;[e,t]=mY(e,t,ba);let{validationBehavior:a}=mZ(v_)||{},o=null!=(r=null!=(n=e.validationBehavior)?n:a)?r:"native",i=function(e){var t;let n=v8(e),[r,a]=g2(e.value,e.defaultValue||null,e.onChange),o=r||e.placeholderValue||null,[i,s]=vt(o,e.granularity),l=null!=r?r.toDate(null!=s?s:"UTC"):null,u="hour"===i||"minute"===i||"second"===i,c=null==(t=e.shouldCloseOnSelect)||t,[d,m]=(0,l$.useState)(null),[p,f]=(0,l$.useState)(null);if(r&&(d=r,"hour"in r&&(p=r)),o&&!(i in o))throw Error("Invalid granularity "+i+" for value "+o.toString());let h=(null==r?void 0:r.calendar.identifier)==="gregory"&&"BC"===r.era,g=(0,l$.useMemo)(()=>({granularity:i,timeZone:s,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:h}),[i,e.hourCycle,e.shouldForceLeadingZeros,s,e.hideTimeZone,h]),{minValue:y,maxValue:v,isDateUnavailable:b}=e,w=(0,l$.useMemo)(()=>y3(r,y,v,b,g),[r,y,v,b,g]),E=yJ({...e,value:r,builtinValidation:w}),x=E.displayValidation.isInvalid,D=e.validationState||(x?"invalid":null),_=(e,t)=>{a("timeZone"in t?t.set(hh(e)):hg(e,t)),m(null),f(null),E.commitValidation()};return{...E,value:r,setValue:a,dateValue:d,timeValue:p,setDateValue:t=>{let r="function"==typeof c?c():c;u?p||r?_(t,p||y8(e.defaultValue||e.placeholderValue)):m(t):(a(t),E.commitValidation()),r&&n.setOpen(!1)},setTimeValue:e=>{d&&e?_(d,e):f(e)},granularity:i,hasTime:u,...n,setOpen(t){!t&&!r&&d&&u&&_(d,p||y8(e.defaultValue||e.placeholderValue)),n.setOpen(t)},validationState:D,isInvalid:x,formatValue:(e,t)=>l?new hK(e,y9(t,g)).format(l):"",getDateFormatter:(e,t)=>new hK(e,y9({},{...g,...t}))}}({...e,validationBehavior:o}),s=(0,l$.useRef)(null),[l,u]=mq(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,fieldProps:m,buttonProps:p,dialogProps:f,calendarProps:h,descriptionProps:g,errorMessageProps:y,...v}=function(e,t,n){var r;let a=mV(),o=mV(),i=mV(),s=hH((r=yh)&&r.__esModule?r.default:r,"@react-aria/datepicker"),{isInvalid:l,validationErrors:u,validationDetails:c}=t.displayValidation,{labelProps:d,fieldProps:m,descriptionProps:p,errorMessageProps:f}=yF({...e,labelElementType:"span",isInvalid:l,errorMessage:e.errorMessage||u}),h=yj(t,n),g=m["aria-labelledby"]||m.id,{locale:y}=fA(),v=t.formatValue(y,{month:"long"}),b=gr(v?s.format("selectedDateDescription",{date:v}):""),w=[b["aria-describedby"],m["aria-describedby"]].filter(Boolean).join(" ")||void 0,E=m5(e),x=(0,l$.useMemo)(()=>y$(n),[n]),D=(0,l$.useRef)(!1),{focusWithinProps:_}=fl({...e,isDisabled:t.isOpen,onBlurWithin:t=>{let n=document.getElementById(o);if(!(null==n?void 0:n.contains(t.relatedTarget))){var r,a;D.current=!1,null==(r=e.onBlur)||r.call(e,t),null==(a=e.onFocusChange)||a.call(e,!1)}},onFocusWithin:t=>{if(!D.current){var n,r;D.current=!0,null==(n=e.onFocus)||n.call(e,t),null==(r=e.onFocusChange)||r.call(e,!0)}}});return{groupProps:mH(E,h,m,b,_,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":g,"aria-describedby":w,onKeyDown(n){!t.isOpen&&e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){!t.isOpen&&e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...d,onClick:()=>{x.focusFirst()}},fieldProps:{...m,id:i,[yU]:"presentation","aria-describedby":w,value:t.value,onChange:t.setValue,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,granularity:e.granularity,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior,[yq]:t,autoFocus:e.autoFocus,name:e.name},descriptionProps:p,errorMessageProps:f,buttonProps:{...b,id:a,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${a} ${g}`,"aria-describedby":w,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:o,"aria-labelledby":`${a} ${g}`},calendarProps:{autoFocus:!0,value:t.dateValue,onChange:t.setDateValue,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,defaultFocusedValue:t.dateValue?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" ")},isInvalid:l,validationErrors:u,validationDetails:c}}({...mJ(e),label:u,validationBehavior:o},i,s),[b,w]=(0,l$.useState)(null),E=(0,l$.useCallback)(()=>{s.current&&w(s.current.offsetWidth+"px")},[]);vY({ref:s,onResize:E});let{focusProps:x,isFocused:D,isFocusVisible:_}=fu({within:!0}),k=mG({...e,values:{state:i,isFocusWithin:D,isFocusVisible:_,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen},defaultClassName:"react-aria-DatePicker"}),S=m5(e);return delete S.id,lO().createElement(mK,{values:[[bi,i],[yd,{...c,ref:s,isInvalid:i.isInvalid}],[vl,m],[fv,{...p,isPressed:i.isOpen}],[vk,{...d,ref:l,elementType:"span"}],[g7,h],[vb,i],[v7,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":b}}],[vv,f],[fE,{slots:{description:g,errorMessage:y}}],[vE,v]]},lO().createElement("div",{...x,...S,...k,ref:t,slot:e.slot||void 0,"data-focus-within":D||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":_||void 0,"data-disabled":e.isDisabled||void 0,"data-open":i.isOpen||void 0}))}),bu=(0,l$.forwardRef)(function(e,t){var n,r;[e,t]=mY(e,t,bo);let{validationBehavior:a}=mZ(v_)||{},o=null!=(r=null!=(n=e.validationBehavior)?n:a)?r:"native",i=function(e){var t,n,r;let a=v8(e),[o,i]=g2(e.value,e.defaultValue||null,e.onChange),[s,l]=(0,l$.useState)(()=>o||{start:null,end:null});null==o&&s.start&&s.end&&l(s={start:null,end:null});let u=o||s,c=e=>{l(e||{start:null,end:null}),br(e)?i(e):i(null)},[d,m]=vt((null==u?void 0:u.start)||(null==u?void 0:u.end)||e.placeholderValue||null,e.granularity),p="hour"===d||"minute"===d||"second"===d,f=null==(r=e.shouldCloseOnSelect)||r,[h,g]=(0,l$.useState)(null),[y,v]=(0,l$.useState)(null);u&&br(u)&&(h=u,"hour"in u.start&&(y=u));let b=(e,t)=>{c({start:"timeZone"in t.start?t.start.set(hh(e.start)):hg(e.start,t.start),end:"timeZone"in t.end?t.end.set(hh(e.end)):hg(e.end,t.end)}),g(null),v(null),P.commitValidation()},w=t=>{let n="function"==typeof f?f():f;p?br(t)&&(null==y?void 0:y.start)&&(null==y?void 0:y.end)?b(t,{start:(null==y?void 0:y.start)||y8(e.placeholderValue),end:(null==y?void 0:y.end)||y8(e.placeholderValue)}):g(t):br(t)?(c(t),P.commitValidation()):g(t),n&&a.setOpen(!1)},E=e=>{br(h)&&br(e)?b(h,e):v(e)},x=(null==u||null==(t=u.start)?void 0:t.calendar.identifier)==="gregory"&&"BC"===u.start.era||(null==u||null==(n=u.end)?void 0:n.calendar.identifier)==="gregory"&&"BC"===u.end.era,D=(0,l$.useMemo)(()=>({granularity:d,timeZone:m,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:x}),[d,e.hourCycle,e.shouldForceLeadingZeros,m,e.hideTimeZone,x]),{minValue:_,maxValue:k,isDateUnavailable:S}=e,C=(0,l$.useMemo)(()=>{var e,t;let n;return n=y1(y3(null!=(e=null==u?void 0:u.start)?e:null,_,k,S,D),y3(null!=(t=null==u?void 0:u.end)?t:null,_,k,S,D)),(null==u?void 0:u.end)!=null&&null!=u.start&&0>u.end.compare(u.start)&&(n=y1(n,{isInvalid:!0,validationErrors:[(hL.getGlobalDictionaryForPackage("@react-stately/datepicker")||y4).getStringForLocale("rangeReversed",y2())],validationDetails:{...yK,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})),n},[u,_,k,S,D]),P=yJ({...e,value:o,name:(0,l$.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:C}),R=P.displayValidation.isInvalid,T=e.validationState||(R?"invalid":null);return{...P,value:u,setValue:c,dateRange:h,timeRange:y,granularity:d,hasTime:p,setDate(e,t){var n,r;"start"===e?w({start:t,end:null!=(n=null==h?void 0:h.end)?n:null}):w({start:null!=(r=null==h?void 0:h.start)?r:null,end:t})},setTime(e,t){var n,r;"start"===e?E({start:t,end:null!=(n=null==y?void 0:y.end)?n:null}):E({start:null!=(r=null==y?void 0:y.start)?r:null,end:t})},setDateTime(e,t){var n,r;"start"===e?c({start:t,end:null!=(n=null==u?void 0:u.end)?n:null}):c({start:null!=(r=null==u?void 0:u.start)?r:null,end:t})},setDateRange:w,setTimeRange:E,...a,setOpen(t){!t&&!((null==u?void 0:u.start)&&(null==u?void 0:u.end))&&br(h)&&p&&b(h,{start:(null==y?void 0:y.start)||y8(e.placeholderValue),end:(null==y?void 0:y.end)||y8(e.placeholderValue)}),a.setOpen(t)},validationState:T,isInvalid:R,formatValue(t,n){let r;if(!u||!u.start||!u.end)return null;let a="timeZone"in u.start?u.start.timeZone:void 0,o=e.granularity||(u.start&&"minute"in u.start?"minute":"day"),i="timeZone"in u.end?u.end.timeZone:void 0,s=e.granularity||(u.end&&"minute"in u.end?"minute":"day"),l=y9(n,{granularity:o,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===u.start.calendar.identifier&&"BC"===u.start.era||"gregory"===u.end.calendar.identifier&&"BC"===u.end.era}),c=u.start.toDate(a||"UTC"),d=u.end.toDate(i||"UTC"),m=new hK(t,l);if(a===i&&o===s&&0!==u.start.compare(u.end)){try{let e=m.formatRangeToParts(c,d),t=-1;for(let n=0;n<e.length;n++){let r=e[n];if("shared"===r.source&&"literal"===r.type)t=n;else if("endRange"===r.source)break}let n="",r="";for(let a=0;a<e.length;a++)a<t?n+=e[a].value:a>t&&(r+=e[a].value);return{start:n,end:r}}catch{}r=m}else r=new hK(t,y9(n,{granularity:s,timeZone:i,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:m.format(c),end:r.format(d)}},getDateFormatter:(e,t)=>new hK(e,y9({},{...D,...t}))}}({...e,validationBehavior:o}),s=(0,l$.useRef)(null),[l,u]=mq(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,startFieldProps:m,endFieldProps:p,buttonProps:f,dialogProps:h,calendarProps:g,descriptionProps:y,errorMessageProps:v,...b}=function(e,t,n){var r,a,o,i,s,l;let u=hH((l=yh)&&l.__esModule?l.default:l,"@react-aria/datepicker"),{isInvalid:c,validationErrors:d,validationDetails:m}=t.displayValidation,{labelProps:p,fieldProps:f,descriptionProps:h,errorMessageProps:g}=yF({...e,labelElementType:"span",isInvalid:c,errorMessage:e.errorMessage||d}),y=f["aria-labelledby"]||f.id,{locale:v}=fA(),b=t.formatValue(v,{month:"long"}),w=gr(b?u.format("selectedRangeDescription",{startDate:b.start,endDate:b.end}):""),E={"aria-label":u.format("startDate"),"aria-labelledby":y},x={"aria-label":u.format("endDate"),"aria-labelledby":y},D=mV(),_=mV(),k=yj(t,n),S=[w["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,C=(0,l$.useMemo)(()=>y$(n,{accept:e=>e.id!==D}),[n,D]),P={[yW]:C,[yU]:"presentation","aria-describedby":S,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},R=m5(e),T=(0,l$.useRef)(!1),{focusWithinProps:$}=fl({...e,isDisabled:t.isOpen,onBlurWithin:t=>{let n=document.getElementById(_);if(!(null==n?void 0:n.contains(t.relatedTarget))){var r,a;T.current=!1,null==(r=e.onBlur)||r.call(e,t),null==(a=e.onFocusChange)||a.call(e,!1)}},onFocusWithin:t=>{if(!T.current){var n,r;T.current=!0,null==(n=e.onFocus)||n.call(e,t),null==(r=e.onFocusChange)||r.call(e,!0)}}}),O=(0,l$.useRef)(yZ),N=(0,l$.useRef)(yZ);return{groupProps:mH(R,k,f,w,$,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":S,onKeyDown(n){!t.isOpen&&e.onKeyDown&&e.onKeyDown(n)},onKeyUp(n){!t.isOpen&&e.onKeyUp&&e.onKeyUp(n)}}),labelProps:{...p,onClick:()=>{C.focusFirst()}},buttonProps:{...w,id:D,"aria-haspopup":"dialog","aria-label":u.format("calendar"),"aria-labelledby":`${D} ${y}`,"aria-describedby":S,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:_,"aria-labelledby":`${D} ${y}`},startFieldProps:{...E,...P,value:null!=(i=null==(r=t.value)?void 0:r.start)?i:null,onChange:e=>t.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,[yq]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){O.current=e,t.updateValidation(y1(e,N.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...x,...P,value:null!=(s=null==(a=t.value)?void 0:a.end)?s:null,onChange:e=>t.setDateTime("end",e),name:e.endName,[yq]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){N.current=e,t.updateValidation(y1(O.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:h,errorMessageProps:g,calendarProps:{autoFocus:!0,value:(null==(o=t.dateRange)?void 0:o.start)&&t.dateRange.end?t.dateRange:null,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" ")},isInvalid:c,validationErrors:d,validationDetails:m}}({...mJ(e),label:u,validationBehavior:o},i,s),[w,E]=(0,l$.useState)(null),x=(0,l$.useCallback)(()=>{s.current&&E(s.current.offsetWidth+"px")},[]);vY({ref:s,onResize:x});let{focusProps:D,isFocused:_,isFocusVisible:k}=fu({within:!0}),S=mG({...e,values:{state:i,isFocusWithin:_,isFocusVisible:k,isDisabled:e.isDisabled||!1,isInvalid:i.isInvalid,isOpen:i.isOpen},defaultClassName:"react-aria-DateRangePicker"}),C=m5(e);return delete C.id,lO().createElement(mK,{values:[[bs,i],[yd,{...c,ref:s,isInvalid:i.isInvalid}],[fv,{...f,isPressed:i.isOpen}],[vk,{...d,ref:l,elementType:"span"}],[ye,g],[vb,i],[v7,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":w}}],[vv,h],[vl,{slots:{start:m,end:p}}],[fE,{slots:{description:y,errorMessage:v}}],[vE,b]]},lO().createElement("div",{...D,...C,...S,ref:t,slot:e.slot||void 0,"data-focus-within":_||void 0,"data-invalid":i.isInvalid||void 0,"data-focus-visible":k||void 0,"data-disabled":e.isDisabled||void 0,"data-open":i.isOpen||void 0}))});function bc(e){return lO().createElement(fN,e)}function bd(e,t,n=!1){if(null==e)return n?e:void 0;if("string"==typeof e&&!e)return n?null:void 0;if(e instanceof he||e instanceof ha||e instanceof hi)return t?hy(e,t):e;{let n=cd()(e).toDate(),r=new he(n.getFullYear(),n.getMonth()+1,n.getDate());return t?hy(r,t):r}}function bm(e){if(e)return e.toDate(hR())}function bp(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function bf(e){let t=e??"",n=bp(t);if(!n)return t;try{return new Intl.DisplayNames([n],{type:"language"}).of(n)??t}catch{return t}}function bh(){let e=window.i18next.language,t=bp(e)??e;return"ht"===t&&(t="fr-HT"),t}if("u">typeof navigator){let e=navigator;Q=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;Q=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var bg=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch(e){return"en-US"}}(Q||"en-US"),by=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},bv={};for(let e=1;e<100;e++)bv[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var bb={arab:1632,arabext:1776,bali:6992,beng:2534,deva:2406,fullwide:65296,gujr:2790,khmr:6112,knda:3302,laoo:3792,limb:6470,mlym:3430,mong:6160,mymr:4160,orya:2918,tamldec:3046,telu:3174,thai:3664,tibt:3872},bw="[1234567890一二三四五六七八九〇\\d]",bE={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,〇:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},bx={},bD={"Eastern Daylight Time":-240,"Eastern Standard Time":-300,"Central Daylight Time":-300,"Central Standard Time":-360,"Mountain Daylight Time":-360,"Mountain Standard Time":-420,"Pacific Daylight Time":-420,"Pacific Standard Time":-480,"Coordinated Universal Time":0,ACDT:630,ACST:570,ACT:480,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,AMST:-180,AMT:-240,ART:-180,AST:180,AWDT:540,AWST:480,AZOST:-60,AZT:240,BDT:360,BIOT:360,BIT:-720,BOT:-240,BRST:-120,BRT:-180,BTT:360,CAT:120,CCT:390,CDT:-300,CEDT:120,CEST:120,CET:60,CHADT:825,CHAST:765,CHOT:480,ChST:600,CHUT:600,CIST:-480,CIT:480,CKT:-600,CLST:-180,CLT:-240,COST:-240,COT:-300,CST:-360,CT:480,CVT:-60,CXT:420,DAVT:420,DDUT:600,DFT:60,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEDT:180,EEST:180,EET:120,EGST:0,EGT:-60,EIT:540,EST:-300,FET:180,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GIT:-540,GMT:0,GST:-120,GYT:-240,HADT:-540,HAEC:120,HAST:-600,HKT:480,HMT:300,HOVT:420,HST:-600,IBST:0,ICT:420,IDT:180,IOT:180,IRDT:270,IRKT:480,IRST:210,IST:120,JST:540,KGT:360,KOST:660,KRAT:420,KST:540,LHST:630,LINT:840,MAGT:720,MART:-510,MAWT:300,MDT:-360,MET:60,MEST:120,MHT:720,MIST:660,MIT:-510,MMT:390,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:660,NPT:345,NST:-150,NT:-150,NUT:-660,NZDT:780,NZST:720,OMST:360,ORAT:300,PDT:-420,PET:-300,PETT:720,PGT:600,PHOT:780,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PYST:-180,PYT:-240,RET:240,ROTT:-180,SAKT:660,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SLST:330,SRET:660,SRT:-180,SST:480,SYOT:180,TAHT:-600,THA:420,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TOT:780,TVT:720,UCT:0,ULAT:480,USZ1:120,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-240,VLAT:600,VOLT:240,VOST:360,VUT:660,WAKT:720,WAST:120,WAT:60,WEDT:60,WEST:60,WET:0,WIT:420,WST:480,YAKT:540,YEKT:300},b_={zone:bD,year:bv,meridiem:{am:0,pm:12,"a.m.":0,"p.m.":12},month:{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12},dayname:{sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},digit:{}},bk={MONTHNAME:"january|february|march|april|may|june|july|august|september|october|november|december|jan\\.?|feb\\.?|mar\\.?|apr\\.?|may\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|oct\\.?|nov\\.?|dec\\.?",DAYNAME:"sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun\\.?|mon\\.?|tue\\.?|wed\\.?|thu\\.?|fri\\.?|sat\\.?",ZONE:"\\(?(?:"+Object.keys(bD).join("|")+")\\)?",MERIDIEM:"am|pm|a.m.|p.m.",ORDINAL:"st|nd|rd|th|\\.",YEAR:"\\d{4}|\\d{2}",YEAR2:"\\d{2}",YEAR4:"\\d{4}",YEAR6:"-\\d{6}|\\+?\\d{5,6}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",OFFSET:"(?:GMT)?[\xb1−+-](?:[01]\\d[0-5]\\d|[01]\\d:[0-5]\\d|[01]?\\d)",H24:"[01]\\d|2[0-3]",H12:"0?[1-9]|1[012]",MIN:"[0-5]\\d",SEC:"[0-5]\\d|60",MS:"\\d{9}|\\d{6}|\\d{1,3}",GAP:"[\\s/.,-]{1,}"},bS={...bk,YEAR:"*{4}|*{2}",YEAR4:"*{4}",YEAR6:"-*{6}|\\+?*{5,6}",MONTH:"*{1,2}",MONTH2:"*{2}",DAY:"*{1,2}",DAY2:"*{2}",OFFSET:"(?:GMT)?[\xb1−+-](?:*{4}|*{2}:*{2}|*{1,2})",H24:"*{2}",H12:"*{1,2}",MIN:"*{2}",SEC:"*{2}",MS:"*{9}|*{6}|*{3}"},bC={},bP=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=bg){return bC[t.toLowerCase()]||(bC[t.toLowerCase()]=new e(t)),bC[t.toLowerCase()]}constructor(e=bg){this.locale=e,this.lookups={...b_},this.vars={...bk};const t=new Intl.NumberFormat(this.locale);this.numberingSystem=t.resolvedOptions().numberingSystem,this.dateOptions=new Intl.DateTimeFormat(this.locale).resolvedOptions(),this.baseName=new Intl.Locale(this.locale).baseName,this.build()}toInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;if("latn"===this.numberingSystem&&!this.baseName.startsWith("zh")){let t=parseInt(e,10);if(!isNaN(t))return t}let t="";for(let n=0;n<e.length;n++)t+=String(this.lookups.digit[e[n]]);return parseInt(t,10)}millisecondToInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;let t=e.slice(0,3);return 1===t.length?100*this.toInt(t):2===t.length?10*this.toInt(t):this.toInt(t)}monthNameToInt(e){if("string"!=typeof e)return;let t=e.toLocaleLowerCase(this.locale).replace(/\.$/,"");return this.lookups.month[t]||12}h12ToInt(e,t){if("string"!=typeof e)return;let n=this.lookups.meridiem[t?.toLowerCase()]||0,r=this.toInt(e);return r<12&&12===n&&(r+=12),12===r&&0===n&&(r=0),r}zoneToOffset(e){if("string"==typeof e)return e=e.replace(/[^a-z\s]/gi,""),this.lookups.zone[e]}offsetToMinutes(e){if("string"!=typeof e)return;let t=e.match(/^(?:GMT)?([±−+-])(..?):?(..)?$/);if(t){let[,e,n,r]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(n)+this.toInt(r||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=bE:this.buildNumbers(),!/^en/i.test(this.locale)&&(this.buildMonthNames(),this.buildDaynames(),/zh/i.test(this.locale)||this.buildMeridiems())}buildNumbers(){let{group:e,lookup:t}=function(e){if(bx[e])return bx[e];if("fullwide"===e||"hanidec"===e)return{group:bw,lookup:{...bE}};let t=bb[e];if(!t)return{group:"\\d",lookup:{...bE}};let n=String.fromCharCode(t),r=String.fromCharCode(t+9),a={};for(let e=0;e<10;e++)a[String.fromCharCode(t+e)]=e;return bx[e]={group:`[${n}-${r}]`,lookup:a},bx[e]}(this.numberingSystem);for(let n in this.lookups.digit=t,bS)bS.hasOwnProperty(n)&&(this.vars[n]=bS[n].replace(/\*/g,e))}buildMonthNames(){let e={},t={};if(/^fi/i.test(this.locale))"tammi|helmi|maalis|huhti|touko|kes\xe4|hein\xe4|elo|syys|loka|marras|joulu".split("|").forEach((n,r)=>{["","k","kuu","kuuta"].forEach((a,o)=>{e[n+a+(o<2?"\\.?":"")]=!0,t[n+a]=r+1})});else{let n=[],r=e=>"month"===e.type;for(let e=0;e<12;e++)n.push(new Date(2017,e,1));for(let a of["full","long","medium"]){let o=Intl.DateTimeFormat(this.locale,{dateStyle:a});for(let i=0;i<12;i++){let s=o.formatToParts(n[i]).find(r).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===a?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=i+1)}}let a=Intl.DateTimeFormat(this.locale,{month:"short"});for(let o=0;o<12;o++){let i=a.formatToParts(n[o]).find(r).value.toLocaleLowerCase(this.locale);i=i.replace(/\.$/,""),e[`${i}\\.?`]=!0,t[i]=o+1}}this.vars.MONTHNAME=Object.keys(e).join("|"),this.lookups.month=t}buildDaynames(){let e=[],t=e=>"weekday"===e.type;for(let t=0;t<7;t++)e.push(new Date(2017,0,t+1));let n=[],r={};for(let a of["long","short"]){let o=Intl.DateTimeFormat(this.locale,{weekday:a});for(let i=0;i<7;i++){let s=o.formatToParts(e[i]).find(t).value.toLocaleLowerCase(this.locale);"short"===a?(s=s.replace(/\.$/,""),n.push(`${s}\\.?`)):n.push(s),r[s]=i}}this.vars.DAYNAME=n.join("|"),this.lookups.dayname=r}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,n=[],r={},a=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let o=0;o<2;o++){let i=a.formatToParts(e[o]).find(t);if(!i)return;let s=i.value.toLocaleLowerCase(this.locale);n.push(s),r[s]=12*o}this.vars.MERIDIEM=n.join("|"),this.lookups.meridiem=r}compile(e){return RegExp(e.replace(/_([A-Z0-9]+)_/g,(e,t)=>{if(!this.vars[t])throw Error(`Template string contains invalid variable _${t}_`);return this.vars[t]}),"i")}},bR=["ee-TG","en-AS","en-CA","en-FM","en-GH","en-GU","en-KE","en-KY","en-MH","en-MP","en-US","en-VI","en-WS","jp-JP","sm-AS","sm-SM"],bT={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},b$=()=>new Date;function bO(e){return function(t){let n={};for(let r=0,a=e.length;r<a;r++){let a=e[r];a&&(n[a]=t[r])}return n}}var bN=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:n,formatter:r}){this.doneChecker=e,this.fallback=t,this.patterns=n,this.formatter=r}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),n={},r=!1;for(let e of this.patterns){let a=t.match(e.regex);if(!a)continue;r=!0;let o=e.handler(a);if(o){for(let[e,t]of Object.entries(o))e in n||void 0===t||(n[e]=t);if(t=(t=t.slice(0,a.index)+t.slice(a.index+a[0].length+1)).trim(),this.doneChecker(n,t))break}}return r?this.formatter(n):this.fallback(e)}},bA=["year","month","day","hour","minute","second","millisecond","offset"],bI={};function bj(e,t){return""===t||/^\s+$/.test(t)||"year"in e&&("month"in e||"monthname"in e)&&"day"in e&&"hour"in e&&"minute"in e&&"second"in e&&"millisecond"in e&&("zone"in e||"offset"in e)}var bM=[[/([^\d.]+)(\d{1,2})\.(\d{2})\.(\d{2})(\D|$)/,"$1$2:$3:$4$5"],[/([^\d.]+)(\d{1,2})\.(\d{2})(\D|$)/,"$1$2:$3$4"]],bL={ar:[[/ /g," "]],bn:[[/,/g,""]],zh:[[/早上\s*([\d:]+)/,"$1am"],[/凌晨\s*([\d:]+)/,"$1am"],[/上午\s*([\d:]+)/,"$1am"],[/下午\s*([\d:]+)/,"$1pm"],[/晚上\s*([\d:]+)/,"$1pm"]],he:[[/ב/gi,""]],de:[[/ um /g," "]],pt:[[/\sde /gi," "]],es:[[/\sde /gi," "]],da:[[/\sden /gi," "],...bM],ru:[[/ г\./g,""]],th:[[/\s*นาฬิกา\s*/i,":"],[/\s*นาที\s*/i,":"],[/\s*วินาที\s*/i," "]],ko:[[/\s*시\s*/,":"],[/\s*분\s*/,":"],[/\s*초\s*/,""],[/(오전|오후)\s*([\d:]+)/,"$2$1"],[/(\d{4})\. (\d{1,2})\. (\d{1,2})\./,"$1-$2-$3"]],fi:bM,id:bM,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function bF(e,t=bg){let n=function(e){if(!bI[e]){var t,n;let r,a,o=bP.factory(e);bI[e]=new bN({doneChecker:bj,fallback:(t=e,function(e){let n=String(e).slice(0,50);return""===n&&(n="(empty string)"),{invalid:`Unable to parse "${n}" with locale "${t}"`}}),patterns:(r=[{name:"timestampWithOffset",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:bO(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:bO(["","year","month","day","hour","minute","second","millisecond","zone"])},{name:"timestampWithOffsetAndZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? (_OFFSET_|Z)\\s*(_ZONE_)$"),handler:bO(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:o.compile(`^(${bw}{2,4})\\s*\u5E74\\s*(${bw}{1,2})\\s*\u6708\\s*(${bw}{1,2})\\s*\u65E5$`),handler:bO(["","year","month","day"])},{name:"korean",regex:o.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:bO(["","year","month","day"])},{name:"twitter",regex:/^(?:sun|mon|tue|wed|thu|fri|sat) (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) (\d{2}) (\d{2}):(\d{2}):(\d{2}) ([+-]\d{4}) (\d{4})$/i,handler:bO(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=b$(),n=e[0].toLowerCase(),r={now:0,today:0,tomorrow:864e5,yesterday:-864e5}[n];0!==r&&t.setTime(t.getTime()+r);let a={year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()};return"now"===n?{...a,hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()}:a}},{name:"ago",regex:/^(\+|-|in|) ?([\d.]+) ?(years?|months?|weeks?|days?|hours?|minutes?|seconds?|milliseconds?|ms|s|m|h|w|d|M|y)( ago)?$/i,handler:function([,e,t,n,r]){t=parseFloat(t),"week"===(n=n.length<=2?bT[n]:(n=n.replace(/s$/,"")).toLowerCase())&&(n="day",t*=7),("-"===e||r)&&(t*=-1);let a=b$();return"millisecond"===n?a.setUTCMilliseconds(a.getUTCMilliseconds()+t):"second"===n?a.setUTCSeconds(a.getUTCSeconds()+t):"minute"===n?a.setUTCMinutes(a.getUTCMinutes()+t):"hour"===n?a.setUTCHours(a.getUTCHours()+t):"day"===n?a.setUTCDate(a.getUTCDate()+t):"month"===n?a.setUTCMonth(a.getUTCMonth()+t):"year"===n&&a.setUTCFullYear(a.getUTCFullYear()+t),{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate(),hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds()}}},{name:"atSeconds",regex:/^@(\d+)$/,handler:function(e){let t=new Date(1e3*parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}},{name:"microsoftJson",regex:/^\/Date\((\d+)([+-]\d{4})?\)\/$/,handler:function(e){let t=new Date(parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds(),offset:e[2]}}},{name:"full24",regex:o.compile("(?:^|[\\sT])(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?(Z)?$"),handler:bO(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:bO(["","hour","minute","second","millisecond","zone"])},{name:"hms12WithOffset",regex:o.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)\\s*(_OFFSET_)"),handler:bO(["","hour","minute","second","meridiem","offset"])},{name:"hms12",regex:o.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:bO(["","hour","minute","second","meridiem"])},{name:"hms24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:bO(["","hour","minute","second","millisecond"])},{name:"hm12",regex:o.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:bO(["","hour","minute","meridiem"])},{name:"hm24",regex:o.compile("(_H24_):(_MIN_)"),handler:bO(["","hour","minute"])},{name:"h12",regex:o.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:bO(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:bO(["","year","month","day"])},{name:"yearMonthnameDay",regex:o.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:bO(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:o.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:bO(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:o.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:bO(["","monthname","day","","year"])},{name:"dayMonthname",regex:o.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:bO(["","day","","monthname"])},{name:"monthnameDay",regex:o.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:bO(["","monthname","day"])},{name:"hmsNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:bO(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:bO(["","hour","minute"])},{name:"ymd",regex:o.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:bO(["","year","","month","day"])},{name:"mdy",regex:o.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:bO(["","month","","day","year"])},{name:"dmy",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:bO(["","day","month","year"])},{name:"yearLoose",regex:o.compile("_YEAR4_"),handler:bO(["year"])},{name:"dayMonthnameLoose",regex:o.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:bO(["","day","monthname"])},{name:"monthnameDayLoose",regex:o.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:bO(["","monthname","day"])},{name:"monthname",regex:o.compile("_MONTHNAME_"),handler:bO(["monthname"])},{name:"year4",regex:o.compile("_YEAR4_"),handler:bO(["year"])},{name:"md",regex:o.compile("(_MONTH_)[/-](_DAY_)"),handler:bO(["","month","day"])},{name:"dm",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:bO(["","day","month"])},{name:"day",regex:o.compile("_DAY_"),handler:bO(["day"])},{name:"year2",regex:o.compile("_YEAR2_"),handler:bO(["year"])},{name:"onlyZone",regex:o.compile("_ZONE_"),handler:bO(["zone"])},{name:"onlyOffset",regex:o.compile("_OFFSET_"),handler:bO(["offset"])}],a=o.baseName.slice(0,5),bR.includes(a)?r:r.filter(e=>!["mdy","md"].includes(e.name))),formatter:(n=o,function(e){let t={};for(let[r,a]of Object.entries(e))if("monthname"===r){if(a){let e=n.monthNameToInt(a);void 0!==e&&(t.month=e)}}else if("hour"===r&&e.meridiem){let r=n.h12ToInt(a,e.meridiem);void 0!==r&&(t.hour=r)}else if("zone"===r){if(a){let e=n.zoneToOffset(a);void 0!==e&&(t.offset=e)}}else if("offset"===r){let e=n.offsetToMinutes(a);void 0!==e&&(t.offset=e)}else if("millisecond"===r){let e=n.millisecondToInt(a);"number"==typeof e&&(t.millisecond=e)}else if(bA.includes(r)){let e=n.toInt(a);"number"==typeof e&&(t[r]=e)}return t.year<100&&(t.year=bv[t.year]),t.year&&"buddhist"===n.dateOptions.calendar&&(t.year-=543),t})})}return bI[e]}(t),r=function(e,t){let n=bL[t.slice(0,2).toLowerCase()];if(!n)return e;for(let[t,r]of n)e=e.replace(t,r);return e}(e,t);return n.attempt(r)}function bB(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new by(e.year,e.month-1,e.day,e.hour||0,e.minute||0,e.second||0,e.millisecond||0);return"number"==typeof e.offset?new by(t.valueOf()-60*e.offset*1e3):t}function bV(e,t=bg){let n=bF(e,t),r=n.invalid?new by(NaN):bB(n);return r.isValid()||(r.invalid=`Unable to parse date "${e}"`),r}function bU(e,t=bg){return e instanceof Date?new by(e.valueOf()):"number"==typeof e?new by(e):bV(e,t)}Date.fromString=by.fromString=bV,Date.fromAny=by.fromAny=bU,"u">typeof window&&(window.anyDateParser={fromString:bV,fromAny:bU,fromObject:bB,attempt:bF});var bW=n(5238),bH=n(3826);let bz=function(e){return null==e};function bK(e,t){var n=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return n.get?n.get.call(e):n.value}cd().extend(cm),cd().extend(bH),cd().extend(bW);let bG="YYYY-MM-DDTHH:mm:ss.SSSZZ";function bZ(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&cd()(e,bG).isValid()}function bY(e){return cd()(e).isToday()}function bq(e){return bZ(e)?cd()(e,bG).toDate():null}function bJ(e,t=!1){let n=cd()(e);return t&&(n=n.utc()),n.format(bG)}function bX(e){return cd()(e).toDate()}var bQ=new WeakMap;let b0=new class{register(e,t){bK(this,bQ).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(bK(this,bQ).has(t))return bK(this,bQ).get(t)}if(e.language&&bK(this,bQ).has(e.language))return bK(this,bQ).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return bK(this,bQ).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}(this,bQ,{writable:!0,value:new Map})}};function b1(e,t){b0.register(e,t)}function b4(e){let t=e??bh();return b0.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let b2={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function b3(e,t={}){let n=bF(e,bh());if(n.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!bz(n.day)&&bz(n.month)&&(n=Object.assign({},tM(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},tM(n,"day"),{date:n.day}));let r=cd()().set(n).toDate();return bz(n.year)&&(t.year=!1),bz(n.month)&&(t.month=!1),bz(n.date)&&(t.day=!1),b6(r,t)}function b6(e,t){let n,r=t?.locale??bh(),a=new Intl.Locale(r),{calendar:o,mode:i,time:s,day:l,month:u,year:c,noToday:d,numberingSystem:m}={...b2,...{noToday:"am"===a.language},...t},p={calendar:o??b4(a),year:c?"numeric":void 0,month:u?"short":void 0,day:l?"2-digit":void 0,numberingSystem:m},f=cd()(e).isToday();if(f&&!d)n=(n=new Intl.RelativeTimeFormat(r,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(r)+n.slice(1);else{"en"===a.language&&(r="en-GB");let t=new Intl.DateTimeFormat(r,p).formatToParts(e);("en"===a.language||"am"===a.language)&&"standard"==i&&c&&l&&(t=t.map(b5("-"))),"wide"==i&&(t=t.map(b5(" — "))),"ethiopic"===p.calendar&&(t=t.filter((e,t,n)=>"era"!==e.type&&("literal"!==e.type||!(t<n.length-1)||"era"!==n[t+1].type))),n=t.map(e=>e.value).join("")}return(!0===s||f&&"for today"===s)&&(n+=`, ${b9(e)}`),n}let b5=e=>(t,n,r)=>"literal"!==t.type||" "!==t.value||n<r.length-1&&"era"===r[n+1].type?t:{type:"literal",value:e};function b9(e){return e.toLocaleTimeString(bh(),{hour:"2-digit",minute:"2-digit"})}function b8(e,t){return b6(e,{...t,time:!0})}function b7(e,t){let n=b4("string"==typeof t?new Intl.Locale(t):t);return n?hy(e,gY(n)):e}function we(e,t){return new Intl.DurationFormat(bh(),t).format(e)}function wt(e,t){if(null==e)return null;if("string"==typeof e){let n=bF(e,bh());return n.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(n.day&&!n.month&&(n={...tM(n,"day"),...{month:n.day}}),n.month&&(n.month-=1),n.day&&(n={...tM(n,"day"),...{date:n.day}}),cd()(t).set(n))}return cd()(e)}let wn=["years","months","days","hours","minutes","seconds"],wr={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},wa={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function wo(e,t=cd()(),n){let r,a=cd()(t),o=wt(e,a);if(null==o)return null;if("string"==typeof n){let e=wr[n]??n;return{[e]:a.diff(o,e)}}let{thresholds:i,largestUnit:s,smallestUnit:l}=n??{};if(void 0!==s||void 0!==l){let e,t=l?wr[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,n){let r=wn.indexOf(n);for(let a=0;a<wn.length;a++){let o=wn[a];if(t.diff(e,o)>0)return a<=r?o:n}return n}(o,a,t??"seconds"):wr[s]??s,function(e,t,n,r){let a=wn.indexOf(n),o=wn.indexOf(r),i=wn.slice(a,o+1),s={},l=e;for(let e of i){let n=t.diff(l,e);s[e]=n,l=l.add(n,e)}return s}(o,a,e,t??e)}let u=(r=function(e){let t={...wa};if(e)for(let[n,r]of Object.entries(e))void 0!==r&&(t[wr[n]??n]=r);return t}(i),a.diff(o,"seconds")<r.seconds?"seconds":a.diff(o,"minutes")<r.minutes?"minutes":a.diff(o,"hours")<r.hours?"hours":a.diff(o,"days")<r.days?"days":a.diff(o,"months")<r.months?"months":"years");return{[u]:a.diff(o,u)}}let wi={style:"short",localeMatcher:"lookup"};function ws(e,t=cd()(),n){let r=wo(e,t,n);return null==r?null:we(r,"object"==typeof n&&n.formatOptions?{...wi,...n.formatOptions}:wi)}let wl=(0,l$.createContext)(null);function wu(){let e=uT({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,l$.useMemo)(()=>{let t=bh();return e[t]&&(t=e[t]),t},[window.i18next.language]),n=(0,l$.useMemo)(()=>{let e=b4(t);return void 0!==e?gY(e):void 0},[t]),r=(0,l$.useMemo)(()=>new Intl.Locale(t,{calendar:n?.identifier}),[t,n]),a=(0,l$.useMemo)(()=>n?hy(hk(hR()),n):hk(hR()),[n]);return{calendar:n,intlLocale:r,today_:a}}let wc=new he(1793,1,1);var wd={};function wm(){return"u">typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}wd={"ar-AE":{decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:"حقل رقمي"},"bg-BG":{decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:"Номер на полето"},"cs-CZ":{decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"da-DK":{decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:"Talfelt"},"de-DE":{decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:"Nummernfeld"},"el-GR":{decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"},"en-US":{decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"},"es-ES":{decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"et-EE":{decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri v\xe4li"},"fi-FI":{decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:"Numerokentt\xe4"},"fr-FR":{decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"},"he-IL":{decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:"שדה מספר"},"hr-HR":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"hu-HU":{decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:"Sz\xe1mmező"},"it-IT":{decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"},"ja-JP":{decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:"数値フィールド"},"ko-KR":{decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:"번호 필드"},"lt-LT":{decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"},"lv-LV":{decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:"Skaitļu lauks"},"nb-NO":{decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:"Tallfelt"},"nl-NL":{decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"},"pl-PL":{decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:"Pole numeru"},"pt-BR":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"pt-PT":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo num\xe9rico"},"ro-RO":{decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:"C\xe2mp numeric"},"ru-RU":{decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:"Числовое поле"},"sk-SK":{decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"sl-SI":{decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:"Številčno polje"},"sr-SP":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"sv-SE":{decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:"Nummerf\xe4lt"},"tr-TR":{decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:"Sayı alanı"},"uk-UA":{decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:"Поле номера"},"zh-CN":{decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:"数字字段"},"zh-TW":{decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:"數字欄位"}};var wp=n(137);function wf(e={}){let{locale:t}=fA();return(0,l$.useMemo)(()=>new(0,wp.K)(t,e),[t,e])}var wh={};function wg(e){var t;let n=(0,l$.useRef)(void 0),{value:r,textValue:a,minValue:o,maxValue:i,isDisabled:s,isReadOnly:l,isRequired:u,onIncrement:c,onIncrementPage:d,onDecrement:m,onDecrementPage:p,onDecrementToMin:f,onIncrementToMax:h}=e,g=hH((t=wh)&&t.__esModule?t.default:t,"@react-aria/spinbutton");(0,l$.useEffect)(()=>()=>clearTimeout(n.current),[]);let y=(0,l$.useRef)(!1),v=()=>{y.current=!0},b=()=>{y.current=!1},w=""===a?g.format("Empty"):(a||`${r}`).replace("-","−");(0,l$.useEffect)(()=>{y.current&&(mQ&&mQ.clear("assertive"),m0(w,"assertive"))},[w]);let E=mR(e=>{clearTimeout(n.current),null==c||c(),n.current=window.setTimeout(()=>{(void 0===i||isNaN(i)||void 0===r||isNaN(r)||r<i)&&E(60)},e)}),x=mR(e=>{clearTimeout(n.current),null==m||m(),n.current=window.setTimeout(()=>{(void 0===o||isNaN(o)||void 0===r||isNaN(r)||r>o)&&x(60)},e)}),D=e=>{e.preventDefault()},{addGlobalListener:_,removeAllGlobalListeners:k}=pA();return{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===r||isNaN(r)?void 0:r,"aria-valuetext":w,"aria-valuemin":o,"aria-valuemax":i,"aria-disabled":s||void 0,"aria-readonly":l||void 0,"aria-required":u||void 0,onKeyDown:e=>{if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!l)switch(e.key){case"PageUp":if(d){e.preventDefault(),null==d||d();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),null==c||c());break;case"PageDown":if(p){e.preventDefault(),null==p||p();break}case"ArrowDown":case"Down":m&&(e.preventDefault(),null==m||m());break;case"Home":f&&(e.preventDefault(),null==f||f());break;case"End":h&&(e.preventDefault(),null==h||h())}},onFocus:v,onBlur:b},incrementButtonProps:{onPressStart:()=>{E(400),_(window,"contextmenu",D)},onPressEnd:()=>{clearTimeout(n.current),k()},onFocus:v,onBlur:b},decrementButtonProps:{onPressStart:()=>{x(400),_(window,"contextmenu",D)},onPressEnd:()=>{clearTimeout(n.current),k()},onFocus:v,onBlur:b}}}wh={"ar-AE":{Empty:"فارغ"},"bg-BG":{Empty:"Изпразни"},"cs-CZ":{Empty:"Pr\xe1zdn\xe9"},"da-DK":{Empty:"Tom"},"de-DE":{Empty:"Leer"},"el-GR":{Empty:"Άδειο"},"en-US":{Empty:"Empty"},"es-ES":{Empty:"Vac\xedo"},"et-EE":{Empty:"T\xfchjenda"},"fi-FI":{Empty:"Tyhj\xe4"},"fr-FR":{Empty:"Vide"},"he-IL":{Empty:"ריק"},"hr-HR":{Empty:"Prazno"},"hu-HU":{Empty:"\xdcres"},"it-IT":{Empty:"Vuoto"},"ja-JP":{Empty:"空"},"ko-KR":{Empty:"비어 있음"},"lt-LT":{Empty:"Tuščias"},"lv-LV":{Empty:"Tukšs"},"nb-NO":{Empty:"Tom"},"nl-NL":{Empty:"Leeg"},"pl-PL":{Empty:"Pusty"},"pt-BR":{Empty:"Vazio"},"pt-PT":{Empty:"Vazio"},"ro-RO":{Empty:"Gol"},"ru-RU":{Empty:"Не заполнено"},"sk-SK":{Empty:"Pr\xe1zdne"},"sl-SI":{Empty:"Prazen"},"sr-SP":{Empty:"Prazno"},"sv-SE":{Empty:"Tomt"},"tr-TR":{Empty:"Boş"},"uk-UA":{Empty:"Пусто"},"zh-CN":{Empty:"空"},"zh-TW":{Empty:"空白"}};var wy=n(7120);function wv(e,t,n){let r="+"===e?t+n:t-n;if(t%1!=0||n%1!=0){let a=t.toString().split("."),o=n.toString().split("."),i=Math.pow(10,Math.max(a[1]&&a[1].length||0,o[1]&&o[1].length||0));t=Math.round(t*i),n=Math.round(n*i),r=("+"===e?t+n:t-n)/i}return r}let wb=(0,l$.createContext)(null),ww=(0,l$.createContext)(null),wE=(0,l$.forwardRef)(function(e,t){var n,r;[e,t]=mY(e,t,wb);let{validationBehavior:a}=mZ(v_)||{},o=null!=(r=null!=(n=e.validationBehavior)?n:a)?r:"native",{locale:i}=fA(),s=function(e){let{minValue:t,maxValue:n,step:r,formatOptions:a,value:o,defaultValue:i=NaN,onChange:s,locale:l,isDisabled:u,isReadOnly:c}=e;null===o&&(o=NaN),void 0===o||isNaN(o)||(o=void 0===r||isNaN(r)?vT(o,t,n):vO(o,t,n,r)),isNaN(i)||(i=void 0===r||isNaN(r)?vT(i,t,n):vO(i,t,n,r));let[d,m]=g2(o,isNaN(i)?NaN:i,s),[p,f]=(0,l$.useState)(()=>isNaN(d)?"":new(0,wp.K)(l,a).format(d)),h=(0,l$.useMemo)(()=>new(0,wy.d)(l,a),[l,a]),g=(0,l$.useMemo)(()=>h.getNumberingSystem(p),[h,p]),y=(0,l$.useMemo)(()=>new(0,wp.K)(l,{...a,numberingSystem:g}),[l,a,g]),v=(0,l$.useMemo)(()=>y.resolvedOptions(),[y]),b=(0,l$.useCallback)(e=>isNaN(e)||null===e?"":y.format(e),[y]),w=yJ({...e,value:d}),E=void 0===r||isNaN(r)?1:r;"percent"===v.style&&(void 0===r||isNaN(r))&&(E=.01);let[x,D]=(0,l$.useState)(d),[_,k]=(0,l$.useState)(l),[S,C]=(0,l$.useState)(a);Object.is(d,x)&&l===_&&a===S||(f(b(d)),D(d),k(l),C(a));let P=(0,l$.useMemo)(()=>h.parse(p),[h,p]),R=(e,r=0)=>{if(isNaN(P))return vO(isNaN(r)?0:r,t,n,E);{let r=vO(P,t,n,E);return"+"===e&&r>P||"-"===e&&r<P?r:vO(wv(e,P,E),t,n,E)}},T=(0,l$.useMemo)(()=>!u&&!c&&(isNaN(P)||void 0===n||isNaN(n)||vO(P,t,n,E)>P||wv("+",P,E)<=n),[u,c,t,n,E,P]),$=(0,l$.useMemo)(()=>!u&&!c&&(isNaN(P)||void 0===t||isNaN(t)||vO(P,t,n,E)<P||wv("-",P,E)>=t),[u,c,t,n,E,P]);return{...w,validate:e=>h.isValidPartialNumber(e,t,n),increment:()=>{let e=R("+",t);e===d&&f(b(e)),m(e),w.commitValidation()},incrementToMax:()=>{null!=n&&(m(vO(n,t,n,E)),w.commitValidation())},decrement:()=>{let e=R("-",n);e===d&&f(b(e)),m(e),w.commitValidation()},decrementToMin:()=>{null!=t&&(m(t),w.commitValidation())},canIncrement:T,canDecrement:$,minValue:t,maxValue:n,numberValue:P,setNumberValue:m,setInputValue:f,inputValue:p,commit:()=>{let e;if(!p.length){m(NaN),f(void 0===o?"":b(d));return}isNaN(P)?f(b(d)):(e=void 0===r||isNaN(r)?vT(P,t,n):vO(P,t,n,r),m(e=h.parse(b(e))),f(b(void 0===o?e:d)))}}}({...e,locale:i,validationBehavior:o}),l=(0,l$.useRef)(null),[u,c]=mq(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:m,inputProps:p,incrementButtonProps:f,decrementButtonProps:h,descriptionProps:g,errorMessageProps:y,...v}=function(e,t,n){var r,a;let o,{id:i,decrementAriaLabel:s,incrementAriaLabel:l,isDisabled:u,isReadOnly:c,isRequired:d,minValue:m,maxValue:p,autoFocus:f,label:h,formatOptions:g,onBlur:y=()=>{},onFocus:v,onFocusChange:b,onKeyDown:w,onKeyUp:E,description:x,errorMessage:D,isWheelDisabled:_,...k}=e,{increment:S,incrementToMax:C,decrement:P,decrementToMin:R,numberValue:T,inputValue:$,commit:O,commitValidation:N}=t,A=hH((a=wd)&&a.__esModule?a.default:a,"@react-aria/numberfield"),I=mV(i),{focusProps:j}=fa({onBlur(){O()}}),M=wf(g),L=(0,l$.useMemo)(()=>M.resolvedOptions(),[M]),F=wf({...g,currencySign:void 0}),B=(0,l$.useMemo)(()=>isNaN(T)?"":F.format(T),[F,T]),{spinButtonProps:V,incrementButtonProps:U,decrementButtonProps:W}=wg({isDisabled:u,isReadOnly:c,isRequired:d,maxValue:p,minValue:m,onIncrement:S,onIncrementToMax:C,onDecrement:P,onDecrementToMin:R,value:T,textValue:B}),[H,z]=(0,l$.useState)(!1),{focusWithinProps:K}=fl({isDisabled:u,onFocusWithinChange:z});!function(e,t){let{onScroll:n,isDisabled:r}=e,a=(0,l$.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),n&&n({deltaX:e.deltaX,deltaY:e.deltaY}))},[n]);ge(t,"wheel",r?void 0:a)}({onScroll:(0,l$.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?S():e.deltaY<0&&P())},[P,S]),isDisabled:_||u||c||!H},n);let G=(null!=(r=L.maximumFractionDigits)?r:0)>0,Z=void 0===t.minValue||isNaN(t.minValue)||t.minValue<0,Y="numeric";pf()?Z?Y="text":G&&(Y="decimal"):pb()&&(Z?Y="numeric":G&&(Y="decimal"));let q=m5(e),J=(0,l$.useCallback)(e=>{"Enter"===e.key?(O(),N()):e.continuePropagation()},[O,N]),{isInvalid:X,validationErrors:Q,validationDetails:ee}=t.displayValidation,{labelProps:et,inputProps:en,descriptionProps:er,errorMessageProps:ea}=function(e,t,n){let r=mR(e=>{let r=n.current;if(!r)return;let a=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":a=r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentForward":a=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd+1):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteContentBackward":a=r.selectionEnd===r.selectionStart?r.value.slice(0,r.selectionStart-1)+r.value.slice(r.selectionStart):r.value.slice(0,r.selectionStart)+r.value.slice(r.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":a=r.value.slice(r.selectionStart);break;default:null!=e.data&&(a=r.value.slice(0,r.selectionStart)+e.data+r.value.slice(r.selectionEnd))}null!=a&&t.validate(a)||e.preventDefault()});(0,l$.useEffect)(()=>{if(!wm()||!n.current)return;let e=n.current;return e.addEventListener("beforeinput",r,!1),()=>{e.removeEventListener("beforeinput",r,!1)}},[n,r]);let a=wm()?null:e=>{let n=e.target.value.slice(0,e.target.selectionStart)+e.data+e.target.value.slice(e.target.selectionEnd);t.validate(n)||e.preventDefault()},{labelProps:o,inputProps:i,descriptionProps:s,errorMessageProps:l,...u}=function(e,t){let{inputElementType:n="input",isDisabled:r=!1,isRequired:a=!1,isReadOnly:o=!1,type:i="text",validationBehavior:s="aria"}=e,[l,u]=g2(e.value,e.defaultValue||"",e.onChange),{focusableProps:c}=fs(e,t),d=yJ({...e,value:l}),{isInvalid:m,validationErrors:p,validationDetails:f}=d.displayValidation,{labelProps:h,fieldProps:g,descriptionProps:y,errorMessageProps:v}=yF({...e,isInvalid:m,errorMessage:e.errorMessage||p}),b=m5(e,{labelable:!0}),w={type:i,pattern:e.pattern};return yL(t,l,u),yB(e,d,t),(0,l$.useEffect)(()=>{if(t.current instanceof pr(t.current).HTMLTextAreaElement){let e=t.current;Object.defineProperty(e,"defaultValue",{get:()=>e.value,set:()=>{},configurable:!0})}},[t]),{labelProps:h,inputProps:mH(b,"input"===n?w:void 0,{disabled:r,readOnly:o,required:a&&"native"===s,"aria-required":a&&"aria"===s||void 0,"aria-invalid":m||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:l,onChange:e=>u(e.target.value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(lO().version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...c,...g}),descriptionProps:y,errorMessageProps:v,isInvalid:m,validationErrors:p,validationDetails:f}}(e,n),c=(0,l$.useRef)(null);return{inputProps:mH(i,{onBeforeInput:a,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:r}=n.current;c.current={value:e,selectionStart:t,selectionEnd:r}},onCompositionEnd(){if(n.current&&!t.validate(n.current.value)){let{value:e,selectionStart:r,selectionEnd:a}=c.current;n.current.value=e,n.current.setSelectionRange(r,a),t.setInputValue(e)}}}),labelProps:o,descriptionProps:s,errorMessageProps:l,...u}}({...k,...q,name:void 0,label:h,autoFocus:f,isDisabled:u,isReadOnly:c,isRequired:d,validate:void 0,[yq]:t,value:$,defaultValue:void 0,autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:I,type:"text",inputMode:Y,onChange:e=>{t.validate(e)&&t.setInputValue(e)},onBlur:y,onFocus:v,onFocusChange:b,onKeyDown:(0,l$.useMemo)(()=>mC(J,w),[J,w]),onKeyUp:E,description:x,errorMessage:D},t,n);yL(n,t.numberValue,t.setNumberValue);let eo=mH(V,j,en,{role:null,"aria-roledescription":pg()?null:A.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(eo["aria-required"]=void 0);let ei=e=>{var t;document.activeElement!==n.current&&("mouse"===e.pointerType?null==(t=n.current)||t.focus():e.target.focus())},es=e["aria-label"]||("string"==typeof e.label?e.label:"");es||(o=null!=e.label?et.id:e["aria-labelledby"]);let el=mV(),eu=mV(),ec=mH(U,{"aria-label":l||A.format("increase",{fieldLabel:es}).trim(),id:o&&!l?el:null,"aria-labelledby":o&&!l?`${el} ${o}`:null,"aria-controls":I,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:ei}),ed=mH(W,{"aria-label":s||A.format("decrease",{fieldLabel:es}).trim(),id:o&&!s?eu:null,"aria-labelledby":o&&!s?`${eu} ${o}`:null,"aria-controls":I,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:ei});return{groupProps:{...K,role:"group","aria-disabled":u,"aria-invalid":X?"true":void 0},labelProps:et,inputProps:eo,incrementButtonProps:ec,decrementButtonProps:ed,errorMessageProps:ea,descriptionProps:er,isInvalid:X,validationErrors:Q,validationDetails:ee}}({...mJ(e),label:c,validationBehavior:o},s,l),b=mG({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:v.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),w=m5(e);return delete w.id,lO().createElement(mK,{values:[[ww,s],[yd,m],[yp,{...p,ref:l}],[vk,{...d,ref:u}],[fv,{slots:{increment:f,decrement:h}}],[fE,{slots:{description:g,errorMessage:y}}],[vE,v]]},lO().createElement("div",{...w,...b,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":v.isInvalid||void 0}),e.name&&lO().createElement("input",{type:"hidden",name:e.name,value:isNaN(s.numberValue)?"":s.numberValue}))});function wx(e,t){return Number.parseInt(b6(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let wD=(0,l$.forwardRef)(function(e,t){let{className:n}=e,r=(0,l$.useContext)(yt),a=(0,l$.useContext)(yn),o=r??a,i=(0,l$.useContext)(wl),s=hR(),l=b6(o.visibleRange.start.toDate(s),{calendar:i.calendar,locale:i.baseName,day:!1,year:!1,noToday:!0}),u=wx(o.visibleRange.start.toDate(s),i),c=o.maxValue?wx(o.maxValue.toDate(s),i):void 0,d=o.minValue?wx(o.minValue.toDate(s),i):void 0,m=(0,l$.useCallback)(e=>{o.setFocusedDate(o.focusedDate.cycle("year",e-o.focusedDate.year))},[]);return o&&(0,cO.jsxs)("span",{ref:t,className:n,children:[(0,cO.jsx)("span",{children:l}),(0,cO.jsxs)(wE,{formatOptions:{useGrouping:!1},maxValue:c,minValue:d,onChange:m,value:u,children:[(0,cO.jsx)(yf,{}),(0,cO.jsxs)(ym,{children:[(0,cO.jsx)(fb,{slot:"increment",children:(0,cO.jsx)(de,{size:8})}),(0,cO.jsx)(fb,{slot:"decrement",children:(0,cO.jsx)(c9,{size:8})})]})]})]})}),w_="-esm-stock-management__datepicker-module__inputGroup___-wpzr",wk="-esm-stock-management__datepicker-module__inputSegment___ocu7L",wS="-esm-stock-management__datepicker-module__dateInputWrapper___909Km",wC="-esm-stock-management__datepicker-module__invalidText___oHJHi",wP="-esm-stock-management__datepicker-module__flatButton___i9LDo",wR="-esm-stock-management__datepicker-module__flatButtonMd___VZMkc",wT="-esm-stock-management__datepicker-module__flatButtonSm___VA5wy",w$="-esm-stock-management__datepicker-module__flatButtonLg___MnYLl";function wO({children:e}){let t=(0,l$.useContext)(bi),n=(0,l$.useContext)(bs),r=t??n,a=u7(()=>r?.close());return(0,cO.jsx)(vw,{className:"-esm-stock-management__datepicker-module__dialog___2pADb",ref:a,children:e})}let wN=(0,l$.forwardRef)(function({variant:e,today_:t,minDate:n,maxDate:r},a){let o="range"===e;return(0,cO.jsx)(bt,{ref:a,className:"-esm-stock-management__datepicker-module__popover___pb58i",placement:"bottom start",offset:1,isNonModal:!0,children:(0,cO.jsx)(wO,{children:(0,cO.jsxs)(o?ya:yr,{...o?{minValue:n,maxValue:r,className:"cds--date-picker__calendar"}:{},children:[(0,cO.jsxs)("header",{className:"-esm-stock-management__datepicker-module__header___+fi16",children:[(0,cO.jsx)(fb,{className:cA()(wP,wR),slot:"previous",children:(0,cO.jsx)(dl,{size:16})}),(0,cO.jsx)(wD,{className:"-esm-stock-management__datepicker-module__monthYear___mGhot"}),(0,cO.jsx)(fb,{className:cA()(wP,wR),slot:"next",children:(0,cO.jsx)(du,{size:16})})]}),(0,cO.jsx)(yi,{className:"-esm-stock-management__datepicker-module__calendarGrid___z07wV",children:e=>(0,cO.jsx)(yc,{className:cA()("cds--date-picker__day",{"-esm-stock-management__datepicker-module__today___dNc4M":0===t.compare(e)}),date:e},e.toString())})]})})})}),wA=(0,l$.forwardRef)(function(e,t){let n=(0,l$.useContext)(bi),[r,a]=mY({slot:e.slot},t,vl),{locale:o}=fA(),i=vi({...r,locale:o,createCalendar:gY}),s=(0,l$.useRef)(null),{fieldProps:l,inputProps:u}=yH({...r,inputRef:s},i,a),c=(0,l$.useCallback)(()=>{i.isDisabled||n.toggle()},[]);return(0,cO.jsxs)(mK,{values:[[vu,i],[yp,{...u,ref:s}],[yd,{...l,ref:a,isInvalid:i.isInvalid}]],children:[(0,cO.jsx)(ym,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:i.isDisabled,isInvalid:i.isInvalid,onClick:c,children:i.segments.map((t,n)=>(0,l$.cloneElement)(e.children(t),{key:n}))}),(0,cO.jsx)(yf,{})]})}),wI=(0,l$.forwardRef)(function(e,t){let n=(0,l$.useContext)(bi),r=(0,l$.useContext)(bs);return(n??r).isInvalid?(0,cO.jsx)(mg,{ref:t,size:16,...e}):(0,cO.jsx)(c5,{ref:t,size:16,...e})});class wj{of(e){return this.dictionary.getStringForLocale(e,this.locale)}constructor(e,t){this.locale=e,this.dictionary=t}}let wM=new Map,wL=(0,l$.forwardRef)(function({segment:e,...t},n){let r=(0,l$.useContext)(vu),a=mS(n),{segmentProps:o}=function(e,t,n){let r,a,o,i,s=(0,l$.useRef)(""),{locale:l,direction:u}=fA(),c=function(){var e;let{locale:t}=fA(),n=hW((e=yh)&&e.__esModule?e.default:e,"@react-aria/datepicker");return(0,l$.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new wj(t,n)}},[t,n])}(),{ariaLabel:d,ariaLabelledBy:m,ariaDescribedBy:p,focusManager:f}=yV.get(t),h=e.isPlaceholder?"":e.text,g=(0,l$.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),y=hX({month:"long",timeZone:g.timeZone}),v=hX({hour:"numeric",hour12:g.hour12,timeZone:g.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(h=v.format(t.dateValue));else{let e=y.format(t.dateValue);h=e!==h?`${h} \u{2013} ${e}`:e}let{spinButtonProps:b}=wg({value:e.value,textValue:h,minValue:e.minValue,maxValue:e.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!e.isEditable,isRequired:t.isRequired,onIncrement:()=>{s.current="",t.increment(e.type)},onDecrement:()=>{s.current="",t.decrement(e.type)},onIncrementPage:()=>{s.current="",t.incrementPage(e.type)},onDecrementPage:()=>{s.current="",t.decrementPage(e.type)},onIncrementToMax:()=>{s.current="",void 0!==e.maxValue&&t.setSegment(e.type,e.maxValue)},onDecrementToMin:()=>{s.current="",void 0!==e.minValue&&t.setSegment(e.type,e.minValue)}}),w=(0,l$.useMemo)(()=>new(0,wy.d)(l,{maximumFractionDigits:0}),[l]),E=()=>{if(e.text===e.placeholder&&f.focusPrevious(),!w.isValidPartialNumber(e.text)||t.isReadOnly||e.isPlaceholder)"dayPeriod"===e.type&&t.clearSegment(e.type);else{let n=e.text.slice(0,-1),r=w.parse(n);0===(n=0===r?"":n).length||0===r?t.clearSegment(e.type):t.setSegment(e.type,r),s.current=n}},{startsWith:x}=(r=function(e){let{locale:t}=fA(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(wM.has(n))return wM.get(n);let r=new Intl.Collator(t,e);return wM.set(n,r),r}({usage:"search",sensitivity:"base"}),a=(0,l$.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===r.compare(e.slice(0,t.length),t)),[r]),o=(0,l$.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===r.compare(e.slice(-t.length),t)),[r]),i=(0,l$.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let n=0,a=(t=t.normalize("NFC")).length;for(;n+a<=e.length;n++){let o=e.slice(n,n+a);if(0===r.compare(t,o))return!0}return!1},[r]),(0,l$.useMemo)(()=>({startsWith:a,endsWith:o,contains:i}),[a,o,i])),D=hX({hour:"numeric",hour12:!0}),_=(0,l$.useMemo)(()=>{let e=new Date;return e.setHours(0),D.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[D]),k=(0,l$.useMemo)(()=>{let e=new Date;return e.setHours(12),D.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[D]),S=hX({year:"numeric",era:"narrow",timeZone:"UTC"}),C=(0,l$.useMemo)(()=>{if("era"!==e.type)return[];let n=hy(new he(1,1,1),t.calendar),r=t.calendar.getEras().map(e=>{let t=n.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:S.formatToParts(t).find(e=>"era"===e.type).value}}),a=function(e){e.sort();let t=e[0],n=e[e.length-1];for(let e=0;e<t.length;e++)if(t[e]!==n[e])return e;return 0}(r.map(e=>e.formatted));if(a)for(let e of r)e.formatted=e.formatted.slice(a);return r},[S,t.calendar,e.type]),P=n=>{if(t.isDisabled||t.isReadOnly)return;let r=s.current+n;switch(e.type){case"dayPeriod":if(x(_,n))t.setSegment("dayPeriod",0);else if(x(k,n))t.setSegment("dayPeriod",12);else break;f.focusNext();break;case"era":{let e=C.find(e=>x(e.formatted,n));e&&(t.setSegment("era",e.era),f.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!w.isValidPartialNumber(r))return;let a=w.parse(r),o=a,i=0===e.minValue;if("hour"===e.type&&t.dateFormatter.resolvedOptions().hour12){switch(t.dateFormatter.resolvedOptions().hourCycle){case"h11":a>11&&(o=w.parse(n));break;case"h12":i=!1,a>12&&(o=w.parse(n))}void 0!==e.value&&e.value>=12&&a>1&&(a+=12)}else void 0!==e.maxValue&&a>e.maxValue&&(o=w.parse(n));if(isNaN(a))return;let l=0!==o||i;l&&t.setSegment(e.type,o),void 0!==e.maxValue&&(Number(a+"0")>e.maxValue||r.length>=String(e.maxValue).length)?(s.current="",l&&f.focusNext()):s.current=r}}};ge((0,l$.useRef)("u">typeof document?document:null),"selectionchange",()=>{var e;let t=window.getSelection();(null==t?void 0:t.anchorNode)&&(null==(e=n.current)?void 0:e.contains(null==t?void 0:t.anchorNode))&&t.collapse(n.current)});let R=(0,l$.useRef)("");ge(n,"beforeinput",r=>{if(n.current)switch(r.preventDefault(),r.inputType){case"deleteContentBackward":case"deleteContentForward":w.isValidPartialNumber(e.text)&&!t.isReadOnly&&E();break;case"insertCompositionText":R.current=n.current.textContent,n.current.textContent=n.current.textContent;break;default:null!=r.data&&P(r.data)}}),ge(n,"input",e=>{let{inputType:t,data:r}=e;"insertCompositionText"===t&&(n.current&&(n.current.textContent=R.current),null!=r&&(x(_,r)||x(k,r))&&P(r))}),mP(()=>{let e=n.current;return()=>{document.activeElement===e&&(f.focusPrevious()||f.focusNext())}},[n,f]);let T=pg()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,l$.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])||t.isInvalid||(p=void 0);let $=mV(),O=!t.isDisabled&&!t.isReadOnly&&e.isEditable,N="literal"===e.type?"":c.of(e.type),A=h5({"aria-label":`${N}${d?`, ${d}`:""}${m?", ":""}`,"aria-labelledby":m});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let I={caretColor:"transparent"};if("rtl"===u){I.unicodeBidi="embed";let t=g[e.type];("numeric"===t||"2-digit"===t)&&(I.direction="ltr")}return{segmentProps:mH(b,A,{id:$,...T,"aria-invalid":t.isInvalid?"true":void 0,"aria-describedby":p,"aria-readonly":t.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:O,suppressContentEditableWarning:O,spellCheck:O?"false":void 0,autoCorrect:O?"off":void 0,[parseInt(lO().version,10)>=17?"enterKeyHint":"enterkeyhint"]:O?"next":void 0,inputMode:t.isDisabled||"dayPeriod"===e.type||"era"===e.type||!O?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:e=>{if("a"===e.key&&(pp()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),E()}},onFocus:()=>{s.current="",n.current&&gi(n.current,{containingElement:gs(n.current)});let e=window.getSelection();null==e||e.collapse(n.current)},style:I,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}(e,r,a),{focusProps:i,isFocused:s,isFocusVisible:l}=fu(),{hoverProps:u,isHovered:c}=ff({...t,isDisabled:r.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:n,children:r,defaultClassName:a,defaultChildren:o,defaultStyle:i,values:s}=e;return(0,l$.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:a}):t,l="function"==typeof n?n({...s,defaultStyle:i||{}}):n,u="function"==typeof r?r({...s,defaultChildren:o}):null==r?o:r,{className:e??a,style:l||i?{...i,...l}:void 0,children:u??o,"data-rac":""}},[t,n,r,a,o,i,s])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:r.isInvalid,isDisabled:r.isDisabled,isHovered:c,isFocused:s,isFocusVisible:l},defaultChildren:e.text}),m=(0,l$.useCallback)(e=>{e.stopPropagation()},[]);return(0,cO.jsx)("span",{...mH(m5(t),o,i,u),...d,ref:a,style:o.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":r.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":r.isDisabled||void 0,"data-type":e.type,"data-hovered":c||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0,onClick:m})}),wF={short:!1,size:"md"},wB=(0,l$.forwardRef)(function(e,t){let{className:n,defaultValue:r,isDisabled:a,invalid:o,invalidText:i,isInvalid:s,label:l,labelText:u,light:c,maxDate:d,minDate:m,onChange:p,onChangeRaw:f,short:h,size:g,value:y,...v}={...wF,...e},{calendar:b,intlLocale:w,today_:E}=wu(),x=(0,l$.useId)(),D=!!(u??l),_=(0,l$.useMemo)(()=>bd(r,b),[r,b]),k=(0,l$.useMemo)(()=>bd(y,b,!0),[y,b]),S=(0,l$.useMemo)(()=>bd(d,b),[d,b]),C=(0,l$.useMemo)(()=>bd(m??wc,b),[m,b]),P=(0,l$.useMemo)(()=>o||s,[o,s]),R=(0,l$.useMemo)(()=>(f&&p&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),f??(e=>p?.(bm(e)))),[f,p]);return(0,cO.jsx)(bc,{locale:w.toString(),children:(0,cO.jsx)("div",{className:cA()("cds--form-item",n),children:(0,cO.jsx)(mK,{values:[[wl,w]],children:(0,cO.jsxs)(bl,{className:cA()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":h,"cds--date-picker--light":c}),defaultValue:_,isDisabled:a,isInvalid:P,maxValue:S,minValue:C,value:k,shouldForceLeadingZeros:"en"===w.language||void 0,...v,onChange:R,children:[(0,cO.jsxs)("div",{className:"cds--date-picker-container",children:[D&&(0,cO.jsx)(vS,{className:cA()("cds--label",{"cds--label--disabled":a}),htmlFor:x,children:u??l}),(0,cO.jsxs)(ym,{className:w_,children:[(0,cO.jsx)(wA,{id:D?x:void 0,ref:t,className:cA()("cds--date-picker-input__wrapper","-esm-stock-management__datepicker-module__inputWrapper___MHJAy",{"-esm-stock-management__datepicker-module__inputWrapperSm___esx4E":"sm"===g,"-esm-stock-management__datepicker-module__inputWrapperMd___VQbzP":"md"===g||!g||0===g.length,"-esm-stock-management__datepicker-module__inputWrapperLg___Rk9Ce":"lg"===g}),children:e=>"era"!==e.type?(0,cO.jsx)(wL,{className:wk,segment:e}):(0,cO.jsx)(lO().Fragment,{})}),(0,cO.jsx)(fb,{className:cA()(wP,{[wT]:"sm"===g,[wR]:"md"===g||!g||0===g.length,[w$]:"lg"===g}),children:(0,cO.jsx)(wI,{})})]}),(0,cO.jsx)(vx,{className:wC,children:i})]}),(0,cO.jsx)(wN,{variant:"single",today_:E})]})})})})}),wV=(0,l$.forwardRef)(function({className:e,defaultValue:t,invalid:n,invalidText:r,isDisabled:a,isInvalid:o,label:i,labelText:s,light:l,maxDate:u,minDate:c,onChange:d,onChangeRaw:m,size:p="md",value:f,...h},g){let{calendar:y,intlLocale:v,today_:b}=wu(),w=(0,l$.useId)(),E=!!(s??i),x=(0,l$.useMemo)(()=>{if(f)return{start:bd(f[0],y,!1),end:bd(f[1],y,!1)}},[f,y]),D=(0,l$.useMemo)(()=>{if(t)return{start:bd(t[0],y,!1),end:bd(t[1],y,!1)}},[t,y]),_=(0,l$.useMemo)(()=>bd(c??wc,y,!0),[c,y]),k=(0,l$.useMemo)(()=>bd(u,y,!0),[u,y]),S=(0,l$.useMemo)(()=>n||o,[n,o]),C=(0,l$.useMemo)(()=>(m&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),m??(e=>d?.([bm(e.start),bm(e.end)]))),[m,d]);return(0,cO.jsx)(bc,{locale:v.toString(),children:(0,cO.jsx)("div",{className:cA()("cds--form-item",e),children:(0,cO.jsx)(mK,{values:[[wl,v]],children:(0,cO.jsx)(bu,{id:E?w:void 0,className:cA()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":a}),isInvalid:S,shouldForceLeadingZeros:"en"===v.language||void 0,maxValue:k,minValue:_,value:x,defaultValue:D,ref:g,isDisabled:a,...h,onChange:C,children:(0,cO.jsxs)("div",{className:"cds--date-picker-container",children:[E&&(0,cO.jsx)(vS,{className:cA()("cds--label",{"cds--label--disabled":a}),htmlFor:w,children:s??i}),(0,cO.jsxs)(ym,{className:w_,children:[(0,cO.jsxs)("div",{className:cA()("-esm-stock-management__datepicker-module__inputsWrapper___UyGoG",{"-esm-stock-management__datepicker-module__inputsWrapperSm___qrGsA":"sm"===p,"-esm-stock-management__datepicker-module__inputsWrapperMd___pofu4":"md"===p||!p||0===p.length,"-esm-stock-management__datepicker-module__inputsWrapperLg___eF1Im":"lg"===p}),children:[(0,cO.jsx)(vd,{className:cA()("cds--date-picker-input__wrapper","-esm-stock-management__datepicker-module__startInput___C8vnM",wS),slot:"start",children:e=>(0,cO.jsx)(wL,{className:wk,segment:e})}),(0,cO.jsx)("div",{className:"-esm-stock-management__datepicker-module__separator___vHLFZ",children:(0,cO.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,cO.jsx)(vd,{className:cA()("cds--date-picker-input__wrapper","-esm-stock-management__datepicker-module__endInput___25OF9",wS),slot:"end",children:e=>(0,cO.jsx)(wL,{className:wk,segment:e})})]}),(0,cO.jsx)(fb,{className:cA()(wP,{[wT]:"sm"===p,[wR]:"md"===p||!p||0===p.length,[w$]:"lg"===p}),children:(0,cO.jsx)(wI,{})})]}),(0,cO.jsx)(vx,{className:wC,children:r}),(0,cO.jsx)(wN,{variant:"range",today_:b,minDate:_,maxDate:k})]})})})})})}),wU=({diagnoses:e})=>{let{diagnosisTags:t}=uT({externalModuleName:"@openmrs/esm-styleguide"});return(0,cO.jsx)("div",{className:"-esm-stock-management__diagnosis-tags-module__container___l7XiW",children:e.map(e=>{let{rank:n,uuid:r,display:a}=e,o=t[1===n?"primaryColor":"secondaryColor"];return(0,cO.jsx)(cF.Tag,{type:o,children:a},r)})})},wW={action:"-esm-stock-management__empty-card-module__action___l4wUo",content:"-esm-stock-management__empty-card-module__content___XbsSJ",desktopHeading:"-esm-stock-management__empty-card-module__desktopHeading___0EPXX",tabletHeading:"-esm-stock-management__empty-card-module__tabletHeading___unl1F",tile:"-esm-stock-management__empty-card-module__tile___vS3Sj"},wH=({width:e="64",height:t="64"})=>(0,cO.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,cO.jsx)("use",{href:"#omrs-empty-data-illustration"})}),wz=e=>{let t="tablet"===u2(),n=e.launchForm;return(0,cO.jsx)(cF.Layer,{className:wW.layer,children:(0,cO.jsxs)(cF.Tile,{className:wW.tile,children:[(0,cO.jsx)("div",{className:t?wW.tabletHeading:wW.desktopHeading,children:(0,cO.jsx)("h4",{children:e.headerTitle})}),(0,cO.jsx)(wH,{}),(0,cO.jsx)("p",{className:wW.content,children:a6("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,cO.jsx)("p",{className:wW.action,children:n&&(0,cO.jsx)(cF.Button,{onClick:()=>n(),kind:"ghost",size:t?"lg":"sm",children:a6("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},wK=({error:e,headerTitle:t})=>{let n="tablet"===u2();return(0,cO.jsx)(cF.Layer,{children:(0,cO.jsxs)(cF.Tile,{className:"-esm-stock-management__error-state-module__tile___hHM56",children:[(0,cO.jsx)("div",{className:n?"-esm-stock-management__error-state-module__tabletHeading___W7a4U":"-esm-stock-management__error-state-module__desktopHeading___VL8Rv",children:(0,cO.jsx)("h4",{children:t})}),(0,cO.jsxs)("p",{className:"-esm-stock-management__error-state-module__errorMessage___IytZy",children:[a6("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,cO.jsx)("p",{className:"-esm-stock-management__error-state-module__errorCopy___E1yZO",children:a6("errorCopy")})]})})},wG=wK,wZ=lO().forwardRef((e,t)=>{let{slotName:n,basePath:r,componentContext:a,state:o}=u5(),i=window.location??{pathname:""},s=lK(n??"");return e.isChildOfHeader&&n&&s.length>0?(0,cO.jsxs)(cF.SideNav,{"aria-label":a6("leftNavigation","Left navigation"),className:"-esm-stock-management__left-nav-module__leftNav___ZqLpw",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,cO.jsx)(lY,{name:"global-nav-menu-slot"}),n?(0,cO.jsx)(uw,{value:a,fallback:(0,cO.jsx)(lY,{name:n,state:{basePath:r,currentPath:i,...o}}),children:(0,cO.jsx)(lN.Provider,{value:a,children:(0,cO.jsx)(lY,{name:n,state:{basePath:r,currentPath:i,...o}})})}):null]}):null}),wY=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:n,locationsPerRequest:r=50,onChange:a})=>{let[o,i]=(0,l$.useState)(""),s=(0,l$.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:n,error:r,isLoading:a}=uA()(t,om,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,l$.useMemo)(()=>({location:n?.data?.entry?n.data.entry[0]:null,error:t?r:null,isLoading:!!t&&a}),[n,a,r,t])}(t),{locations:u,isLoading:c,hasMore:d,loadingNewData:m,error:p,setPage:f}=function(e,t=0,n=""){let r=uO(n),{data:a,isLoading:o,isValidating:i,setSize:s,error:l}=uY()(function(n,a){if(a){let e=a.data?.link?.find(e=>"next"===e.relation);if(!e)return null;let t=new URL(e.url);return t.origin===window.location.origin?e.url:new URL(`${t.pathname}${t.search?`?${t.search}`:""}`,window.location.origin).toString()}let o=`${ou}/Location?`,i=new URLSearchParams;return i.append("_summary","data"),t&&i.append("_count",""+t),n&&i.append("_getpagesoffset",""+n*t),e&&i.append("_tag",e),"string"==typeof r&&""!==r&&i.append("name:contains",r),o+i.toString()},om);return(0,l$.useMemo)(()=>({locations:a?.length?a?.flatMap(e=>e?.data?.entry??[]):[],isLoading:o,totalResults:a?.[0]?.data?.total,hasMore:!!a?.length&&a?.[a.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:i,error:l||null,setPage:s}),[o,a,i,s,l])}(n,r,o),h=(0,l$.useMemo)(()=>l&&!o&&t?[l,...u.filter(({resource:e})=>e.id!==t)]:u??[],[l,u,t,o]),g=(0,l$.useCallback)(e=>{a(),i(e.trim())},[a]),y=ce((0,l$.useCallback)(()=>{!m&&d&&f(e=>e+1)},[m,d,f])),v=d?Math.max(0,Math.floor(h.length-r/2)):-1;return(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsx)(cF.Search,{"aria-describedby":p?`${s}-error`:void 0,labelText:a6("searchForLocation"),id:s,placeholder:a6("searchForLocation"),onChange:e=>g(e.target.value),size:"lg"}),p&&(0,cO.jsx)("div",{className:"-esm-stock-management__location-picker-module__errorNotification___MBWvf",id:`${s}-error`,children:(0,cO.jsx)(cF.InlineNotification,{kind:"error",subtitle:a6("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:a6("error","Error")})}),(0,cO.jsx)("div",{className:"-esm-stock-management__location-picker-module__searchResults___aCL93",children:c?(0,cO.jsx)("div",{className:"-esm-stock-management__location-picker-module__loadingContainer___Vn1H0",children:Array.from({length:5}).map((e,t)=>(0,cO.jsx)(cF.RadioButtonSkeleton,{className:"-esm-stock-management__location-picker-module__radioButtonSkeleton___RKMHj",role:"progressbar"},t))}):(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsx)("div",{className:"-esm-stock-management__location-picker-module__locationResultsContainer___5yuvs",children:h.length>0?(0,cO.jsx)(cF.RadioButtonGroup,{name:"loginLocations",onChange:e=>{a(e?.toString())},orientation:"vertical",valueSelected:e,children:h.map((e,t)=>(0,cO.jsx)(cF.RadioButton,{className:"-esm-stock-management__location-picker-module__locationRadioButton___b52LI",id:e.resource.id,labelText:(0,cO.jsx)("span",{ref:t===v?y:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,cO.jsx)("div",{className:"-esm-stock-management__location-picker-module__emptyState___qiPqQ",children:(0,cO.jsx)("p",{className:"-esm-stock-management__location-picker-module__locationNotFound___tKDOJ",children:a6("noResultsToDisplay")})})}),m&&(0,cO.jsx)("div",{className:"-esm-stock-management__location-picker-module__loadingIcon___PGwvc",children:(0,cO.jsx)(cF.InlineLoading,{description:a6("loading")})})]})})]})},wq=B("modalState",{modalContainer:null,modalStack:[]}),wJ=0;async function wX(e,t,n={}){let r=ll(t),a=null;if(e){if(!r)throw Error(`No modal named '${t}' has been registered.`);let{load:o}=r,i=await o(),s=wJ++;a=await lC({...i,name:`${t}-${s}`},{...n,domElement:e})}else C(`Failed to launch modal. Please notify your administrator. Modal name: ${t}`);return a}function wQ(e){return"TO_BE_DELETED"===e.state||"DELETED"===e.state}function w0(e,t){t?.unmount&&(t.unmountPromise?.catch(()=>{}),t.unmount().catch(t=>{console.error(`The modal '${e}' failed to unmount`,t)}))}function w1(e){return e.find(e=>!wQ(e))}function w4(e,t){e.container&&(e.container.style.visibility=t?"unset":"hidden")}let w2=window.getComputedStyle(document.body).overflow;function w3({modalStack:e,modalContainer:t}){if(t)if(e.length){t.style.visibility||(addEventListener("keydown",w5),document.body.style.overflow="hidden",t.style.visibility="unset");let n=w1(e);e.forEach(e=>{switch(e.state){case"NEW":{let n=function({size:e}){let t=document.createElement("div");return t.className=`cds--modal-container cds--modal-container--${e}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}({size:e.props?.size??"md"});e.container=n,e.state="MOUNTING",wX(n,e.modalName,e.props).then(r=>{wQ(e)?w0(e.modalName,r):r?(e.parcel=r,t.prepend(n),w4(e,w1(wq.getState().modalStack)===e),r.mountPromise.then(()=>{wQ(e)||(e.state="MOUNTED")},t=>{C(t),e.parcel=null,w6(e)})):w6(e)},t=>{C(t),w6(e)});break}case"MOUNTING":case"MOUNTED":w4(e,e===n);break;case"TO_BE_DELETED":e.state="DELETED",e.onClose(),w0(e.modalName,e.parcel),e.container?.remove(),setTimeout(()=>{let t=wq.getState();wq.setState({...t,modalStack:t.modalStack.filter(t=>t!==e)})},0)}})}else t.style.removeProperty("visibility"),document.body.style.overflow=w2,removeEventListener("keydown",w5)}function w6(e){if(wQ(e))return;e.state="TO_BE_DELETED";let t=wq.getState();wq.setState({...t,modalStack:[...t.modalStack]})}function w5(e){"Escape"===e.key&&function(){let[e]=wq.getState().modalStack;e&&w6(e)}()}function w9(e){wq.subscribe(w3),wq.setState({...wq.getState(),modalContainer:e})}function w8(e,t={},n=()=>{}){let r=()=>{let e=wq.getState().modalStack.find(e=>e.onClose===n);e&&w6(e)};if(ll(e)){var a;let o,i;a={state:"NEW",onClose:n,modalName:e,props:{close:r,...t}},i=[a,...(o=wq.getState()).modalStack],wq.setState({...o,modalStack:i})}else C(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return r}var w7=n(6401);let Ee=({notification:e})=>{let{description:t,action:n,kind:r,critical:a,title:o,onAction:i}=e;return(0,cO.jsx)(cF.ActionableNotification,{actionButtonLabel:n,kind:r||"info",lowContrast:a,subtitle:t,title:o||"",inline:!0,onActionButtonClick:i})},Et=({subject:e})=>{let[t,n]=(0,l$.useState)([]);return(0,l$.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.action!==e.action||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,cO.jsx)(cO.Fragment,{children:t.map(e=>(0,cO.jsx)(Ee,{notification:e},e.id))})},En=({notification:e})=>{let{actionButtonLabel:t,onActionButtonClick:n=()=>{},subtitle:r,kind:a,title:o,critical:i,progressActionLabel:s,id:l,...u}=e,[c,d]=(0,l$.useState)(t);return(0,cO.jsx)(cF.ActionableNotification,{kind:a||"info",actionButtonLabel:c,ariaLabel:a6("closesActionableNotification","Closes actionable notification"),onActionButtonClick:()=>{n(),s&&d(s)},statusIconDescription:a6("actionableNotification","Actionable notification"),subtitle:r,title:o,lowContrast:i,inline:!0,...u})},Er=({subject:e})=>{let[t,n]=(0,l$.useState)([]);return(0,l$.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,cO.jsx)(cO.Fragment,{children:t.map(e=>(0,cO.jsx)(En,{notification:e},e.id))})};class Ea{subscribe(e){return this.listeners.add(e),{unsubscribe:()=>{this.listeners.delete(e)}}}next(e){for(let t of[...this.listeners])t(e)}constructor(){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"listeners",new Set)}}let Eo=new Ea,Ei=0,Es=new Ea,El=0;function Eu(e){e&&(0,lq.createRoot)(e).render((0,cO.jsx)(Et,{subject:Eo}))}function Ec(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!(0,w7.A)(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{Eo.next({...e,id:Ei++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function Ed(e){e&&(0,lq.createRoot)(e).render((0,cO.jsx)(Er,{subject:Es}))}function Em(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!(0,w7.A)(t))?setTimeout(()=>{Es.next({...e,id:El++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let Ep=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],Ef=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"],Eh={container:"-esm-stock-management__numeric-observation-module__container___+Kqi9",card:"-esm-stock-management__numeric-observation-module__card___Q-ECG","abnormal-value":"-esm-stock-management__numeric-observation-module__abnormal-value___bx1h9","critical-value":"-esm-stock-management__numeric-observation-module__critical-value___nSKSX",cell:"-esm-stock-management__numeric-observation-module__cell___wc90e","critically-high":"-esm-stock-management__numeric-observation-module__critically-high___fmZfJ","critically-low":"-esm-stock-management__numeric-observation-module__critically-low___h9797",high:"-esm-stock-management__numeric-observation-module__high___0-YpP",low:"-esm-stock-management__numeric-observation-module__low___TuqAk","label-container":"-esm-stock-management__numeric-observation-module__label-container___FtozC","value-container":"-esm-stock-management__numeric-observation-module__value-container___R9qoY",label:"-esm-stock-management__numeric-observation-module__label___0DGA5",value:"-esm-stock-management__numeric-observation-module__value___ohqoh",units:"-esm-stock-management__numeric-observation-module__units___xvMd3","pad-right":"-esm-stock-management__numeric-observation-module__pad-right___umcen","off-scale-low":"-esm-stock-management__numeric-observation-module__off-scale-low___my+0i","off-scale-high":"-esm-stock-management__numeric-observation-module__off-scale-high___so9dv",arrow:"-esm-stock-management__numeric-observation-module__arrow___Agoh9"},Eg=({value:e,unit:t,label:n,interpretation:r,referenceRange:a,conceptUuid:o,variant:i="card",patientUuid:s})=>{let l=(0,l$.useId)(),{referenceRange:u,isLoading:c}=function(e,t){let n=null;e&&(n=t?`${ol}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${ol}/conceptreferencerange/?concept=${e}&v=full`);let{data:r,error:a,isLoading:o}=uA()(n,om),i=r?.data?.results?.[0];return{referenceRange:i?{hiNormal:i.hiNormal??null,hiAbsolute:i.hiAbsolute??null,hiCritical:i.hiCritical??null,lowNormal:i.lowNormal??null,lowAbsolute:i.lowAbsolute??null,lowCritical:i.lowCritical??null}:void 0,error:a,isLoading:o}}(a||r?void 0:o,s),d=a??u,m=(0,l$.useMemo)(()=>{if(r)return r?"--"===r?"normal":Ep.includes(r)?r.toLowerCase():Ef.includes(r)?r:"normal":void 0;if(d&&!c){if(!d||null==e||""===e)return"normal";let t="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(t)?"normal":null!==d.hiAbsolute&&void 0!==d.hiAbsolute&&t>d.hiAbsolute?"off_scale_high":null!==d.hiCritical&&void 0!==d.hiCritical&&t>=d.hiCritical?"critically_high":null!==d.hiNormal&&void 0!==d.hiNormal&&t>d.hiNormal?"high":null!==d.lowAbsolute&&void 0!==d.lowAbsolute&&t<d.lowAbsolute?"off_scale_low":null!==d.lowCritical&&void 0!==d.lowCritical&&t<=d.lowCritical?"critically_low":null!==d.lowNormal&&void 0!==d.lowNormal&&t<d.lowNormal?"low":"normal"}return"normal"},[r,d,e,c])??"normal",p="critically_low"===m||"critically_high"===m||"off_scale_low"===m||"off_scale_high"===m,f="normal"!==m,h=n?`omrs-numeric-obs-label-${n.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,g=`omrs-numeric-obs-value-${l}`,y=`omrs-numeric-obs-unit-${l}`,v=null!=e&&""!==e,b=v?e:a6("notAvailable","Not available"),w=cA()({[Eh["critically-low"]]:"critically_low"===m||"off_scale_low"===m,[Eh["critically-high"]]:"critically_high"===m||"off_scale_high"===m,[Eh.low]:"low"===m,[Eh.high]:"high"===m,[Eh["off-scale-low"]]:"off_scale_low"===m,[Eh["off-scale-high"]]:"off_scale_high"===m}),E=cA()({[Eh.container]:!0,[Eh.card]:!0,[Eh["critical-value"]]:p,[Eh["abnormal-value"]]:f&&!p}),x=cA()({[Eh.cell]:!0,[w]:!0});return"cell"===i?(0,cO.jsxs)("div",{className:x,children:[b,v&&t?` ${t}`:""]}):(0,cO.jsxs)("section",{className:E,"data-testid":"numeric-observation-card",children:[n&&(0,cO.jsxs)("div",{className:Eh["label-container"],children:[(0,cO.jsx)("span",{id:h,className:Eh.label,children:n}),f&&(0,cO.jsx)("span",{className:Eh[m.replace("_","-")],title:a6("abnormalValue","Abnormal value")})]}),(0,cO.jsxs)("div",{className:Eh["value-container"],children:[(0,cO.jsx)("span",{id:g,"aria-labelledby":h&&y?`${h} ${y}`:h||y||void 0,className:Eh.value,children:b}),v&&t&&(0,cO.jsx)("span",{id:y,className:Eh.units,children:t})]})]})},Ey="-esm-stock-management__page-header-module__pageHeader___XNJYe",Ev=e=>{if("children"in e){let{children:t,className:n,...r}=e;return(0,cO.jsx)("div",{className:cA()(Ey,n),...r,children:t})}{let{title:t,illustration:n,className:r,...a}=e;return(0,cO.jsx)("div",{className:cA()(Ey,r),...a,children:(0,cO.jsx)(Eb,{title:t,illustration:n})})}},Eb=({title:e,illustration:t,className:n})=>{let[r,a]=(0,l$.useState)(null);return(0,l$.useEffect)(()=>{ny("@openmrs/esm-styleguide").then(e=>{a(e)})},[]),(0,cO.jsxs)("div",{className:cA()("-esm-stock-management__page-header-module__pageHeaderContent___V-mTz",n),children:[t,(0,cO.jsxs)("div",{className:"-esm-stock-management__page-header-module__pageLabels___vGJvg",children:[r?.implementationName&&(0,cO.jsx)("p",{children:a6(r.implementationName)}),(0,cO.jsx)("p",{className:"-esm-stock-management__page-header-module__pageName___+eYMc",children:e})]})]})},Ew=({totalItems:e,pageSize:t,onPageNumberChange:n,pageNumber:r,dashboardLinkUrl:a,currentItems:o,dashboardLinkLabel:i})=>{let{pageSizes:s,pageItemsCount:l}=cr(t,e,r,o),u="tablet"===u2(),c=a6("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,cO.jsx)(cO.Fragment,{children:e>0&&(0,cO.jsxs)("div",{className:cA()({"-esm-stock-management__pagination-module__tablet___DdaYk":u,"-esm-stock-management__pagination-module__desktop___rSwlo":!u}),children:[(0,cO.jsxs)("div",{children:[c,a&&(0,cO.jsx)(lA,{to:a,className:"-esm-stock-management__pagination-module__configurableLink___cTCLf",children:i??a6("seeAll","See all")})]}),(0,cO.jsx)(cF.Pagination,{className:"-esm-stock-management__pagination-module__pagination___U6anZ",page:r,pageSize:t,pageSizes:s,totalItems:e,onChange:n,pageRangeText:(e,t)=>a6("paginationOfPages","of {{count}} pages",{count:t}),size:u?"lg":"sm"})]})})};function EE(e){return ED(Ek(e,"usual","official"))}function Ex(e){return EE(e)}function ED(e){var t;let n;return e?e.text??(n=(t=e).given??[],(t.family?n.concat(t.family):n).join(" ")):""}function E_(e){return ED(e)}function Ek(e,...t){for(let n of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,r;return t=e,r=n,t.use?t.use===r:"usual"===r});if(t)return t}}function ES(e,t=cd()()){let n=cd()(t),r=wt(e,n);if(null==r)return null;let a=n.diff(r,"hours"),o=n.diff(r,"days"),i=n.diff(r,"weeks"),s=n.diff(r,"months"),l=n.diff(r,"years"),u={};if(a<2)u.minutes=n.diff(r,"minutes");else if(o<2)u.hours=a;else if(i<4)u.days=o;else if(l<1){let e=n.subtract(i,"weeks").diff(r,"days");u.weeks=i,u.days=e}else if(l<2){let e=n.subtract(s,"months").diff(r,"days");u.months=s,u.days=e}else if(l<18){let e=n.subtract(l,"year").diff(r,"months");u.years=l,u.months=e}else u.years=l;return u}function EC(e,t=cd()()){let n=ES(e,t);if(null==n)return null;let r={style:"short",localeMatcher:"lookup"};return"minutes"in n&&0===n.minutes&&(r.minutesDisplay="always"),we(n,r)}let EP={container:"-esm-stock-management__patient-banner-patient-info-module__container___WV40g",activePatientContainer:"-esm-stock-management__patient-banner-patient-info-module__activePatientContainer___YBgYK",patientBanner:"-esm-stock-management__patient-banner-patient-info-module__patientBanner___o-DQc",patientName:"-esm-stock-management__patient-banner-patient-info-module__patientName___KWLAJ",patientAvatar:"-esm-stock-management__patient-banner-patient-info-module__patientAvatar___gG4I3",patientAvatarButton:"-esm-stock-management__patient-banner-patient-info-module__patientAvatarButton___by4L9",patientInfo:"-esm-stock-management__patient-banner-patient-info-module__patientInfo___VU1fL",demographics:"-esm-stock-management__patient-banner-patient-info-module__demographics___xDHsd",row:"-esm-stock-management__patient-banner-patient-info-module__row___MlVwp",flexRow:"-esm-stock-management__patient-banner-patient-info-module__flexRow___9Aj3s",tagsSlot:"-esm-stock-management__patient-banner-patient-info-module__tagsSlot___PqCHJ",identifiers:"-esm-stock-management__patient-banner-patient-info-module__identifiers___bbREn",identifier:"-esm-stock-management__patient-banner-patient-info-module__identifier___HQzz8",primaryIdentifier:"-esm-stock-management__patient-banner-patient-info-module__primaryIdentifier___ocKCs",secondaryIdentifier:"-esm-stock-management__patient-banner-patient-info-module__secondaryIdentifier___4MLDH",value:"-esm-stock-management__patient-banner-patient-info-module__value___tkQTC",tag:"-esm-stock-management__patient-banner-patient-info-module__tag___u7Kco",gender:"-esm-stock-management__patient-banner-patient-info-module__gender___7eQuO",separator:"-esm-stock-management__patient-banner-patient-info-module__separator___CZBA8",tooltipPadding:"-esm-stock-management__patient-banner-patient-info-module__tooltipPadding___UQr5s",tooltipSmallText:"-esm-stock-management__patient-banner-patient-info-module__tooltipSmallText___MRUhY",actionsButtonText:"-esm-stock-management__patient-banner-patient-info-module__actionsButtonText___8ZC1R"};function ER({showIdentifierLabel:e,type:t,value:n}){return(0,cO.jsx)("span",{className:EP.primaryIdentifier,children:(0,cO.jsxs)(cF.Tag,{className:EP.tag,type:"gray",children:[e&&t?.text&&(0,cO.jsxs)("span",{className:EP.label,children:[t.text,": "]}),(0,cO.jsx)("span",{className:EP.value,children:n})]})})}function ET({showIdentifierLabel:e,type:t,value:n}){return(0,cO.jsxs)(cF.FormLabel,{className:EP.secondaryIdentifier,id:`patient-banner-identifier-${n}`,children:[e&&(0,cO.jsxs)("span",{className:EP.label,children:[t?.text,": "]}),(0,cO.jsx)("span",{className:EP.value,children:n})]})}function E$({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:n}=uT(),{primaryIdentifierCode:r}=ci(),a=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!n?.uuids.includes(t)})??[];return(0,cO.jsx)(cO.Fragment,{children:a?.length?a.map(({value:e,type:n},o)=>(0,cO.jsxs)(lO().Fragment,{children:[(0,cO.jsx)("span",{className:EP.identifier,children:n?.coding?.[0]?.code===r?(0,cO.jsx)(ER,{showIdentifierLabel:t,type:n,value:e}):(0,cO.jsx)(ET,{showIdentifierLabel:t,type:n,value:e})}),o<a.length-1&&(0,cO.jsx)("span",{className:EP.separator,children:"\xb7"})]},e)):""})}let EO={Female:dE,Male:dx,Other:dD,Unknown:d_},EN=({gender:e})=>{let t=EO[e];return t?(0,cO.jsx)(t,{fill:"#525252"}):null},EA={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function EI({patient:e,renderedFrom:t}){var n;let r,a,o=EE(e),i=e?.gender&&(a=EA[r=(n=e.gender).toLowerCase()]??"Unknown",{displayText:a6(r,n),iconKey:a}),s=(0,l$.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,cO.jsxs)("div",{className:EP.patientInfo,children:[(0,cO.jsx)("div",{className:cA()(EP.row,EP.patientNameRow),children:(0,cO.jsxs)("div",{className:EP.flexRow,children:[(0,cO.jsx)("span",{className:EP.patientName,children:o}),i&&(0,cO.jsxs)("div",{className:EP.gender,children:[(0,cO.jsx)(EN,{gender:i.iconKey}),(0,cO.jsx)("span",{children:i.displayText})]}),(0,cO.jsx)(lY,{className:EP.tagsSlot,name:"patient-banner-tags-slot",state:s})]})}),(0,cO.jsxs)("div",{className:EP.demographics,children:[e.birthDate&&(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsx)("span",{children:EC(e.birthDate)}),(0,cO.jsx)("span",{className:EP.separator,children:"\xb7"}),(0,cO.jsx)("span",{children:b3(e.birthDate,{time:!1})}),(0,cO.jsx)("span",{className:EP.separator,children:"\xb7"})]}),(0,cO.jsx)(E$,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,cO.jsx)(lY,{className:EP.extensionSlot,name:"patient-banner-bottom-slot",state:s})]})]})}var Ej=n(1673);function EM({patient:e,patientUuid:t,actionsSlotName:n,additionalActionsSlotState:r}){let[a,o]=(0,l$.useState)(!1),{extensions:i}=lG(n),s="tablet"===u2(),l=u7(()=>o(!1),a),u=(0,l$.useRef)(null),c=(0,l$.useRef)(null),d=(0,l$.useId)(),m=`patient-actions-menu-trigger-${d}`,p=`patient-actions-menu-${d}`,f=(0,l$.useCallback)(()=>o(e=>!e),[]),h=(0,l$.useCallback)(()=>{o(!1),u.current?.focus()},[]),g=(0,l$.useCallback)(e=>{if("Escape"===e.key&&a){e.stopPropagation(),h();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&a){e.preventDefault();let t=c.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,r=Array.from(t).indexOf(n);if(-1===r)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let a=r+("ArrowDown"===e.key?1:-1),o=a<0?t.length-1:a>=t.length?0:a;t[o]?.focus()}},[h,a]);(0,l$.useEffect)(()=>{if(a&&c.current){let e=c.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[a]);let y=(0,l$.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:h,...r}),[t,e,h,r]);return 0===i.length?null:(0,cO.jsx)("div",{className:"-esm-stock-management__patient-banner-actions-menu-module__overflowMenuContainer___7eCLh",children:(0,cO.jsxs)("div",{"data-overflow-menu":!0,className:cA()("cds--overflow-menu",cU),ref:l,children:[(0,cO.jsxs)("button",{className:cA()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":a},cz),"aria-controls":p,"aria-expanded":a,"aria-haspopup":"true",id:m,onClick:f,onKeyDown:g,ref:u,children:[(0,cO.jsx)("span",{className:"-esm-stock-management__patient-banner-actions-menu-module__actionsButtonText___TbM5a",children:a6("actions","Actions")})," ",(0,cO.jsx)(Ej.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,cO.jsxs)("div",{className:cA()("cds--overflow-menu-options","cds--overflow-menu--flip",cW,{[cH]:a}),"aria-labelledby":m,"data-floating-menu-direction":"bottom",id:p,onKeyDown:g,ref:c,role:"menu",tabIndex:-1,children:[(0,cO.jsx)("ul",{className:cA()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":s}),children:(0,cO.jsx)(lY,{name:n,state:y},n)}),(0,cO.jsx)("span",{})]})]})})}var EL=n(6767),EF=n.n(EL);function EB(e){let{patientPhotoConceptUuid:t}=uT({externalModuleName:"@openmrs/esm-styleguide"}),n=t?`${ol}/obs?patient=${e}&concept=${t}&v=full`:null,{data:r,error:a,isLoading:o}=un()(e?n:null,om),i=r?.data?.results[0];return{data:i?{dateTime:i?.obsDatetime,imageSrc:i?.value?.links?.uri}:null,error:a,isLoading:o}}let EV=({width:e=56,height:t=56,"aria-label":n})=>{let{t:r}=(0,ue.useTranslation)();return(0,cO.jsxs)("svg",{"aria-label":n??r("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,cO.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,cO.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"})]})},EU="-esm-stock-management__patient-photo-module__avatar___R93LX";function EW({patientUuid:e,patientName:t,alt:n}){let{data:r,isLoading:a}=EB(e),[o,i]=(0,l$.useState)(null),[s,l]=(0,l$.useState)(!1),u=(0,l$.useMemo)(()=>EF().generate(e),[e]);(0,l$.useEffect)(()=>{if(r?.imageSrc){let e=new URL(r.imageSrc,window.location.origin).pathname;l(!0);let t=!1,n=new Image;return n.onload=()=>{t||(i(e),l(!1))},n.onerror=()=>{t||(i(null),l(!1))},n.src=e,()=>{t=!0}}i(null),l(!1)},[r?.imageSrc]);let c=(0,l$.useMemo)(()=>n||(o?a6("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):a6("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[n,o,t]);return a||s?(0,cO.jsx)(cF.SkeletonIcon,{className:"-esm-stock-management__patient-photo-module__skeleton___I-6iq","data-testid":"skeleton-icon"}):r?.imageSrc&&!o?(0,cO.jsx)(EV,{"aria-label":a6("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):o?(0,cO.jsx)("div",{"aria-label":c,children:(0,cO.jsx)("img",{className:EU,src:o,alt:c,title:t})}):(0,cO.jsx)("div",{"aria-label":c,children:(0,cO.jsx)("div",{className:EU,title:t,style:{backgroundImage:u.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,cO.jsx)("span",{className:"-esm-stock-management__patient-photo-module__initials___JnUBD",children:function(e,t=3){return e.split(/\s+/).filter(Boolean).slice(0,t).map(e=>e[0]).join("")}(t)})})})}let EH=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-ct-scan","omrs-pict-dentistry","omrs-pict-digital-trust","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-metadata-export","omrs-pict-obstetrics","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],Ez=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),EK=Ez,EG=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),EZ=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),EY=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),Eq=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),EJ=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),EX=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),EQ=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),E0=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),E1=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),E4=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),E2=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),E3=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),E6=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),E5=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),E9=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-metadata-export",pictogramProps:e})})),E8=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),E7=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),xe=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),xt=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),xn=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),xr=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),xa=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),xo=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),xi=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),xs=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),xl=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),xu=(0,l$.memo)((0,l$.forwardRef)(function(e,t){return(0,cO.jsx)(xp,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),xc=E1,xd=xe,xm=(0,l$.memo)((0,l$.forwardRef)(function({pictogram:e,fallback:t,...n},r){let a=(0,l$.useRef)(document.getElementById(e));return(0,l$.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(a.current=document.getElementById(e))});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,cO.jsx)(uw,{value:a.current,fallback:t,children:(0,cO.jsx)(xp,{ref:r,pictogram:e,pictogramProps:n})})})),xp=(0,l$.memo)((0,l$.forwardRef)(function({pictogram:e,pictogramProps:t},n){let{className:r,size:a}=Object.assign({},{size:92},t);return(a<=26||a>144)&&(console.error(`Invalid size '${a}' specified for ${e}. Defaulting to 92.`),a=92),(0,cO.jsx)("svg",{ref:n,className:cA()("-esm-stock-management__pictograms-module__pictogram___LTPzD",r),height:a,width:a,children:(0,cO.jsx)("use",{href:`#${e}`})})})),xf=({children:e})=>"tablet"===u2()?(0,cO.jsx)(cF.Layer,{children:e}):(0,cO.jsx)(cO.Fragment,{children:e}),xh=({snackbar:e,closeSnackbar:t})=>{let{actionButtonLabel:n="",kind:r="success",onActionButtonClick:a=()=>{},isLowContrast:o="error"!==r,progressActionLabel:i,subtitle:s="",timeoutInMs:l=5e3,autoClose:u="error"!==r,title:c,id:d,...m}=e,[p,f]=(0,l$.useState)(n),[h,g]=(0,l$.useState)(!0),[y,v]=(0,l$.useState)(!1),b=(0,l$.useCallback)(()=>{setTimeout(t,250)},[t]),w=(0,l$.useCallback)(()=>{v(!0),b()},[b]);return(0,l$.useEffect)(()=>{if(u){let e=setTimeout(w,l);return()=>clearTimeout(e)}},[l,u,w]),(0,l$.useEffect)(()=>{g(!1),window.setTimeout(()=>{g(!0)},0)},[]),(0,cO.jsx)(cF.ActionableNotification,{actionButtonLabel:p,"aria-label":a6("closeSnackbar","Close snackbar"),className:cA()("-esm-stock-management__snackbar-module__slideIn___TqSN-",{"-esm-stock-management__snackbar-module__animated___+XPKT":h,"-esm-stock-management__snackbar-module__slideOut___1cFIY":y}),kind:r,lowContrast:o,onActionButtonClick:()=>{a(),w(),i&&f(i)},onClose:b,statusIconDescription:a6("snackbarNotification","Snackbar notification"),subtitle:s,title:c,...m})},xg=({subject:e})=>{let[t,n]=(0,l$.useState)([]),r=(0,l$.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,l$.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,cO.jsx)(cO.Fragment,{children:t.map(e=>(0,cO.jsx)(xh,{snackbar:e,closeSnackbar:()=>r(e)},e.id))})},xy=new Ea,xv=0;function xb(e){e&&(0,lq.createRoot)(e).render((0,cO.jsx)(xg,{subject:xy}))}function xw(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{xy.next({...e,id:xv++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let xE=({toast:e,closeToast:t})=>{let{description:n,kind:r,critical:a,title:o,actionButtonLabel:i,onActionButtonClick:s=()=>{}}=e,l=(0,l$.useCallback)(()=>{s(),t()},[t,s]);return(0,cO.jsx)("div",{children:(0,cO.jsx)(cF.ActionableNotification,{actionButtonLabel:i,kind:r||"info",lowContrast:a,subtitle:n,title:o||"",onActionButtonClick:l,onClose:t})})},xx=({subject:e})=>{let[t,n]=(0,l$.useState)([]),r=(0,l$.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,l$.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.kind!==e.kind||t.title!==e.title||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick),e]));return()=>t.unsubscribe()},[e]),(0,cO.jsx)(cO.Fragment,{children:t.map(e=>(0,cO.jsx)(xE,{toast:e,closeToast:()=>r(e)},e.id))})},xD=new Ea,x_=0;function xk(e){e&&(0,lq.createRoot)(e).render((0,cO.jsx)(xx,{subject:xD}))}function xS(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!(0,w7.A)(t))?setTimeout(()=>{xD.next({...e,id:x_++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}function xC(e,t=!1){if(t)return!0;let n=xO[e];return!n||!n()}function xP(e,t){let n=xB.getState()?.workspaceGroup,r=n?.name;r&&e===r&&xH(()=>{let r=xY(e);r&&(r.setState({},!0),r.subscribe(()=>{})()),"function"==typeof n?.cleanup&&n.cleanup(),xB.setState(e=>({...e,workspaceGroup:void 0})),"function"==typeof t&&t()},r?e=>e.currentWorkspaceGroup===r:()=>!0)}function xR(e,t){let{name:n,additionalProps:r}=t;lf(n);let a=()=>{xM(e.name,{ignoreChanges:!0,onWorkspaceClose:()=>xT(n,r),closeWorkspaceGroup:!1})};xC(e.name)?a():xK("closing-workspace-launching-new-workspace",a,e.title??e.name)}function xT(e,t){let n=lf(e),r=xB.getState().workspaceGroup;if(r&&!r.members?.includes(e))return void xP(r.name,()=>{xT(e,t)});let a=xB.getState().workspaceGroup?.name,o={...n,title:xG(n,t),closeWorkspace:(t={})=>xM(e,t),closeWorkspaceWithSavedChanges:t=>xM(e,{ignoreChanges:!0,...t}),promptBeforeClosing:t=>{var n,r;return n=e,r=t,void(xO[n]=r)},setTitle:(t,n)=>{o.title=t,o.titleNode=n,xB.setState(t=>{let n=t.openWorkspaces.map(t=>t.name===e?o:t);return{...t,openWorkspaces:n}})},currentWorkspaceGroup:a,additionalProps:t??{}};function i(e,t){xB.setState(n=>{let r=[e,...t??n.openWorkspaces],a=xW(e);return{...n,openWorkspaces:r,workspaceWindowState:a}})}a&&xY(a,t);let s=xB.getState().openWorkspaces,l=s.findIndex(t=>t.name===e),u=s.find(e=>e.type==o.type);if(0===s.length)i(o);else if(s[0].canHide||0===l)if(l>=0){let t=s[l];i({...t,additionalProps:o.additionalProps,...t.title===xG(t,t.additionalProps)&&{title:xG(o,o.additionalProps)}},s.filter(t=>t.name!=e))}else u?(i(u,xB.getState().openWorkspaces.filter(e=>e.type!=o.type)),xR(u,{name:e,additionalProps:t})):i(o);else xR(s[0],{name:e,additionalProps:t})}function x$({targetUrl:e,contextKey:t,workspaceName:n,additionalProps:r}){xL(t),xT(n,r),a8({to:e})}let xO={};function xN(e,t){xO[e]=t}function xA(e){return xO[e]}function xI(){let e=xB.getState();xB.setState({...e,prompt:null})}let xj={ignoreChanges:!1,onWorkspaceClose:()=>{},closeWorkspaceGroup:!0};function xM(e,t={}){t={...xj,...t};let n=()=>{let n=xB.getState();n.openWorkspaces.find(t=>t.name===e);let r=n.openWorkspaces.filter(t=>t.name!=e),a=xB.getState().workspaceGroup?.name;a&&t.closeWorkspaceGroup&&xP(a),xO[e]=()=>!1,xB.setState(e=>({...e,prompt:null,openWorkspaces:r,workspaceWindowState:xW(r?.[0])})),t?.onWorkspaceClose?.()};return xC(e,t?.ignoreChanges)?(n(),!0):(xK("closing-workspace",n,lf(e).title??e),!1)}function xL(e){xB.getState().context!=e&&xB.setState({context:e,openWorkspaces:[],prompt:null})}let xF={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},xB=B("workspace",xF);function xV(){return xB}function xU(e){let t=xB.getState();xB.setState({...t,workspaceWindowState:e})}function xW(e){return e?.preferredWindowSize??"normal"}function xH(e=()=>{},t=()=>!0){let n=xB.getState().openWorkspaces.filter(t).every(({name:e})=>xC(e)),r=()=>{xZ(),e?.()};n?r():xK("closing-all-workspaces",r)}function xz(){let{workspaceWindowState:e,openWorkspaces:t,prompt:n,workspaceGroup:r}=lF(xB);return(0,l$.useMemo)(()=>({active:t.length>0,prompt:n,workspaceWindowState:e,workspaces:t,workspaceGroup:r}),[t,e,n,r])}function xK(e,t=()=>{},n=""){let r;switch(e){case"closing-workspace":r={title:a6("unsavedChangesTitleText","Unsaved changes"),body:a6("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:()=>{t?.()},confirmText:a6("discard","Discard")};break;case"closing-all-workspaces":{let e=xB.getState().openWorkspaces.filter(({name:e})=>!xC(e)).map(({title:e},t)=>`${t+1}. ${e}`);r={title:a6("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:a6("closingAllWorkspacesPromptBody","There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",{workspaceNames:e.join(",")}),onConfirm:()=>{t?.()},confirmText:a6("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:e.length})};break}case"closing-workspace-launching-new-workspace":r={title:a6("unsavedChangesTitleText","Unsaved changes"),body:a6("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:n}),onConfirm:()=>{xB.setState(e=>({...e,prompt:null})),t?.()},confirmText:a6("openAnyway","Open anyway")};break;default:console.error(`Workspace system trying to open unknown prompt type "${e}" in function "showWorkspacePrompts"`),t?.();return}xB.setState(e=>({...e,prompt:r}))}function xG(e,t){return t?.workspaceTitle??e.title}function xZ(){xB.setState(xF)}function xY(e,t={}){if(!e||"default"===e)return;let n=U(e,{});return t&&n.setState(e=>({...e,...t})),n}let xq="-esm-stock-management__action-menu-button-module__container___Uwne-",xJ="-esm-stock-management__action-menu-button-module__elementContainer___vWkQO",xX="-esm-stock-management__action-menu-button-module__active___D7Idw";function xQ({getIcon:e,formOpenInTheBackground:t,tagContent:n}){return(0,cO.jsxs)(cO.Fragment,{children:[e({size:16}),t?(0,cO.jsx)("span",{className:"-esm-stock-management__action-menu-button-module__interruptedTag___7undI",children:"!"}):(0,cO.jsx)("span",{className:"-esm-stock-management__action-menu-button-module__countTag___XJRiM",children:n})]})}let x0=({getIcon:e,label:t,iconDescription:n,handler:r,type:a,tagContent:o})=>{let i=u2(),{workspaces:s,workspaceWindowState:l}=xz(),u=s?.findIndex(({type:e})=>e===a)??-1,c="hidden"!==l&&0===u,d=u>0||0===u&&"hidden"===l;return"tablet"===i||"phone"===i?(0,cO.jsxs)(cF.Button,{className:cA()(xq,{[xX]:c}),iconDescription:n,kind:"ghost",onClick:r,role:"button",tabIndex:0,size:"md",children:[(0,cO.jsx)("span",{className:xJ,children:(0,cO.jsx)(xQ,{formOpenInTheBackground:d,getIcon:e,tagContent:o})}),(0,cO.jsx)("span",{children:t})]}):(0,cO.jsx)(cF.IconButton,{align:"left","aria-label":n,className:cA()(xq,{[xX]:c}),enterDelayMs:300,kind:"ghost",label:t,onClick:r,size:"md",children:(0,cO.jsx)("div",{className:xJ,children:(0,cO.jsx)(xQ,{formOpenInTheBackground:d,getIcon:e,tagContent:o})})})};var x1=n(4535),x4=n(771),x2=n(4898),x3=/[\\^$.*+?()[\]{}|]/g,x6=RegExp(x3.source);let x5=function(e){return(e=(0,x2.A)(e))&&x6.test(e)?e.replace(x3,"\\$&"):e};function x9({contextKey:e}){let{prompt:t}=xz();return(0,l$.useEffect)(()=>{RegExp(`/${x5(e)}(/|$)`).test(window.location.pathname)||console.warn(`WorkspaceContainer has provided an invalid context key: "${e}". The context key must be part of the URL path, with no initial or trailing slash.`)},[]),(0,l$.useEffect)(()=>(xL(e),()=>{xL(null)}),[e]),(0,l$.useEffect)(()=>{let t=t=>{let{detail:{cancelNavigation:n,newUrl:r}}=t,a=RegExp(`/${x5(e)}(/|$)`),o=new URL(r),i=a.test(o.pathname),s=xB.getState().openWorkspaces.every(({name:e})=>xC(e));i||(s?xZ():(n?.(),xH(()=>{a8({to:r})})))};return window.addEventListener("single-spa:before-routing-event",t),()=>{window.removeEventListener("single-spa:before-routing-event",t)}},[]),null!=t?(0,cO.jsxs)(cF.ComposedModal,{open:!0,onClose:xI,children:[(0,cO.jsx)(cF.ModalHeader,{title:t.title}),(0,cO.jsx)(cF.ModalBody,{children:(0,cO.jsx)("p",{className:"-esm-stock-management__workspace-notification-module__messageBody___M3IAD",children:t.body})}),(0,cO.jsxs)(cF.ModalFooter,{children:[(0,cO.jsx)(cF.Button,{kind:"secondary",onClick:xI,children:t.cancelText??a6("cancel")}),(0,cO.jsx)(cF.Button,{kind:"danger",onClick:t.onConfirm,children:t.confirmText??a6("confirm")})]})]}):null}function x8(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 x7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x8(Object(n),!0).forEach(function(t){Dt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function De(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dn(e){return(Dn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Dr(e,t){return(Dr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Da(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Do=function(e){var t=l$.Component;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),t&&Dr(i,t);var n,r,a,o=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=Dn(i);e=n?Reflect.construct(t,arguments,Dn(this).constructor):t.apply(this,arguments);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return Da(this)});function i(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),Dt(Da(t=o.call(this,e)),"handleRef",function(e){t.el=e}),Dt(Da(t),"addThingToDo",function(e,n){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then(function(){if(!t.unmounted||"unmount"===e)return n.apply(void 0,arguments)}).catch(function(n){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),n&&n.message&&(n.message="During '".concat(e,"', parcel threw an error: ").concat(n.message)),t.props.handleError?t.props.handleError(n):setTimeout(function(){throw n}),n}))}),Dt(Da(t),"getParcelProps",function(){var e=x7(x7({},t.props),{},{domElement:t.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e}),t.state={hasError:!1},!e.config)throw Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return t}return r=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var t,n=e.props.mountParcel||e.mountParcel;if(!n)throw Error("\n <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop \n ");return e.el?t=e.el:(e.createdDomElement=t=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach(function(n){t.style[n]=e.props.wrapStyle[n]}),e.props.appendTo.appendChild(t)),e.parcel=n(e.props.config,x7({domElement:t},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return l4&&l4.Consumer?l$.createElement(l4.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):null;var t=l4&&l4.Consumer?l$.createElement(l4.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):void 0;return l$.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}],De(i.prototype,r),a&&De(i,a),i}();Dt(Do,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});function Di({workspace:e,additionalPropsFromPage:t}){let[n,r]=(0,l$.useState)(),a=function(e){let[t,n]=(0,l$.useState)({}),[r,a]=(0,l$.useState)(e);return(0,l$.useEffect)(()=>{r!==e&&a(e)},[e]),(0,l$.useEffect)(()=>{let e,t=xY(r);return t&&(n(t.getState()),e=t.subscribe(n)),()=>{t&&e?.()}},[r]),t}(e.currentWorkspaceGroup);(0,l$.useEffect)(()=>{let t=!0;return e.load().then(e=>{t&&r(e)}),()=>{t=!1}},[e]);let o=(0,l$.useMemo)(()=>e&&{closeWorkspace:e.closeWorkspace,closeWorkspaceWithSavedChanges:e.closeWorkspaceWithSavedChanges,promptBeforeClosing:e.promptBeforeClosing,setTitle:e.setTitle,...t,...a,...e.additionalProps},[e,t,a]);return n?(0,cO.jsx)(Do,{config:n,mountParcel:lR,...o},e.name):(0,cO.jsx)(cF.InlineLoading,{className:"-esm-stock-management__workspace-module__loader___v7QFg",description:`${a6("loading","Loading")} ...`})}function Ds({isWithinWorkspace:e,name:t,actionMenuProps:n={}}){let[r,a]=(0,l$.useState)(!1),o=(0,l$.useRef)(window.innerHeight),{featureName:i}=(0,l$.useContext)(lN),s=u2();(0,l$.useEffect)(()=>{let e=()=>{a(!u3(s)&&o.current>window.innerHeight),o.current!=window.innerHeight&&(o.current=window.innerHeight)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o]);let l=`action-menu-${t&&"default"!=t?t:i}-items-slot`;return(0,cO.jsx)("aside",{className:cA()("-esm-stock-management__action-menu-module__sideRail___Aa96v",{"-esm-stock-management__action-menu-module__withinWorkspace___2bJET":e,"-esm-stock-management__action-menu-module__sideRailHidden___Yb0w9":r,"-esm-stock-management__action-menu-module__sideRailVisible___XIAk7":!r}),children:(0,cO.jsx)("div",{className:"-esm-stock-management__action-menu-module__container___mzfAh",children:(0,cO.jsx)(lY,{className:"-esm-stock-management__action-menu-module__chartExtensions___DiJtm",name:l,state:n})})})}function Dl({contextKey:e,overlay:t,showSiderailAndBottomNav:n,additionalWorkspaceProps:r,actionMenuProps:a}){let o=u2(),{workspaces:i,workspaceWindowState:s,workspaceGroup:l}=xz(),u=l?.name,c=i[0],d="hidden"===s||null==c,m=c?.width??(t?"wider":"narrow"),p=(0,l$.useMemo)(()=>n||u&&!d,[u,d,n]);return uC(!d&&!u3(o)),(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsxs)("div",{className:n?"-esm-stock-management__workspace-module__workspaceContainerWithActionMenu___6x1qS":"-esm-stock-management__workspace-module__workspaceContainerWithoutActionMenu___TJHnt",children:[(0,cO.jsx)("aside",{className:cA()(t?"-esm-stock-management__workspace-module__workspaceOverlayOuterContainer___4y++2":"-esm-stock-management__workspace-module__workspaceWindowSpacer___6kF9R",{"-esm-stock-management__workspace-module__hiddenRelative___qqT-4":d,"-esm-stock-management__workspace-module__narrowWorkspace___MMI1u":"narrow"===m,"-esm-stock-management__workspace-module__widerWorkspace___be-UT":"wider"===m,"-esm-stock-management__workspace-module__extraWideWorkspace___JmWmj":"extra-wide"===m}),children:(0,cO.jsx)("div",{className:cA()("-esm-stock-management__workspace-module__workspaceFixedContainer___TfJP7",{"-esm-stock-management__workspace-module__maximizedWindow___71jv4":"maximized"===s,"-esm-stock-management__workspace-module__hiddenFixed___48wS9":d}),children:i.map((e,t)=>(0,cO.jsx)("div",{className:cA()("-esm-stock-management__workspace-module__workspaceInnerContainer___h3oyO",{"-esm-stock-management__workspace-module__hiddenExtraWorkspace___AP+Vj":0!==t}),children:(0,cO.jsx)(l$.Suspense,{fallback:null,children:(0,cO.jsx)(ue.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName,children:(0,cO.jsx)(Du,{workspaceInstance:e,additionalWorkspaceProps:r})})})},`workspace-container-${e?e.name:`empty-${t}`}`))})}),(0,cO.jsx)(x9,{contextKey:e})]}),p&&(0,cO.jsx)(Ds,{name:u,isWithinWorkspace:!n,actionMenuProps:a})]})}function Du({workspaceInstance:e,additionalWorkspaceProps:t}){let{t:n}=(0,ue.useTranslation)(),r=u2(),{workspaceWindowState:a,workspaceGroup:o}=xz(),i=o?.name,s="maximized"===a;(0,l$.useEffect)(()=>{let t=n(e.title);t!==e.title&&e.setTitle(t)},[e.title,n,e.setTitle]);let{featureName:l}=(0,l$.useContext)(lN),u=(0,l$.useCallback)(()=>{xU(s?"normal":"maximized")},[s]),{canHide:c=!1,canMaximize:d=!1,currentWorkspaceGroup:m="",closeWorkspace:p}=(0,l$.useMemo)(()=>e??{},[e]),f=(0,l$.useMemo)(()=>({...t,...e?.additionalProps}),[t,e]);return e&&(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsxs)(cF.Header,{"aria-label":a6("workspaceHeader","Workspace Header"),className:"-esm-stock-management__workspace-module__header___nACZO",children:[!u3(r)&&!c&&(0,cO.jsx)(cF.HeaderMenuButton,{"aria-label":a6("close","Close"),renderMenuIcon:(0,cO.jsx)(c1,{}),onClick:()=>p()}),(0,cO.jsx)(cF.HeaderName,{prefix:"",children:e.titleNode??n(e.title)}),(0,cO.jsx)("div",{className:"-esm-stock-management__workspace-module__overlayHeaderSpacer___HBnr+"}),(0,cO.jsxs)(cF.HeaderGlobalBar,{className:"-esm-stock-management__workspace-module__headerButtons___heP0Q",children:[(0,cO.jsx)(lY,{name:`workspace-header-group-${e.currentWorkspaceGroup}-slot`,state:f}),(0,cO.jsx)(lY,{name:`workspace-header-type-${e.type}-slot`,state:f}),(0,cO.jsx)(lY,{name:`workspace-header-${l}-slot`,state:f}),u3(r)&&(0,cO.jsxs)(cO.Fragment,{children:[(d||s)&&(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":s?a6("minimize","Minimize"):a6("maximize","Maximize"),onClick:u,children:s?(0,cO.jsx)(x1.Xj,{}):(0,cO.jsx)(x1.hz,{})}),c&&!i?(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":a6("hide","Hide"),onClick:()=>xU("hidden"),children:(0,cO.jsx)(c4,{})}):(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":a6("close","Close"),onClick:()=>p?.(),children:(0,cO.jsx)(dd,{})})]}),"tablet"===r&&c&&(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":a6("close","Close"),onClick:()=>p?.(),children:(0,cO.jsx)(x4.d3,{})})]})]}),(0,cO.jsx)("div",{className:cA()("-esm-stock-management__workspace-module__workspaceContent___oYdxI",{"-esm-stock-management__workspace-module__marginWorkspaceContent___7hwHu":!!m}),children:(0,cO.jsx)(Di,{workspace:e,additionalPropsFromPage:t},e.name)})]})}let Dc="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Dd=new Uint8Array(16),Dm=[];for(let e=0;e<256;++e)Dm.push((e+256).toString(16).slice(1));let Dp=function(e,t,n){if(Dc&&!t&&!e)return Dc();let r=(e=e||{}).random??e.rng?.()??function(){if(!d){if("u"<typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");d=crypto.getRandomValues.bind(crypto)}return d(Dd)}();if(r.length<16)throw Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(Dm[e[t+0]]+Dm[e[t+1]]+Dm[e[t+2]]+Dm[e[t+3]]+"-"+Dm[e[t+4]]+Dm[e[t+5]]+"-"+Dm[e[t+6]]+Dm[e[t+7]]+"-"+Dm[e[t+8]]+Dm[e[t+9]]+"-"+Dm[e[t+10]]+Dm[e[t+11]]+Dm[e[t+12]]+Dm[e[t+13]]+Dm[e[t+14]]+Dm[e[t+15]]).toLowerCase()}(r)};async function Df(e,t){let{openedGroup:n}=lg.getState();if(n){if(n.groupName===e&&Dy(n.props,t))return!0;else if(!await Dv({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return lg.setState(n=>({...n,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function Dh(e){let{openedGroup:t,openedWindows:n}=lg.getState();if(t){if(n.length>0&&!(e||await Dv({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;lg.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function Dg(e,t=null,n=null,r=null){let a=lg.getState();if(!a.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let o=ly(e);if(!o)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:i}=a,{name:s}=o,l=lv(s);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${o.name} is not registered to a workspace group`);let u=lb(e);if(i&&(i.groupName!==l.name||!Dy(i.props,r)))return!!await Dv({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(lg.setState({...a,openedGroup:{groupName:l.name,props:r},openedWindows:[{windowName:s,openedWorkspaces:[DD(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(u>=0){let r=a.openedWindows[u],o=a.openedGroup?.props??{},i=a.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:c}=r;if(Dy(r.props,n)){let d=c.find(t=>t.workspaceName===e);return d&&Dy(d.props,t)?((i||u!==a.openedWindows.length-1)&&lg.setState(Db.restoreWindow(a,s)),!0):!!await Dv({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})&&(lg.setState({...a,openedGroup:{groupName:l.name,props:a?.openedGroup?.props??o},openedWindows:[...a.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[DD(e,t)],props:r?.props??n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await Dv({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})&&(lg.setState({...a,openedGroup:{groupName:l.name,props:o??a?.openedGroup?.props},openedWindows:[...a.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[DD(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(lg.setState({...a,openedGroup:{groupName:l.name,props:r??a?.openedGroup?.props??null},openedWindows:[...a.openedWindows,{windowName:s,openedWorkspaces:[DD(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await Dv({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:o.name})&&(lg.setState({...a,openedGroup:{groupName:l.name,props:r??a?.openedGroup?.props??null},openedWindows:[{windowName:s,openedWorkspaces:[DD(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function Dy(e,t){return null==e||null==t||T(e,t)}function Dv(e){function t(e,t){let n=[];for(let r=e.openedWorkspaces.length-1;r>=0;r--){let a=e.openedWorkspaces[r];if(a.hasUnsavedChanges&&n.push(a),t&&a.workspaceName===t)break}return n}let{openedWindows:n,workspaceTitleByWorkspaceName:r}=lg.getState(),a=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":a=n.flatMap(e=>t(e));break;case"CLOSE_WINDOW":{let r=n.find(t=>t.windowName===e.windowName);if(!r)throw Error(`Window ${e.windowName} not found in opened windows.`);a=t(r);break}case"CLOSE_WORKSPACE":{let r=n.find(t=>t.windowName===e.windowName);if(!r)throw Error(`Window ${e.windowName} not found in opened windows.`);a=t(r,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":a=n.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>t(e))}return 0===a.length?Promise.resolve(!0):new Promise(e=>{let t=w8("workspace2-close-prompt",{size:"sm",onConfirm:()=>{t(),e(!0)},onCancel:()=>{t(),e(!1)},affectedWorkspaceTitles:a.map(e=>r[e.workspaceName])})})}let Db={setWindowMaximized(e,t,n){let r=e.openedWindows.findIndex(e=>e.windowName===t),a=[...e.openedWindows],o={...a[r],maximized:n};return a[r]=o,{...e,openedWindows:a}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let n=e.openedWindows.findIndex(e=>e.windowName===t),r=e.openedWindows[n],a=[...e.openedWindows.filter((e,t)=>t!==n),r];return{...e,openedWindows:a,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let n=lb(t);if(n<0)return e;let r={...e.openedWindows[n]},a=r.openedWorkspaces.findIndex(e=>e.workspaceName===t),o=[...e.openedWindows];r.openedWorkspaces=r.openedWorkspaces.slice(0,a);let i=e.isMostRecentlyOpenedWindowHidden;if(0===r.openedWorkspaces.length){let t=n===e.openedWindows.length-1;o.splice(n,1),t&&o.length>0&&(i=!1)}else o[n]=r;return{...e,openedWindows:o,isMostRecentlyOpenedWindowHidden:i}},openChildWorkspace(e,t,n,r){let a=e.registeredWorkspacesByName[n];if(!a)throw Error(`No workspace named "${n}" registered`);let o=e.registeredWorkspacesByName[t];if(!o)throw Error(`No workspace named "${t}" registered`);if(o.window!==a.window)throw Error(`Child workspace ${n} does not belong to the same workspace window as parent workspace ${t}`);let i=e.openedWindows.findIndex(e=>e.windowName===a.window);if(-1==i)throw Error(`Cannot open child workspace ${n} as window ${a.window} is not opened`);let{openedWorkspaces:s}=e.openedWindows[i],l=s.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${n} from parent workspace ${t} as the parent is not opened within the workspace window`);let u=s.slice(0,l+1);return{openedWindows:e.openedWindows.map((e,t)=>t==i?{...e,openedWorkspaces:[...u,DD(n,r)]}:e)}},setHasUnsavedChanges(e,t,n){let r=lb(t);if(r<0)return e;let a={...e.openedWindows[r]},o=a.openedWorkspaces.findIndex(e=>e.workspaceName===t);if(o<0)return e;a.openedWorkspaces[o]={...a.openedWorkspaces[o],hasUnsavedChanges:n};let i=[...e.openedWindows];return i[r]=a,{...e,openedWindows:i}},setWorkspaceTitle(e,t,n){let r={...e.workspaceTitleByWorkspaceName};return null===n?delete r[t]:r[t]=n,{...e,workspaceTitleByWorkspaceName:r}}};function Dw(){return lB(lg,Db)}let DE=()=>(0,l$.useContext)(l4),Dx=()=>Object.keys(lg.getState().registeredWorkspacesByName);function DD(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:Dp()}}let D_={workspaceOuterContainer:"-esm-stock-management__workspace2-module__workspaceOuterContainer___DLiCR",narrowWorkspace:"-esm-stock-management__workspace2-module__narrowWorkspace___VL0kF",widerWorkspace:"-esm-stock-management__workspace2-module__widerWorkspace___3QgrA",extraWideWorkspace:"-esm-stock-management__workspace2-module__extraWideWorkspace___s7nnh",workspaceMiddleContainer:"-esm-stock-management__workspace2-module__workspaceMiddleContainer___mTGNN",maximized:"-esm-stock-management__workspace2-module__maximized___-yo9l",hidden:"-esm-stock-management__workspace2-module__hidden___K2ryM",workspaceInnerContainer:"-esm-stock-management__workspace2-module__workspaceInnerContainer___o3zVl",workspaceSpacer:"-esm-stock-management__workspace2-module__workspaceSpacer___N6-ox",loader:"-esm-stock-management__workspace2-module__loader___29hpw",hiddenExtraWorkspace:"-esm-stock-management__workspace2-module__hiddenExtraWorkspace___-W7TY",header:"-esm-stock-management__workspace2-module__header___p0kuD",headerButtons:"-esm-stock-management__workspace2-module__headerButtons___hMydG",workspaceContent:"-esm-stock-management__workspace2-module__workspaceContent___uROr7",overlayHeaderSpacer:"-esm-stock-management__workspace2-module__overlayHeaderSpacer___zdrhx",isActionMenuOpened:"-esm-stock-management__workspace2-module__isActionMenuOpened___Wc1Il",showActionMenu:"-esm-stock-management__workspace2-module__showActionMenu___qCVQ-",marginWorkspaceContent:"-esm-stock-management__workspace2-module__marginWorkspaceContent___A+20C",workspaceContainerWithActionMenu:"-esm-stock-management__workspace2-module__workspaceContainerWithActionMenu___S98dq",workspaceFixedContainer:"-esm-stock-management__workspace2-module__workspaceFixedContainer___c9Uny",workspaceContainerWithoutActionMenu:"-esm-stock-management__workspace2-module__workspaceContainerWithoutActionMenu___u8FbT"},Dk=({title:e,children:t,hasUnsavedChanges:n=!1})=>{let r=u2(),{setWindowMaximized:a,hideWindow:o,setHasUnsavedChanges:i,openedWindows:s,openedGroup:l,registeredGroupsByName:u,registeredWindowsByName:c,registeredWorkspacesByName:d,workspaceTitleByWorkspaceName:m,setWorkspaceTitle:p,isMostRecentlyOpenedWindowHidden:f}=Dw(),{workspaceName:h,isRootWorkspace:g,closeWorkspace:y,showActionMenu:v}=DE(),b=lb(h),w=s[b],E=w?.openedWorkspaces.find(e=>e.workspaceName===h);if((0,l$.useEffect)(()=>{E?.hasUnsavedChanges!=n&&i(h,n??!1)},[E?.hasUnsavedChanges,n,h,i]),(0,l$.useEffect)(()=>{m[h]!==e&&p(h,e)},[m,h,e,p]),b<0||null==l||null==E)return null;let x=u[l.groupName];if(!x)throw Error(`Cannot find registered workspace group ${l.groupName}`);let D=d[h].window,_=c[D];if(!_)throw Error(`Cannot find registered workspace window ${D}`);let{icon:k,canMaximize:S}=_,C="closable"===x.persistence,P=!!k&&!C,{maximized:R}=w,T=_?.width??"narrow",$=Object.values(c).some(e=>e.group===l.groupName&&void 0!==e.icon),O=b<s.length-1||f;return(0,cO.jsxs)("div",{className:cA()(D_.workspaceOuterContainer,{[D_.narrowWorkspace]:"narrow"===T,[D_.widerWorkspace]:"wider"===T,[D_.extraWideWorkspace]:"extra-wide"===T,[D_.isActionMenuOpened]:$}),children:[(0,cO.jsx)("div",{className:cA()(D_.workspaceSpacer,{[D_.hidden]:O})}),(0,cO.jsx)("div",{className:cA()(D_.workspaceMiddleContainer,{[D_.maximized]:R,[D_.hidden]:O,[D_.isRootWorkspace]:g,[D_.showActionMenu]:v}),children:(0,cO.jsxs)("div",{className:cA()(D_.workspaceInnerContainer,{[D_.maximized]:R,[D_.hidden]:O,[D_.isRootWorkspace]:g}),children:[(0,cO.jsxs)(cF.Header,{"aria-label":a6("workspaceHeader"),className:D_.header,children:[(0,cO.jsx)(cF.HeaderName,{prefix:"",children:e}),(0,cO.jsx)("div",{className:D_.overlayHeaderSpacer}),(0,cO.jsx)(cF.HeaderGlobalBar,{className:D_.headerButtons,children:u3(r)?(0,cO.jsxs)(cO.Fragment,{children:[(S||R)&&(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":R?a6("minimize"):a6("maximize"),onClick:()=>a(D,!R),children:R?(0,cO.jsx)(x1.Xj,{}):(0,cO.jsx)(x1.hz,{})}),P&&(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":a6("hide"),onClick:()=>o(),children:(0,cO.jsx)(c4,{})}),!C&&(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":a6("close"),onClick:()=>y({closeWindow:!0}),children:(0,cO.jsx)(dd,{})})]}):(0,cO.jsxs)(cO.Fragment,{children:[P&&(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":a6("hide"),onClick:()=>o(),children:(0,cO.jsx)(x4.d3,{})}),(0,cO.jsx)(cF.HeaderGlobalAction,{"aria-label":a6("close"),onClick:()=>{C?Dh():y({closeWindow:!0})},children:(0,cO.jsx)(dd,{})})]})})]}),(0,cO.jsx)("div",{className:cA()(D_.workspaceContent),children:t})]})})]})},DS="-esm-stock-management__action-menu-button2-module__container___gYRoa",DC="-esm-stock-management__action-menu-button2-module__elementContainer___vBViO",DP="-esm-stock-management__action-menu-button2-module__active___uRJRA",DR="-esm-stock-management__action-menu-button2-module__focused___D4VYB";function DT({getIcon:e,hasUnsavedChanges:t,tagContent:n}){return(0,cO.jsxs)(cO.Fragment,{children:[e({size:16}),t?(0,cO.jsx)("span",{className:"-esm-stock-management__action-menu-button2-module__interruptedTag___35fO7",children:"!"}):(0,cO.jsx)("span",{className:"-esm-stock-management__action-menu-button2-module__countTag___l8lfc",children:n})]})}let D$=({icon:e,label:t,tagContent:n,workspaceToLaunch:r,onBeforeWorkspaceLaunch:a})=>{let o=u2(),{openedWindows:i,restoreWindow:s,hideWindow:l,isMostRecentlyOpenedWindowHidden:u}=Dw(),{extension:c}=(0,l$.useContext)(lN),d=i.findIndex(e=>e.windowName===c?.extensionId),m=i[d],p=null!=m,f=p&&(d<i.length-1||u),h=p&&!f,g=m?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,y=async()=>{if(p)f?s(m.windowName):l();else if(await (a?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:n}=r;Dg(e,t,n)}};return"tablet"===o||"phone"===o?(0,cO.jsxs)(cF.Button,{className:cA()(DS,{[DP]:p&&!h,[DR]:h}),iconDescription:t,kind:"ghost",onClick:y,role:"button",tabIndex:0,size:"md",children:[(0,cO.jsx)("span",{className:DC,children:(0,cO.jsx)(DT,{hasUnsavedChanges:g,getIcon:e,tagContent:n})}),(0,cO.jsx)("span",{children:t})]}):(0,cO.jsx)(cF.IconButton,{align:"left","aria-label":t,className:cA()(DS,{[DP]:p&&!h,[DR]:h}),enterDelayMs:300,kind:"ghost",label:t,onClick:y,size:"md",children:(0,cO.jsx)("div",{className:DC,children:(0,cO.jsx)(DT,{hasUnsavedChanges:g,getIcon:e,tagContent:n})})})};function DO({showContactDetails:e,toggleContactDetails:t,className:n}){return(0,cO.jsx)(cF.Button,{className:n,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?dc:ds,children:e?a6("showLess","Show less"):a6("showMore","Show more")})}let DN={contactDetails:"-esm-stock-management__patient-banner-contact-details-module__contactDetails___AvROu",deceased:"-esm-stock-management__patient-banner-contact-details-module__deceased___DDd39",heading:"-esm-stock-management__patient-banner-contact-details-module__heading___GGJyV",row:"-esm-stock-management__patient-banner-contact-details-module__row___8JcKK",col:"-esm-stock-management__patient-banner-contact-details-module__col___ct1O9",relationship:"-esm-stock-management__patient-banner-contact-details-module__relationship___GTTsg"},DA=({patientUuid:e})=>{let{cohorts:t=[],isLoading:n}=function(e){let t=e?`${ol}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:n,isLoading:r}=un()(t,om),a=n?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,l$.useMemo)(()=>({cohorts:a,isLoading:r}),[r,a])}(e);return(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsxs)("p",{className:DN.heading,children:[a6("patientLists","Patient Lists")," (",t?.length??0,")"]}),n?(0,cO.jsx)(cF.InlineLoading,{description:`${a6("loading","Loading")} ...`,role:"progressbar"}):(0,cO.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>bX(e?.startDate).getTime()-bX(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,cO.jsx)("li",{children:(0,cO.jsx)(lA,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,cO.jsx)("li",{children:"--"})})(),t.length>3&&(0,cO.jsx)("li",{className:DN.link,children:(0,cO.jsx)(lA,{to:`${window.spaBase}/home/patient-lists`,children:a6("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},DI=({patientId:e})=>{let{patient:t,isLoading:n}=co(e),r=t?.address?.find(e=>"home"===e.use),a=e=>e.split("#")[1];return n?(0,cO.jsx)(cF.InlineLoading,{description:`${a6("loading","Loading")} ...`,role:"progressbar"}):(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsx)("p",{className:DN.heading,children:a6("address","Address")}),(0,cO.jsx)("ul",{children:r?Object.entries(r).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?r.extension?.[0]?.extension?.map((t,n)=>(0,cO.jsxs)("li",{children:[a6(a(t.url),a(t.url)),": ",t.valueString]},`address-${e}-${n}`)):(0,cO.jsxs)("li",{children:[a6(e,e),": ",t]},`address-${e}`)):(0,cO.jsx)("li",{children:"--"})})]})},Dj=({patientUuid:e})=>{let{isLoading:t,contactAttributes:n}=(e=>{let{contactAttributeTypes:t=[]}=uT({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:n,error:r,isLoading:a}=(e=>{let{data:t,error:n,isLoading:r}=uA()(`${ol}/patient/${e}?v=custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))`,om);return{isLoading:r,attributes:t?.data.person.attributes??[],error:n}})(e);return{contactAttributes:(0,l$.useMemo)(()=>n.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[n,t]),isLoading:a,error:r}})(e),r=(0,l$.useMemo)(()=>n?[...n?.map(e=>[e.attributeType.display?a6(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[n]);return(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsx)("p",{className:DN.heading,children:a6("contactDetails","Contact Details")}),t?(0,cO.jsx)(cF.InlineLoading,{description:`${a6("loading","Loading")} ...`,role:"progressbar"}):(0,cO.jsx)("ul",{children:r.length?r.map(([e,t],n)=>(0,cO.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${n}`)):(0,cO.jsx)("li",{children:"--"})})]})},DM=({patientId:e})=>{let{data:t,isLoading:n}=function(e){let t=`${ol}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:n,error:r,isLoading:a,isValidating:o}=un()(e?t:null,om),i=n?.data?.results?.length?function(e,t){let n=[];for(let r of t)e===r.personA.uuid?n.push({uuid:`${r.uuid}`,display:r.personB.display,relativeAge:r.personB.age,relativeUuid:r.personB.uuid,relationshipType:r.relationshipType.bIsToA}):n.push({uuid:`${r.uuid}`,display:r.personA.display,relativeAge:r.personA.age,relativeUuid:r.personA.uuid,relationshipType:r.relationshipType.aIsToB});return n}(e,n.data.results):null;return{data:n?i:null,error:r,isLoading:a,isValidating:o}}(e);return(0,cO.jsxs)(cO.Fragment,{children:[(0,cO.jsx)("p",{className:DN.heading,children:a6("relationships","Relationships")}),n?(0,cO.jsx)(cF.InlineLoading,{description:`${a6("loading","Loading")} ...`,role:"progressbar"}):(0,cO.jsx)("ul",{children:t&&t.length>0?(0,cO.jsx)(cO.Fragment,{children:t.map(e=>(0,cO.jsxs)("li",{className:DN.relationship,children:[(0,cO.jsx)("div",{children:(0,cO.jsx)(lA,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,cO.jsx)("div",{children:e.relationshipType}),(0,cO.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?a6("yearAbbreviation","yr"):a6("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,cO.jsx)("li",{children:"--"})})]})};function DL({patientId:e,deceased:t}){return(0,cO.jsxs)("div",{className:cA()(DN.contactDetails,{[DN.deceased]:t}),children:[(0,cO.jsxs)("div",{className:DN.row,children:[(0,cO.jsx)("div",{className:DN.col,children:(0,cO.jsx)(DI,{patientId:e})}),(0,cO.jsx)("div",{className:DN.col,children:(0,cO.jsx)(Dj,{patientUuid:e})})]}),(0,cO.jsxs)("div",{className:DN.row,children:[(0,cO.jsx)("div",{className:DN.col,children:(0,cO.jsx)(DM,{patientId:e})}),(0,cO.jsx)("div",{className:DN.col,children:(0,cO.jsx)(DA,{patientUuid:e})})]})]})}function DF(e){let t=document.querySelector("template#loading-spinner");if(t){let n=t.content.cloneNode(!0),r=Array.prototype.map.call(n.childNodes,e=>e);return e.appendChild(n),()=>r.forEach(e=>e.remove())}return()=>{}}let DB="-esm-stock-management__action-menu2-module__container___4aX3S";function DV({workspaceGroup:e,groupProps:t}){let n=u2(),{persistence:r}=e;return(0,cO.jsx)("aside",{className:"-esm-stock-management__action-menu2-module__sideRail___a7qg9",children:(0,cO.jsxs)("div",{className:DB,children:["closable"==r&&u3(n)&&(0,cO.jsx)(cF.IconButton,{align:"left",onClick:()=>Dh(),label:a6("close"),kind:"ghost",children:(0,cO.jsx)(dd,{})}),(0,cO.jsx)(lN.Provider,{value:{moduleName:e.moduleName,featureName:e.name},children:(0,cO.jsx)(lY,{className:DB,name:e.name,state:{groupProps:t}})})]})})}function DU(e){let t=new URL(e,window.location.origin).pathname,n=new URL(window.getOpenmrsSpaBase?.()??"/",window.location.origin).pathname,r=n.endsWith("/")?n.slice(0,-1):n,a=null;return r?r===t?a="/":t.startsWith(`${r}/`)&&(a=t.slice(r.length)):a=t,{full:t,spaRelative:a}}let DW=({lifeCycle:e,openedWorkspace:t,openedWindow:n,isRootWorkspace:r,isLeafWorkspace:a,showActionMenu:o})=>{let{openedGroup:i,closeWorkspace:s,openChildWorkspace:l}=Dw(),u=(0,l$.useMemo)(()=>t&&{closeWorkspace:async(e={})=>{let{closeWindow:r=!1,discardUnsavedChanges:a=!1}=e;return r?!!(a||await Dv({reason:"CLOSE_WINDOW",explicit:!0,windowName:n.windowName}))&&(s(n.openedWorkspaces[0].workspaceName),!0):!!(a||await Dv({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:n.windowName,workspaceName:t.workspaceName}))&&(s(t.workspaceName),!0)},launchChildWorkspace:async(e,r)=>{let a=t.workspaceName,{openedWorkspaces:o}=n,i=o.findIndex(e=>e.workspaceName===a);-1===i||i!==o.length-1&&o.slice(i+1).some(e=>e.hasUnsavedChanges)&&!await Dv({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:n.windowName,workspaceName:o[i+1].workspaceName})||l(a,e,r||{})},workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:n.props,groupProps:i&&i.props?i.props:null,workspaceMeta:lg.getState().registeredWorkspacesByName[t.workspaceName]?.meta??{},isRootWorkspace:r,isLeafWorkspace:a,windowName:n.windowName,showActionMenu:o},[t,s,i,n]);if(!e){let{registeredWorkspacesByName:e}=lg.getState(),n=e[t.workspaceName],a=n&&n.window?n.window:void 0,{registeredWindowsByName:s}=lg.getState(),l=a?s[a]:void 0,u=l&&l.width?l.width:"narrow",c=Object.values(s).some(e=>e.group===i?.groupName&&void 0!==e.icon);return(0,cO.jsxs)("div",{className:cA()(D_.workspaceOuterContainer,{[D_.narrowWorkspace]:"narrow"===u,[D_.widerWorkspace]:"wider"===u,[D_.extraWideWorkspace]:"extra-wide"===u,[D_.isActionMenuOpened]:c}),children:[(0,cO.jsx)("div",{className:D_.workspaceSpacer}),(0,cO.jsx)("div",{className:cA()(D_.workspaceMiddleContainer,{[D_.isRootWorkspace]:r,[D_.showActionMenu]:o}),children:(0,cO.jsx)("div",{className:cA()(D_.workspaceInnerContainer,{[D_.isRootWorkspace]:r}),children:(0,cO.jsx)(cF.InlineLoading,{className:D_.loader,description:`${a6("loading")} ...`})})})]})}return(0,cO.jsx)(Do,{config:e,mountParcel:lR,...u},t.workspaceName)},DH=({openedWindow:e,showActionMenu:t})=>{let{openedWorkspaces:n}=e,[r,a]=(0,l$.useState)({}),{registeredWorkspacesByName:o}=lg.getState();return(0,l$.useEffect)(()=>{let e=!1;return Promise.all(n.map(async e=>{let{moduleName:t,component:n}=o[e.workspaceName];return[e.uuid,await cE(t,n)]})).then(t=>{e||a(Object.fromEntries(t))}),()=>{e=!0}},[n]),(0,cO.jsx)(cO.Fragment,{children:n.map((a,o)=>(0,cO.jsx)(DW,{openedWorkspace:a,openedWindow:e,lifeCycle:r[a.uuid],isRootWorkspace:0===o,isLeafWorkspace:o===n.length-1,showActionMenu:t},a.uuid))})};function Dz(e){e&&(0,lq.createRoot)(e).render((0,cO.jsx)(DK,{}))}function DK(){let{openedGroup:e,openedWindows:t,registeredGroupsByName:n,registeredWindowsByName:r}=Dw();if((0,l$.useEffect)(()=>iT("before-page-changed",t=>{let{newPage:r,cancelNavigation:a,oldUrl:o,newUrl:i}=t;if(!e)return;if(r)return void a(Dh().then(e=>!e));let s=n[e.groupName],l=s?.scopePattern;l&&function(e,t,n){try{let r=new RegExp(e),a=DU(t),o=DU(n);if(null===a.spaRelative||null===o.spaRelative)return!0;let i=r.exec(a.spaRelative),s=r.exec(o.spaRelative);if(i&&s||(i=r.exec(a.full),s=r.exec(o.full)),!i||!s)return!0;if(i.length>1)return!i.slice(1).every((e,t)=>e===s[t+1]);return!1}catch{return!0}}(l,o,i)&&a(Dh().then(e=>!e))}),[e,n]),!e)return null;let a=n[e.groupName],o=t.some(e=>e.maximized),{name:i}=a,s=Object.values(r).filter(e=>e.group===i&&void 0!==e.icon).sort((e,t)=>(e.order??Number.MAX_VALUE)-(t.order??Number.MAX_VALUE)).length>0;return(0,cO.jsxs)("div",{className:cA()("-esm-stock-management__workspace-windows-and-menu-module__workspaceWindowsAndMenuContainer___crgqC",{"-esm-stock-management__workspace-windows-and-menu-module__overlay___FCMKG":a.overlay,"-esm-stock-management__workspace-windows-and-menu-module__hasMaximizedWindow___gk319":o}),children:[(0,cO.jsx)("div",{className:"-esm-stock-management__workspace-windows-and-menu-module__workspaceWindowsContainer___MrLlf",children:t.map(e=>(0,cO.jsx)(DH,{openedWindow:e,showActionMenu:s},e.windowName))}),s&&(0,cO.jsx)(DV,{workspaceGroup:a,groupProps:e.props})]})}function DG(e,t,n){if(null==e)return n;let r=bp(e);if(!r)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),n;let a=[];for(let e of t){let t=bp(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}a.push({canonical:t,original:e})}let o=r;for(;o;){let e=a.find(e=>e.canonical===o);if(e)return e.original;let t=o+"-",n=a.find(e=>e.canonical.startsWith(t));if(n)return n.original;if("ht"===o){o="fr-HT";continue}let r=o.lastIndexOf("-");if(-1===r)break;let i=(o=o.slice(0,r)).lastIndexOf("-");-1!==i&&o.length-i==2&&(o=o.slice(0,i))}return n}function DZ(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function DY(e){return!!e&&e.constructor===Object}var Dq=n(7638);function DJ(e){let[t,n,r]=e.split(".");return`${t}.${n}.${r}`}function DX(e,t){return Dq(function(e){let t=e.indexOf("-");if(t>=0){let n=DJ(e.slice(0,t)),r=e.slice(t+1);return`${n}-${r}`}return DJ(e)}(t),e,{includePrerelease:!0})}async function DQ(e,t={}){let n,{shouldRetry:r,getDelay:a,onError:o}=t;r=r??(e=>e<=5),a=a??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let i=0;do try{return await D0(a(i)),await e()}catch(e){o?.(e,i),n=e}while(r(i++));throw n}async function D0(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}function D1(e,t,n,r){}function D4(e){}function D2(e){return Promise.resolve([])}function D3(e){return Promise.resolve([])}function D6(e){return Promise.resolve({success:!1,result:void 0,error:"No service worker has been registered. Offline-related features have been removed from the framework."})}function D5(e){return()=>{}}function D9(){return!0}}}]);
|