@openmrs/esm-form-builder-app 3.5.2-pre.3757 → 3.5.2-pre.3761

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/8398.js CHANGED
@@ -1,6 +1,6 @@
1
- (globalThis.webpackChunk_openmrs_esm_form_builder_app=globalThis.webpackChunk_openmrs_esm_form_builder_app||[]).push([["8398"],{47581(e){e.exports=function(e,t,r){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=r();return this.format(e)===t.format(e)}}},5238(e){e.exports=function(e,t,r){var n=t.prototype,i=function(e){var t=e.date,i=e.utc,o={};if(!(null===t||t instanceof Date||t instanceof Array||n.$utils().u(t)||"Object"!==t.constructor.name)){if(!Object.keys(t).length)return new Date;var a=i?r.utc():r();Object.keys(t).forEach(function(e){var r;o["date"===(r=n.$utils().p(e))?"day":r]=t[e]});var s=o.day||(o.year||o.month>=0?1:a.date()),l=o.year||a.year(),u=o.month>=0?o.month:o.year||o.day?0:a.month(),c=o.hour||0,d=o.minute||0,f=o.second||0,p=o.millisecond||0;return i?new Date(Date.UTC(l,u,s,c,d,f,p)):new Date(l,u,s,c,d,f,p)}return t},o=n.parse;n.parse=function(e){e.date=i.bind(this)(e),o.bind(this)(e)};var a=n.set,s=n.add,l=n.subtract,u=function(e,t,r,n){void 0===n&&(n=1);var i=Object.keys(t),o=this;return i.forEach(function(r){o=e.bind(o)(t[r]*n,r)}),o};n.set=function(e,t){return t=void 0===t?e:t,"Object"===e.constructor.name?u.bind(this)(function(e,t){return a.bind(this)(t,e)},t,e):a.bind(this)(e,t)},n.add=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t):s.bind(this)(e,t)},n.subtract=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t,-1):l.bind(this)(e,t)}}},83826(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,o){var a=i.prototype;o.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},a.utc=function(t){var r=o(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.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=a.utcOffset;a.utcOffset=function(n,i){var o=this.$utils().u;if(o(n))return this.$u?0:o(this.$offset)?u.call(this):this.$offset;if("string"==typeof n&&null===(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],o=i[0],a=60*i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(n)))return this;var a=16>=Math.abs(n)?60*n:n,s=this;if(i)return s.$offset=a,s.$u=0===n,s;if(0!==n){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var c=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(e,t,r){if(e&&this.$u===e.$u)return f.call(this,e,t,r);var n=this.local(),i=o(e).local();return f.call(n,i,t,r)}}}()},16767(e,t,r){!function(t){"use strict";var n=r(26974);function i(e){return function(t,r){return"object"==typeof t&&(r=t,t=null),null==t&&(t=new Date().toString()),r||(r={}),e.call(this,t,r)}}var o=e.exports={generate:i(function(e,t){return new n(e,t)})};t&&(t.fn.geopattern=i(function(e,r){return this.each(function(){var n=t(this).attr("data-title-sha");n&&(r=t.extend({hash:n},r));var i=o.generate(e,r);t(this).css("background-image",i.toDataUrl())})}))}("u">typeof jQuery?jQuery:null)},82467(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,r,n){return t+t+r+r+n+n});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,r,n=e.r,i=e.g,o=e.b,a=Math.max(n/=255,i/=255,o/=255),s=Math.min(n,i,o),l=(a+s)/2;if(a===s)t=r=0;else{var u=a-s;switch(r=l>.5?u/(2-a-s):u/(a+s),a){case n:t=(i-o)/u+6*(i<o);break;case i:t=(o-n)/u+2;break;case o:t=(n-i)/u+4}t/=6}return{h:t,s:r,l:l}},hsl2rgb:function(e){function t(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var r,n,i,o=e.h,a=e.s,s=e.l;if(0===a)r=n=i=s;else{var l=s<.5?s*(1+a):s+a-s*a,u=2*s-l;r=t(u,l,o+1/3),n=t(u,l,o),i=t(u,l,o-1/3)}return{r:Math.round(255*r),g:Math.round(255*n),b:Math.round(255*i)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},26974(e,t,r){"use strict";var n=r(97804),i=r(82467),o=r(66743),a=r(28502),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,r){return parseInt(e.substr(t,r||1),16)}function d(e,t,r,n,i){return(parseFloat(e)-t)*(i-n)/(r-t)+n}function f(e){return e%2==0?"#ddd":"#222"}function p(e){return d(e,0,15,.02,.15)}var h=e.exports=function(e,t){return this.opts=n({},s,t),this.hash=t.hash||o(e),this.svg=new a,this.generateBackground(),this.generatePattern(),this};function m(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function y(e){return[0,0,e,e,0,e,0,0].join(",")}function g(e,t,r,n,i){var o=y(n),a=p(i[0]),s=f(i[0]),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a,fill:s};e.polyline(o,l).transform({translate:[t+n,r],scale:[-1,1]}),e.polyline(o,l).transform({translate:[t+n,r+2*n],scale:[1,-1]}),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a=p(i[1]),fill:s=f(i[1])},e.polyline(o,l).transform({translate:[t+n,r+2*n],scale:[-1,-1]}),e.polyline(o,l).transform({translate:[t+n,r],scale:[1,1]})}function b(e,t,r,n,i){var o=p(i),a=f(i),s=y(n),l={stroke:u,"stroke-opacity":.02,"fill-opacity":o,fill:a};e.polyline(s,l).transform({translate:[t,r+n],scale:[1,-1]}),e.polyline(s,l).transform({translate:[t+2*n,r+n],scale:[-1,-1]}),e.polyline(s,l).transform({translate:[t,r+n],scale:[1,1]}),e.polyline(s,l).transform({translate:[t+2*n,r+n],scale:[-1,1]})}h.prototype.toSvg=function(){return this.svg.toString()},h.prototype.toString=function(){return this.toSvg()},h.prototype.toBase64=function(){var e=this.toSvg();return"u">typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},h.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},h.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},h.prototype.generateBackground=function(){var e,t,r,n;this.opts.color?r=i.hex2rgb(this.opts.color):(t=d(c(this.hash,14,3),0,4095,0,359),n=c(this.hash,17),(e=i.rgb2hsl(i.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,n%2==0?e.s=Math.min(1,(100*e.s+n)/100):e.s=Math.max(0,(100*e.s-n)/100),r=i.hsl2rgb(e)),this.color=i.rgb2hex(r),this.svg.rect(0,0,"100%","100%",{fill:i.rgb2rgbString(r)})},h.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)]()},h.prototype.geoHexagons=function(){var e,t,r,n,i,o,a,s,l,h=d(c(this.hash,0),0,15,8,60),m=h*Math.sqrt(3),y=2*h,g=(s=h/2,[0,l=Math.sin(60*Math.PI/180)*h,s,0,s+h,0,2*h,l,s+h,2*l,s,2*l,0,l].join(","));for(this.svg.setWidth(3*y+3*h),this.svg.setHeight(6*m),t=0,a=0;a<6;a++)for(o=0;o<6;o++)i=c(this.hash,t),e=o%2==0?a*m:a*m+m/2,r=p(i),n={fill:f(i),"fill-opacity":r,stroke:u,"stroke-opacity":.02},this.svg.polyline(g,n).transform({translate:[o*h*1.5-y/2,e-m/2]}),0===o&&this.svg.polyline(g,n).transform({translate:[6*h*1.5-y/2,e-m/2]}),0===a&&(e=o%2==0?6*m:6*m+m/2,this.svg.polyline(g,n).transform({translate:[o*h*1.5-y/2,e-m/2]})),0===o&&0===a&&this.svg.polyline(g,n).transform({translate:[6*h*1.5-y/2,5*m+m/2]}),t++},h.prototype.geoSineWaves=function(){var e,t,r,n,i,o,a,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++)r=p(o=c(this.hash,t)),e=f(o),a=s/4*.7,i={fill:"none",stroke:e,opacity:r,"stroke-width":""+u+"px"},n="M0 "+l+" C "+a+" 0, "+(s/2-a)+" 0, "+s/2+" "+l+" S "+(s-a)+" "+2*l+", "+s+" "+l+" S "+(1.5*s-a)+" 0, "+1.5*s+", "+l,this.svg.path(n,i).transform({translate:[-s/4,u*t-1.5*l]}),this.svg.path(n,i).transform({translate:[-s/4,u*t-1.5*l+36*u]})},h.prototype.geoChevrons=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,30,80),l=d(c(this.hash,0),0,15,30,80),h=(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,a=0;a<6;a++)for(o=0;o<6;o++)r=p(i=c(this.hash,t)),n={stroke:u,"stroke-opacity":.02,fill:f(i),"fill-opacity":r,"stroke-width":1},this.svg.group(n).transform({translate:[o*s,a*l*.66-l/2]}).polyline(h).end(),0===a&&this.svg.group(n).transform({translate:[o*s,6*l*.66-l/2]}).polyline(h).end(),t+=1},h.prototype.geoPlusSigns=function(){var e,t,r,n,i,o,a,s,l=d(c(this.hash,0),0,15,10,25),h=3*l,y=m(l);for(this.svg.setWidth(12*l),this.svg.setHeight(12*l),r=0,s=0;s<6;s++)for(a=0;a<6;a++)n=p(o=c(this.hash,r)),t=f(o),e=+(s%2!=0),i={fill:t,stroke:u,"stroke-opacity":.02,"fill-opacity":n},this.svg.group(i).transform({translate:[a*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===a&&this.svg.group(i).transform({translate:[4*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===s&&this.svg.group(i).transform({translate:[a*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),0===a&&0===s&&this.svg.group(i).transform({translate:[4*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),r++},h.prototype.geoXes=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,25),l=m(s),u=3*s*.943;for(this.svg.setWidth(3*u),this.svg.setHeight(3*u),t=0,a=0;a<6;a++)for(o=0;o<6;o++)r=p(i=c(this.hash,t)),e=o%2==0?a*u-.5*u:a*u-.5*u+u/4,n={fill:f(i),opacity:r},this.svg.group(n).transform({translate:[o*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&this.svg.group(n).transform({translate:[6*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===a&&(e=o%2==0?6*u-u/2:6*u-u/2+u/4,this.svg.group(n).transform({translate:[o*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end()),5===a&&this.svg.group(n).transform({translate:[o*u/2-u/2,e-11*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&0===a&&this.svg.group(n).transform({translate:[6*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),t++},h.prototype.geoOverlappingCircles=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=p(n=c(this.hash,e)),r={fill:f(n),opacity:t},this.svg.circle(i*a,o*a,a,r),0===i&&this.svg.circle(6*a,o*a,a,r),0===o&&this.svg.circle(i*a,6*a,a,r),0===i&&0===o&&this.svg.circle(6*a,6*a,a,r),e++},h.prototype.geoOctogons=function(){var e,t,r,n,i,o,a,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),r=0,a=0;a<6;a++)for(o=0;o<6;o++)n=p(i=c(this.hash,r)),t=f(i),this.svg.polyline(l,{fill:t,"fill-opacity":n,stroke:u,"stroke-opacity":.02}).transform({translate:[o*s,a*s]}),r+=1},h.prototype.geoSquares=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),t=0,o=0;o<6;o++)for(i=0;i<6;i++)r=p(n=c(this.hash,t)),e=f(n),this.svg.rect(i*a,o*a,a,a,{fill:e,"fill-opacity":r,stroke:u,"stroke-opacity":.02}),t+=1},h.prototype.geoConcentricCircles=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60),s=a/5;for(this.svg.setWidth((a+s)*6),this.svg.setHeight((a+s)*6),t=0,o=0;o<6;o++)for(i=0;i<6;i++)r=p(n=c(this.hash,t)),e=f(n),this.svg.circle(i*a+i*s+(a+s)/2,o*a+o*s+(a+s)/2,a/2,{fill:"none",stroke:e,opacity:r,"stroke-width":s+"px"}),r=p(n=c(this.hash,39-t)),e=f(n),this.svg.circle(i*a+i*s+(a+s)/2,o*a+o*s+(a+s)/2,a/4,{fill:e,"fill-opacity":r}),t+=1},h.prototype.geoOverlappingRings=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60),s=a/4;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=p(n=c(this.hash,e)),r={fill:"none",stroke:f(n),opacity:t,"stroke-width":s+"px"},this.svg.circle(i*a,o*a,a-s/2,r),0===i&&this.svg.circle(6*a,o*a,a-s/2,r),0===o&&this.svg.circle(i*a,6*a,a-s/2,r),0===i&&0===o&&this.svg.circle(6*a,6*a,a-s/2,r),e+=1},h.prototype.geoTriangles=function(){var e,t,r,n,i,o,a,s,l=d(c(this.hash,0),0,15,15,80),h=l/2*Math.sqrt(3),m=[s=l/2,0,l,h,0,h,s,0].join(",");for(this.svg.setWidth(3*l),this.svg.setHeight(6*h),e=0,a=0;a<6;a++)for(o=0;o<6;o++)t=p(i=c(this.hash,e)),n={fill:f(i),"fill-opacity":t,stroke:u,"stroke-opacity":.02},r=a%2==0?180*(o%2==0):180*(o%2!=0),this.svg.polyline(m,n).transform({translate:[o*l*.5-l/2,h*a],rotate:[r,l/2,h/2]}),0===o&&this.svg.polyline(m,n).transform({translate:[6*l*.5-l/2,h*a],rotate:[r,l/2,h/2]}),e+=1},h.prototype.geoDiamonds=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,50),l=d(c(this.hash,1),0,15,10,50),h=[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,a=0;a<6;a++)for(o=0;o<6;o++)r=p(i=c(this.hash,t)),n={fill:f(i),"fill-opacity":r,stroke:u,"stroke-opacity":.02},e=a%2==0?0:s/2,this.svg.polyline(h,n).transform({translate:[o*s-s/2+e,l/2*a-l/2]}),0===o&&this.svg.polyline(h,n).transform({translate:[6*s-s/2+e,l/2*a-l/2]}),0===a&&this.svg.polyline(h,n).transform({translate:[o*s-s/2+e,l/2*6-l/2]}),0===o&&0===a&&this.svg.polyline(h,n).transform({translate:[6*s-s/2+e,l/2*6-l/2]}),t+=1},h.prototype.geoNestedSquares=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,4,12),s=7*a;for(this.svg.setWidth((s+a)*6+6*a),this.svg.setHeight((s+a)*6+6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=p(n=c(this.hash,e)),r={fill:"none",stroke:f(n),opacity:t,"stroke-width":a+"px"},this.svg.rect(i*s+i*a*2+a/2,o*s+o*a*2+a/2,s,s,r),t=p(n=c(this.hash,39-e)),r={fill:"none",stroke:f(n),opacity:t,"stroke-width":a+"px"},this.svg.rect(i*s+i*a*2+a/2+2*a,o*s+o*a*2+a/2+2*a,3*a,3*a,r),e+=1},h.prototype.geoMosaicSquares=function(){var e,t,r,n=d(c(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*n),this.svg.setHeight(8*n),e=0,r=0;r<4;r++)for(t=0;t<4;t++)t%2==0?r%2==0?b(this.svg,t*n*2,r*n*2,n,c(this.hash,e)):g(this.svg,t*n*2,r*n*2,n,[c(this.hash,e),c(this.hash,e+1)]):r%2==0?g(this.svg,t*n*2,r*n*2,n,[c(this.hash,e),c(this.hash,e+1)]):b(this.svg,t*n*2,r*n*2,n,c(this.hash,e)),e+=1},h.prototype.geoPlaid=function(){var e,t,r,n,i,o,a=0,s=0;for(t=0;t<36;)a+=c(this.hash,t)+5,r=p(o=c(this.hash,t+1)),e=f(o),n=o+5,this.svg.rect(0,a,"100%",n,{opacity:r,fill:e}),a+=n,t+=2;for(t=0;t<36;)s+=c(this.hash,t)+5,r=p(o=c(this.hash,t+1)),e=f(o),i=o+5,this.svg.rect(s,0,i,"100%",{opacity:r,fill:e}),s+=i,t+=2;this.svg.setWidth(s),this.svg.setHeight(a)},h.prototype.geoTessellation=function(){var e,t,r,n,i=d(c(this.hash,0),0,15,5,40),o=i*Math.sqrt(3),a=2*i,s=i/2*Math.sqrt(3),l=[0,0,s,i/2,0,i,0,0].join(","),h=3*i+2*s,m=2*o+2*i;for(this.svg.setWidth(h),this.svg.setHeight(m),e=0;e<20;e++)switch(t=p(n=c(this.hash,e)),r={stroke:u,"stroke-opacity":.02,fill:f(n),"fill-opacity":t,"stroke-width":1},e){case 0:this.svg.rect(-i/2,-i/2,i,i,r),this.svg.rect(h-i/2,-i/2,i,i,r),this.svg.rect(-i/2,m-i/2,i,i,r),this.svg.rect(h-i/2,m-i/2,i,i,r);break;case 1:this.svg.rect(a/2+s,o/2,i,i,r);break;case 2:this.svg.rect(-i/2,m/2-i/2,i,i,r),this.svg.rect(h-i/2,m/2-i/2,i,i,r);break;case 3:this.svg.rect(a/2+s,1.5*o+i,i,i,r);break;case 4:this.svg.polyline(l,r).transform({translate:[i/2,-i/2],rotate:[0,i/2,s/2]}),this.svg.polyline(l,r).transform({translate:[i/2,m- -i/2],rotate:[0,i/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(l,r).transform({translate:[h-i/2,-i/2],rotate:[0,i/2,s/2],scale:[-1,1]}),this.svg.polyline(l,r).transform({translate:[h-i/2,m+i/2],rotate:[0,i/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(l,r).transform({translate:[h/2+i/2,o/2]});break;case 7:this.svg.polyline(l,r).transform({translate:[h-h/2-i/2,o/2],scale:[-1,1]});break;case 8:this.svg.polyline(l,r).transform({translate:[h/2+i/2,m-o/2],scale:[1,-1]});break;case 9:this.svg.polyline(l,r).transform({translate:[h-h/2-i/2,m-o/2],scale:[-1,-1]});break;case 10:this.svg.polyline(l,r).transform({translate:[i/2,m/2-i/2]});break;case 11:this.svg.polyline(l,r).transform({translate:[h-i/2,m/2-i/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,i/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[-h+i/2,i/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 15:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[-h+i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 16:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,-m+m/2-i/2-i],rotate:[30,0,i]});break;case 17:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[-h+i/2,-m+m/2-i/2-i],rotate:[30,0,i]});break;case 18:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,-m+i/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[-h+i/2,-m+i/2],rotate:[-30,0,0]})}}},66743(e){"use strict";function t(){var e=0x67452301,t=0xefcdab89,r=0x98badcfe,n=0x10325476,i=0xc3d2e1f0,o=new Uint32Array(80),a=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,f=t,p=r,h=n,m=i;for(u=0;u<80;u++){u<20?(s=h^f&(p^h),l=0x5a827999):u<40?(s=f^p^h,l=0x6ed9eba1):u<60?(s=f&p|h&(f|p),l=0x8f1bbcdc):(s=f^p^h,l=0xca62c1d6);var y=(d<<5|d>>>27)+s+m+l+(0|o[u]);m=h,h=p,p=f<<30|f>>>2,f=d,d=y}for(u=0,e=e+d|0,t=t+f|0,r=r+p|0,n=n+h|0,i=i+m|0,a=0;u<16;u++)o[u]=0}function c(e){o[a]|=(255&e)<<s,s?s-=8:(a++,s=24),16===a&&u()}function d(e){for(var t="",r=28;r>=0;r-=4)t+=(e>>r&15).toString(16);return t}return{update:function(e){if("string"==typeof e){var t=e.length;l+=8*t;for(var r=0;r<t;r++)c(e.charCodeAt(r));return}var n=e.length;l+=8*n;for(var i=0;i<n;i++)c(e[i])},digest:function(){c(128),(a>14||14===a&&s<24)&&u(),a=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(r)+d(n)+d(i)}}}e.exports=function(e){if(void 0===e)return t();var r=t();return r.update(e),r.digest()}},28502(e,t,r){"use strict";var n=r(97804),i=r(16541);function o(){return this.width=100,this.height=100,this.svg=i("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(r){e.setAttribute(r,t[r])})},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,r,o,a){var s=this;if(Array.isArray(e))return e.forEach(function(e){s.rect.apply(s,e.concat(a))}),this;var l=i("rect");return this.currentContext().appendChild(l),this.setAttributes(l,n({x:e,y:t,width:r,height:o},a)),this},o.prototype.circle=function(e,t,r,o){var a=i("circle");return this.currentContext().appendChild(a),this.setAttributes(a,n({cx:e,cy:t,r:r},o)),this},o.prototype.path=function(e,t){var r=i("path");return this.currentContext().appendChild(r),this.setAttributes(r,n({d:e},t)),this},o.prototype.polyline=function(e,t){var r=this;if(Array.isArray(e))return e.forEach(function(e){r.polyline(e,t)}),this;var o=i("polyline");return this.currentContext().appendChild(o),this.setAttributes(o,n({points:e},t)),this},o.prototype.group=function(e){var t=i("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,n({},e)),this}},16541(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("")}},97804(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(e){if(!e||"[object Object]"!==r.call(e)||e.nodeType||e.setInterval)return!1;var n,i=t.call(e,"constructor"),o=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(n in e);return void 0===n||t.call(e,n)}e.exports=function e(){var t,r,i,o,a,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(r in t)i=l[r],l!==(o=t[r])&&(d&&o&&(n(o)||(a=Array.isArray(o)))?(a?(a=!1,s=i&&Array.isArray(i)?i:[]):s=i&&n(i)?i:{},l[r]=e(d,s,o)):void 0!==o&&(l[r]=o));return l}},48067(e,t){"use strict";t.pathToRegexp=function(e,t={}){let{delimiter:u="/",end:c=!0,sensitive:d=!1,trailing:f=!0}=t,p=[],h=[];for(let c of function e(t,r){if(Array.isArray(t))for(let n of t)e(n,r);else r.push(t);return r}(e,[])){let e="object"==typeof c?c:function(e,t={}){let{encodePath:a=r}=t,u=[...e],c=[],d=0,f=0;function p(){let t="";if(n.test(u[d]))do t+=u[d++];while(i.test(u[d]));else if('"'===u[d]){let r=d;for(;d++<u.length;){if('"'===u[d]){d++,r=0;break}"\\"===u[d]&&d++,t+=u[d]}if(r)throw new l(`Unterminated quote at index ${r}`,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(r){let n=[];for(;;){let i=c[f++];if(i.type===r)break;if("char"===i.type||"escape"===i.type){let e=i.value,t=c[f];for(;"char"===t.type||"escape"===t.type;)e+=t.value,t=c[++f];n.push({type:"text",value:a(e)});continue}if("param"===i.type||"wildcard"===i.type){n.push({type:i.type,name:i.value});continue}if("{"===i.type){n.push({type:"group",tokens:t("}")});continue}throw new l(`Unexpected ${i.type} at index ${i.index}, expected ${r}`,e)}return n}("end"),e)}(c,t);for(let t of function* e(t,r,n){if(r===t.length)return yield n;let i=t[r];if("group"===i.type)for(let o of e(i.tokens,0,n.slice()))yield*e(t,r+1,o);else n.push(i);yield*e(t,r+1,n)}(e.tokens,0,[]))h.push(function(e,t,r,n){let i="",o="",s=!0;for(let d of e){if("text"===d.type){i+=a(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}`,n);"param"===d.type?i+=`(${u=t,(c=s?"":o).length<2?u.length<2?`[^${a(u+c)}]`:`(?:(?!${a(u)})[^${a(c)}])`:u.length<2?`(?:(?!${a(c)})[^${a(u)}])`:`(?:(?!${a(c)}|${a(u)})[\\s\\S])`}+)`:i+="([\\s\\S]+)",r.push(d),o="",s=!1;continue}}return i}(t,u,p,e.originalPath))}let m=`^(?:${h.join("|")})`;return f&&(m+=`(?:${a(u)}$)?`),{regexp:new RegExp(m+=c?"$":`(?=${a(u)}|$)`,d?"":"i"),keys:p}};let r=e=>e,n=/^[$_\p{ID_Start}]$/u,i=/^[$\u200c\u200d\p{ID_Continue}]$/u,o={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function a(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class s{constructor(e,t){this.tokens=e,this.originalPath=t}}class l extends TypeError{constructor(e,t){let r=e;t&&(r+=`: ${t}`),super(r+="; visit https://git.new/pathToRegexpError for info"),this.originalPath=t}}},5338(e,t,r){"use strict";var n=r(54575);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},49850(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(83207);t.AsyncSubject=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return i(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),a.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),a.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(o.Subject)},466(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(16967);t.BehaviorSubject=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(!this.closed)return this._value;throw new a.ObjectUnsubscribedError},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(o.Subject)},54470(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.InnerSubscriber=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(r(31396).Subscriber)},76765(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(80453),o=r(97795),a=r(21576);(n=t.NotificationKind||(t.NotificationKind={})).NEXT="N",n.ERROR="E",n.COMPLETE="C",t.Notification=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,r){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return r&&r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return o.of(this.value);case"E":return a.throwError(this.error);case"C":return i.empty()}throw Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},52515(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(54487),i=r(25158),o=r(86676),a=r(8173),s=r(3344);function l(e){if(e||(e=s.config.Promise||Promise),!e)throw Error("no Promise impl found");return e}t.Observable=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,o=i.toSubscriber(e,t,r);if(n?o.add(n.call(o,this.source)):o.add(this.source||s.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),s.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),n.canReportError(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=l(t))(function(t,n){var i;i=r.subscribe(function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}},n,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:a.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}()},32544(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3344),i=r(34163);t.empty={closed:!0,next:function(e){},error:function(e){if(n.config.useDeprecatedSynchronousErrorHandling)throw e;i.hostReportError(e)},complete:function(){}}},15905(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(r(31396).Subscriber)},2173(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(55677),s=r(83207),l=r(25495),u=r(16967),c=r(93601);t.ReplaySubject=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0);var i=e.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=r<1?1:r,r===1/0?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return i(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var r=this._events;r.push(t),r.length>this._bufferSize&&r.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new d(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=n.length;if(this.closed)throw new u.ObjectUnsubscribedError;if(this.isStopped||this.hasError?t=s.Subscription.EMPTY:(this.observers.push(e),t=new c.SubjectSubscription(this,e)),i&&e.add(e=new l.ObserveOnSubscriber(e,i)),r)for(var a=0;a<o&&!e.closed;a++)e.next(n[a]);else for(var a=0;a<o&&!e.closed;a++)e.next(n[a].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||a.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(e-n[o].time<r);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&n.splice(0,o),n},t}(o.Subject);var d=function(e,t){this.time=e,this.value=t}},83849(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=function(){function e(t,r){void 0===r&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(r,t)},e.now=function(){return Date.now()},e}()},12888(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(52515),a=r(31396),s=r(83207),l=r(16967),u=r(93601),c=r(4421),d=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return i(t,e),t}(a.Subscriber);t.SubjectSubscriber=d;var f=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype[c.rxSubscriber]=function(){return new d(this)},t.prototype.lift=function(e){var t=new p(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new l.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(!this.closed)return e.prototype._trySubscribe.call(this,t);throw new l.ObjectUnsubscribedError},t.prototype._subscribe=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(e.complete(),s.Subscription.EMPTY):(this.observers.push(e),new u.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new o.Observable;return e.source=this,e},t.create=function(e,t){return new p(e,t)},t}(o.Observable);t.Subject=f;var p=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):s.Subscription.EMPTY},t}(f);t.AnonymousSubject=p},93601(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SubjectSubscription=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return i(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(r(83207).Subscription)},31396(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83385),a=r(32544),s=r(83207),l=r(4421),u=r(3344),c=r(34163),d=function(e){function t(r,n,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=a.empty;break;case 1:if(!r){o.destination=a.empty;break}if("object"==typeof r){r instanceof t?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new f(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new f(o,r,n,i)}return o}return i(t,e),t.prototype[l.rxSubscriber]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.Subscription);t.Subscriber=d;var f=function(e){function t(t,r,n,i){var s,l=e.call(this)||this;l._parentSubscriber=t;var u=l;return o.isFunction(r)?s=r:r&&(s=r.next,n=r.error,i=r.complete,r!==a.empty&&(u=Object.create(r),o.isFunction(u.unsubscribe)&&l.add(u.unsubscribe.bind(u)),u.unsubscribe=l.unsubscribe.bind(l))),l._context=u,l._next=s,l._error=n,l._complete=i,l}return i(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=u.config.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?this.__tryOrSetError(t,this._error,e):this.__tryOrUnsub(this._error,e),this.unsubscribe();else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):c.hostReportError(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;c.hostReportError(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,r):this.__tryOrUnsub(r),this.unsubscribe()}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.config.useDeprecatedSynchronousErrorHandling)throw e;c.hostReportError(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!u.config.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{t.call(this._context,r)}catch(t){if(u.config.useDeprecatedSynchronousErrorHandling)return e.syncErrorValue=t,e.syncErrorThrown=!0,!0;return c.hostReportError(t),!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(d);t.SafeSubscriber=f},83207(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34728),i=r(60194),o=r(83385),a=r(61245);function s(e){return e.reduce(function(e,t){return e.concat(t instanceof a.UnsubscriptionError?t.errors:t)},[])}t.Subscription=function(){var e;function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){if(!this.closed){var e,r=this._parentOrParents,l=this._ctorUnsubscribe,u=this._unsubscribe,c=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var d=0;d<r.length;++d)r[d].remove(this);if(o.isFunction(u)){l&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){e=t instanceof a.UnsubscriptionError?s(t.errors):[t]}}if(n.isArray(c))for(var d=-1,f=c.length;++d<f;){var p=c[d];if(i.isObject(p))try{p.unsubscribe()}catch(t){e=e||[],t instanceof a.UnsubscriptionError?e=e.concat(s(t.errors)):e.push(t)}}if(e)throw new a.UnsubscriptionError(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},(e=new t).closed=!0,t.EMPTY=e,t}()},3344(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=!1;t.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):r&&console.log("RxJS: Back to a better error behavior. Thank you. <3"),r=value},get useDeprecatedSynchronousErrorHandling(){return r}}},64398(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(52515),s=r(87092);t.SimpleInnerSubscriber=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(o.Subscriber),t.ComplexInnerSubscriber=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(o.Subscriber),t.SimpleOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(o.Subscriber),t.ComplexOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,r,n){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(o.Subscriber),t.innerSubscribe=function(e,t){var r;if(!t.closed){if(e instanceof a.Observable)return e.subscribe(t);try{r=s.subscribeTo(e)(t)}catch(e){t.error(e)}return r}}},52871(e,t,r){"use strict";var n,i,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=r(12888),s=r(52515),l=r(31396),u=r(83207),c=r(46888),d=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return o(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return!e&&(this._isComplete=!1,(e=this._connection=new u.Subscription).add(this.source.subscribe(new f(this.getSubject(),this))),e.closed&&(this._connection=null,e=u.Subscription.EMPTY)),e},t.prototype.refCount=function(){return c.refCount()(this)},t}(s.Observable);t.ConnectableObservable=d,t.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(i=d.prototype)._subscribe},_isComplete:{value:i._isComplete,writable:!0},getSubject:{value:i.getSubject},connect:{value:i.connect},refCount:{value:i.refCount}};var f=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return o(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(a.SubjectSubscriber);(function(e){this.connectable=e}).prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new p(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i};var p=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return o(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var r=this.connection,n=e._connection;this.connection=null,n&&(!r||n===r)&&n.unsubscribe()},t}(l.Subscriber)},98072(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(52515),a=r(52745),s=r(15390);t.SubscribeOnObservable=function(e){function t(t,r,n){void 0===r&&(r=0),void 0===n&&(n=a.asap);var i=e.call(this)||this;return i.source=t,i.delayTime=r,i.scheduler=n,(!s.isNumeric(r)||r<0)&&(i.delayTime=0),n&&"function"==typeof n.schedule||(i.scheduler=a.asap),i}return i(t,e),t.create=function(e,r,n){return void 0===r&&(r=0),void 0===n&&(n=a.asap),new t(e,r,n)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return this.add(t.subscribe(r))},t.prototype._subscribe=function(e){var r=this.delayTime,n=this.source;return this.scheduler.schedule(t.dispatch,r,{source:n,subscriber:e})},t}(o.Observable)},50278(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(18244),a=r(34728),s=r(15905),l=r(47849),u=r(35853),c={};t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0,n=void 0;return o.isScheduler(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&a.isArray(e[0])&&(e=e[0]),u.fromArray(e,n).lift(new d(r))};var d=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.resultSelector))},e}();t.CombineLatestOperator=d;var f=function(e){function t(t,r){var n=e.call(this,t)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return i(t,e),t.prototype._next=function(e){this.values.push(c),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var r=0;r<t;r++){var n=e[r];this.add(l.subscribeToResult(this,n,void 0,r))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r){var n=this.values,i=n[r],o=this.toRespond?i===c?--this.toRespond:this.toRespond:0;n[r]=t,0===o&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.OuterSubscriber);t.CombineLatestSubscriber=f},95434(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(97795),i=r(6345);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i.concatAll()(n.of.apply(void 0,e))}},93180(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(24098),o=r(80453);t.defer=function(e){return new n.Observable(function(t){var r;try{r=e()}catch(e){t.error(e);return}return(r?i.from(r):o.empty()).subscribe(t)})}},80453(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515);t.EMPTY=new n.Observable(function(e){return e.complete()}),t.empty=function(e){var r;return e?(r=e,new n.Observable(function(e){return r.schedule(function(){return e.complete()})})):t.EMPTY}},24098(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(87092),o=r(17315);t.from=function(e,t){return t?o.scheduled(e,t):e instanceof n.Observable?e:new n.Observable(i.subscribeTo(e))}},35853(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(70499),o=r(68822);t.fromArray=function(e,t){return t?o.scheduleArray(e,t):new n.Observable(i.subscribeToArray(e))}},5776(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(18244),o=r(49287),a=r(35853);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=1/0,s=null,l=e[e.length-1];return(i.isScheduler(l)?(s=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof l&&(r=e.pop()),null===s&&1===e.length&&e[0]instanceof n.Observable)?e[0]:o.mergeAll(r)(a.fromArray(e,s))}},97795(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(18244),i=r(35853),o=r(68822);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return n.isScheduler(r)?(e.pop(),o.scheduleArray(e,r)):i.fromArray(e)}},23827(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(34728),a=r(35853),s=r(15905),l=r(47849);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length)if(!o.isArray(e[0]))return e[0];else e=e[0];return a.fromArray(e,void 0).lift(new u)};var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new c(e))},e}();t.RaceOperator=u;var c=function(e){function t(t){var r=e.call(this,t)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return i(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var r=0;r<t&&!this.hasFirst;r++){var n=e[r],i=l.subscribeToResult(this,n,void 0,r);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},t.prototype.notifyNext=function(e,t,r){if(!this.hasFirst){this.hasFirst=!0;for(var n=0;n<this.subscriptions.length;n++)if(n!==r){var i=this.subscriptions[n];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(t)},t}(s.OuterSubscriber);t.RaceSubscriber=c},21576(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515);function i(e){var t=e.error;e.subscriber.error(t)}t.throwError=function(e,t){return new n.Observable(t?function(r){return t.schedule(i,0,{error:e,subscriber:r})}:function(t){return t.error(e)})}},24529(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(25190),o=r(15390),a=r(18244);function s(e){var t=e.index,r=e.period,n=e.subscriber;if(n.next(t),!n.closed){if(-1===r)return n.complete();e.index=t+1,this.schedule(e,r)}}t.timer=function(e,t,r){void 0===e&&(e=0);var l=-1;return o.isNumeric(t)?l=1>Number(t)&&1||Number(t):a.isScheduler(t)&&(r=t),a.isScheduler(r)||(r=i.async),new n.Observable(function(t){var n=o.isNumeric(e)?e:e-r.now();return r.schedule(s,n,{index:0,period:l,subscriber:t})})}},70887(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(35853),a=r(34728),s=r(31396),l=r(57211),u=r(64398);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return"function"==typeof r&&e.pop(),o.fromArray(e,void 0).lift(new c(r))};var c=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.resultSelector))},e}();t.ZipOperator=c;var d=function(e){function t(t,r,n){void 0===n&&(n=Object.create(null));var i=e.call(this,t)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return i(t,e),t.prototype._next=function(e){var t=this.iterators;a.isArray(e)?t.push(new p(e)):"function"==typeof e[l.iterator]?t.push(new f(e[l.iterator]())):t.push(new h(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0===t)return void this.destination.complete();this.active=t;for(var r=0;r<t;r++){var n=e[r];n.stillUnsubscribed?this.destination.add(n.subscribe()):this.active--}},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,r=this.destination,n=0;n<t;n++){var i=e[n];if("function"==typeof i.hasValue&&!i.hasValue())return}for(var o=!1,a=[],n=0;n<t;n++){var i=e[n],s=i.next();if(i.hasCompleted()&&(o=!0),s.done)return void r.complete();a.push(s.value)}this.resultSelector?this._tryresultSelector(a):r.next(a),o&&r.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.Subscriber);t.ZipSubscriber=d;var f=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},e}(),p=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(e){var t=this.index++,r=this.array;return t<this.length?{value:r[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),h=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return i(t,e),t.prototype[l.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return u.innerSubscribe(this.observable,new u.SimpleInnerSubscriber(this))},t}(u.SimpleOuterSubscriber)},38461(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.audit=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var r=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,r=this.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(o.SimpleOuterSubscriber)},32392(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25190),i=r(38461),o=r(24529);t.auditTime=function(e,t){return void 0===t&&(t=n.async),i.audit(function(){return o.timer(e,t)})}},37954(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.buffer=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.closingNotifier))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.buffer=[],n.add(o.innerSubscribe(r,new o.SimpleInnerSubscriber(n))),n}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(o.SimpleOuterSubscriber)},30647(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.bufferCount=function(e,t){return void 0===t&&(t=null),function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,t&&e!==t?this.subscriberClass=l:this.subscriberClass=s}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.bufferSize=r,n.buffer=[],n}return i(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(o.Subscriber),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return i(t,e),t.prototype._next=function(e){var t=this.bufferSize,r=this.startBufferEvery,n=this.buffers,i=this.count;this.count++,i%r==0&&n.push([]);for(var o=n.length;o--;){var a=n[o];a.push(e),a.length===t&&(n.splice(o,1),this.destination.next(a))}},t.prototype._complete=function(){for(var t=this.buffers,r=this.destination;t.length>0;){var n=t.shift();n.length>0&&r.next(n)}e.prototype._complete.call(this)},t}(o.Subscriber)},16327(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(25190),a=r(31396),s=r(18244);t.bufferTime=function(e){var t=arguments.length,r=o.async;s.isScheduler(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],t--);var n=null;t>=2&&(n=arguments[1]);var i=1/0;return t>=3&&(i=arguments[2]),function(t){return t.lift(new l(e,n,i,r))}};var l=function(){function e(e,t,r,n){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){this.buffer=[]},c=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;a.bufferTimeSpan=r,a.bufferCreationInterval=n,a.maxBufferSize=i,a.scheduler=o,a.contexts=[];var s=a.openContext();return a.timespanOnly=null==n||n<0,a.timespanOnly?a.add(s.closeAction=o.schedule(d,r,{subscriber:a,context:s,bufferTimeSpan:r})):(a.add(s.closeAction=o.schedule(p,r,{subscriber:a,context:s})),a.add(o.schedule(f,n,{bufferTimeSpan:r,bufferCreationInterval:n,subscriber:a,scheduler:o}))),a}return i(t,e),t.prototype._next=function(e){for(var t,r=this.contexts,n=r.length,i=0;i<n;i++){var o=r[i],a=o.buffer;a.push(e),a.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,r=this.destination;t.length>0;){var n=t.shift();r.next(n.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:e,bufferTimeSpan:r};this.add(e.closeAction=this.scheduler.schedule(d,r,n))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(a.Subscriber);function d(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function f(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openContext();n.closed||(n.add(o.closeAction=i.schedule(p,r,{subscriber:n,context:o})),this.schedule(e,t))}function p(e){var t=e.subscriber,r=e.context;t.closeContext(r)}},46786(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83207),a=r(47849),s=r(15905);t.bufferToggle=function(e,t){return function(r){return r.lift(new l(e,t))}};var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.closingSelector=n,i.contexts=[],i.add(a.subscribeToResult(i,r)),i}return i(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,n=0;n<r;n++)t[n].buffer.push(e)},t.prototype._error=function(t){for(var r=this.contexts;r.length>0;){var n=r.shift();n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var r=t.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var r=e.buffer,n=e.subscription;this.destination.next(r),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,r=new o.Subscription,n={buffer:[],subscription:r};t.push(n);var i=a.subscribeToResult(this,e,n);!i||i.closed?this.closeBuffer(n):(i.context=n,this.add(i),r.add(i))},t}(s.OuterSubscriber)},11662(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83207),a=r(64398);t.bufferWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.closingSelector=r,n.subscribing=!1,n.openBuffer(),n}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e,t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{e=(0,this.closingSelector)()}catch(e){return this.error(e)}t=new o.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(a.innerSubscribe(e,new a.SimpleInnerSubscriber(this))),this.subscribing=!1},t}(a.SimpleOuterSubscriber)},85503(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.catchError=function(e){return function(t){var r=new a(e),n=t.lift(r);return r.caught=n}};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){e.prototype.error.call(this,t);return}this._unsubscribeAndRecycle();var n=new o.SimpleInnerSubscriber(this);this.add(n);var i=o.innerSubscribe(r,n);i!==n&&this.add(i)}},t}(o.SimpleOuterSubscriber)},24908(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(50278);t.combineAll=function(e){return function(t){return t.lift(new n.CombineLatestOperator(e))}}},89060(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34728),i=r(50278),o=r(24098);t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&n.isArray(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(o.from([t].concat(e)),new i.CombineLatestOperator(r))}}},16600(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(95434);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.concat.apply(void 0,[t].concat(e)))}}},6345(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(49287);t.concatAll=function(){return n.mergeAll(1)}},52248(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(75206);t.concatMap=function(e,t){return n.mergeMap(e,t,1)}},43577(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52248);t.concatMapTo=function(e,t){return n.concatMap(function(){return e},t)}},88765(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.count=function(e){return function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){this.destination.error(e);return}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(o.Subscriber)},23287(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.debounce=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var r=this.durationSubscription;this.value=e,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this)))&&!r.closed&&this.add(this.durationSubscription=r)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(o.SimpleOuterSubscriber)},38066(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(25190);t.debounceTime=function(e,t){return void 0===t&&(t=a.async),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.dueTime,this.scheduler))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dueTime=r,i.scheduler=n,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return i(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(u,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(o.Subscriber);function u(e){e.debouncedNext()}},12767(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.defaultIfEmpty=function(e){return void 0===e&&(e=null),function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.defaultValue))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.defaultValue=r,n.isEmpty=!0,n}return i(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(o.Subscriber)},46965(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(25190),a=r(24465),s=r(31396),l=r(76765);t.delay=function(e,t){void 0===t&&(t=o.async);var r=a.isDate(e)?e-t.now():Math.abs(e);return function(e){return e.lift(new u(r,t))}};var u=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))},e}(),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.delay=r,i.scheduler=n,i.queue=[],i.active=!1,i.errored=!1,i}return i(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,r=new d(t.now()+this.delay,e);this.queue.push(r),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(l.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(l.Notification.createComplete()),this.unsubscribe()},t}(s.Subscriber),d=function(e,t){this.time=e,this.notification=t}},69861(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(52515),s=r(15905),l=r(47849);t.delayWhen=function(e,t){return t?function(r){return new d(r,t).lift(new u(e))}:function(t){return t.lift(new u(e))}};var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delayDurationSelector))},e}(),c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.delayDurationSelector=r,n.completed=!1,n.delayNotifierSubscriptions=[],n.index=0,n}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var r=this.delayDurationSelector(e,t);r&&this.tryDelay(r,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return -1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var r=l.subscribeToResult(this,e,t);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(s.OuterSubscriber),d=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subscriptionDelay=r,n}return i(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new f(e,this.source))},t}(a.Observable),f=function(e){function t(t,r){var n=e.call(this)||this;return n.parent=t,n.source=r,n.sourceSubscribed=!1,n}return i(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(o.Subscriber)},47642(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.dematerialize=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(o.Subscriber)},98820(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.distinct=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.keySelector,this.flushes))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=r,i.values=new Set,n&&i.add(o.innerSubscribe(n,new o.SimpleInnerSubscriber(i))),i}return i(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,r=this.destination;try{t=this.keySelector(e)}catch(e){r.error(e);return}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var r=this.values;r.has(e)||(r.add(e),this.destination.next(t))},t}(o.SimpleOuterSubscriber);t.DistinctSubscriber=s},21772(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.distinctUntilChanged=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compare,this.keySelector))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){try{var t,r=this.keySelector;t=r?r(e):e}catch(e){return this.destination.error(e)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))},t}(o.Subscriber)},5075(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21772);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged(function(r,n){return t?t(r[e],n[e]):r[e]===n[e]})}},32399(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(37568),i=r(12670),o=r(12056),a=r(12767),s=r(11231);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(l){return l.pipe(i.filter(function(t,r){return r===e}),s.take(1),r?a.defaultIfEmpty(t):o.throwIfEmpty(function(){return new n.ArgumentOutOfRangeError}))}}},32631(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(95434),i=r(97795);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return n.concat(t,i.of.apply(void 0,e))}}},47233(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.every=function(e,t){return function(r){return r.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.predicate=e,this.thisArg=t,this.source=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg,this.source))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.predicate=r,o.thisArg=n,o.source=i,o.index=0,o.thisArg=n||o,o}return i(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){this.destination.error(e);return}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(o.Subscriber)},92408(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.exhaust=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return i(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(o.innerSubscribe(e,new o.SimpleInnerSubscriber(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(o.SimpleOuterSubscriber)},1112(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(76808),a=r(24098),s=r(64398);t.exhaustMap=function e(t,r){return r?function(n){return n.pipe(e(function(e,n){return a.from(t(e,n)).pipe(o.map(function(t,i){return r(e,t,n,i)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return i(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber)},77736(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=1>(t||0)?1/0:t,function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.concurrent,this.scheduler))},e}();t.ExpandOperator=a;var s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.project=r,o.concurrent=n,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,n<1/0&&(o.buffer=[]),o}return i(t,e),t.dispatch=function(e){var t=e.subscriber,r=e.result,n=e.value,i=e.index;t.subscribeToProjection(r,n,i)},t.prototype._next=function(e){var r=this.destination;if(r.closed)return void this._complete();var n=this.index++;if(this.active<this.concurrent){r.next(e);try{var i=(0,this.project)(e,n);this.scheduler?this.destination.add(this.scheduler.schedule(t.dispatch,0,{subscriber:this,result:i,value:e,index:n})):this.subscribeToProjection(i,e,n)}catch(e){r.error(e)}}else this.buffer.push(e)},t.prototype.subscribeToProjection=function(e,t,r){this.active++,this.destination.add(o.innerSubscribe(e,new o.SimpleInnerSubscriber(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(o.SimpleOuterSubscriber);t.ExpandSubscriber=s},12670(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.filter=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}t&&this.destination.next(e)},t}(o.Subscriber)},91258(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(83207);t.finalize=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.callback))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.add(new a.Subscription(r)),n}return i(t,e),t}(o.Subscriber)},15063(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.find=function(e,t){if("function"!=typeof e)throw TypeError("predicate is not a function");return function(r){return r.lift(new a(e,r,!1,t))}};var a=function(){function e(e,t,r,n){this.predicate=e,this.source=t,this.yieldIndex=r,this.thisArg=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();t.FindValueOperator=a;var s=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.predicate=r,a.source=n,a.yieldIndex=i,a.thisArg=o,a.index=0,a}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,r=this.thisArg,n=this.index++;try{t.call(r||this,e,n,this.source)&&this.notifyComplete(this.yieldIndex?n:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(o.Subscriber);t.FindValueSubscriber=s},42939(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(15063);t.findIndex=function(e,t){return function(r){return r.lift(new n.FindValueOperator(e,r,!0,t))}}},69948(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(81136),i=r(12670),o=r(11231),a=r(12767),s=r(12056),l=r(44579);t.first=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter(function(t,r){return e(t,r,u)}):l.identity,o.take(1),r?a.defaultIfEmpty(t):s.throwIfEmpty(function(){return new n.EmptyError}))}}},77784(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(83207),s=r(52515),l=r(12888);t.groupBy=function(e,t,r,n){return function(i){return i.lift(new u(e,t,r,n))}};var u=function(){function e(e,t,r,n){this.keySelector=e,this.elementSelector=t,this.durationSelector=r,this.subjectSelector=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),c=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.keySelector=r,a.elementSelector=n,a.durationSelector=i,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return i(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){this.error(e);return}this._group(e,t)},t.prototype._group=function(e,t){var r,n=this.groups;n||(n=this.groups=new Map);var i=n.get(t);if(this.elementSelector)try{r=this.elementSelector(e)}catch(e){this.error(e)}else r=e;if(!i){i=this.subjectSelector?this.subjectSelector():new l.Subject,n.set(t,i);var o=new f(t,i,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new f(t,i))}catch(e){this.error(e);return}this.add(a.subscribe(new d(t,i,this)))}}i.closed||i.next(r)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,r){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(o.Subscriber),d=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.key=t,i.group=r,i.parent=n,i}return i(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(o.Subscriber),f=function(e){function t(t,r,n){var i=e.call(this)||this;return i.key=t,i.groupSubject=r,i.refCountSubscription=n,i}return i(t,e),t.prototype._subscribe=function(e){var t=new a.Subscription,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&t.add(new p(r)),t.add(n.subscribe(e)),t},t}(s.Observable);t.GroupedObservable=f;var p=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,t.count++,r}return i(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(a.Subscription)},36863(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.ignoreElements=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype._next=function(e){},t}(o.Subscriber)},63371(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.isEmpty=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(o.Subscriber)},17064(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(81136),i=r(12670),o=r(23439),a=r(12056),s=r(12767),l=r(44579);t.last=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter(function(t,r){return e(t,r,u)}):l.identity,o.takeLast(1),r?s.defaultIfEmpty(t):a.throwIfEmpty(function(){return new n.EmptyError}))}}},76808(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.map=function(e,t){return function(r){if("function"!=typeof e)throw TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.thisArg))},e}();t.MapOperator=a;var s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(o.Subscriber)},13353(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.mapTo=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.value))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return i(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(o.Subscriber)},92539(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(76765);t.materialize=function(){return function(e){return e.lift(new s)}};var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new l(e))},e}(),l=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype._next=function(e){this.destination.next(a.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(a.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(a.Notification.createComplete()),e.complete()},t}(o.Subscriber)},56416(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22518);t.max=function(e){return n.reduce("function"==typeof e?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},41570(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5776);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.merge.apply(void 0,[t].concat(e)))}}},49287(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(75206),i=r(44579);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},75206(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(76808),a=r(24098),s=r(64398);function l(e,t,r){return(void 0===r&&(r=1/0),"function"==typeof t)?function(n){return n.pipe(l(function(r,n){return a.from(e(r,n)).pipe(o.map(function(e,i){return t(r,e,n,i)}))},r))}:("number"==typeof t&&(r=t),function(t){return t.lift(new u(e,r))})}t.mergeMap=l;var u=function(){function e(e,t){void 0===t&&(t=1/0),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent))},e}();t.MergeMapOperator=u;var c=function(e){function t(t,r,n){void 0===n&&(n=1/0);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber);t.MergeMapSubscriber=c,t.flatMap=l},89019(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(75206);t.mergeMapTo=function(e,t,r){return(void 0===r&&(r=1/0),"function"==typeof t)?n.mergeMap(function(){return e},t,r):("number"==typeof t&&(r=t),n.mergeMap(function(){return e},r))}},52307(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.accumulator=e,this.seed=t,this.concurrent=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.concurrent))},e}();t.MergeScanOperator=a;var s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o.acc=n,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return i(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,r=this.destination,n=void 0;try{n=(0,this.accumulator)(this.acc,e,t)}catch(e){return r.error(e)}this.active++,this._innerSub(n)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new o.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=o.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(o.SimpleOuterSubscriber);t.MergeScanSubscriber=s},87198(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22518);t.min=function(e){return n.reduce("function"==typeof e?function(t,r){return 0>e(t,r)?t:r}:function(e,t){return e<t?e:t})}},74864(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52871);t.multicast=function(e,t){return function(r){if(o="function"==typeof e?e:function(){return e},"function"==typeof t)return r.lift(new i(o,t));var o,a=Object.create(r,n.connectableObservableDescriptor);return a.source=r,a.subjectFactory=o,a}};var i=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(e);return i.add(t.subscribe(n)),i},e}();t.MulticastOperator=i},25495(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(76765);t.observeOn=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.scheduler,this.delay))},e}();t.ObserveOnOperator=s;var l=function(e){function t(t,r,n){void 0===n&&(n=0);var i=e.call(this,t)||this;return i.scheduler=r,i.delay=n,i}return i(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(a.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(a.Notification.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(a.Notification.createComplete()),this.unsubscribe()},t}(o.Subscriber);t.ObserveOnSubscriber=l;var u=function(e,t){this.notification=e,this.destination=t};t.ObserveOnMessage=u},55029(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(24098),a=r(34728),s=r(64398);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&a.isArray(e[0])&&(e=e[0]),function(t){return t.lift(new l(e))}},t.onErrorResumeNextStatic=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0;return 1===e.length&&a.isArray(e[0])&&(e=e[0]),r=e.shift(),o.from(r).lift(new l(e))};var l=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextSources))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.nextSources=r,n}return i(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)}else this.destination.complete()},t}(s.SimpleOuterSubscriber)},87304(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.pairwise=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.hasPrev=!1,r}return i(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(o.Subscriber)},84236(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(55352),i=r(12670);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},11075(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(76808);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw Error("list of properties cannot be empty.");return function(t){var i,o;return n.map((i=e,o=r,function(e){for(var t=e,r=0;r<o;r++){var n=null!=t?t[i[r]]:void 0;if(void 0===n)return;t=n}return t}))(t)}}},35485(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(12888),i=r(74864);t.publish=function(e){return e?i.multicast(function(){return new n.Subject},e):i.multicast(new n.Subject)}},60091(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(466),i=r(74864);t.publishBehavior=function(e){return function(t){return i.multicast(new n.BehaviorSubject(e))(t)}}},33433(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(49850),i=r(74864);t.publishLast=function(){return function(e){return i.multicast(new n.AsyncSubject)(e)}}},49622(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2173),i=r(74864);t.publishReplay=function(e,t,r,o){r&&"function"!=typeof r&&(o=r);var a="function"==typeof r?r:void 0,s=new n.ReplaySubject(e,t,o);return function(e){return i.multicast(function(){return s},a)(e)}}},96721(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34728),i=r(23827);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&n.isArray(e[0])&&(e=e[0]),t.lift.call(i.race.apply(void 0,[t].concat(e)))}}},22518(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(40253),i=r(23439),o=r(12767),a=r(8173);t.reduce=function(e,t){return arguments.length>=2?function(r){return a.pipe(n.scan(e,t),i.takeLast(1),o.defaultIfEmpty(t))(r)}:function(t){return a.pipe(n.scan(function(t,r,n){return e(t,r,n+1)}),i.takeLast(1))(t)}}},46888(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.refCount=function(){return function(e){return e.lift(new a(e))}};var a=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new s(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var r=this.connection,n=e._connection;this.connection=null,n&&(!r||n===r)&&n.unsubscribe()},t}(o.Subscriber)},66483(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(80453);t.repeat=function(e){return void 0===e&&(e=-1),function(t){return 0===e?a.empty():e<0?t.lift(new s(-1,t)):t.lift(new s(e-1,t))}};var s=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.count,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return i(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,r=this.count;if(0===r)return e.prototype.complete.call(this);r>-1&&(this.count=r-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(o.Subscriber)},10283(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(64398);t.repeatWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i.sourceIsBeingSubscribedTo=!0,i}return i(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){this.notifications=new o.Subject;try{var t;t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=a.innerSubscribe(t,new a.SimpleInnerSubscriber(this))},t}(a.SimpleOuterSubscriber)},53160(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.retry=function(e){return void 0===e&&(e=-1),function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return e.prototype.error.call(this,t);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},t}(o.Subscriber)},75508(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(64398);t.retryWhen=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.errors,n=this.retries,i=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{r=new o.Subject;try{n=(0,this.notifier)(r)}catch(t){return e.prototype.error.call(this,t)}i=a.innerSubscribe(n,new a.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=i,r.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(a.SimpleOuterSubscriber)},61754(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.sample=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=t.subscribe(r);return n.add(o.innerSubscribe(this.notifier,new o.SimpleInnerSubscriber(r))),n},e}(),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return i(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(o.SimpleOuterSubscriber)},61183(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(25190);t.sampleTime=function(e,t){return void 0===t&&(t=a.async),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.period,this.scheduler))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(u,r,{subscriber:i,period:r})),i}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(o.Subscriber);function u(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}},40253(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.scan=function(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){void 0===r&&(r=!1),this.accumulator=e,this.seed=t,this.hasSeed=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.hasSeed))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return i(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.accumulator(this.seed,e,r)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(o.Subscriber)},5017(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.sequenceEqual=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compareTo,this.comparator))},e}();t.SequenceEqualOperator=a;var s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.compareTo=r,i.comparator=n,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(r.subscribe(new l(t,i))),i}return i(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,r=this.comparator;e.length>0&&t.length>0;){var n=e.shift(),i=t.shift(),o=!1;try{o=r?r(n,i):n===i}catch(e){this.destination.error(e)}o||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(o.Subscriber);t.SequenceEqualSubscriber=s;var l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.parent=r,n}return i(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(o.Subscriber)},83213(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(74864),i=r(46888),o=r(12888);function a(){return new o.Subject}t.share=function(){return function(e){return i.refCount()(n.multicast(a)(e))}}},8614(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2173);t.shareReplay=function(e,t,r){var i;return i=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:r},function(e){var t,r,o,a,s,l,u,c,d,f,p,h;return e.lift((s=void 0===(a=(t=i).bufferSize)?1/0:a,u=void 0===(l=t.windowTime)?1/0:l,c=t.refCount,d=t.scheduler,f=0,p=!1,h=!1,function(e){var t;f++,!r||p?(p=!1,t=(r=new n.ReplaySubject(s,u,d)).subscribe(this),o=e.subscribe({next:function(e){r.next(e)},error:function(e){p=!0,r.error(e)},complete:function(){h=!0,o=void 0,r.complete()}}),h&&(o=void 0)):t=r.subscribe(this),this.add(function(){f--,t.unsubscribe(),t=void 0,o&&!h&&c&&0===f&&(o.unsubscribe(),o=void 0,r=void 0)})}))}}},28480(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(81136);t.single=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.predicate,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return i(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new a.EmptyError)},t}(o.Subscriber)},74775(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.skip=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.total))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return i(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(o.Subscriber)},2807(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(37568);t.skipLast=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new o.Subscriber(e)):t.subscribe(new l(e,this._skipCount))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n._skipCount=r,n._count=0,n._ring=Array(r),n}return i(t,e),t.prototype._next=function(e){var t=this._skipCount,r=this._count++;if(r<t)this._ring[r]=e;else{var n=r%t,i=this._ring,o=i[n];i[n]=e,this.destination.next(o)}},t}(o.Subscriber)},12519(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.skipUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.notifier))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;n.hasValue=!1;var i=new o.SimpleInnerSubscriber(n);n.add(i),n.innerSubscription=i;var a=o.innerSubscribe(r,i);return a!==i&&(n.add(a),n.innerSubscription=a),n}return i(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(o.SimpleOuterSubscriber)},34846(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.skipWhile=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return i(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=!!t}catch(e){this.destination.error(e)}},t}(o.Subscriber)},94558(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(95434),i=r(18244);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return i.isScheduler(r)?(e.pop(),function(t){return n.concat(e,t,r)}):function(t){return n.concat(e,t)}}},70015(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(98072);t.subscribeOn=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new i(e,t))}};var i=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new n.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},65433(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7912),i=r(44579);t.switchAll=function(){return n.switchMap(i.identity)}},7912(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(76808),a=r(24098),s=r(64398);t.switchMap=function e(t,r){return"function"==typeof r?function(n){return n.pipe(e(function(e,n){return a.from(t(e,n)).pipe(o.map(function(t,i){return r(e,t,n,i)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.index=0,n}return i(t,e),t.prototype._next=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var r=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(r),this.innerSubscription=s.innerSubscribe(e,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(s.SimpleOuterSubscriber)},37865(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7912);t.switchMapTo=function(e,t){return t?n.switchMap(function(){return e},t):n.switchMap(function(){return e})}},11231(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(37568),s=r(80453);t.take=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return i(t,e),t.prototype._next=function(e){var t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))},t}(o.Subscriber)},23439(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(37568),s=r(80453);t.takeLast=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=[],n.count=0,n}return i(t,e),t.prototype._next=function(e){var t=this.ring,r=this.total,n=this.count++;t.length<r?t.push(e):t[n%r]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;i<r;i++){var o=t++%r;e.next(n[o])}e.complete()},t}(o.Subscriber)},51279(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.takeUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=o.innerSubscribe(this.notifier,new o.SimpleInnerSubscriber(r));return n&&!r.seenValue?(r.add(n),t.subscribe(r)):r},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.seenValue=!1,r}return i(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(o.SimpleOuterSubscriber)},96518(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.takeWhile=function(e,t){return void 0===t&&(t=!1),function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.inclusive))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return i(t,e),t.prototype._next=function(e){var t,r=this.destination;try{t=this.predicate(e,this.index++)}catch(e){r.error(e);return}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var r=this.destination;t?r.next(e):(this.inclusive&&r.next(e),r.complete())},t}(o.Subscriber)},31451(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(7653),s=r(83385);t.tap=function(e,t,r){return function(n){return n.lift(new l(e,t,r))}};var l=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextOrObserver,this.error,this.complete))},e}(),u=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o._tapNext=a.noop,o._tapError=a.noop,o._tapComplete=a.noop,o._tapError=n||a.noop,o._tapComplete=i||a.noop,s.isFunction(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||a.noop,o._tapError=r.error||a.noop,o._tapComplete=r.complete||a.noop),o}return i(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){this.destination.error(e);return}return this.destination.complete()},t}(o.Subscriber)},30464(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.defaultThrottleConfig={leading:!0,trailing:!1},t.throttle=function(e,r){return void 0===r&&(r=t.defaultThrottleConfig),function(t){return t.lift(new a(e,!!r.leading,!!r.trailing))}};var a=function(){function e(e,t,r){this.durationSelector=e,this.leading=t,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector,this.leading,this.trailing))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=r,o._leading=n,o._trailing=i,o._hasValue=!1,o}return i(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(o.SimpleOuterSubscriber)},17661(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(25190),s=r(30464);t.throttleTime=function(e,t,r){return void 0===t&&(t=a.async),void 0===r&&(r=s.defaultThrottleConfig),function(n){return n.lift(new l(e,t,r.leading,r.trailing))}};var l=function(){function e(e,t,r,n){this.duration=e,this.scheduler=t,this.leading=r,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),u=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.duration=r,a.scheduler=n,a.leading=i,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return i(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(c,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue),this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(o.Subscriber);function c(e){e.subscriber.clearThrottle()}},12056(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(81136),a=r(31396);t.throwIfEmpty=function(e){return void 0===e&&(e=u),function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.errorFactory))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errorFactory=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(a.Subscriber);function u(){return new o.EmptyError}},15276(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25190),i=r(40253),o=r(93180),a=r(76808);t.timeInterval=function(e){return void 0===e&&(e=n.async),function(t){return o.defer(function(){return t.pipe(i.scan(function(t,r){var n=t.current;return{value:r,current:e.now(),last:n}},{current:e.now(),value:void 0,last:void 0}),a.map(function(e){var t=e.current,r=e.last;return new s(e.value,t-r)}))})}};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},88673(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25190),i=r(43734),o=r(4053),a=r(21576);t.timeout=function(e,t){return void 0===t&&(t=n.async),o.timeoutWith(e,a.throwError(new i.TimeoutError),t)}},4053(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(25190),a=r(24465),s=r(64398);t.timeoutWith=function(e,t,r){return void 0===r&&(r=o.async),function(n){var i=a.isDate(e),o=i?e-r.now():Math.abs(e);return n.lift(new l(o,i,t,r))}};var l=function(){function e(e,t,r,n){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),u=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.absoluteTimeout=r,a.waitFor=n,a.withObservable=i,a.scheduler=o,a.scheduleTimeout(),a}return i(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(s.innerSubscribe(t,new s.SimpleInnerSubscriber(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(s.SimpleOuterSubscriber)},68858(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25190),i=r(76808);t.timestamp=function(e){return void 0===e&&(e=n.async),i.map(function(t){return new o(t,e.now())})};var o=function(e,t){this.value=e,this.timestamp=t};t.Timestamp=o},32284(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22518);function i(e,t,r){return 0===r?[t]:(e.push(t),e)}t.toArray=function(){return n.reduce(i,[])}},77544(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(64398);t.window=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var r=new l(e),n=t.subscribe(r);return n.closed||r.add(a.innerSubscribe(this.windowBoundaries,new a.SimpleInnerSubscriber(r))),n},e}(),l=function(e){function t(t){var r=e.call(this,t)||this;return r.window=new o.Subject,t.next(r.window),r}return i(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,r=this.window=new o.Subject;t.next(r)},t}(a.SimpleOuterSubscriber)},41565(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(12888);t.windowCount=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.windowSize,this.startWindowEvery))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=r,i.startWindowEvery=n,i.windows=[new a.Subject],i.count=0,t.next(i.windows[0]),i}return i(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,n=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(e);var l=this.count-n+1;if(l>=0&&l%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var u=new a.Subject;i.push(u),r.next(u)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(o.Subscriber)},43877(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(25190),s=r(31396),l=r(15390),u=r(18244);t.windowTime=function(e){var t=a.async,r=null,n=1/0;return u.isScheduler(arguments[3])&&(t=arguments[3]),u.isScheduler(arguments[2])?t=arguments[2]:l.isNumeric(arguments[2])&&(n=Number(arguments[2])),u.isScheduler(arguments[1])?t=arguments[1]:l.isNumeric(arguments[1])&&(r=Number(arguments[1])),function(i){return i.lift(new c(e,r,n,t))}};var c=function(){function e(e,t,r,n){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return i(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(o.Subject),f=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;a.destination=t,a.windowTimeSpan=r,a.windowCreationInterval=n,a.maxWindowSize=i,a.scheduler=o,a.windows=[];var s=a.openWindow();return null!==n&&n>=0?(a.add(o.schedule(m,r,{subscriber:a,window:s,context:null})),a.add(o.schedule(h,n,{windowTimeSpan:r,windowCreationInterval:n,subscriber:a,scheduler:o}))):a.add(o.schedule(p,r,{subscriber:a,window:s,windowTimeSpan:r})),a}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;n<r;n++){var i=t[n];!i.closed&&(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new d;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(s.Subscriber);function p(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&t.closeWindow(n),e.window=t.openWindow(),this.schedule(e,r)}function h(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),a={action:this,subscription:null};a.subscription=n.schedule(m,t,{subscriber:r,window:o,context:a}),this.add(a.subscription),this.schedule(e,i)}function m(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}},5428(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(83207),s=r(15905),l=r(47849);t.windowToggle=function(e,t){return function(r){return r.lift(new u(e,t))}};var u=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.openings,this.closingSelector))},e}(),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.openings=r,i.closingSelector=n,i.contexts=[],i.add(i.openSubscription=l.subscribeToResult(i,r,r)),i}return i(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var r=t.length,n=0;n<r;n++)t[n].window.next(e)},t.prototype._error=function(t){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.error(t),o.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var r=t.length,n=-1;++n<r;){var i=t[n];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,r=-1;++r<t;){var n=e[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,r,n,i){if(e===this.openings){var s=void 0;try{s=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var u=new o.Subject,c=new a.Subscription,d={window:u,subscription:c};this.contexts.push(d);var f=l.subscribeToResult(this,s,d);f.closed?this.closeWindow(this.contexts.length-1):(f.context=d,c.add(f)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,r=t[e],n=r.window,i=r.subscription;t.splice(e,1),n.complete(),i.unsubscribe()}},t}(s.OuterSubscriber)},39284(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(15905),s=r(47849);t.windowWhen=function(e){return function(t){return t.lift(new l(e))}};var l=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.closingSelector))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.closingSelector=r,n.openWindow(),n}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.openWindow(i)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t,r=this.window;r&&r.complete();var n=this.window=new o.Subject;this.destination.next(n);try{t=(0,this.closingSelector)()}catch(e){this.destination.error(e),this.window.error(e);return}this.add(this.closingNotification=s.subscribeToResult(this,t))},t}(a.OuterSubscriber)},91183(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(15905),a=r(47849);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var r;return"function"==typeof e[e.length-1]&&(r=e.pop()),t.lift(new s(e,r))}};var s=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.observables,this.project))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(var s=0;s<o;s++){var l=r[s];i.add(a.subscribeToResult(i,l,void 0,s))}return i}return i(t,e),t.prototype.notifyNext=function(e,t,r){this.values[r]=t;var n=this.toRespond;if(n.length>0){var i=n.indexOf(r);-1!==i&&n.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(o.OuterSubscriber)},909(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(70887);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.zip.apply(void 0,[t].concat(e)))}}},53282(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(70887);t.zipAll=function(e){return function(t){return t.lift(new n.ZipOperator(e))}}},68822(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(83207);t.scheduleArray=function(e,t){return new n.Observable(function(r){var n=new i.Subscription,o=0;return n.add(t.schedule(function(){o===e.length?r.complete():(r.next(e[o++]),r.closed||n.add(this.schedule()))})),n})}},90229(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(83207),o=r(57211);t.scheduleIterable=function(e,t){if(!e)throw Error("Iterable cannot be null");return new n.Observable(function(r){var n,a=new i.Subscription;return a.add(function(){n&&"function"==typeof n.return&&n.return()}),a.add(t.schedule(function(){n=e[o.iterator](),a.add(t.schedule(function(){if(!r.closed){try{var e,t,i=n.next();e=i.value,t=i.done}catch(e){r.error(e);return}t?r.complete():(r.next(e),this.schedule())}}))})),a})}},60002(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(83207),o=r(86676);t.scheduleObservable=function(e,t){return new n.Observable(function(r){var n=new i.Subscription;return n.add(t.schedule(function(){var i=e[o.observable]();n.add(i.subscribe({next:function(e){n.add(t.schedule(function(){return r.next(e)}))},error:function(e){n.add(t.schedule(function(){return r.error(e)}))},complete:function(){n.add(t.schedule(function(){return r.complete()}))}}))})),n})}},1138(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(83207);t.schedulePromise=function(e,t){return new n.Observable(function(r){var n=new i.Subscription;return n.add(t.schedule(function(){return e.then(function(e){n.add(t.schedule(function(){r.next(e),n.add(t.schedule(function(){return r.complete()}))}))},function(e){n.add(t.schedule(function(){return r.error(e)}))})})),n})}},17315(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(60002),i=r(1138),o=r(68822),a=r(90229),s=r(26565),l=r(77328),u=r(51087),c=r(32555);t.scheduled=function(e,t){if(null!=e){if(s.isInteropObservable(e))return n.scheduleObservable(e,t);else if(l.isPromise(e))return i.schedulePromise(e,t);else if(u.isArrayLike(e))return o.scheduleArray(e,t);else if(c.isIterable(e)||"string"==typeof e)return a.scheduleIterable(e,t)}throw TypeError((null!==e&&typeof e||e)+" is not observable")}},45666(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(83207).Subscription)},52883(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(80772);t.AsapAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return(void 0===n&&(n=0),null!==n&&n>0)?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=o.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(o.Immediate.clearImmediate(r),t.scheduled=void 0)},t}(r(21076).AsyncAction)},93728(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do if(t=e.execute(e.state,e.delay))break;while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},t}(r(94333).AsyncScheduler)},21076(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r=!1,n=void 0;try{this.work(e)}catch(e){r=!0,n=!!e&&e||Error(e)}if(r)return this.unsubscribe(),n},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(r(45666).Action)},94333(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83849);t.AsyncScheduler=function(e){function t(r,n){void 0===n&&(n=o.Scheduler.now);var i=e.call(this,r,function(){return t.delegate&&t.delegate!==i?t.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return i(t,e),t.prototype.schedule=function(r,n,i){return(void 0===n&&(n=0),t.delegate&&t.delegate!==this)?t.delegate.schedule(r,n,i):e.prototype.schedule.call(this,r,n,i)},t.prototype.flush=function(e){var t,r=this.actions;if(this.active)return void r.push(e);this.active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this.active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(o.Scheduler)},46847(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return(void 0===r&&(r=0),r>0)?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(r(21076).AsyncAction)},5044(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(94333).AsyncScheduler)},52745(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52883);t.asapScheduler=new(r(93728)).AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},25190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21076);t.asyncScheduler=new(r(94333)).AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},55677(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(46847);t.queueScheduler=new(r(5044)).QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},57211(e,t){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.getSymbolIterator=r,t.iterator=r(),t.$$iterator=t.iterator},86676(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},4421(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rxSubscriber="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),t.$$rxSubscriber=t.rxSubscriber},37568(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},81136(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}()},80772(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=1,n=Promise.resolve(),i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=r++;return i[t]=!0,n.then(function(){return o(t)&&e()}),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},16967(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},43734(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeoutError=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}()},61245(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}()},54487(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(31396);t.canReportError=function(e){for(;e;){var t=e,r=t.closed,i=t.destination,o=t.isStopped;if(r||o)return!1;e=i&&i instanceof n.Subscriber?i:null}return!0}},34163(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hostReportError=function(e){setTimeout(function(){throw e},0)}},44579(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=function(e){return e}},34728(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=Array.isArray||function(e){return e&&"number"==typeof e.length}},51087(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},24465(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDate=function(e){return e instanceof Date&&!isNaN(+e)}},83385(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return"function"==typeof e}},26565(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(86676);t.isInteropObservable=function(e){return e&&"function"==typeof e[n.observable]}},32555(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(57211);t.isIterable=function(e){return e&&"function"==typeof e[n.iterator]}},15390(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34728);t.isNumeric=function(e){return!n.isArray(e)&&e-parseFloat(e)+1>=0}},60194(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return null!==e&&"object"==typeof e}},77328(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},18244(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=function(e){return e&&"function"==typeof e.schedule}},7653(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=function(){}},55352(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=function(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}},8173(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(44579);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},87092(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(70499),i=r(75259),o=r(98190),a=r(31021),s=r(51087),l=r(77328),u=r(60194),c=r(57211),d=r(86676);t.subscribeTo=function(e){if(e&&"function"==typeof e[d.observable])return a.subscribeToObservable(e);if(s.isArrayLike(e))return n.subscribeToArray(e);if(l.isPromise(e))return i.subscribeToPromise(e);if(e&&"function"==typeof e[c.iterator])return o.subscribeToIterable(e);throw TypeError("You provided "+(u.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},70499(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeToArray=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}},98190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(57211);t.subscribeToIterable=function(e){return function(t){for(var r=e[n.iterator]();;){var i=void 0;try{i=r.next()}catch(e){return t.error(e),t}if(i.done){t.complete();break}if(t.next(i.value),t.closed)break}return"function"==typeof r.return&&t.add(function(){r.return&&r.return()}),t}}},31021(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(86676);t.subscribeToObservable=function(e){return function(t){var r=e[n.observable]();if("function"==typeof r.subscribe)return r.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")}}},75259(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34163);t.subscribeToPromise=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,n.hostReportError),t}}},47849(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(54470),i=r(87092),o=r(52515);t.subscribeToResult=function(e,t,r,a,s){if(void 0===s&&(s=new n.InnerSubscriber(e,r,a)),!s.closed)return t instanceof o.Observable?t.subscribe(s):i.subscribeTo(t)(s)}},25158(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(31396),i=r(4421),o=r(32544);t.toSubscriber=function(e,t,r){if(e){if(e instanceof n.Subscriber)return e;if(e[i.rxSubscriber])return e[i.rxSubscriber]()}return e||t||r?new n.Subscriber(e,t,r):new n.Subscriber(o.empty)}},56170(e,t,r){"use strict";r(38461).audit,r(32392).auditTime,r(37954).buffer,r(30647).bufferCount,r(16327).bufferTime,r(46786).bufferToggle,r(11662).bufferWhen,r(85503).catchError,r(24908).combineAll,r(89060).combineLatest,r(16600).concat,r(6345).concatAll,r(52248).concatMap,r(43577).concatMapTo,r(88765).count,r(23287).debounce,r(38066).debounceTime,r(12767).defaultIfEmpty,r(46965).delay,r(69861).delayWhen,r(47642).dematerialize,r(98820).distinct,r(21772).distinctUntilChanged,r(5075).distinctUntilKeyChanged,r(32399).elementAt,r(32631).endWith,r(47233).every,r(92408).exhaust,r(1112).exhaustMap,r(77736).expand,r(12670).filter,r(91258).finalize,r(15063).find,r(42939).findIndex,r(69948).first,r(77784).groupBy,r(36863).ignoreElements,r(63371).isEmpty,r(17064).last,t.map=r(76808).map,r(13353).mapTo,r(92539).materialize,r(56416).max,r(41570).merge,r(49287).mergeAll;var n=r(75206);n.mergeMap,n.flatMap,r(89019).mergeMapTo,r(52307).mergeScan,r(87198).min,r(74864).multicast,r(25495).observeOn,r(55029).onErrorResumeNext,r(87304).pairwise,r(84236).partition,r(11075).pluck,r(35485).publish,r(60091).publishBehavior,r(33433).publishLast,r(49622).publishReplay,r(96721).race,r(22518).reduce,r(66483).repeat,r(10283).repeatWhen,r(53160).retry,r(75508).retryWhen,r(46888).refCount,r(61754).sample,r(61183).sampleTime,r(40253).scan,r(5017).sequenceEqual,r(83213).share,r(8614).shareReplay,r(28480).single,r(74775).skip,r(2807).skipLast,r(12519).skipUntil,r(34846).skipWhile,r(94558).startWith,r(70015).subscribeOn,r(65433).switchAll,r(7912).switchMap,r(37865).switchMapTo,t.take=r(11231).take,r(23439).takeLast,r(51279).takeUntil,r(96518).takeWhile,r(31451).tap,r(30464).throttle,r(17661).throttleTime,r(12056).throwIfEmpty,r(15276).timeInterval,r(88673).timeout,r(4053).timeoutWith,r(68858).timestamp,r(32284).toArray,r(77544).window,r(41565).windowCount,r(43877).windowTime,r(5428).windowToggle,r(39284).windowWhen,r(91183).withLatestFrom,r(909).zip,r(53282).zipAll},52285(e,t,r){"use strict";let n,i,o,a,s,l,u,c,d,f,p,h,m;r.r(t),r.d(t,{GenderUnknownIcon:()=>pR,evaluateAsNumber:()=>uB,useOpenmrsSWR:()=>fS,Assessment1Pictogram:()=>Sb,ChemistryIcon:()=>ph,StockManagementPictogram:()=>SB,importDynamic:()=>op,BabyIcon:()=>pn,DashboardExtension:()=>hR,useFhirPagination:()=>fr,ArrowUpIcon:()=>pr,pictogramIds:()=>Sm,getDynamicOfflineDataHandlers:()=>l5,ActivityIcon:()=>f8,compile:()=>uK,showActionableNotification:()=>EK,useForceUpdate:()=>d9,PatientBannerPatientIdentifiers:()=>E6,TableBatchActions:()=>f4,getAsyncLifecycle:()=>d$,subscribeOpenmrsEvent:()=>uh,useVisit:()=>fB,TransferPictogram:()=>SV,PasswordIcon:()=>p3,usePagination:()=>fD,useVisitContextStore:()=>fF,Assessment2Pictogram:()=>Sv,PatientBannerToggleContactDetailsButton:()=>Sr,CloseOutlineIcon:()=>pw,ObstetricsPictogram:()=>SR,CloseIcon:()=>pv,parseDateInput:()=>xW,useFeatureFlag:()=>d8,getConfig:()=>t2,attach:()=>ck,LabOrderIcon:()=>pU,VisitMode:()=>um,getLocale:()=>w4,offlineUuidPrefix:()=>cQ,useLocations:()=>fw,ActionMenuButton:()=>Dm,isUrlWithTemplateParameters:()=>rh,getLifecycle:()=>dI,formatDatetime:()=>xB,getVisitsForPatient:()=>uE,useEmrConfiguration:()=>d2,subscribeConnectivity:()=>b,useLeftNav:()=>fv,formatPartialDate:()=>xI,CustomOverflowMenu:()=>f0,ToolsIcon:()=>hp,ErrorState:()=>ED,LocationIcon:()=>pK,GroupIcon:()=>pM,canBeginEditSynchronizationItemsOfType:()=>l1,ConditionsIcon:()=>hP,SaveIcon:()=>hr,VisitStatus:()=>uy,createUseStore:()=>ds,detach:()=>cT,getSessionLocation:()=>id,setCurrentVisit:()=>u_,usePatient:()=>fC,useRenderableExtensions:()=>fT,useWorkspaces:()=>Da,setLeftNav:()=>cI,isDevEnabled:()=>iy,formatTime:()=>xF,useConfig:()=>dQ,validator:()=>tk,syncOfflinePatientData:()=>uc,CalendarIcon:()=>po,closeWorkspaceGroup2:()=>DN,getHistory:()=>n1,StickyNoteAddIcon:()=>hl,ConfigurableLink:()=>c4,subscribeSnackbarShown:()=>T,getPatientName:()=>EZ,getVisitStore:()=>uv,getDynamicOfflineDataEntriesFor:()=>l7,getCoreTranslation:()=>os,GenderMaleIcon:()=>pT,getLoggedInUser:()=>ic,isOfflineUuid:()=>c0,getBreadcrumbs:()=>rx,evaluateAsNumberAsync:()=>uV,extractVariableNames:()=>u0,putDynamicOfflineDataFor:()=>ut,EditIcon:()=>pO,translateFrom:()=>oa,putDynamicOfflineData:()=>ue,shallowEqual:()=>M,showSnackbar:()=>SJ,Type:()=>tC,InPatientPictogram:()=>Sk,MaximizeIcon:()=>pz,subscribeNotificationShown:()=>P,useStoreWithActions:()=>da,PatientBannerActionsMenu:()=>St,PatientSearchPictogram:()=>SA,WarningIcon:()=>hS,DocumentAttachmentIcon:()=>pE,fhirBaseUrl:()=>n6,matchLocale:()=>DJ,registerBreadcrumb:()=>r_,CardiologyPictogram:()=>Sw,EventsIcon:()=>pC,ImageMedicalIcon:()=>p$,calculateInterpretation:()=>ER,createGlobalStore:()=>K,usePatientPhoto:()=>Sd,getCurrentOfflineMode:()=>cK,useExtensionStore:()=>d5,closeWorkspace:()=>S7,DiagnosisTags:()=>Ew,createAttachment:()=>o_,iconIds:()=>f5,PatientsPictogram:()=>SM,TableIcon:()=>hd,interpolateUrl:()=>nJ,useLeftNavStore:()=>f_,Icon:()=>hj,InformationFilledIcon:()=>pF,subscribeToastShown:()=>k,LaboratoryPictogram:()=>ST,detachAll:()=>cj,convertToLocaleCalendar:()=>xV,toDateObjectStrict:()=>xC,DocumentIcon:()=>px,defineConfigSchema:()=>t1,ActionMenuButton2:()=>DY,setupDynamicOfflineDataHandler:()=>l8,filterBreadcrumbs:()=>rS,makeUrl:()=>n8,oneOf:()=>ry,launchWorkspaceGroup:()=>function e(t,r){let n=function(e){let t=c5.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}(t),{state:i,onWorkspaceGroupLaunch:o,workspaceGroupCleanup:a,workspaceToLaunch:s}=r,l=function(){return Dr}();if(l.getState().openWorkspaces.length){let n=l.getState().workspaceGroup;n?S3(n?.name,()=>{e(t,r)}):Do(()=>{e(t,r)})}else l.setState(e=>({...e,workspaceGroup:{name:t,members:n.members,cleanup:a}})),Dc(t,i),o?.(),s&&S2(s.name,s.additionalProps??{})},PatientBannerContactDetails:()=>Sl,selectPreferredName:()=>EX,getAssignedExtensions:()=>cA,syncDynamicOfflineData:()=>uo,PatientPhoto:()=>Sh,MobileCheckIcon:()=>pY,createErrorHandler:()=>R,openmrsObservableFetch:()=>n7,MaterialOrderIcon:()=>pH,MicroscopeIcon:()=>pZ,parseDate:()=>xT,getAttachmentByUuid:()=>ob,LeftNavMenu:()=>EP,registerExtension:()=>cC,ShoppingCartAddItemIcon:()=>hk,PharmacyPictogram:()=>SI,ReferralOrderIcon:()=>p9,AttachmentIcon:()=>hO,ReportIcon:()=>he,MoneyIcon:()=>pJ,getAttachments:()=>ov,DownloadIcon:()=>pS,PageHeaderContent:()=>Eq,MedicationIcon:()=>pq,PrinterIcon:()=>p6,getFullSynchronizationItemsFor:()=>lJ,PatientListsPictogram:()=>SH,ShoppingCartArrowDownIcon:()=>hs,provide:()=>t4,AppointmentsAltPictogram:()=>Sg,GenericOrderTypeIcon:()=>pA,setupOfflineSync:()=>l2,useAppContext:()=>dH,removeDynamicOfflineDataFor:()=>un,useConnectivity:()=>d0,ViewIcon:()=>hE,formattedName:()=>EQ,sessionEndpoint:()=>n5,GeriatricsPictogram:()=>SP,useExtensionSlotStore:()=>dc,unregisterContext:()=>iw,duration:()=>xq,SearchIcon:()=>hn,CaretLeftIcon:()=>ps,TableOfContentsIcon:()=>hc,isVersionSatisfied:()=>D3,isOmrsDateToday:()=>xP,getExtensionStore:()=>cs,BloodBankPictogram:()=>S_,EmptyCardIllustration:()=>EE,PenIcon:()=>p2,TriagePictogram:()=>SU,Workspace2:()=>DK,CheckmarkOutlineIcon:()=>pp,refetchCurrentUser:()=>is,registerOfflinePatientHandler:()=>uu,registerExtensionSlot:()=>cM,AllergiesIcon:()=>hD,ArrowDownIcon:()=>f7,getGlobalStore:()=>z,reportError:()=>j,showToast:()=>S0,subscribeToContext:()=>iS,OpenmrsDatePicker:()=>Ev,ArrowRightIcon:()=>pt,getDynamicOfflineDataEntries:()=>l9,getLocaleDisplayName:()=>w3,messageOmrsServiceWorker:()=>oR,navigate:()=>nX,launchWorkspace2:()=>DI,registerBreadcrumbs:()=>rw,isUrl:()=>rm,CustomOverflowMenuItem:()=>f1,MotherIcon:()=>pQ,CaretDownIcon:()=>pa,ArrowLeftIcon:()=>pe,FacilityPictogram:()=>SO,ViewOffIcon:()=>hx,fetchCurrentPatient:()=>uf,useDefineAppContext:()=>dV,useOnClickOutside:()=>fx,useOpenmrsInfinite:()=>fc,validators:()=>rg,MessageQueueIcon:()=>pG,TwoFactorAuthenticationIcon:()=>hg,Pharmacy2Pictogram:()=>S$,goBackInHistory:()=>n3,GroupAccessIcon:()=>pN,showNotification:()=>EW,getAsyncExtensionLifecycle:()=>dF,WorkspaceContainer:()=>DR,queueSynchronizationItem:()=>lZ,ListCheckedIcon:()=>pW,formatDurationBetween:()=>xZ,ResponsiveWrapper:()=>SG,GynaecologyPictogram:()=>SC,ShoppingCartIcon:()=>ha,defaultVisitCustomRepresentation:()=>ug,Pagination:()=>EG,getBreadcrumbsFor:()=>rD,CheckmarkFilledIcon:()=>pf,clearCurrentUser:()=>il,useOpenmrsPagination:()=>d7,updateVisit:()=>ux,backendDependencies:()=>ig,ChevronUpIcon:()=>pb,MaybePictogram:()=>Sz,beginEditSynchronizationItem:()=>l3,Pictogram:()=>Sq,getStartedVisit:()=>uS,omrsOfflineResponseStatusHttpHeaderName:()=>cz,openmrsFetch:()=>n9,saveVisit:()=>uw,HomePictogram:()=>SK,ChevronDownIcon:()=>pm,DentistryPictogram:()=>SE,OpenmrsDateRangePicker:()=>E_,ServiceQueuesPictogram:()=>SF,deleteAttachmentPermanently:()=>ow,OverflowMenuHorizontalIcon:()=>p0,getVisitTypes:()=>uP,launchWorkspace:()=>S2,EventScheduleIcon:()=>pP,DigitalTrustPictogram:()=>SS,NumericObservation:()=>EN,attachmentUrl:()=>og,getSessionStore:()=>io,interpolateString:()=>nQ,inRange:()=>rp,registerContext:()=>i_,AppointmentsPictogram:()=>Sy,showModal:()=>E$,toLanguageTag:()=>w1,ProcedureOrderIcon:()=>p5,useAttachments:()=>dG,getRegisteredWorkspace2Names:()=>DV,useConceptReferenceRange:()=>EA,setSessionLocation:()=>ip,toLocationObject:()=>uC,useExtensionSlotMeta:()=>d6,useOnVisible:()=>fE,ChartAverageIcon:()=>pc,ChartLineIcon:()=>pd,UserAvatarIcon:()=>hb,UserHasAccess:()=>fR,evaluateAsBooleanAsync:()=>uF,createDashboard:()=>hA,getFeatureFlag:()=>u6,getLocations:()=>uk,EmergencyDepartmentPictogram:()=>SD,navigateAndLaunchWorkspace:()=>S6,getOfflineDb:()=>lK,getSynchronizationItem:()=>l0,renderExtension:()=>cW,omrsOfflineCachingStrategyHttpHeaderName:()=>cq,formatDate:()=>x$,toVisitTypeObject:()=>uO,useFhirInfinite:()=>fm,useSession:()=>fj,useStore:()=>di,SwitcherIcon:()=>ho,age:()=>E1,syncAllDynamicOfflineData:()=>ui,useAssignedExtensionIds:()=>dq,userHasAccess:()=>iu,isOmrsDateStrict:()=>xO,CaretRightIcon:()=>pl,evaluateAsType:()=>uU,usePaginationInfo:()=>fO,evaluateAsync:()=>u$,PageHeader:()=>Ez,TranslateIcon:()=>hh,useOpenmrsFetchAll:()=>ff,setUserProperties:()=>ih,MovementIcon:()=>pX,ageAsDuration:()=>E0,removeDynamicOfflineData:()=>ur,subscribePrecacheStaticDependencies:()=>w,getExtensionNameFromId:()=>cO,PaymentsDeskPictogram:()=>SN,useVisitTypes:()=>fV,usePrimaryIdentifierCode:()=>fk,updateContext:()=>iE,deleteSynchronizationItem:()=>l4,getCurrentUser:()=>ii,useLayoutType:()=>fg,ResetIcon:()=>ht,RenewIcon:()=>p7,useWorkspace2Context:()=>DB,XrayPictogram:()=>SW,CaretUpIcon:()=>pu,subscribeActionableNotificationShown:()=>C,OpenmrsAppContext:()=>dU,ErrorCard:()=>EO,GenderFemaleIcon:()=>pk,omrsOfflineResponseBodyHttpHeaderName:()=>cH,getOfflinePatientDataStore:()=>ul,retry:()=>D4,getDefaultsFromConfigSchema:()=>function e(t){let r={};for(let n of Object.keys(t))if(DX(t[n])&&t[n].hasOwnProperty("_default"))r[n]=t[n]._default;else{if(n.startsWith("_"))continue;DX(t[n])?r[n]=e(t[n]):r[n]=t[n]}return r},ExtensionSlot:()=>dm,subscribeConnectivityChanged:()=>g,subscribeTo:()=>q,unsetLeftNav:()=>c$,useAbortController:()=>dK,Extension:()=>fU,getFhirServerPaginationHandlers:()=>fn,MaybeIcon:()=>hT,useConnectedExtensions:()=>dX,useCustomOverflowMenu:()=>fX,PedestrianFamilyIcon:()=>p4,generateOfflineUuid:()=>cX,HospitalBedIcon:()=>pI,CtScanPictogram:()=>Sx,OpenmrsFetchError:()=>ie,getSynchronizationItems:()=>lQ,UserFollowIcon:()=>hv,RenderIfValueIsTruthy:()=>dW,launchWorkspaceGroup2:()=>DM,normalizeInterpretation:()=>Ej,ChevronRightIcon:()=>pg,UserXrayIcon:()=>h_,GenderOtherIcon:()=>pj,CalendarHeatMapIcon:()=>pi,formatDuration:()=>xU,contextStore:()=>ib,registerFeatureFlag:()=>u2,restBaseUrl:()=>n2,getFullSynchronizationItems:()=>lX,useFhirFetchAll:()=>fh,toOmrsIsoString:()=>xk,Labs2Pictogram:()=>Sj,PatientBannerPatientInfo:()=>E7,evaluateAsBoolean:()=>uL,getDefaultCalendar:()=>xM,SettingsIcon:()=>hi,DrugOrderIcon:()=>pD,isOnline:()=>u5,setUserLanguage:()=>ia,useBodyScrollLock:()=>dZ,SyringeIcon:()=>hu,LocationPicker:()=>EC,ProgramsIcon:()=>p8,useDebounce:()=>d1,TimeIcon:()=>hf,useAssignedExtensions:()=>df,CloseFilledIcon:()=>p_,canAccessStorage:()=>DQ,registerDefaultCalendar:()=>xA,TreeViewAltIcon:()=>hy,AddIcon:()=>f9,OverflowMenuVerticalIcon:()=>p1,getConfigStore:()=>tF,InventoryManagementIcon:()=>pV,formatPatientName:()=>EJ,UserIcon:()=>hw,getContext:()=>ix,InformationSquareIcon:()=>pB,EmptyCard:()=>ES,ChevronLeftIcon:()=>py,RadiologyIcon:()=>hC,displayName:()=>EY,evaluate:()=>uI,isDesktop:()=>fb,defineExtensionConfigSchema:()=>t3,RegistrationPictogram:()=>SL,CardHeader:()=>fz,getSyncLifecycle:()=>dL,InformationIcon:()=>pL,TrashCanIcon:()=>hm,evaluateAsTypeAsync:()=>uW});let y="openmrs:connectivity-changed";function g(e){if(!window.offlineEnabled)return()=>{};let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}function b(e){return e({online:!window.offlineEnabled||navigator.onLine}),g(e)}let v="openmrs:precache-static-dependencies";function w(e){let t=t=>e(t.detail);return window.addEventListener(v,t),()=>window.removeEventListener(v,t)}let x="openmrs:notification-shown",E="openmrs:actionable-notification-shown",S="openmrs:toast-shown",D="openmrs:snack-bar-shown";function O(e){window.dispatchEvent(new CustomEvent(S,{detail:e}))}function P(e){let t=t=>e(t.detail);return window.addEventListener(x,t),()=>window.removeEventListener(x,t)}function C(e){let t=t=>e(t.detail);return window.addEventListener(E,t),()=>window.removeEventListener(E,t)}function k(e){let t=t=>e(t.detail);return window.addEventListener(S,t),()=>window.removeEventListener(S,t)}function T(e){let t=t=>e(t.detail);return window.addEventListener(D,t),()=>window.removeEventListener(D,t)}function j(e){let t=A(e);setTimeout(()=>{throw t})}function R(){let e=Error();return t=>{let r=A(t);r.stack+=`
1
+ (globalThis.webpackChunk_openmrs_esm_form_builder_app=globalThis.webpackChunk_openmrs_esm_form_builder_app||[]).push([["8398"],{47581(e){e.exports=function(e,t,r){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=r();return this.format(e)===t.format(e)}}},5238(e){e.exports=function(e,t,r){var n=t.prototype,i=function(e){var t=e.date,i=e.utc,o={};if(!(null===t||t instanceof Date||t instanceof Array||n.$utils().u(t)||"Object"!==t.constructor.name)){if(!Object.keys(t).length)return new Date;var a=i?r.utc():r();Object.keys(t).forEach(function(e){var r;o["date"===(r=n.$utils().p(e))?"day":r]=t[e]});var s=o.day||(o.year||o.month>=0?1:a.date()),l=o.year||a.year(),u=o.month>=0?o.month:o.year||o.day?0:a.month(),c=o.hour||0,d=o.minute||0,f=o.second||0,p=o.millisecond||0;return i?new Date(Date.UTC(l,u,s,c,d,f,p)):new Date(l,u,s,c,d,f,p)}return t},o=n.parse;n.parse=function(e){e.date=i.bind(this)(e),o.bind(this)(e)};var a=n.set,s=n.add,l=n.subtract,u=function(e,t,r,n){void 0===n&&(n=1);var i=Object.keys(t),o=this;return i.forEach(function(r){o=e.bind(o)(t[r]*n,r)}),o};n.set=function(e,t){return t=void 0===t?e:t,"Object"===e.constructor.name?u.bind(this)(function(e,t){return a.bind(this)(t,e)},t,e):a.bind(this)(e,t)},n.add=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t):s.bind(this)(e,t)},n.subtract=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t,-1):l.bind(this)(e,t)}}},83826(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,o){var a=i.prototype;o.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},a.utc=function(t){var r=o(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.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=a.utcOffset;a.utcOffset=function(n,i){var o=this.$utils().u;if(o(n))return this.$u?0:o(this.$offset)?u.call(this):this.$offset;if("string"==typeof n&&null===(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],o=i[0],a=60*i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(n)))return this;var a=16>=Math.abs(n)?60*n:n,s=this;if(i)return s.$offset=a,s.$u=0===n,s;if(0!==n){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var c=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var f=a.diff;a.diff=function(e,t,r){if(e&&this.$u===e.$u)return f.call(this,e,t,r);var n=this.local(),i=o(e).local();return f.call(n,i,t,r)}}}()},16767(e,t,r){!function(t){"use strict";var n=r(26974);function i(e){return function(t,r){return"object"==typeof t&&(r=t,t=null),null==t&&(t=new Date().toString()),r||(r={}),e.call(this,t,r)}}var o=e.exports={generate:i(function(e,t){return new n(e,t)})};t&&(t.fn.geopattern=i(function(e,r){return this.each(function(){var n=t(this).attr("data-title-sha");n&&(r=t.extend({hash:n},r));var i=o.generate(e,r);t(this).css("background-image",i.toDataUrl())})}))}("u">typeof jQuery?jQuery:null)},82467(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,r,n){return t+t+r+r+n+n});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,r,n=e.r,i=e.g,o=e.b,a=Math.max(n/=255,i/=255,o/=255),s=Math.min(n,i,o),l=(a+s)/2;if(a===s)t=r=0;else{var u=a-s;switch(r=l>.5?u/(2-a-s):u/(a+s),a){case n:t=(i-o)/u+6*(i<o);break;case i:t=(o-n)/u+2;break;case o:t=(n-i)/u+4}t/=6}return{h:t,s:r,l:l}},hsl2rgb:function(e){function t(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var r,n,i,o=e.h,a=e.s,s=e.l;if(0===a)r=n=i=s;else{var l=s<.5?s*(1+a):s+a-s*a,u=2*s-l;r=t(u,l,o+1/3),n=t(u,l,o),i=t(u,l,o-1/3)}return{r:Math.round(255*r),g:Math.round(255*n),b:Math.round(255*i)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},26974(e,t,r){"use strict";var n=r(97804),i=r(82467),o=r(66743),a=r(28502),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,r){return parseInt(e.substr(t,r||1),16)}function d(e,t,r,n,i){return(parseFloat(e)-t)*(i-n)/(r-t)+n}function f(e){return e%2==0?"#ddd":"#222"}function p(e){return d(e,0,15,.02,.15)}var h=e.exports=function(e,t){return this.opts=n({},s,t),this.hash=t.hash||o(e),this.svg=new a,this.generateBackground(),this.generatePattern(),this};function m(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function y(e){return[0,0,e,e,0,e,0,0].join(",")}function g(e,t,r,n,i){var o=y(n),a=p(i[0]),s=f(i[0]),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a,fill:s};e.polyline(o,l).transform({translate:[t+n,r],scale:[-1,1]}),e.polyline(o,l).transform({translate:[t+n,r+2*n],scale:[1,-1]}),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a=p(i[1]),fill:s=f(i[1])},e.polyline(o,l).transform({translate:[t+n,r+2*n],scale:[-1,-1]}),e.polyline(o,l).transform({translate:[t+n,r],scale:[1,1]})}function b(e,t,r,n,i){var o=p(i),a=f(i),s=y(n),l={stroke:u,"stroke-opacity":.02,"fill-opacity":o,fill:a};e.polyline(s,l).transform({translate:[t,r+n],scale:[1,-1]}),e.polyline(s,l).transform({translate:[t+2*n,r+n],scale:[-1,-1]}),e.polyline(s,l).transform({translate:[t,r+n],scale:[1,1]}),e.polyline(s,l).transform({translate:[t+2*n,r+n],scale:[-1,1]})}h.prototype.toSvg=function(){return this.svg.toString()},h.prototype.toString=function(){return this.toSvg()},h.prototype.toBase64=function(){var e=this.toSvg();return"u">typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},h.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},h.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},h.prototype.generateBackground=function(){var e,t,r,n;this.opts.color?r=i.hex2rgb(this.opts.color):(t=d(c(this.hash,14,3),0,4095,0,359),n=c(this.hash,17),(e=i.rgb2hsl(i.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,n%2==0?e.s=Math.min(1,(100*e.s+n)/100):e.s=Math.max(0,(100*e.s-n)/100),r=i.hsl2rgb(e)),this.color=i.rgb2hex(r),this.svg.rect(0,0,"100%","100%",{fill:i.rgb2rgbString(r)})},h.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)]()},h.prototype.geoHexagons=function(){var e,t,r,n,i,o,a,s,l,h=d(c(this.hash,0),0,15,8,60),m=h*Math.sqrt(3),y=2*h,g=(s=h/2,[0,l=Math.sin(60*Math.PI/180)*h,s,0,s+h,0,2*h,l,s+h,2*l,s,2*l,0,l].join(","));for(this.svg.setWidth(3*y+3*h),this.svg.setHeight(6*m),t=0,a=0;a<6;a++)for(o=0;o<6;o++)i=c(this.hash,t),e=o%2==0?a*m:a*m+m/2,r=p(i),n={fill:f(i),"fill-opacity":r,stroke:u,"stroke-opacity":.02},this.svg.polyline(g,n).transform({translate:[o*h*1.5-y/2,e-m/2]}),0===o&&this.svg.polyline(g,n).transform({translate:[6*h*1.5-y/2,e-m/2]}),0===a&&(e=o%2==0?6*m:6*m+m/2,this.svg.polyline(g,n).transform({translate:[o*h*1.5-y/2,e-m/2]})),0===o&&0===a&&this.svg.polyline(g,n).transform({translate:[6*h*1.5-y/2,5*m+m/2]}),t++},h.prototype.geoSineWaves=function(){var e,t,r,n,i,o,a,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++)r=p(o=c(this.hash,t)),e=f(o),a=s/4*.7,i={fill:"none",stroke:e,opacity:r,"stroke-width":""+u+"px"},n="M0 "+l+" C "+a+" 0, "+(s/2-a)+" 0, "+s/2+" "+l+" S "+(s-a)+" "+2*l+", "+s+" "+l+" S "+(1.5*s-a)+" 0, "+1.5*s+", "+l,this.svg.path(n,i).transform({translate:[-s/4,u*t-1.5*l]}),this.svg.path(n,i).transform({translate:[-s/4,u*t-1.5*l+36*u]})},h.prototype.geoChevrons=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,30,80),l=d(c(this.hash,0),0,15,30,80),h=(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,a=0;a<6;a++)for(o=0;o<6;o++)r=p(i=c(this.hash,t)),n={stroke:u,"stroke-opacity":.02,fill:f(i),"fill-opacity":r,"stroke-width":1},this.svg.group(n).transform({translate:[o*s,a*l*.66-l/2]}).polyline(h).end(),0===a&&this.svg.group(n).transform({translate:[o*s,6*l*.66-l/2]}).polyline(h).end(),t+=1},h.prototype.geoPlusSigns=function(){var e,t,r,n,i,o,a,s,l=d(c(this.hash,0),0,15,10,25),h=3*l,y=m(l);for(this.svg.setWidth(12*l),this.svg.setHeight(12*l),r=0,s=0;s<6;s++)for(a=0;a<6;a++)n=p(o=c(this.hash,r)),t=f(o),e=+(s%2!=0),i={fill:t,stroke:u,"stroke-opacity":.02,"fill-opacity":n},this.svg.group(i).transform({translate:[a*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===a&&this.svg.group(i).transform({translate:[4*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===s&&this.svg.group(i).transform({translate:[a*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),0===a&&0===s&&this.svg.group(i).transform({translate:[4*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),r++},h.prototype.geoXes=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,25),l=m(s),u=3*s*.943;for(this.svg.setWidth(3*u),this.svg.setHeight(3*u),t=0,a=0;a<6;a++)for(o=0;o<6;o++)r=p(i=c(this.hash,t)),e=o%2==0?a*u-.5*u:a*u-.5*u+u/4,n={fill:f(i),opacity:r},this.svg.group(n).transform({translate:[o*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&this.svg.group(n).transform({translate:[6*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===a&&(e=o%2==0?6*u-u/2:6*u-u/2+u/4,this.svg.group(n).transform({translate:[o*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end()),5===a&&this.svg.group(n).transform({translate:[o*u/2-u/2,e-11*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&0===a&&this.svg.group(n).transform({translate:[6*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),t++},h.prototype.geoOverlappingCircles=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=p(n=c(this.hash,e)),r={fill:f(n),opacity:t},this.svg.circle(i*a,o*a,a,r),0===i&&this.svg.circle(6*a,o*a,a,r),0===o&&this.svg.circle(i*a,6*a,a,r),0===i&&0===o&&this.svg.circle(6*a,6*a,a,r),e++},h.prototype.geoOctogons=function(){var e,t,r,n,i,o,a,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),r=0,a=0;a<6;a++)for(o=0;o<6;o++)n=p(i=c(this.hash,r)),t=f(i),this.svg.polyline(l,{fill:t,"fill-opacity":n,stroke:u,"stroke-opacity":.02}).transform({translate:[o*s,a*s]}),r+=1},h.prototype.geoSquares=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),t=0,o=0;o<6;o++)for(i=0;i<6;i++)r=p(n=c(this.hash,t)),e=f(n),this.svg.rect(i*a,o*a,a,a,{fill:e,"fill-opacity":r,stroke:u,"stroke-opacity":.02}),t+=1},h.prototype.geoConcentricCircles=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60),s=a/5;for(this.svg.setWidth((a+s)*6),this.svg.setHeight((a+s)*6),t=0,o=0;o<6;o++)for(i=0;i<6;i++)r=p(n=c(this.hash,t)),e=f(n),this.svg.circle(i*a+i*s+(a+s)/2,o*a+o*s+(a+s)/2,a/2,{fill:"none",stroke:e,opacity:r,"stroke-width":s+"px"}),r=p(n=c(this.hash,39-t)),e=f(n),this.svg.circle(i*a+i*s+(a+s)/2,o*a+o*s+(a+s)/2,a/4,{fill:e,"fill-opacity":r}),t+=1},h.prototype.geoOverlappingRings=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60),s=a/4;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=p(n=c(this.hash,e)),r={fill:"none",stroke:f(n),opacity:t,"stroke-width":s+"px"},this.svg.circle(i*a,o*a,a-s/2,r),0===i&&this.svg.circle(6*a,o*a,a-s/2,r),0===o&&this.svg.circle(i*a,6*a,a-s/2,r),0===i&&0===o&&this.svg.circle(6*a,6*a,a-s/2,r),e+=1},h.prototype.geoTriangles=function(){var e,t,r,n,i,o,a,s,l=d(c(this.hash,0),0,15,15,80),h=l/2*Math.sqrt(3),m=[s=l/2,0,l,h,0,h,s,0].join(",");for(this.svg.setWidth(3*l),this.svg.setHeight(6*h),e=0,a=0;a<6;a++)for(o=0;o<6;o++)t=p(i=c(this.hash,e)),n={fill:f(i),"fill-opacity":t,stroke:u,"stroke-opacity":.02},r=a%2==0?180*(o%2==0):180*(o%2!=0),this.svg.polyline(m,n).transform({translate:[o*l*.5-l/2,h*a],rotate:[r,l/2,h/2]}),0===o&&this.svg.polyline(m,n).transform({translate:[6*l*.5-l/2,h*a],rotate:[r,l/2,h/2]}),e+=1},h.prototype.geoDiamonds=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,50),l=d(c(this.hash,1),0,15,10,50),h=[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,a=0;a<6;a++)for(o=0;o<6;o++)r=p(i=c(this.hash,t)),n={fill:f(i),"fill-opacity":r,stroke:u,"stroke-opacity":.02},e=a%2==0?0:s/2,this.svg.polyline(h,n).transform({translate:[o*s-s/2+e,l/2*a-l/2]}),0===o&&this.svg.polyline(h,n).transform({translate:[6*s-s/2+e,l/2*a-l/2]}),0===a&&this.svg.polyline(h,n).transform({translate:[o*s-s/2+e,l/2*6-l/2]}),0===o&&0===a&&this.svg.polyline(h,n).transform({translate:[6*s-s/2+e,l/2*6-l/2]}),t+=1},h.prototype.geoNestedSquares=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,4,12),s=7*a;for(this.svg.setWidth((s+a)*6+6*a),this.svg.setHeight((s+a)*6+6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=p(n=c(this.hash,e)),r={fill:"none",stroke:f(n),opacity:t,"stroke-width":a+"px"},this.svg.rect(i*s+i*a*2+a/2,o*s+o*a*2+a/2,s,s,r),t=p(n=c(this.hash,39-e)),r={fill:"none",stroke:f(n),opacity:t,"stroke-width":a+"px"},this.svg.rect(i*s+i*a*2+a/2+2*a,o*s+o*a*2+a/2+2*a,3*a,3*a,r),e+=1},h.prototype.geoMosaicSquares=function(){var e,t,r,n=d(c(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*n),this.svg.setHeight(8*n),e=0,r=0;r<4;r++)for(t=0;t<4;t++)t%2==0?r%2==0?b(this.svg,t*n*2,r*n*2,n,c(this.hash,e)):g(this.svg,t*n*2,r*n*2,n,[c(this.hash,e),c(this.hash,e+1)]):r%2==0?g(this.svg,t*n*2,r*n*2,n,[c(this.hash,e),c(this.hash,e+1)]):b(this.svg,t*n*2,r*n*2,n,c(this.hash,e)),e+=1},h.prototype.geoPlaid=function(){var e,t,r,n,i,o,a=0,s=0;for(t=0;t<36;)a+=c(this.hash,t)+5,r=p(o=c(this.hash,t+1)),e=f(o),n=o+5,this.svg.rect(0,a,"100%",n,{opacity:r,fill:e}),a+=n,t+=2;for(t=0;t<36;)s+=c(this.hash,t)+5,r=p(o=c(this.hash,t+1)),e=f(o),i=o+5,this.svg.rect(s,0,i,"100%",{opacity:r,fill:e}),s+=i,t+=2;this.svg.setWidth(s),this.svg.setHeight(a)},h.prototype.geoTessellation=function(){var e,t,r,n,i=d(c(this.hash,0),0,15,5,40),o=i*Math.sqrt(3),a=2*i,s=i/2*Math.sqrt(3),l=[0,0,s,i/2,0,i,0,0].join(","),h=3*i+2*s,m=2*o+2*i;for(this.svg.setWidth(h),this.svg.setHeight(m),e=0;e<20;e++)switch(t=p(n=c(this.hash,e)),r={stroke:u,"stroke-opacity":.02,fill:f(n),"fill-opacity":t,"stroke-width":1},e){case 0:this.svg.rect(-i/2,-i/2,i,i,r),this.svg.rect(h-i/2,-i/2,i,i,r),this.svg.rect(-i/2,m-i/2,i,i,r),this.svg.rect(h-i/2,m-i/2,i,i,r);break;case 1:this.svg.rect(a/2+s,o/2,i,i,r);break;case 2:this.svg.rect(-i/2,m/2-i/2,i,i,r),this.svg.rect(h-i/2,m/2-i/2,i,i,r);break;case 3:this.svg.rect(a/2+s,1.5*o+i,i,i,r);break;case 4:this.svg.polyline(l,r).transform({translate:[i/2,-i/2],rotate:[0,i/2,s/2]}),this.svg.polyline(l,r).transform({translate:[i/2,m- -i/2],rotate:[0,i/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(l,r).transform({translate:[h-i/2,-i/2],rotate:[0,i/2,s/2],scale:[-1,1]}),this.svg.polyline(l,r).transform({translate:[h-i/2,m+i/2],rotate:[0,i/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(l,r).transform({translate:[h/2+i/2,o/2]});break;case 7:this.svg.polyline(l,r).transform({translate:[h-h/2-i/2,o/2],scale:[-1,1]});break;case 8:this.svg.polyline(l,r).transform({translate:[h/2+i/2,m-o/2],scale:[1,-1]});break;case 9:this.svg.polyline(l,r).transform({translate:[h-h/2-i/2,m-o/2],scale:[-1,-1]});break;case 10:this.svg.polyline(l,r).transform({translate:[i/2,m/2-i/2]});break;case 11:this.svg.polyline(l,r).transform({translate:[h-i/2,m/2-i/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,i/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[-h+i/2,i/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 15:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[-h+i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 16:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,-m+m/2-i/2-i],rotate:[30,0,i]});break;case 17:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[-h+i/2,-m+m/2-i/2-i],rotate:[30,0,i]});break;case 18:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,-m+i/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[-h+i/2,-m+i/2],rotate:[-30,0,0]})}}},66743(e){"use strict";function t(){var e=0x67452301,t=0xefcdab89,r=0x98badcfe,n=0x10325476,i=0xc3d2e1f0,o=new Uint32Array(80),a=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,f=t,p=r,h=n,m=i;for(u=0;u<80;u++){u<20?(s=h^f&(p^h),l=0x5a827999):u<40?(s=f^p^h,l=0x6ed9eba1):u<60?(s=f&p|h&(f|p),l=0x8f1bbcdc):(s=f^p^h,l=0xca62c1d6);var y=(d<<5|d>>>27)+s+m+l+(0|o[u]);m=h,h=p,p=f<<30|f>>>2,f=d,d=y}for(u=0,e=e+d|0,t=t+f|0,r=r+p|0,n=n+h|0,i=i+m|0,a=0;u<16;u++)o[u]=0}function c(e){o[a]|=(255&e)<<s,s?s-=8:(a++,s=24),16===a&&u()}function d(e){for(var t="",r=28;r>=0;r-=4)t+=(e>>r&15).toString(16);return t}return{update:function(e){if("string"==typeof e){var t=e.length;l+=8*t;for(var r=0;r<t;r++)c(e.charCodeAt(r));return}var n=e.length;l+=8*n;for(var i=0;i<n;i++)c(e[i])},digest:function(){c(128),(a>14||14===a&&s<24)&&u(),a=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(r)+d(n)+d(i)}}}e.exports=function(e){if(void 0===e)return t();var r=t();return r.update(e),r.digest()}},28502(e,t,r){"use strict";var n=r(97804),i=r(16541);function o(){return this.width=100,this.height=100,this.svg=i("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(r){e.setAttribute(r,t[r])})},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,r,o,a){var s=this;if(Array.isArray(e))return e.forEach(function(e){s.rect.apply(s,e.concat(a))}),this;var l=i("rect");return this.currentContext().appendChild(l),this.setAttributes(l,n({x:e,y:t,width:r,height:o},a)),this},o.prototype.circle=function(e,t,r,o){var a=i("circle");return this.currentContext().appendChild(a),this.setAttributes(a,n({cx:e,cy:t,r:r},o)),this},o.prototype.path=function(e,t){var r=i("path");return this.currentContext().appendChild(r),this.setAttributes(r,n({d:e},t)),this},o.prototype.polyline=function(e,t){var r=this;if(Array.isArray(e))return e.forEach(function(e){r.polyline(e,t)}),this;var o=i("polyline");return this.currentContext().appendChild(o),this.setAttributes(o,n({points:e},t)),this},o.prototype.group=function(e){var t=i("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,n({},e)),this}},16541(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("")}},97804(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(e){if(!e||"[object Object]"!==r.call(e)||e.nodeType||e.setInterval)return!1;var n,i=t.call(e,"constructor"),o=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(n in e);return void 0===n||t.call(e,n)}e.exports=function e(){var t,r,i,o,a,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(r in t)i=l[r],l!==(o=t[r])&&(d&&o&&(n(o)||(a=Array.isArray(o)))?(a?(a=!1,s=i&&Array.isArray(i)?i:[]):s=i&&n(i)?i:{},l[r]=e(d,s,o)):void 0!==o&&(l[r]=o));return l}},48067(e,t){"use strict";t.pathToRegexp=function(e,t={}){let{delimiter:u="/",end:c=!0,sensitive:d=!1,trailing:f=!0}=t,p=[],h=[];for(let c of function e(t,r){if(Array.isArray(t))for(let n of t)e(n,r);else r.push(t);return r}(e,[])){let e="object"==typeof c?c:function(e,t={}){let{encodePath:a=r}=t,u=[...e],c=[],d=0,f=0;function p(){let t="";if(n.test(u[d]))do t+=u[d++];while(i.test(u[d]));else if('"'===u[d]){let r=d;for(;d++<u.length;){if('"'===u[d]){d++,r=0;break}"\\"===u[d]&&d++,t+=u[d]}if(r)throw new l(`Unterminated quote at index ${r}`,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(r){let n=[];for(;;){let i=c[f++];if(i.type===r)break;if("char"===i.type||"escape"===i.type){let e=i.value,t=c[f];for(;"char"===t.type||"escape"===t.type;)e+=t.value,t=c[++f];n.push({type:"text",value:a(e)});continue}if("param"===i.type||"wildcard"===i.type){n.push({type:i.type,name:i.value});continue}if("{"===i.type){n.push({type:"group",tokens:t("}")});continue}throw new l(`Unexpected ${i.type} at index ${i.index}, expected ${r}`,e)}return n}("end"),e)}(c,t);for(let t of function* e(t,r,n){if(r===t.length)return yield n;let i=t[r];if("group"===i.type)for(let o of e(i.tokens,0,n.slice()))yield*e(t,r+1,o);else n.push(i);yield*e(t,r+1,n)}(e.tokens,0,[]))h.push(function(e,t,r,n){let i="",o="",s=!0;for(let d of e){if("text"===d.type){i+=a(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}`,n);"param"===d.type?i+=`(${u=t,(c=s?"":o).length<2?u.length<2?`[^${a(u+c)}]`:`(?:(?!${a(u)})[^${a(c)}])`:u.length<2?`(?:(?!${a(c)})[^${a(u)}])`:`(?:(?!${a(c)}|${a(u)})[\\s\\S])`}+)`:i+="([\\s\\S]+)",r.push(d),o="",s=!1;continue}}return i}(t,u,p,e.originalPath))}let m=`^(?:${h.join("|")})`;return f&&(m+=`(?:${a(u)}$)?`),{regexp:new RegExp(m+=c?"$":`(?=${a(u)}|$)`,d?"":"i"),keys:p}};let r=e=>e,n=/^[$_\p{ID_Start}]$/u,i=/^[$\u200c\u200d\p{ID_Continue}]$/u,o={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function a(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class s{constructor(e,t){this.tokens=e,this.originalPath=t}}class l extends TypeError{constructor(e,t){let r=e;t&&(r+=`: ${t}`),super(r+="; visit https://git.new/pathToRegexpError for info"),this.originalPath=t}}},5338(e,t,r){"use strict";var n=r(54575);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},49850(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(83207);t.AsyncSubject=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return i(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),a.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),a.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(o.Subject)},466(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(16967);t.BehaviorSubject=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(!this.closed)return this._value;throw new a.ObjectUnsubscribedError},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(o.Subject)},54470(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.InnerSubscriber=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(r(31396).Subscriber)},76765(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(80453),o=r(97795),a=r(21576);(n=t.NotificationKind||(t.NotificationKind={})).NEXT="N",n.ERROR="E",n.COMPLETE="C",t.Notification=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,r){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return r&&r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return o.of(this.value);case"E":return a.throwError(this.error);case"C":return i.empty()}throw Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},52515(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(54487),i=r(25158),o=r(86676),a=r(8173),s=r(3344);function l(e){if(e||(e=s.config.Promise||Promise),!e)throw Error("no Promise impl found");return e}t.Observable=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,o=i.toSubscriber(e,t,r);if(n?o.add(n.call(o,this.source)):o.add(this.source||s.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),s.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),n.canReportError(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=l(t))(function(t,n){var i;i=r.subscribe(function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}},n,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:a.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}()},32544(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3344),i=r(34163);t.empty={closed:!0,next:function(e){},error:function(e){if(n.config.useDeprecatedSynchronousErrorHandling)throw e;i.hostReportError(e)},complete:function(){}}},15905(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(r(31396).Subscriber)},2173(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(55677),s=r(83207),l=r(25495),u=r(16967),c=r(93601);t.ReplaySubject=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0);var i=e.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=r<1?1:r,r===1/0?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return i(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var r=this._events;r.push(t),r.length>this._bufferSize&&r.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new d(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=n.length;if(this.closed)throw new u.ObjectUnsubscribedError;if(this.isStopped||this.hasError?t=s.Subscription.EMPTY:(this.observers.push(e),t=new c.SubjectSubscription(this,e)),i&&e.add(e=new l.ObserveOnSubscriber(e,i)),r)for(var a=0;a<o&&!e.closed;a++)e.next(n[a]);else for(var a=0;a<o&&!e.closed;a++)e.next(n[a].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||a.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(e-n[o].time<r);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&n.splice(0,o),n},t}(o.Subject);var d=function(e,t){this.time=e,this.value=t}},83849(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=function(){function e(t,r){void 0===r&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(r,t)},e.now=function(){return Date.now()},e}()},12888(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(52515),a=r(31396),s=r(83207),l=r(16967),u=r(93601),c=r(4421),d=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return i(t,e),t}(a.Subscriber);t.SubjectSubscriber=d;var f=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype[c.rxSubscriber]=function(){return new d(this)},t.prototype.lift=function(e){var t=new p(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new l.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(!this.closed)return e.prototype._trySubscribe.call(this,t);throw new l.ObjectUnsubscribedError},t.prototype._subscribe=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(e.complete(),s.Subscription.EMPTY):(this.observers.push(e),new u.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new o.Observable;return e.source=this,e},t.create=function(e,t){return new p(e,t)},t}(o.Observable);t.Subject=f;var p=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):s.Subscription.EMPTY},t}(f);t.AnonymousSubject=p},93601(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SubjectSubscription=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return i(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(r(83207).Subscription)},31396(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83385),a=r(32544),s=r(83207),l=r(4421),u=r(3344),c=r(34163),d=function(e){function t(r,n,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=a.empty;break;case 1:if(!r){o.destination=a.empty;break}if("object"==typeof r){r instanceof t?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new f(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new f(o,r,n,i)}return o}return i(t,e),t.prototype[l.rxSubscriber]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.Subscription);t.Subscriber=d;var f=function(e){function t(t,r,n,i){var s,l=e.call(this)||this;l._parentSubscriber=t;var u=l;return o.isFunction(r)?s=r:r&&(s=r.next,n=r.error,i=r.complete,r!==a.empty&&(u=Object.create(r),o.isFunction(u.unsubscribe)&&l.add(u.unsubscribe.bind(u)),u.unsubscribe=l.unsubscribe.bind(l))),l._context=u,l._next=s,l._error=n,l._complete=i,l}return i(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=u.config.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?this.__tryOrSetError(t,this._error,e):this.__tryOrUnsub(this._error,e),this.unsubscribe();else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):c.hostReportError(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;c.hostReportError(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,r):this.__tryOrUnsub(r),this.unsubscribe()}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.config.useDeprecatedSynchronousErrorHandling)throw e;c.hostReportError(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!u.config.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{t.call(this._context,r)}catch(t){if(u.config.useDeprecatedSynchronousErrorHandling)return e.syncErrorValue=t,e.syncErrorThrown=!0,!0;return c.hostReportError(t),!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(d);t.SafeSubscriber=f},83207(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34728),i=r(60194),o=r(83385),a=r(61245);function s(e){return e.reduce(function(e,t){return e.concat(t instanceof a.UnsubscriptionError?t.errors:t)},[])}t.Subscription=function(){var e;function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){if(!this.closed){var e,r=this._parentOrParents,l=this._ctorUnsubscribe,u=this._unsubscribe,c=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var d=0;d<r.length;++d)r[d].remove(this);if(o.isFunction(u)){l&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){e=t instanceof a.UnsubscriptionError?s(t.errors):[t]}}if(n.isArray(c))for(var d=-1,f=c.length;++d<f;){var p=c[d];if(i.isObject(p))try{p.unsubscribe()}catch(t){e=e||[],t instanceof a.UnsubscriptionError?e=e.concat(s(t.errors)):e.push(t)}}if(e)throw new a.UnsubscriptionError(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},(e=new t).closed=!0,t.EMPTY=e,t}()},3344(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=!1;t.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):r&&console.log("RxJS: Back to a better error behavior. Thank you. <3"),r=value},get useDeprecatedSynchronousErrorHandling(){return r}}},64398(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(52515),s=r(87092);t.SimpleInnerSubscriber=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(o.Subscriber),t.ComplexInnerSubscriber=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(o.Subscriber),t.SimpleOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(o.Subscriber),t.ComplexOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,r,n){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(o.Subscriber),t.innerSubscribe=function(e,t){var r;if(!t.closed){if(e instanceof a.Observable)return e.subscribe(t);try{r=s.subscribeTo(e)(t)}catch(e){t.error(e)}return r}}},52871(e,t,r){"use strict";var n,i,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=r(12888),s=r(52515),l=r(31396),u=r(83207),c=r(46888),d=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return o(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return!e&&(this._isComplete=!1,(e=this._connection=new u.Subscription).add(this.source.subscribe(new f(this.getSubject(),this))),e.closed&&(this._connection=null,e=u.Subscription.EMPTY)),e},t.prototype.refCount=function(){return c.refCount()(this)},t}(s.Observable);t.ConnectableObservable=d,t.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(i=d.prototype)._subscribe},_isComplete:{value:i._isComplete,writable:!0},getSubject:{value:i.getSubject},connect:{value:i.connect},refCount:{value:i.refCount}};var f=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return o(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(a.SubjectSubscriber);(function(e){this.connectable=e}).prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new p(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i};var p=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return o(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var r=this.connection,n=e._connection;this.connection=null,n&&(!r||n===r)&&n.unsubscribe()},t}(l.Subscriber)},98072(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(52515),a=r(52745),s=r(15390);t.SubscribeOnObservable=function(e){function t(t,r,n){void 0===r&&(r=0),void 0===n&&(n=a.asap);var i=e.call(this)||this;return i.source=t,i.delayTime=r,i.scheduler=n,(!s.isNumeric(r)||r<0)&&(i.delayTime=0),n&&"function"==typeof n.schedule||(i.scheduler=a.asap),i}return i(t,e),t.create=function(e,r,n){return void 0===r&&(r=0),void 0===n&&(n=a.asap),new t(e,r,n)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return this.add(t.subscribe(r))},t.prototype._subscribe=function(e){var r=this.delayTime,n=this.source;return this.scheduler.schedule(t.dispatch,r,{source:n,subscriber:e})},t}(o.Observable)},50278(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(18244),a=r(34728),s=r(15905),l=r(47849),u=r(35853),c={};t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0,n=void 0;return o.isScheduler(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&a.isArray(e[0])&&(e=e[0]),u.fromArray(e,n).lift(new d(r))};var d=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.resultSelector))},e}();t.CombineLatestOperator=d;var f=function(e){function t(t,r){var n=e.call(this,t)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return i(t,e),t.prototype._next=function(e){this.values.push(c),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var r=0;r<t;r++){var n=e[r];this.add(l.subscribeToResult(this,n,void 0,r))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r){var n=this.values,i=n[r],o=this.toRespond?i===c?--this.toRespond:this.toRespond:0;n[r]=t,0===o&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.OuterSubscriber);t.CombineLatestSubscriber=f},95434(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(97795),i=r(6345);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i.concatAll()(n.of.apply(void 0,e))}},93180(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(24098),o=r(80453);t.defer=function(e){return new n.Observable(function(t){var r;try{r=e()}catch(e){t.error(e);return}return(r?i.from(r):o.empty()).subscribe(t)})}},80453(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515);t.EMPTY=new n.Observable(function(e){return e.complete()}),t.empty=function(e){var r;return e?(r=e,new n.Observable(function(e){return r.schedule(function(){return e.complete()})})):t.EMPTY}},24098(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(87092),o=r(17315);t.from=function(e,t){return t?o.scheduled(e,t):e instanceof n.Observable?e:new n.Observable(i.subscribeTo(e))}},35853(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(70499),o=r(68822);t.fromArray=function(e,t){return t?o.scheduleArray(e,t):new n.Observable(i.subscribeToArray(e))}},5776(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(18244),o=r(49287),a=r(35853);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=1/0,s=null,l=e[e.length-1];return(i.isScheduler(l)?(s=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof l&&(r=e.pop()),null===s&&1===e.length&&e[0]instanceof n.Observable)?e[0]:o.mergeAll(r)(a.fromArray(e,s))}},97795(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(18244),i=r(35853),o=r(68822);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return n.isScheduler(r)?(e.pop(),o.scheduleArray(e,r)):i.fromArray(e)}},23827(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(34728),a=r(35853),s=r(15905),l=r(47849);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length)if(!o.isArray(e[0]))return e[0];else e=e[0];return a.fromArray(e,void 0).lift(new u)};var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new c(e))},e}();t.RaceOperator=u;var c=function(e){function t(t){var r=e.call(this,t)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return i(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var r=0;r<t&&!this.hasFirst;r++){var n=e[r],i=l.subscribeToResult(this,n,void 0,r);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},t.prototype.notifyNext=function(e,t,r){if(!this.hasFirst){this.hasFirst=!0;for(var n=0;n<this.subscriptions.length;n++)if(n!==r){var i=this.subscriptions[n];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(t)},t}(s.OuterSubscriber);t.RaceSubscriber=c},21576(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515);function i(e){var t=e.error;e.subscriber.error(t)}t.throwError=function(e,t){return new n.Observable(t?function(r){return t.schedule(i,0,{error:e,subscriber:r})}:function(t){return t.error(e)})}},24529(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(25190),o=r(15390),a=r(18244);function s(e){var t=e.index,r=e.period,n=e.subscriber;if(n.next(t),!n.closed){if(-1===r)return n.complete();e.index=t+1,this.schedule(e,r)}}t.timer=function(e,t,r){void 0===e&&(e=0);var l=-1;return o.isNumeric(t)?l=1>Number(t)&&1||Number(t):a.isScheduler(t)&&(r=t),a.isScheduler(r)||(r=i.async),new n.Observable(function(t){var n=o.isNumeric(e)?e:e-r.now();return r.schedule(s,n,{index:0,period:l,subscriber:t})})}},70887(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(35853),a=r(34728),s=r(31396),l=r(57211),u=r(64398);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return"function"==typeof r&&e.pop(),o.fromArray(e,void 0).lift(new c(r))};var c=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.resultSelector))},e}();t.ZipOperator=c;var d=function(e){function t(t,r,n){void 0===n&&(n=Object.create(null));var i=e.call(this,t)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return i(t,e),t.prototype._next=function(e){var t=this.iterators;a.isArray(e)?t.push(new p(e)):"function"==typeof e[l.iterator]?t.push(new f(e[l.iterator]())):t.push(new h(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0===t)return void this.destination.complete();this.active=t;for(var r=0;r<t;r++){var n=e[r];n.stillUnsubscribed?this.destination.add(n.subscribe()):this.active--}},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,r=this.destination,n=0;n<t;n++){var i=e[n];if("function"==typeof i.hasValue&&!i.hasValue())return}for(var o=!1,a=[],n=0;n<t;n++){var i=e[n],s=i.next();if(i.hasCompleted()&&(o=!0),s.done)return void r.complete();a.push(s.value)}this.resultSelector?this._tryresultSelector(a):r.next(a),o&&r.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.Subscriber);t.ZipSubscriber=d;var f=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},e}(),p=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(e){var t=this.index++,r=this.array;return t<this.length?{value:r[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),h=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return i(t,e),t.prototype[l.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return u.innerSubscribe(this.observable,new u.SimpleInnerSubscriber(this))},t}(u.SimpleOuterSubscriber)},38461(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.audit=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var r=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,r=this.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(o.SimpleOuterSubscriber)},32392(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25190),i=r(38461),o=r(24529);t.auditTime=function(e,t){return void 0===t&&(t=n.async),i.audit(function(){return o.timer(e,t)})}},37954(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.buffer=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.closingNotifier))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.buffer=[],n.add(o.innerSubscribe(r,new o.SimpleInnerSubscriber(n))),n}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(o.SimpleOuterSubscriber)},30647(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.bufferCount=function(e,t){return void 0===t&&(t=null),function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,t&&e!==t?this.subscriberClass=l:this.subscriberClass=s}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.bufferSize=r,n.buffer=[],n}return i(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(o.Subscriber),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return i(t,e),t.prototype._next=function(e){var t=this.bufferSize,r=this.startBufferEvery,n=this.buffers,i=this.count;this.count++,i%r==0&&n.push([]);for(var o=n.length;o--;){var a=n[o];a.push(e),a.length===t&&(n.splice(o,1),this.destination.next(a))}},t.prototype._complete=function(){for(var t=this.buffers,r=this.destination;t.length>0;){var n=t.shift();n.length>0&&r.next(n)}e.prototype._complete.call(this)},t}(o.Subscriber)},16327(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(25190),a=r(31396),s=r(18244);t.bufferTime=function(e){var t=arguments.length,r=o.async;s.isScheduler(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],t--);var n=null;t>=2&&(n=arguments[1]);var i=1/0;return t>=3&&(i=arguments[2]),function(t){return t.lift(new l(e,n,i,r))}};var l=function(){function e(e,t,r,n){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){this.buffer=[]},c=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;a.bufferTimeSpan=r,a.bufferCreationInterval=n,a.maxBufferSize=i,a.scheduler=o,a.contexts=[];var s=a.openContext();return a.timespanOnly=null==n||n<0,a.timespanOnly?a.add(s.closeAction=o.schedule(d,r,{subscriber:a,context:s,bufferTimeSpan:r})):(a.add(s.closeAction=o.schedule(p,r,{subscriber:a,context:s})),a.add(o.schedule(f,n,{bufferTimeSpan:r,bufferCreationInterval:n,subscriber:a,scheduler:o}))),a}return i(t,e),t.prototype._next=function(e){for(var t,r=this.contexts,n=r.length,i=0;i<n;i++){var o=r[i],a=o.buffer;a.push(e),a.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,r=this.destination;t.length>0;){var n=t.shift();r.next(n.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:e,bufferTimeSpan:r};this.add(e.closeAction=this.scheduler.schedule(d,r,n))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(a.Subscriber);function d(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function f(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openContext();n.closed||(n.add(o.closeAction=i.schedule(p,r,{subscriber:n,context:o})),this.schedule(e,t))}function p(e){var t=e.subscriber,r=e.context;t.closeContext(r)}},46786(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83207),a=r(47849),s=r(15905);t.bufferToggle=function(e,t){return function(r){return r.lift(new l(e,t))}};var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.closingSelector=n,i.contexts=[],i.add(a.subscribeToResult(i,r)),i}return i(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,n=0;n<r;n++)t[n].buffer.push(e)},t.prototype._error=function(t){for(var r=this.contexts;r.length>0;){var n=r.shift();n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var r=t.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var r=e.buffer,n=e.subscription;this.destination.next(r),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,r=new o.Subscription,n={buffer:[],subscription:r};t.push(n);var i=a.subscribeToResult(this,e,n);!i||i.closed?this.closeBuffer(n):(i.context=n,this.add(i),r.add(i))},t}(s.OuterSubscriber)},11662(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83207),a=r(64398);t.bufferWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.closingSelector=r,n.subscribing=!1,n.openBuffer(),n}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e,t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{e=(0,this.closingSelector)()}catch(e){return this.error(e)}t=new o.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(a.innerSubscribe(e,new a.SimpleInnerSubscriber(this))),this.subscribing=!1},t}(a.SimpleOuterSubscriber)},85503(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.catchError=function(e){return function(t){var r=new a(e),n=t.lift(r);return r.caught=n}};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){e.prototype.error.call(this,t);return}this._unsubscribeAndRecycle();var n=new o.SimpleInnerSubscriber(this);this.add(n);var i=o.innerSubscribe(r,n);i!==n&&this.add(i)}},t}(o.SimpleOuterSubscriber)},24908(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(50278);t.combineAll=function(e){return function(t){return t.lift(new n.CombineLatestOperator(e))}}},89060(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34728),i=r(50278),o=r(24098);t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&n.isArray(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(o.from([t].concat(e)),new i.CombineLatestOperator(r))}}},16600(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(95434);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.concat.apply(void 0,[t].concat(e)))}}},6345(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(49287);t.concatAll=function(){return n.mergeAll(1)}},52248(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(75206);t.concatMap=function(e,t){return n.mergeMap(e,t,1)}},43577(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52248);t.concatMapTo=function(e,t){return n.concatMap(function(){return e},t)}},88765(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.count=function(e){return function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){this.destination.error(e);return}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(o.Subscriber)},23287(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.debounce=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var r=this.durationSubscription;this.value=e,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this)))&&!r.closed&&this.add(this.durationSubscription=r)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(o.SimpleOuterSubscriber)},38066(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(25190);t.debounceTime=function(e,t){return void 0===t&&(t=a.async),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.dueTime,this.scheduler))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dueTime=r,i.scheduler=n,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return i(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(u,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(o.Subscriber);function u(e){e.debouncedNext()}},12767(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.defaultIfEmpty=function(e){return void 0===e&&(e=null),function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.defaultValue))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.defaultValue=r,n.isEmpty=!0,n}return i(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(o.Subscriber)},46965(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(25190),a=r(24465),s=r(31396),l=r(76765);t.delay=function(e,t){void 0===t&&(t=o.async);var r=a.isDate(e)?e-t.now():Math.abs(e);return function(e){return e.lift(new u(r,t))}};var u=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))},e}(),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.delay=r,i.scheduler=n,i.queue=[],i.active=!1,i.errored=!1,i}return i(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,r=new d(t.now()+this.delay,e);this.queue.push(r),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(l.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(l.Notification.createComplete()),this.unsubscribe()},t}(s.Subscriber),d=function(e,t){this.time=e,this.notification=t}},69861(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(52515),s=r(15905),l=r(47849);t.delayWhen=function(e,t){return t?function(r){return new d(r,t).lift(new u(e))}:function(t){return t.lift(new u(e))}};var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delayDurationSelector))},e}(),c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.delayDurationSelector=r,n.completed=!1,n.delayNotifierSubscriptions=[],n.index=0,n}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var r=this.delayDurationSelector(e,t);r&&this.tryDelay(r,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return -1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var r=l.subscribeToResult(this,e,t);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(s.OuterSubscriber),d=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subscriptionDelay=r,n}return i(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new f(e,this.source))},t}(a.Observable),f=function(e){function t(t,r){var n=e.call(this)||this;return n.parent=t,n.source=r,n.sourceSubscribed=!1,n}return i(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(o.Subscriber)},47642(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.dematerialize=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(o.Subscriber)},98820(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.distinct=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.keySelector,this.flushes))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=r,i.values=new Set,n&&i.add(o.innerSubscribe(n,new o.SimpleInnerSubscriber(i))),i}return i(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,r=this.destination;try{t=this.keySelector(e)}catch(e){r.error(e);return}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var r=this.values;r.has(e)||(r.add(e),this.destination.next(t))},t}(o.SimpleOuterSubscriber);t.DistinctSubscriber=s},21772(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.distinctUntilChanged=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compare,this.keySelector))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){try{var t,r=this.keySelector;t=r?r(e):e}catch(e){return this.destination.error(e)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))},t}(o.Subscriber)},5075(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21772);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged(function(r,n){return t?t(r[e],n[e]):r[e]===n[e]})}},32399(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(37568),i=r(12670),o=r(12056),a=r(12767),s=r(11231);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(l){return l.pipe(i.filter(function(t,r){return r===e}),s.take(1),r?a.defaultIfEmpty(t):o.throwIfEmpty(function(){return new n.ArgumentOutOfRangeError}))}}},32631(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(95434),i=r(97795);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return n.concat(t,i.of.apply(void 0,e))}}},47233(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.every=function(e,t){return function(r){return r.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.predicate=e,this.thisArg=t,this.source=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg,this.source))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.predicate=r,o.thisArg=n,o.source=i,o.index=0,o.thisArg=n||o,o}return i(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){this.destination.error(e);return}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(o.Subscriber)},92408(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.exhaust=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return i(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(o.innerSubscribe(e,new o.SimpleInnerSubscriber(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(o.SimpleOuterSubscriber)},1112(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(76808),a=r(24098),s=r(64398);t.exhaustMap=function e(t,r){return r?function(n){return n.pipe(e(function(e,n){return a.from(t(e,n)).pipe(o.map(function(t,i){return r(e,t,n,i)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return i(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber)},77736(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=1>(t||0)?1/0:t,function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.concurrent,this.scheduler))},e}();t.ExpandOperator=a;var s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.project=r,o.concurrent=n,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,n<1/0&&(o.buffer=[]),o}return i(t,e),t.dispatch=function(e){var t=e.subscriber,r=e.result,n=e.value,i=e.index;t.subscribeToProjection(r,n,i)},t.prototype._next=function(e){var r=this.destination;if(r.closed)return void this._complete();var n=this.index++;if(this.active<this.concurrent){r.next(e);try{var i=(0,this.project)(e,n);this.scheduler?this.destination.add(this.scheduler.schedule(t.dispatch,0,{subscriber:this,result:i,value:e,index:n})):this.subscribeToProjection(i,e,n)}catch(e){r.error(e)}}else this.buffer.push(e)},t.prototype.subscribeToProjection=function(e,t,r){this.active++,this.destination.add(o.innerSubscribe(e,new o.SimpleInnerSubscriber(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(o.SimpleOuterSubscriber);t.ExpandSubscriber=s},12670(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.filter=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}t&&this.destination.next(e)},t}(o.Subscriber)},91258(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(83207);t.finalize=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.callback))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.add(new a.Subscription(r)),n}return i(t,e),t}(o.Subscriber)},15063(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.find=function(e,t){if("function"!=typeof e)throw TypeError("predicate is not a function");return function(r){return r.lift(new a(e,r,!1,t))}};var a=function(){function e(e,t,r,n){this.predicate=e,this.source=t,this.yieldIndex=r,this.thisArg=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();t.FindValueOperator=a;var s=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.predicate=r,a.source=n,a.yieldIndex=i,a.thisArg=o,a.index=0,a}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,r=this.thisArg,n=this.index++;try{t.call(r||this,e,n,this.source)&&this.notifyComplete(this.yieldIndex?n:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(o.Subscriber);t.FindValueSubscriber=s},42939(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(15063);t.findIndex=function(e,t){return function(r){return r.lift(new n.FindValueOperator(e,r,!0,t))}}},69948(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(81136),i=r(12670),o=r(11231),a=r(12767),s=r(12056),l=r(44579);t.first=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter(function(t,r){return e(t,r,u)}):l.identity,o.take(1),r?a.defaultIfEmpty(t):s.throwIfEmpty(function(){return new n.EmptyError}))}}},77784(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(83207),s=r(52515),l=r(12888);t.groupBy=function(e,t,r,n){return function(i){return i.lift(new u(e,t,r,n))}};var u=function(){function e(e,t,r,n){this.keySelector=e,this.elementSelector=t,this.durationSelector=r,this.subjectSelector=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),c=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.keySelector=r,a.elementSelector=n,a.durationSelector=i,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return i(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){this.error(e);return}this._group(e,t)},t.prototype._group=function(e,t){var r,n=this.groups;n||(n=this.groups=new Map);var i=n.get(t);if(this.elementSelector)try{r=this.elementSelector(e)}catch(e){this.error(e)}else r=e;if(!i){i=this.subjectSelector?this.subjectSelector():new l.Subject,n.set(t,i);var o=new f(t,i,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new f(t,i))}catch(e){this.error(e);return}this.add(a.subscribe(new d(t,i,this)))}}i.closed||i.next(r)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,r){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(o.Subscriber),d=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.key=t,i.group=r,i.parent=n,i}return i(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(o.Subscriber),f=function(e){function t(t,r,n){var i=e.call(this)||this;return i.key=t,i.groupSubject=r,i.refCountSubscription=n,i}return i(t,e),t.prototype._subscribe=function(e){var t=new a.Subscription,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&t.add(new p(r)),t.add(n.subscribe(e)),t},t}(s.Observable);t.GroupedObservable=f;var p=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,t.count++,r}return i(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(a.Subscription)},36863(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.ignoreElements=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype._next=function(e){},t}(o.Subscriber)},63371(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.isEmpty=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(o.Subscriber)},17064(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(81136),i=r(12670),o=r(23439),a=r(12056),s=r(12767),l=r(44579);t.last=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter(function(t,r){return e(t,r,u)}):l.identity,o.takeLast(1),r?s.defaultIfEmpty(t):a.throwIfEmpty(function(){return new n.EmptyError}))}}},76808(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.map=function(e,t){return function(r){if("function"!=typeof e)throw TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.thisArg))},e}();t.MapOperator=a;var s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(o.Subscriber)},13353(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.mapTo=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.value))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return i(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(o.Subscriber)},92539(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(76765);t.materialize=function(){return function(e){return e.lift(new s)}};var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new l(e))},e}(),l=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype._next=function(e){this.destination.next(a.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(a.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(a.Notification.createComplete()),e.complete()},t}(o.Subscriber)},56416(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22518);t.max=function(e){return n.reduce("function"==typeof e?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},41570(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5776);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.merge.apply(void 0,[t].concat(e)))}}},49287(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(75206),i=r(44579);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},75206(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(76808),a=r(24098),s=r(64398);function l(e,t,r){return(void 0===r&&(r=1/0),"function"==typeof t)?function(n){return n.pipe(l(function(r,n){return a.from(e(r,n)).pipe(o.map(function(e,i){return t(r,e,n,i)}))},r))}:("number"==typeof t&&(r=t),function(t){return t.lift(new u(e,r))})}t.mergeMap=l;var u=function(){function e(e,t){void 0===t&&(t=1/0),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent))},e}();t.MergeMapOperator=u;var c=function(e){function t(t,r,n){void 0===n&&(n=1/0);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber);t.MergeMapSubscriber=c,t.flatMap=l},89019(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(75206);t.mergeMapTo=function(e,t,r){return(void 0===r&&(r=1/0),"function"==typeof t)?n.mergeMap(function(){return e},t,r):("number"==typeof t&&(r=t),n.mergeMap(function(){return e},r))}},52307(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.accumulator=e,this.seed=t,this.concurrent=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.concurrent))},e}();t.MergeScanOperator=a;var s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o.acc=n,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return i(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,r=this.destination,n=void 0;try{n=(0,this.accumulator)(this.acc,e,t)}catch(e){return r.error(e)}this.active++,this._innerSub(n)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new o.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=o.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(o.SimpleOuterSubscriber);t.MergeScanSubscriber=s},87198(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22518);t.min=function(e){return n.reduce("function"==typeof e?function(t,r){return 0>e(t,r)?t:r}:function(e,t){return e<t?e:t})}},74864(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52871);t.multicast=function(e,t){return function(r){if(o="function"==typeof e?e:function(){return e},"function"==typeof t)return r.lift(new i(o,t));var o,a=Object.create(r,n.connectableObservableDescriptor);return a.source=r,a.subjectFactory=o,a}};var i=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(e);return i.add(t.subscribe(n)),i},e}();t.MulticastOperator=i},25495(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(76765);t.observeOn=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.scheduler,this.delay))},e}();t.ObserveOnOperator=s;var l=function(e){function t(t,r,n){void 0===n&&(n=0);var i=e.call(this,t)||this;return i.scheduler=r,i.delay=n,i}return i(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(a.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(a.Notification.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(a.Notification.createComplete()),this.unsubscribe()},t}(o.Subscriber);t.ObserveOnSubscriber=l;var u=function(e,t){this.notification=e,this.destination=t};t.ObserveOnMessage=u},55029(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(24098),a=r(34728),s=r(64398);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&a.isArray(e[0])&&(e=e[0]),function(t){return t.lift(new l(e))}},t.onErrorResumeNextStatic=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0;return 1===e.length&&a.isArray(e[0])&&(e=e[0]),r=e.shift(),o.from(r).lift(new l(e))};var l=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextSources))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.nextSources=r,n}return i(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)}else this.destination.complete()},t}(s.SimpleOuterSubscriber)},87304(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.pairwise=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.hasPrev=!1,r}return i(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(o.Subscriber)},84236(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(55352),i=r(12670);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},11075(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(76808);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw Error("list of properties cannot be empty.");return function(t){var i,o;return n.map((i=e,o=r,function(e){for(var t=e,r=0;r<o;r++){var n=null!=t?t[i[r]]:void 0;if(void 0===n)return;t=n}return t}))(t)}}},35485(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(12888),i=r(74864);t.publish=function(e){return e?i.multicast(function(){return new n.Subject},e):i.multicast(new n.Subject)}},60091(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(466),i=r(74864);t.publishBehavior=function(e){return function(t){return i.multicast(new n.BehaviorSubject(e))(t)}}},33433(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(49850),i=r(74864);t.publishLast=function(){return function(e){return i.multicast(new n.AsyncSubject)(e)}}},49622(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2173),i=r(74864);t.publishReplay=function(e,t,r,o){r&&"function"!=typeof r&&(o=r);var a="function"==typeof r?r:void 0,s=new n.ReplaySubject(e,t,o);return function(e){return i.multicast(function(){return s},a)(e)}}},96721(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34728),i=r(23827);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&n.isArray(e[0])&&(e=e[0]),t.lift.call(i.race.apply(void 0,[t].concat(e)))}}},22518(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(40253),i=r(23439),o=r(12767),a=r(8173);t.reduce=function(e,t){return arguments.length>=2?function(r){return a.pipe(n.scan(e,t),i.takeLast(1),o.defaultIfEmpty(t))(r)}:function(t){return a.pipe(n.scan(function(t,r,n){return e(t,r,n+1)}),i.takeLast(1))(t)}}},46888(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.refCount=function(){return function(e){return e.lift(new a(e))}};var a=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new s(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var r=this.connection,n=e._connection;this.connection=null,n&&(!r||n===r)&&n.unsubscribe()},t}(o.Subscriber)},66483(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(80453);t.repeat=function(e){return void 0===e&&(e=-1),function(t){return 0===e?a.empty():e<0?t.lift(new s(-1,t)):t.lift(new s(e-1,t))}};var s=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.count,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return i(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,r=this.count;if(0===r)return e.prototype.complete.call(this);r>-1&&(this.count=r-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(o.Subscriber)},10283(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(64398);t.repeatWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i.sourceIsBeingSubscribedTo=!0,i}return i(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){this.notifications=new o.Subject;try{var t;t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=a.innerSubscribe(t,new a.SimpleInnerSubscriber(this))},t}(a.SimpleOuterSubscriber)},53160(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.retry=function(e){return void 0===e&&(e=-1),function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return e.prototype.error.call(this,t);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},t}(o.Subscriber)},75508(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(64398);t.retryWhen=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.errors,n=this.retries,i=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{r=new o.Subject;try{n=(0,this.notifier)(r)}catch(t){return e.prototype.error.call(this,t)}i=a.innerSubscribe(n,new a.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=i,r.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(a.SimpleOuterSubscriber)},61754(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.sample=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=t.subscribe(r);return n.add(o.innerSubscribe(this.notifier,new o.SimpleInnerSubscriber(r))),n},e}(),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return i(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(o.SimpleOuterSubscriber)},61183(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(25190);t.sampleTime=function(e,t){return void 0===t&&(t=a.async),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.period,this.scheduler))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(u,r,{subscriber:i,period:r})),i}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(o.Subscriber);function u(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}},40253(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.scan=function(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){void 0===r&&(r=!1),this.accumulator=e,this.seed=t,this.hasSeed=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.hasSeed))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return i(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.accumulator(this.seed,e,r)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(o.Subscriber)},5017(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.sequenceEqual=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compareTo,this.comparator))},e}();t.SequenceEqualOperator=a;var s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.compareTo=r,i.comparator=n,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(r.subscribe(new l(t,i))),i}return i(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,r=this.comparator;e.length>0&&t.length>0;){var n=e.shift(),i=t.shift(),o=!1;try{o=r?r(n,i):n===i}catch(e){this.destination.error(e)}o||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(o.Subscriber);t.SequenceEqualSubscriber=s;var l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.parent=r,n}return i(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(o.Subscriber)},83213(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(74864),i=r(46888),o=r(12888);function a(){return new o.Subject}t.share=function(){return function(e){return i.refCount()(n.multicast(a)(e))}}},8614(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2173);t.shareReplay=function(e,t,r){var i;return i=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:r},function(e){var t,r,o,a,s,l,u,c,d,f,p,h;return e.lift((s=void 0===(a=(t=i).bufferSize)?1/0:a,u=void 0===(l=t.windowTime)?1/0:l,c=t.refCount,d=t.scheduler,f=0,p=!1,h=!1,function(e){var t;f++,!r||p?(p=!1,t=(r=new n.ReplaySubject(s,u,d)).subscribe(this),o=e.subscribe({next:function(e){r.next(e)},error:function(e){p=!0,r.error(e)},complete:function(){h=!0,o=void 0,r.complete()}}),h&&(o=void 0)):t=r.subscribe(this),this.add(function(){f--,t.unsubscribe(),t=void 0,o&&!h&&c&&0===f&&(o.unsubscribe(),o=void 0,r=void 0)})}))}}},28480(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(81136);t.single=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.predicate,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return i(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new a.EmptyError)},t}(o.Subscriber)},74775(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.skip=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.total))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return i(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(o.Subscriber)},2807(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(37568);t.skipLast=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new o.Subscriber(e)):t.subscribe(new l(e,this._skipCount))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n._skipCount=r,n._count=0,n._ring=Array(r),n}return i(t,e),t.prototype._next=function(e){var t=this._skipCount,r=this._count++;if(r<t)this._ring[r]=e;else{var n=r%t,i=this._ring,o=i[n];i[n]=e,this.destination.next(o)}},t}(o.Subscriber)},12519(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.skipUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.notifier))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;n.hasValue=!1;var i=new o.SimpleInnerSubscriber(n);n.add(i),n.innerSubscription=i;var a=o.innerSubscribe(r,i);return a!==i&&(n.add(a),n.innerSubscription=a),n}return i(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(o.SimpleOuterSubscriber)},34846(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.skipWhile=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return i(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=!!t}catch(e){this.destination.error(e)}},t}(o.Subscriber)},94558(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(95434),i=r(18244);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return i.isScheduler(r)?(e.pop(),function(t){return n.concat(e,t,r)}):function(t){return n.concat(e,t)}}},70015(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(98072);t.subscribeOn=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new i(e,t))}};var i=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new n.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},65433(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7912),i=r(44579);t.switchAll=function(){return n.switchMap(i.identity)}},7912(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(76808),a=r(24098),s=r(64398);t.switchMap=function e(t,r){return"function"==typeof r?function(n){return n.pipe(e(function(e,n){return a.from(t(e,n)).pipe(o.map(function(t,i){return r(e,t,n,i)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.index=0,n}return i(t,e),t.prototype._next=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var r=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(r),this.innerSubscription=s.innerSubscribe(e,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(s.SimpleOuterSubscriber)},37865(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7912);t.switchMapTo=function(e,t){return t?n.switchMap(function(){return e},t):n.switchMap(function(){return e})}},11231(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(37568),s=r(80453);t.take=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return i(t,e),t.prototype._next=function(e){var t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))},t}(o.Subscriber)},23439(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(37568),s=r(80453);t.takeLast=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=[],n.count=0,n}return i(t,e),t.prototype._next=function(e){var t=this.ring,r=this.total,n=this.count++;t.length<r?t.push(e):t[n%r]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;i<r;i++){var o=t++%r;e.next(n[o])}e.complete()},t}(o.Subscriber)},51279(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.takeUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=o.innerSubscribe(this.notifier,new o.SimpleInnerSubscriber(r));return n&&!r.seenValue?(r.add(n),t.subscribe(r)):r},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.seenValue=!1,r}return i(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(o.SimpleOuterSubscriber)},96518(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396);t.takeWhile=function(e,t){return void 0===t&&(t=!1),function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.inclusive))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return i(t,e),t.prototype._next=function(e){var t,r=this.destination;try{t=this.predicate(e,this.index++)}catch(e){r.error(e);return}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var r=this.destination;t?r.next(e):(this.inclusive&&r.next(e),r.complete())},t}(o.Subscriber)},31451(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(7653),s=r(83385);t.tap=function(e,t,r){return function(n){return n.lift(new l(e,t,r))}};var l=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextOrObserver,this.error,this.complete))},e}(),u=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o._tapNext=a.noop,o._tapError=a.noop,o._tapComplete=a.noop,o._tapError=n||a.noop,o._tapComplete=i||a.noop,s.isFunction(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||a.noop,o._tapError=r.error||a.noop,o._tapComplete=r.complete||a.noop),o}return i(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){this.destination.error(e);return}return this.destination.complete()},t}(o.Subscriber)},30464(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(64398);t.defaultThrottleConfig={leading:!0,trailing:!1},t.throttle=function(e,r){return void 0===r&&(r=t.defaultThrottleConfig),function(t){return t.lift(new a(e,!!r.leading,!!r.trailing))}};var a=function(){function e(e,t,r){this.durationSelector=e,this.leading=t,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector,this.leading,this.trailing))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=r,o._leading=n,o._trailing=i,o._hasValue=!1,o}return i(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(o.SimpleOuterSubscriber)},17661(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(25190),s=r(30464);t.throttleTime=function(e,t,r){return void 0===t&&(t=a.async),void 0===r&&(r=s.defaultThrottleConfig),function(n){return n.lift(new l(e,t,r.leading,r.trailing))}};var l=function(){function e(e,t,r,n){this.duration=e,this.scheduler=t,this.leading=r,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),u=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.duration=r,a.scheduler=n,a.leading=i,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return i(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(c,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue),this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(o.Subscriber);function c(e){e.subscriber.clearThrottle()}},12056(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(81136),a=r(31396);t.throwIfEmpty=function(e){return void 0===e&&(e=u),function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.errorFactory))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errorFactory=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(a.Subscriber);function u(){return new o.EmptyError}},15276(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25190),i=r(40253),o=r(93180),a=r(76808);t.timeInterval=function(e){return void 0===e&&(e=n.async),function(t){return o.defer(function(){return t.pipe(i.scan(function(t,r){var n=t.current;return{value:r,current:e.now(),last:n}},{current:e.now(),value:void 0,last:void 0}),a.map(function(e){var t=e.current,r=e.last;return new s(e.value,t-r)}))})}};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},88673(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25190),i=r(43734),o=r(4053),a=r(21576);t.timeout=function(e,t){return void 0===t&&(t=n.async),o.timeoutWith(e,a.throwError(new i.TimeoutError),t)}},4053(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(25190),a=r(24465),s=r(64398);t.timeoutWith=function(e,t,r){return void 0===r&&(r=o.async),function(n){var i=a.isDate(e),o=i?e-r.now():Math.abs(e);return n.lift(new l(o,i,t,r))}};var l=function(){function e(e,t,r,n){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),u=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.absoluteTimeout=r,a.waitFor=n,a.withObservable=i,a.scheduler=o,a.scheduleTimeout(),a}return i(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(s.innerSubscribe(t,new s.SimpleInnerSubscriber(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(s.SimpleOuterSubscriber)},68858(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25190),i=r(76808);t.timestamp=function(e){return void 0===e&&(e=n.async),i.map(function(t){return new o(t,e.now())})};var o=function(e,t){this.value=e,this.timestamp=t};t.Timestamp=o},32284(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(22518);function i(e,t,r){return 0===r?[t]:(e.push(t),e)}t.toArray=function(){return n.reduce(i,[])}},77544(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(64398);t.window=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var r=new l(e),n=t.subscribe(r);return n.closed||r.add(a.innerSubscribe(this.windowBoundaries,new a.SimpleInnerSubscriber(r))),n},e}(),l=function(e){function t(t){var r=e.call(this,t)||this;return r.window=new o.Subject,t.next(r.window),r}return i(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,r=this.window=new o.Subject;t.next(r)},t}(a.SimpleOuterSubscriber)},41565(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(31396),a=r(12888);t.windowCount=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.windowSize,this.startWindowEvery))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=r,i.startWindowEvery=n,i.windows=[new a.Subject],i.count=0,t.next(i.windows[0]),i}return i(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,n=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(e);var l=this.count-n+1;if(l>=0&&l%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var u=new a.Subject;i.push(u),r.next(u)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(o.Subscriber)},43877(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(25190),s=r(31396),l=r(15390),u=r(18244);t.windowTime=function(e){var t=a.async,r=null,n=1/0;return u.isScheduler(arguments[3])&&(t=arguments[3]),u.isScheduler(arguments[2])?t=arguments[2]:l.isNumeric(arguments[2])&&(n=Number(arguments[2])),u.isScheduler(arguments[1])?t=arguments[1]:l.isNumeric(arguments[1])&&(r=Number(arguments[1])),function(i){return i.lift(new c(e,r,n,t))}};var c=function(){function e(e,t,r,n){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new f(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return i(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(o.Subject),f=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;a.destination=t,a.windowTimeSpan=r,a.windowCreationInterval=n,a.maxWindowSize=i,a.scheduler=o,a.windows=[];var s=a.openWindow();return null!==n&&n>=0?(a.add(o.schedule(m,r,{subscriber:a,window:s,context:null})),a.add(o.schedule(h,n,{windowTimeSpan:r,windowCreationInterval:n,subscriber:a,scheduler:o}))):a.add(o.schedule(p,r,{subscriber:a,window:s,windowTimeSpan:r})),a}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;n<r;n++){var i=t[n];!i.closed&&(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new d;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(s.Subscriber);function p(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&t.closeWindow(n),e.window=t.openWindow(),this.schedule(e,r)}function h(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),a={action:this,subscription:null};a.subscription=n.schedule(m,t,{subscriber:r,window:o,context:a}),this.add(a.subscription),this.schedule(e,i)}function m(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}},5428(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(83207),s=r(15905),l=r(47849);t.windowToggle=function(e,t){return function(r){return r.lift(new u(e,t))}};var u=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.openings,this.closingSelector))},e}(),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.openings=r,i.closingSelector=n,i.contexts=[],i.add(i.openSubscription=l.subscribeToResult(i,r,r)),i}return i(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var r=t.length,n=0;n<r;n++)t[n].window.next(e)},t.prototype._error=function(t){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.error(t),o.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var r=t.length,n=-1;++n<r;){var i=t[n];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,r=-1;++r<t;){var n=e[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,r,n,i){if(e===this.openings){var s=void 0;try{s=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var u=new o.Subject,c=new a.Subscription,d={window:u,subscription:c};this.contexts.push(d);var f=l.subscribeToResult(this,s,d);f.closed?this.closeWindow(this.contexts.length-1):(f.context=d,c.add(f)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,r=t[e],n=r.window,i=r.subscription;t.splice(e,1),n.complete(),i.unsubscribe()}},t}(s.OuterSubscriber)},39284(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(12888),a=r(15905),s=r(47849);t.windowWhen=function(e){return function(t){return t.lift(new l(e))}};var l=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.closingSelector))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.closingSelector=r,n.openWindow(),n}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.openWindow(i)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t,r=this.window;r&&r.complete();var n=this.window=new o.Subject;this.destination.next(n);try{t=(0,this.closingSelector)()}catch(e){this.destination.error(e),this.window.error(e);return}this.add(this.closingNotification=s.subscribeToResult(this,t))},t}(a.OuterSubscriber)},91183(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(15905),a=r(47849);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var r;return"function"==typeof e[e.length-1]&&(r=e.pop()),t.lift(new s(e,r))}};var s=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.observables,this.project))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(var s=0;s<o;s++){var l=r[s];i.add(a.subscribeToResult(i,l,void 0,s))}return i}return i(t,e),t.prototype.notifyNext=function(e,t,r){this.values[r]=t;var n=this.toRespond;if(n.length>0){var i=n.indexOf(r);-1!==i&&n.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(o.OuterSubscriber)},909(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(70887);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.zip.apply(void 0,[t].concat(e)))}}},53282(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(70887);t.zipAll=function(e){return function(t){return t.lift(new n.ZipOperator(e))}}},68822(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(83207);t.scheduleArray=function(e,t){return new n.Observable(function(r){var n=new i.Subscription,o=0;return n.add(t.schedule(function(){o===e.length?r.complete():(r.next(e[o++]),r.closed||n.add(this.schedule()))})),n})}},90229(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(83207),o=r(57211);t.scheduleIterable=function(e,t){if(!e)throw Error("Iterable cannot be null");return new n.Observable(function(r){var n,a=new i.Subscription;return a.add(function(){n&&"function"==typeof n.return&&n.return()}),a.add(t.schedule(function(){n=e[o.iterator](),a.add(t.schedule(function(){if(!r.closed){try{var e,t,i=n.next();e=i.value,t=i.done}catch(e){r.error(e);return}t?r.complete():(r.next(e),this.schedule())}}))})),a})}},60002(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(83207),o=r(86676);t.scheduleObservable=function(e,t){return new n.Observable(function(r){var n=new i.Subscription;return n.add(t.schedule(function(){var i=e[o.observable]();n.add(i.subscribe({next:function(e){n.add(t.schedule(function(){return r.next(e)}))},error:function(e){n.add(t.schedule(function(){return r.error(e)}))},complete:function(){n.add(t.schedule(function(){return r.complete()}))}}))})),n})}},1138(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52515),i=r(83207);t.schedulePromise=function(e,t){return new n.Observable(function(r){var n=new i.Subscription;return n.add(t.schedule(function(){return e.then(function(e){n.add(t.schedule(function(){r.next(e),n.add(t.schedule(function(){return r.complete()}))}))},function(e){n.add(t.schedule(function(){return r.error(e)}))})})),n})}},17315(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(60002),i=r(1138),o=r(68822),a=r(90229),s=r(26565),l=r(77328),u=r(51087),c=r(32555);t.scheduled=function(e,t){if(null!=e){if(s.isInteropObservable(e))return n.scheduleObservable(e,t);else if(l.isPromise(e))return i.schedulePromise(e,t);else if(u.isArrayLike(e))return o.scheduleArray(e,t);else if(c.isIterable(e)||"string"==typeof e)return a.scheduleIterable(e,t)}throw TypeError((null!==e&&typeof e||e)+" is not observable")}},45666(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(83207).Subscription)},52883(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(80772);t.AsapAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return(void 0===n&&(n=0),null!==n&&n>0)?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=o.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(o.Immediate.clearImmediate(r),t.scheduled=void 0)},t}(r(21076).AsyncAction)},93728(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do if(t=e.execute(e.state,e.delay))break;while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},t}(r(94333).AsyncScheduler)},21076(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r=!1,n=void 0;try{this.work(e)}catch(e){r=!0,n=!!e&&e||Error(e)}if(r)return this.unsubscribe(),n},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(r(45666).Action)},94333(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(83849);t.AsyncScheduler=function(e){function t(r,n){void 0===n&&(n=o.Scheduler.now);var i=e.call(this,r,function(){return t.delegate&&t.delegate!==i?t.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return i(t,e),t.prototype.schedule=function(r,n,i){return(void 0===n&&(n=0),t.delegate&&t.delegate!==this)?t.delegate.schedule(r,n,i):e.prototype.schedule.call(this,r,n,i)},t.prototype.flush=function(e){var t,r=this.actions;if(this.active)return void r.push(e);this.active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this.active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(o.Scheduler)},46847(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return(void 0===r&&(r=0),r>0)?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(r(21076).AsyncAction)},5044(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(94333).AsyncScheduler)},52745(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(52883);t.asapScheduler=new(r(93728)).AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},25190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21076);t.asyncScheduler=new(r(94333)).AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},55677(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(46847);t.queueScheduler=new(r(5044)).QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},57211(e,t){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.getSymbolIterator=r,t.iterator=r(),t.$$iterator=t.iterator},86676(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},4421(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rxSubscriber="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),t.$$rxSubscriber=t.rxSubscriber},37568(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},81136(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}()},80772(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=1,n=Promise.resolve(),i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=r++;return i[t]=!0,n.then(function(){return o(t)&&e()}),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},16967(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},43734(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeoutError=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}()},61245(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}()},54487(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(31396);t.canReportError=function(e){for(;e;){var t=e,r=t.closed,i=t.destination,o=t.isStopped;if(r||o)return!1;e=i&&i instanceof n.Subscriber?i:null}return!0}},34163(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hostReportError=function(e){setTimeout(function(){throw e},0)}},44579(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=function(e){return e}},34728(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=Array.isArray||function(e){return e&&"number"==typeof e.length}},51087(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},24465(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDate=function(e){return e instanceof Date&&!isNaN(+e)}},83385(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return"function"==typeof e}},26565(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(86676);t.isInteropObservable=function(e){return e&&"function"==typeof e[n.observable]}},32555(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(57211);t.isIterable=function(e){return e&&"function"==typeof e[n.iterator]}},15390(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34728);t.isNumeric=function(e){return!n.isArray(e)&&e-parseFloat(e)+1>=0}},60194(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return null!==e&&"object"==typeof e}},77328(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},18244(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=function(e){return e&&"function"==typeof e.schedule}},7653(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=function(){}},55352(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=function(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}},8173(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(44579);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},87092(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(70499),i=r(75259),o=r(98190),a=r(31021),s=r(51087),l=r(77328),u=r(60194),c=r(57211),d=r(86676);t.subscribeTo=function(e){if(e&&"function"==typeof e[d.observable])return a.subscribeToObservable(e);if(s.isArrayLike(e))return n.subscribeToArray(e);if(l.isPromise(e))return i.subscribeToPromise(e);if(e&&"function"==typeof e[c.iterator])return o.subscribeToIterable(e);throw TypeError("You provided "+(u.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},70499(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeToArray=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}},98190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(57211);t.subscribeToIterable=function(e){return function(t){for(var r=e[n.iterator]();;){var i=void 0;try{i=r.next()}catch(e){return t.error(e),t}if(i.done){t.complete();break}if(t.next(i.value),t.closed)break}return"function"==typeof r.return&&t.add(function(){r.return&&r.return()}),t}}},31021(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(86676);t.subscribeToObservable=function(e){return function(t){var r=e[n.observable]();if("function"==typeof r.subscribe)return r.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")}}},75259(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34163);t.subscribeToPromise=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,n.hostReportError),t}}},47849(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(54470),i=r(87092),o=r(52515);t.subscribeToResult=function(e,t,r,a,s){if(void 0===s&&(s=new n.InnerSubscriber(e,r,a)),!s.closed)return t instanceof o.Observable?t.subscribe(s):i.subscribeTo(t)(s)}},25158(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(31396),i=r(4421),o=r(32544);t.toSubscriber=function(e,t,r){if(e){if(e instanceof n.Subscriber)return e;if(e[i.rxSubscriber])return e[i.rxSubscriber]()}return e||t||r?new n.Subscriber(e,t,r):new n.Subscriber(o.empty)}},56170(e,t,r){"use strict";r(38461).audit,r(32392).auditTime,r(37954).buffer,r(30647).bufferCount,r(16327).bufferTime,r(46786).bufferToggle,r(11662).bufferWhen,r(85503).catchError,r(24908).combineAll,r(89060).combineLatest,r(16600).concat,r(6345).concatAll,r(52248).concatMap,r(43577).concatMapTo,r(88765).count,r(23287).debounce,r(38066).debounceTime,r(12767).defaultIfEmpty,r(46965).delay,r(69861).delayWhen,r(47642).dematerialize,r(98820).distinct,r(21772).distinctUntilChanged,r(5075).distinctUntilKeyChanged,r(32399).elementAt,r(32631).endWith,r(47233).every,r(92408).exhaust,r(1112).exhaustMap,r(77736).expand,r(12670).filter,r(91258).finalize,r(15063).find,r(42939).findIndex,r(69948).first,r(77784).groupBy,r(36863).ignoreElements,r(63371).isEmpty,r(17064).last,t.map=r(76808).map,r(13353).mapTo,r(92539).materialize,r(56416).max,r(41570).merge,r(49287).mergeAll;var n=r(75206);n.mergeMap,n.flatMap,r(89019).mergeMapTo,r(52307).mergeScan,r(87198).min,r(74864).multicast,r(25495).observeOn,r(55029).onErrorResumeNext,r(87304).pairwise,r(84236).partition,r(11075).pluck,r(35485).publish,r(60091).publishBehavior,r(33433).publishLast,r(49622).publishReplay,r(96721).race,r(22518).reduce,r(66483).repeat,r(10283).repeatWhen,r(53160).retry,r(75508).retryWhen,r(46888).refCount,r(61754).sample,r(61183).sampleTime,r(40253).scan,r(5017).sequenceEqual,r(83213).share,r(8614).shareReplay,r(28480).single,r(74775).skip,r(2807).skipLast,r(12519).skipUntil,r(34846).skipWhile,r(94558).startWith,r(70015).subscribeOn,r(65433).switchAll,r(7912).switchMap,r(37865).switchMapTo,t.take=r(11231).take,r(23439).takeLast,r(51279).takeUntil,r(96518).takeWhile,r(31451).tap,r(30464).throttle,r(17661).throttleTime,r(12056).throwIfEmpty,r(15276).timeInterval,r(88673).timeout,r(4053).timeoutWith,r(68858).timestamp,r(32284).toArray,r(77544).window,r(41565).windowCount,r(43877).windowTime,r(5428).windowToggle,r(39284).windowWhen,r(91183).withLatestFrom,r(909).zip,r(53282).zipAll},52285(e,t,r){"use strict";let n,i,o,a,s,l,u,c,d,f,p,h,m;r.r(t),r.d(t,{GenderUnknownIcon:()=>pA,evaluateAsNumber:()=>uB,useOpenmrsSWR:()=>fD,Assessment1Pictogram:()=>Sv,ChemistryIcon:()=>pm,StockManagementPictogram:()=>SV,importDynamic:()=>op,BabyIcon:()=>pi,DashboardExtension:()=>hA,useFhirPagination:()=>fn,ArrowUpIcon:()=>pn,pictogramIds:()=>Sy,getDynamicOfflineDataHandlers:()=>l5,ActivityIcon:()=>f9,compile:()=>uK,showActionableNotification:()=>EH,useForceUpdate:()=>d7,PatientBannerPatientIdentifiers:()=>E5,TableBatchActions:()=>f2,getAsyncLifecycle:()=>dL,subscribeOpenmrsEvent:()=>uh,useVisit:()=>fV,TransferPictogram:()=>SU,PasswordIcon:()=>p4,usePagination:()=>fO,useVisitContextStore:()=>fB,Assessment2Pictogram:()=>S_,PatientBannerToggleContactDetailsButton:()=>Sn,CloseOutlineIcon:()=>px,ObstetricsPictogram:()=>SA,CloseIcon:()=>p_,parseDateInput:()=>xK,useFeatureFlag:()=>d9,getConfig:()=>t2,attach:()=>ck,LabOrderIcon:()=>pW,VisitMode:()=>um,getLocale:()=>w2,offlineUuidPrefix:()=>cX,useLocations:()=>fx,ActionMenuButton:()=>Dy,isUrlWithTemplateParameters:()=>rh,getLifecycle:()=>d$,formatDatetime:()=>xV,getVisitsForPatient:()=>uE,useEmrConfiguration:()=>d6,subscribeConnectivity:()=>b,useLeftNav:()=>f_,formatPartialDate:()=>x$,CustomOverflowMenu:()=>f1,ToolsIcon:()=>hh,ErrorState:()=>EO,LocationIcon:()=>pH,GroupIcon:()=>pN,canBeginEditSynchronizationItemsOfType:()=>l1,ConditionsIcon:()=>hC,SaveIcon:()=>hn,VisitStatus:()=>uy,createUseStore:()=>dl,detach:()=>cj,getSessionLocation:()=>id,setCurrentVisit:()=>u_,usePatient:()=>fk,useRenderableExtensions:()=>fT,useWorkspaces:()=>Ds,setLeftNav:()=>cI,isDevEnabled:()=>iy,formatTime:()=>xB,useConfig:()=>dX,validator:()=>tk,syncOfflinePatientData:()=>uc,CalendarIcon:()=>pa,closeWorkspaceGroup2:()=>DI,getHistory:()=>n1,StickyNoteAddIcon:()=>hu,ConfigurableLink:()=>c2,subscribeSnackbarShown:()=>j,getPatientName:()=>EY,getVisitStore:()=>uv,getDynamicOfflineDataEntriesFor:()=>l7,getCoreTranslation:()=>os,GenderMaleIcon:()=>pT,getLoggedInUser:()=>ic,isOfflineUuid:()=>c1,getBreadcrumbs:()=>rx,evaluateAsNumberAsync:()=>uV,extractVariableNames:()=>u0,putDynamicOfflineDataFor:()=>ut,EditIcon:()=>pP,translateFrom:()=>oa,putDynamicOfflineData:()=>ue,shallowEqual:()=>M,showSnackbar:()=>SQ,Type:()=>tC,InPatientPictogram:()=>Sj,MaximizeIcon:()=>pq,subscribeNotificationShown:()=>P,useStoreWithActions:()=>ds,PatientBannerActionsMenu:()=>Sr,PatientSearchPictogram:()=>SM,WarningIcon:()=>hD,DocumentAttachmentIcon:()=>pS,fhirBaseUrl:()=>n6,matchLocale:()=>DQ,registerBreadcrumb:()=>r_,CardiologyPictogram:()=>Sx,EventsIcon:()=>pk,ImageMedicalIcon:()=>pL,calculateInterpretation:()=>EA,createGlobalStore:()=>K,usePatientPhoto:()=>Sf,getCurrentOfflineMode:()=>cH,useExtensionStore:()=>d8,closeWorkspace:()=>De,DiagnosisTags:()=>Ex,createAttachment:()=>o_,iconIds:()=>f8,PatientsPictogram:()=>SN,TableIcon:()=>hf,interpolateUrl:()=>nJ,useLeftNavStore:()=>fw,Icon:()=>hR,InformationFilledIcon:()=>pB,subscribeToastShown:()=>k,LaboratoryPictogram:()=>ST,detachAll:()=>cT,convertToLocaleCalendar:()=>xU,toDateObjectStrict:()=>xk,DocumentIcon:()=>pE,defineConfigSchema:()=>t1,ActionMenuButton2:()=>DJ,setupDynamicOfflineDataHandler:()=>l8,filterBreadcrumbs:()=>rS,makeUrl:()=>n8,oneOf:()=>ry,launchWorkspaceGroup:()=>function e(t,r){let n=function(e){let t=c8.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}(t),{state:i,onWorkspaceGroupLaunch:o,workspaceGroupCleanup:a,workspaceToLaunch:s}=r,l=function(){return Dn}();if(l.getState().openWorkspaces.length){let n=l.getState().workspaceGroup;n?S4(n?.name,()=>{e(t,r)}):Da(()=>{e(t,r)})}else l.setState(e=>({...e,workspaceGroup:{name:t,members:n.members,cleanup:a}})),Dd(t,i),o?.(),s&&S6(s.name,s.additionalProps??{})},PatientBannerContactDetails:()=>Su,selectPreferredName:()=>E0,getAssignedExtensions:()=>cA,syncDynamicOfflineData:()=>uo,PatientPhoto:()=>Sm,MobileCheckIcon:()=>pJ,createErrorHandler:()=>R,openmrsObservableFetch:()=>n7,MaterialOrderIcon:()=>pz,MicroscopeIcon:()=>pY,parseDate:()=>xT,getAttachmentByUuid:()=>ob,LeftNavMenu:()=>EC,registerExtension:()=>cC,ShoppingCartAddItemIcon:()=>hj,PharmacyPictogram:()=>S$,ReferralOrderIcon:()=>p7,AttachmentIcon:()=>hP,ReportIcon:()=>ht,MoneyIcon:()=>pQ,getAttachments:()=>ov,DownloadIcon:()=>pD,PageHeaderContent:()=>EG,MedicationIcon:()=>pG,PrinterIcon:()=>p5,getFullSynchronizationItemsFor:()=>lJ,PatientListsPictogram:()=>Sz,ShoppingCartArrowDownIcon:()=>hl,provide:()=>t4,AppointmentsAltPictogram:()=>Sb,GenericOrderTypeIcon:()=>pM,setupOfflineSync:()=>l2,useAppContext:()=>dz,removeDynamicOfflineDataFor:()=>un,useConnectivity:()=>d1,ViewIcon:()=>hS,formattedName:()=>EX,sessionEndpoint:()=>n5,GeriatricsPictogram:()=>SC,useExtensionSlotStore:()=>dd,unregisterContext:()=>iw,duration:()=>xG,SearchIcon:()=>hi,CaretLeftIcon:()=>pl,TableOfContentsIcon:()=>hd,isVersionSatisfied:()=>D4,isOmrsDateToday:()=>xC,getExtensionStore:()=>cs,BloodBankPictogram:()=>Sw,EmptyCardIllustration:()=>ES,PenIcon:()=>p6,TriagePictogram:()=>SW,Workspace2:()=>DH,CheckmarkOutlineIcon:()=>ph,refetchCurrentUser:()=>is,registerOfflinePatientHandler:()=>uu,registerExtensionSlot:()=>cM,AllergiesIcon:()=>hO,ArrowDownIcon:()=>pe,getGlobalStore:()=>z,reportError:()=>T,showToast:()=>S1,subscribeToContext:()=>iS,OpenmrsDatePicker:()=>E_,ArrowRightIcon:()=>pr,getDynamicOfflineDataEntries:()=>l9,getLocaleDisplayName:()=>w4,messageOmrsServiceWorker:()=>oR,navigate:()=>nX,launchWorkspace2:()=>D$,registerBreadcrumbs:()=>rw,isUrl:()=>rm,CustomOverflowMenuItem:()=>f3,MotherIcon:()=>pX,CaretDownIcon:()=>ps,ArrowLeftIcon:()=>pt,FacilityPictogram:()=>SP,ViewOffIcon:()=>hE,fetchCurrentPatient:()=>uf,useDefineAppContext:()=>dU,useOnClickOutside:()=>fE,useOpenmrsInfinite:()=>fd,validators:()=>rg,MessageQueueIcon:()=>pZ,TwoFactorAuthenticationIcon:()=>hb,Pharmacy2Pictogram:()=>SL,goBackInHistory:()=>n3,GroupAccessIcon:()=>pI,showNotification:()=>EK,getAsyncExtensionLifecycle:()=>dB,WorkspaceContainer:()=>DA,queueSynchronizationItem:()=>lZ,ListCheckedIcon:()=>pK,formatDurationBetween:()=>xY,ResponsiveWrapper:()=>SZ,GynaecologyPictogram:()=>Sk,ShoppingCartIcon:()=>hs,defaultVisitCustomRepresentation:()=>ug,Pagination:()=>EZ,getBreadcrumbsFor:()=>rD,CheckmarkFilledIcon:()=>pp,clearCurrentUser:()=>il,useOpenmrsPagination:()=>fe,updateVisit:()=>ux,backendDependencies:()=>ig,ChevronUpIcon:()=>pv,MaybePictogram:()=>Sq,beginEditSynchronizationItem:()=>l3,Pictogram:()=>SG,getStartedVisit:()=>uS,omrsOfflineResponseStatusHttpHeaderName:()=>cq,openmrsFetch:()=>n9,saveVisit:()=>uw,HomePictogram:()=>SH,ChevronDownIcon:()=>py,DentistryPictogram:()=>SS,OpenmrsDateRangePicker:()=>Ew,ServiceQueuesPictogram:()=>SB,deleteAttachmentPermanently:()=>ow,OverflowMenuHorizontalIcon:()=>p1,getVisitTypes:()=>uP,launchWorkspace:()=>S6,EventScheduleIcon:()=>pC,DigitalTrustPictogram:()=>SD,NumericObservation:()=>EI,attachmentUrl:()=>og,getSessionStore:()=>io,interpolateString:()=>nQ,inRange:()=>rp,registerContext:()=>i_,AppointmentsPictogram:()=>Sg,showModal:()=>EL,toLanguageTag:()=>w3,ProcedureOrderIcon:()=>p8,useAttachments:()=>dZ,getRegisteredWorkspace2Names:()=>DU,useConceptReferenceRange:()=>EM,setSessionLocation:()=>ip,toLocationObject:()=>uC,useExtensionSlotMeta:()=>d5,useOnVisible:()=>fS,ChartAverageIcon:()=>pd,ChartLineIcon:()=>pf,UserAvatarIcon:()=>hv,UserHasAccess:()=>fA,evaluateAsBooleanAsync:()=>uF,createDashboard:()=>hM,getFeatureFlag:()=>u6,getLocations:()=>uk,EmergencyDepartmentPictogram:()=>SO,navigateAndLaunchWorkspace:()=>S5,getOfflineDb:()=>lK,getSynchronizationItem:()=>l0,renderExtension:()=>cK,omrsOfflineCachingStrategyHttpHeaderName:()=>cG,formatDate:()=>xL,toVisitTypeObject:()=>uO,useFhirInfinite:()=>fy,useSession:()=>fR,useStore:()=>da,SwitcherIcon:()=>ha,age:()=>E3,syncAllDynamicOfflineData:()=>ui,useAssignedExtensionIds:()=>dG,userHasAccess:()=>iu,isOmrsDateStrict:()=>xP,CaretRightIcon:()=>pu,evaluateAsType:()=>uU,usePaginationInfo:()=>fP,evaluateAsync:()=>u$,PageHeader:()=>Eq,TranslateIcon:()=>hm,useOpenmrsFetchAll:()=>fp,setUserProperties:()=>ih,MovementIcon:()=>p0,ageAsDuration:()=>E1,removeDynamicOfflineData:()=>ur,subscribePrecacheStaticDependencies:()=>w,getExtensionNameFromId:()=>cO,PaymentsDeskPictogram:()=>SI,useVisitTypes:()=>fU,usePrimaryIdentifierCode:()=>fj,updateContext:()=>iE,deleteSynchronizationItem:()=>l4,getCurrentUser:()=>ii,useLayoutType:()=>fb,ResetIcon:()=>hr,RenewIcon:()=>he,useWorkspace2Context:()=>DV,XrayPictogram:()=>SK,CaretUpIcon:()=>pc,subscribeActionableNotificationShown:()=>C,OpenmrsAppContext:()=>dW,ErrorCard:()=>EP,GenderFemaleIcon:()=>pj,omrsOfflineResponseBodyHttpHeaderName:()=>cz,getOfflinePatientDataStore:()=>ul,retry:()=>D2,getDefaultsFromConfigSchema:()=>function e(t){let r={};for(let n of Object.keys(t))if(D0(t[n])&&t[n].hasOwnProperty("_default"))r[n]=t[n]._default;else{if(n.startsWith("_"))continue;D0(t[n])?r[n]=e(t[n]):r[n]=t[n]}return r},ExtensionSlot:()=>dy,subscribeConnectivityChanged:()=>g,subscribeTo:()=>q,unsetLeftNav:()=>c$,useAbortController:()=>dH,Extension:()=>fW,getFhirServerPaginationHandlers:()=>fi,MaybeIcon:()=>hT,useConnectedExtensions:()=>d0,useCustomOverflowMenu:()=>f0,PedestrianFamilyIcon:()=>p2,generateOfflineUuid:()=>c0,HospitalBedIcon:()=>p$,CtScanPictogram:()=>SE,OpenmrsFetchError:()=>ie,getSynchronizationItems:()=>lQ,UserFollowIcon:()=>h_,RenderIfValueIsTruthy:()=>dK,launchWorkspaceGroup2:()=>DN,normalizeInterpretation:()=>ER,ChevronRightIcon:()=>pb,UserXrayIcon:()=>hw,GenderOtherIcon:()=>pR,CalendarHeatMapIcon:()=>po,formatDuration:()=>xW,contextStore:()=>ib,registerFeatureFlag:()=>u2,restBaseUrl:()=>n2,getFullSynchronizationItems:()=>lX,useFhirFetchAll:()=>fm,toOmrsIsoString:()=>xj,Labs2Pictogram:()=>SR,PatientBannerPatientInfo:()=>Se,evaluateAsBoolean:()=>uL,getDefaultCalendar:()=>xN,SettingsIcon:()=>ho,DrugOrderIcon:()=>pO,isOnline:()=>u5,setUserLanguage:()=>ia,useBodyScrollLock:()=>dY,SyringeIcon:()=>hc,LocationPicker:()=>Ek,ProgramsIcon:()=>p9,useDebounce:()=>d3,TimeIcon:()=>hp,useAssignedExtensions:()=>dp,CloseFilledIcon:()=>pw,canAccessStorage:()=>DX,registerDefaultCalendar:()=>xM,TreeViewAltIcon:()=>hg,AddIcon:()=>f7,OverflowMenuVerticalIcon:()=>p3,getConfigStore:()=>tF,InventoryManagementIcon:()=>pU,formatPatientName:()=>EQ,UserIcon:()=>hx,getContext:()=>ix,InformationSquareIcon:()=>pV,EmptyCard:()=>ED,ChevronLeftIcon:()=>pg,RadiologyIcon:()=>hk,displayName:()=>EJ,evaluate:()=>uI,isDesktop:()=>fv,defineExtensionConfigSchema:()=>t3,RegistrationPictogram:()=>SF,CardHeader:()=>fq,getSyncLifecycle:()=>dF,InformationIcon:()=>pF,TrashCanIcon:()=>hy,evaluateAsTypeAsync:()=>uW});let y="openmrs:connectivity-changed";function g(e){if(!window.offlineEnabled)return()=>{};let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}function b(e){return e({online:!window.offlineEnabled||navigator.onLine}),g(e)}let v="openmrs:precache-static-dependencies";function w(e){let t=t=>e(t.detail);return window.addEventListener(v,t),()=>window.removeEventListener(v,t)}let x="openmrs:notification-shown",E="openmrs:actionable-notification-shown",S="openmrs:toast-shown",D="openmrs:snack-bar-shown";function O(e){window.dispatchEvent(new CustomEvent(S,{detail:e}))}function P(e){let t=t=>e(t.detail);return window.addEventListener(x,t),()=>window.removeEventListener(x,t)}function C(e){let t=t=>e(t.detail);return window.addEventListener(E,t),()=>window.removeEventListener(E,t)}function k(e){let t=t=>e(t.detail);return window.addEventListener(S,t),()=>window.removeEventListener(S,t)}function j(e){let t=t=>e(t.detail);return window.addEventListener(D,t),()=>window.removeEventListener(D,t)}function T(e){let t=A(e);setTimeout(()=>{throw t})}function R(){let e=Error();return t=>{let r=A(t);r.stack+=`
2
2
  Async stacktrace:
3
- ${e.stack}`,j(t)}}function A(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(r){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 M(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 r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);return r.length===n.length&&r.every(r=>e[r]===t[r])}function N(e,t){let r;try{r=e()}catch(e){return}return{getItem:e=>{var n;let i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(n=r.getItem(e))?n:null;return o instanceof Promise?o.then(i):i(o)},setItem:(e,n)=>r.setItem(e,JSON.stringify(n,null==t?void 0:t.replacer)),removeItem:e=>r.removeItem(e)}}window.onerror=function(e){return console.error("Unexpected error: ",e),O({description:e??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),O({description:e.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})};let I=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>I(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>I(t)(e)}}},$=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.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."),r.clear()}},a=t=e(n,i,o);return o},L=e=>e?$(e):$;function F(){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 B={},V=Symbol.for("openmrs.esm-state.instanceCount"),U=globalThis,W=(U[V]??0)+1;function K(e,t,r="none"){let n=B[e];if(n)return n.active?F()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value.setState(t,!0),n.active=!0,n.value;{let n=G(e,t,r);return B[e]={value:n,active:!0},n}}function H(e,t){let r=B[e];return r?(r.active?F()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):r.value=t,r.active=!0,r.value):(B[e]={value:t,active:!0},t)}function z(e,t,r="none"){let n=B[e];if(!n){let n=G(e,t??{},r);return B[e]={value:n,active:!1},n}return n.value}function q(...e){let[t,r,n]=e,i=void 0===n?r:n,o=void 0===n?e=>e:r,a=o(t.getState());return i(a),t.subscribe(e=>{let t=o(e);M(a,t)||(a=t,i(t))})}function G(e,t,r){return"sessionStorage"===r?L()(((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."),(r,n,i)=>{let o,a,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.`),r(...e)},n,i);let d=I(s.serialize),f=()=>{let e,t=d({state:s.partialize({...n()}),version:s.version}).then(e=>o.setItem(s.name,e)).catch(t=>{e=t});if(e)throw e;return t},p=i.setState;i.setState=(e,t)=>{p(e,t),f()};let h=e((...e)=>{r(...e),f()},n,i),m=()=>{var e;if(!o)return;l=!1,u.forEach(e=>e(n()));let t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,n()))||void 0;return I(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 r(a=s.merge(e,null!=(t=n())?t:h),!0),f()}).then(()=>{null==t||t(a,void 0),l=!0,c.forEach(e=>e(a))}).catch(e=>{null==t||t(void 0,e)})};return i.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(o=e.getStorage())},clearStorage:()=>{null==o||o.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},m(),a||h};return(r,n,i)=>{let o,a={storage:N(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,l=new Set,u=new Set,c=a.storage;if(!c)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...e)},n,i);let d=()=>{let e=a.partialize({...n()});return c.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>{f(e,t),d()};let p=e((...e)=>{r(...e),d()},n,i);i.getInitialState=()=>p;let h=()=>{var e,t;if(!c)return;s=!1,l.forEach(e=>{var t;return e(null!=(t=n())?t:p)});let i=(null==(t=a.onRehydrateStorage)?void 0:t.call(a,null!=(e=n())?e:p))||void 0;return I(c.getItem.bind(c))(a.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===a.version)return[!1,e.state];else{if(a.migrate)return[!0,a.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[i,s]=e;if(r(o=a.merge(s,null!=(t=n())?t:p),!0),i)return d()}).then(()=>{null==i||i(o,void 0),o=n(),s=!0,u.forEach(e=>e(o))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(c=e.storage)},clearStorage:()=>{null==c||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>s,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},a.skipHydration||h(),o||p}})(()=>t,{name:e,storage:N(()=>sessionStorage)})):L()(()=>t)}U[V]=W,W>1&&!F()&&console.error(`Detected ${W} 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=B)},1e3);let Z=function(e){return void 0===e};var Y,J,Q,X,ee,et,er,en,ei,eo,ea=r(76922),es=r(18348),el=r(15647),eu=r(53098),ec=Object.prototype,ed=Function.prototype.toString,ef=ec.hasOwnProperty,ep=ed.call(Object);let eh=function(e){if(!(0,eu.A)(e)||"[object Object]"!=(0,es.A)(e))return!1;var t=(0,el.A)(e);if(null===t)return!0;var r=ef.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ed.call(r)==ep};var em=r(20013),ey=r(52528),eg=r(66984);let eb=function(e,t,r){(void 0===r||(0,eg.A)(e[t],r))&&(void 0!==r||t in e)||(0,ey.A)(e,t,r)},ev=function(e,t,r){for(var n=-1,i=Object(e),o=r(e),a=o.length;a--;){var s=o[++n];if(!1===t(i[s],s,i))break}return e};var e_=r(80154),ew=r(1801),ex=r(39759),eE=r(62042),eS=r(20018),eD=r(92049),eO=r(38446),eP=r(55254),eC=r(89610),ek=r(23149),eT=r(79415);let ej=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var eR=r(22031),eA=r(87591);let eM=function(e,t,r,n,i,o,a){var s=ej(e,r),l=ej(t,r),u=a.get(l);if(u)return void eb(e,r,u);var c=o?o(s,l,r+"",e,t,a):void 0,d=void 0===c;if(d){var f=(0,eD.A)(l),p=!f&&(0,eP.A)(l),h=!f&&!p&&(0,eT.A)(l);(c=l,f||p||h)?(0,eD.A)(s)?c=s:(0,eu.A)(s)&&(0,eO.A)(s)?c=(0,ex.A)(s):p?(d=!1,c=(0,e_.A)(l,!0)):h?(d=!1,c=(0,ew.A)(l,!0)):c=[]:eh(l)||(0,eS.A)(l)?(c=s,(0,eS.A)(s))?c=(0,eR.A)(s,(0,eA.A)(s)):(!(0,ek.A)(s)||(0,eC.A)(s))&&(c=(0,eE.A)(l)):d=!1}d&&(a.set(l,c),i(c,l,n,o,a),a.delete(l)),eb(e,r,c)},eN=function e(t,r,n,i,o){t!==r&&ev(r,function(a,s){if(o||(o=new em.A),(0,ek.A)(a))eM(t,r,s,n,e,i,o);else{var l=i?i(ej(t,s),a,s+"",t,r,o):void 0;void 0===l&&(l=a),eb(t,s,l)}},eA.A)},eI=function(e){return e},e$=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)};var eL=Math.max;let eF=function(e,t,r){return t=eL(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=eL(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),e$(e,this,s)}};var eB=r(84171),eV=eB.A?function(e,t){return(0,eB.A)(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:eI,eU=Date.now,eW=(Y=0,J=0,function(){var e=eU(),t=16-(e-J);if(J=e,t>0){if(++Y>=800)return arguments[0]}else Y=0;return eV.apply(void 0,arguments)}),eK=r(25353);let eH=function(e,t,r){if(!(0,ek.A)(r))return!1;var n=typeof t;return("number"==n?!!((0,eO.A)(r)&&(0,eK.A)(t,r.length)):"string"==n&&t in r)&&(0,eg.A)(r[t],e)},ez=function(e){var t;return eW(eF(t=function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&eH(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,o)}return t},void 0,eI),t+"")};var eq=ez(function(e,t,r,n){eN(e,t,r,n)}),eG=r(51046);function eZ(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new eG.A;++t<r;)this.add(e[t])}eZ.prototype.add=eZ.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},eZ.prototype.has=function(e){return this.__data__.has(e)};let eY=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1},eJ=function(e,t,r,n,i,o){var a=1&r,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&r?new eZ:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var h=e[d],m=t[d];if(n)var y=a?n(m,h,d,t,e,o):n(h,m,d,e,t,o);if(void 0!==y){if(y)continue;f=!1;break}if(p){if(!eY(t,function(e,t){if(!p.has(t)&&(h===e||i(h,e,r,n,o)))return p.push(t)})){f=!1;break}}else if(!(h===m||i(h,m,r,n,o))){f=!1;break}}return o.delete(e),o.delete(t),f};var eQ=r(241),eX=r(43988);let e0=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r},e1=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r};var e3=eQ.A?eQ.A.prototype:void 0,e4=e3?e3.valueOf:void 0;let e2=function(e,t,r,n,i,o,a){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new eX.A(e),new eX.A(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,eg.A)(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=e0;case"[object Set]":var l=1&n;if(s||(s=e1),e.size!=t.size&&!l)break;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var c=eJ(s(e),s(t),n,i,o,a);return a.delete(e),c;case"[object Symbol]":if(e4)return e4.call(e)==e4.call(t)}return!1};var e6=r(19042),e5=Object.prototype.hasOwnProperty;let e8=function(e,t,r,n,i,o){var a=1&r,s=(0,e6.A)(e),l=s.length;if(l!=(0,e6.A)(t).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in t:e5.call(t,c)))return!1}var d=o.get(e),f=o.get(t);if(d&&f)return d==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var h=a;++u<l;){var m=e[c=s[u]],y=t[c];if(n)var g=a?n(y,m,c,t,e,o):n(m,y,c,e,t,o);if(!(void 0===g?m===y||i(m,y,r,n,o):g)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var b=e.constructor,v=t.constructor;b!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v)&&(p=!1)}return o.delete(e),o.delete(t),p};var e9=r(57672),e7="[object Arguments]",te="[object Array]",tt="[object Object]",tr=Object.prototype.hasOwnProperty;let tn=function(e,t,r,n,i,o){var a=(0,eD.A)(e),s=(0,eD.A)(t),l=a?te:(0,e9.A)(e),u=s?te:(0,e9.A)(t);l=l==e7?tt:l,u=u==e7?tt:u;var c=l==tt,d=u==tt,f=l==u;if(f&&(0,eP.A)(e)){if(!(0,eP.A)(t))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new em.A),a||(0,eT.A)(e)?eJ(e,t,r,n,i,o):e2(e,t,l,r,n,i,o);if(!(1&r)){var p=c&&tr.call(e,"__wrapped__"),h=d&&tr.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,y=h?t.value():t;return o||(o=new em.A),i(m,y,r,n,o)}}return!!f&&(o||(o=new em.A),e8(e,t,r,n,i,o))},ti=function(e,t){return function e(t,r,n,i,o){return t===r||(null!=t&&null!=r&&((0,eu.A)(t)||(0,eu.A)(r))?tn(t,r,n,i,e,o):t!=t&&r!=r)}(e,t)};var to=r(45572),ta=r(10098),ts=r(61882),tl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tu=/^\w*$/;let tc=function(e,t){if((0,eD.A)(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||(0,ts.A)(e))||tu.test(e)||!tl.test(e)||null!=t&&e in Object(t)};function td(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(td.Cache||eG.A),r}td.Cache=eG.A;var tf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tp=/\\(\\)?/g,th=(X=(Q=td(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(tf,function(e,r,n,i){t.push(n?i.replace(tp,"$1"):r||e)}),t},function(e){return 500===X.size&&X.clear(),e})).cache,Q),tm=r(24898);let ty=function(e,t){return(0,eD.A)(e)?e:tc(e,t)?[e]:th((0,tm.A)(e))},tg=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var tb=1/0;let tv=function(e){if("string"==typeof e||(0,ts.A)(e))return e;var t=e+"";return"0"==t&&1/e==-tb?"-0":t},t_=function(e,t){t=ty(t,e);for(var r=0,n=t.length;null!=e&&r<n;)e=e[tv(t[r++])];return r&&r==n?e:void 0};var tw=r(37688);let tx=function(e,t){var r,n;return t=ty(t,e),r=e,null==(e=(n=t).length<2?r:t_(r,(0,tw.A)(n,0,-1)))||delete e[tv(tg(t))]},tE=function(e){return eh(e)?void 0:e};var tS=r(76335),tD=r(83973),tO=eW(eF(ee=function(e,t){var r={};if(null==e)return r;var n=!1;t=(0,to.A)(t,function(t){return t=ty(t,e),n||(n=t.length>1),t}),(0,eR.A)(e,(0,tD.A)(e),r),n&&(r=(0,ta.A)(r,7,tE));for(var i=t.length;i--;)tx(r,t[i]);return r},void 0,function(e){return(null==e?0:e.length)?(0,tS.A)(e,1):[]}),ee+""),tP=r(20903),tC=((et={}).Array="Array",et.Boolean="Boolean",et.ConceptUuid="ConceptUuid",et.Number="Number",et.Object="Object",et.String="String",et.UUID="UUID",et.PersonAttributeTypeUuid="PersonAttributeTypeUuid",et.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",et);function tk(e,t){return r=>{if(!e(r))if("function"==typeof t)return t(r);else return t}}let tT=tk(e=>Array.isArray(e),"must be an array"),tj=tk(e=>"boolean"==typeof e,"must be a boolean"),tR=tk(e=>"number"==typeof e,"must be a number"),tA=tk(e=>"string"==typeof e,"must be a string"),tM=tk(e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,"must be an object (not an array or null)"),tN=tk(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"),tI=K("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),t$=K("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});t$.subscribe(e=>{var t=e.config;try{localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}catch(e){}});let tL=K("config-store-of-extension-state",{mountedExtensions:[]});function tF(e){return z(`config-module-${e}`,{config:null,loaded:!1,translationOverridesLoaded:!1})}function tB(){return z("config-extension-slots",{slots:{}})}function tV(){return z("config-extensions",{configs:{}})}function tU(e,t,r){return e.configs[t]?.[r]??{loaded:!1,config:null}}let tW=L()(()=>({config:{}})),tK=0,tH=!0,tz=!1;function tq(){if(tH&&n&&!tz){tz=!0,tH=!1;try{n()}catch(e){tH=!0,tG(e),console.error("Failed to derive the implementer tools config",e)}finally{tz=!1}}}function tG(e){tW.setState({derivationError:e instanceof Error?e.message:String(e)})}let tZ=H("config-implementer-tools",{...tW,getState:()=>(0===tK&&tq(),tW.getState()),setState:(...e)=>(tH=!1,tW.setState(...e)),subscribe(e){tK++,tq();let t=tW.subscribe(e),r=!1;return()=>{!r&&(r=!0,tK--),t()}}});function tY(e,t){if(Array.isArray(t))return t}function tJ(e,t){return eq({},e,t,tY)}function tQ(){let e=tI.getState(),t=t$.getState(),r=tL.getState();!function(e,t){for(let r of Object.keys(e.schemas)){let n,i=tF(r),o=e.schemas[r],a=!!e.moduleLoaded[r],s=t0.get(r);if(s&&s.schema===o&&s.moduleLoaded===a&&s.providedConfigs===e.providedConfigs&&s.temporaryConfig===t.config)n=s.state;else{let i=a?function(e,t,r){let n=t.schemas[e],i=re(e,t9(t,r));rr(n,i,e);let o=ra(n,i);return rn(n,o,e),delete o.extensionSlots,o}(r,e,t):function(e,t,r){let n=ra(rf,re(e,t9(t,r)));return rn(rf,n,e),delete n.extensionSlots,n}(r,e,t);n={translationOverridesLoaded:!0,loaded:a,config:i},t0.set(r,{schema:o,moduleLoaded:a,providedConfigs:e.providedConfigs,temporaryConfig:t.config,state:n})}let l=i.getState();l.loaded===n.loaded&&l.translationOverridesLoaded===n.translationOverridesLoaded&&ti(l.config,n.config)||i.setState(n)}}(e,t);let n=function(e,t){let r=rt(t9(e,t)),n=Object.keys(r).reduce((e,t)=>(r[t]?.extensionSlots&&(e[t]=r[t]?.extensionSlots),e),{});var i=n;for(let[e,t]of Object.entries(i))for(let[r,n]of Object.entries(t))!function(e,t,r){let n=`${t}.extensionSlots.${r}`,i=`Extension slot config '${n}'`,o=Object.keys(e).filter(e=>!["add","remove","order","configure"].includes(e));o.length&&rc(n,i+`' contains invalid keys '${o.join("', '")}'`),!e.add||Array.isArray(e.add)&&e.add.every(e=>"string"==typeof e)||rc(n,i+".add' is invalid. Must be an array of strings (extension IDs)"),!e.remove||Array.isArray(e.remove)&&e.remove.every(e=>"string"==typeof e)||rc(n,i+".remove' is invalid. Must be an array of strings (extension IDs)"),!e.order||Array.isArray(e.order)&&e.order.every(e=>"string"==typeof e)||rc(n,i+".order' is invalid. Must be an array of strings (extension IDs)"),e.configure&&!rl(e.configure)&&rc(n,i+".configure' is invalid. Must be an object with extension IDs for keys")}(n,e,r);let o={},a={};for(let e of Object.values(n))for(let[t,r]of Object.entries(e))o[t]=r,r.configure&&(a[t]??(a[t]=[])).push(r.configure);for(let[e,t]of Object.entries(a)){let r=1===t.length?t[0]:rt(t);o[e].configure!==r&&(o[e]={...o[e],configure:r})}return o}(e,t);(function(e){let t=tB(),r=t.getState().slots,n={},i=!1;for(let[t,o]of Object.entries(e)){let e=r[t];e?.loaded&&ti(e.config,o)?n[t]=e:(n[t]={loaded:!0,config:o},i=!0)}(i||Object.keys(r).length!==Object.keys(n).length)&&t.setState({slots:n})})(n),function(e,t,r,n){let i=tV(),o=i.getState().configs,a={},s=!1,l=0;for(let i of t.mountedExtensions){let t=function(e,t,r,n,i,o,a){let s=function(e){let[t]=e.split("#");return t}(n),l=i.schemas[s],u=JSON.stringify([r,n,e,t]),c=t6.get(u);if(c&&c.extensionSchema===l&&c.extensionModuleSchema===i.schemas[t]&&c.providedConfigs===i.providedConfigs&&c.temporaryConfig===o.config)return c.config;let d=l?s:t,f=t9(i,o),p=a?.configure?.[n]??{},h=re(e,f),m=h?.extensionSlots?.[r]?.configure?.[n]??{},y=rt([re(d,f),p,m]),g=l??i.schemas[t];rr(g,y,d);let b=ra(g,y);return rn(g,b,d),delete b.extensionSlots,t6.set(u,{extensionSchema:l,extensionModuleSchema:i.schemas[t],providedConfigs:i.providedConfigs,temporaryConfig:o.config,config:b}),b}(i.slotModuleName,i.extensionModuleName,i.slotName,i.extensionId,e,r,n[i.slotName]),u=o[i.slotName]?.[i.extensionId],c=u?.loaded&&ti(u.config,t)?u:{config:t,loaded:!0};c!==u&&(s=!0),a[i.slotName]||(a[i.slotName]={}),a[i.slotName][i.extensionId]=c,l++}for(let[e,t]of Object.entries(a)){let r=o[e];r&&Object.keys(r).length===Object.keys(t).length&&Object.entries(t).every(([e,t])=>r[e]===t)&&(a[e]=r)}s||(s=Object.keys(o).length!==Object.keys(a).length||Object.values(o).reduce((e,t)=>e+Object.keys(t).length,0)!==l),s&&i.setState({configs:a})}(e,r,t,n),tH=!0,tK>0&&tq()}function tX(){tW.getState().derivationError&&tW.setState({derivationError:void 0});try{tQ()}catch(e){tG(e),console.error("Failed to recompute the configuration",e)}}n=()=>{var e,t;let r,n;return e=tI.getState(),t=t$.getState(),r=tZ.getState(),n={config:function(e,t){let r=function(e){let t={};for(let[r,n]of Object.entries(e)){let e=t8.get(r);if(e&&e.schema===n)t[r]=e.annotated;else{let e=function e(t){return t.hasOwnProperty("_default")?{...t,_value:t._default,_source:"default"}:rl(t)?Object.keys(t).reduce((r,n)=>(r[n]=e(t[n]),r),{}):{}}((0,tP.A)(n));t8.set(r,{schema:n,annotated:e}),t[r]=e}}return t}(e.schemas),n=[...e.providedConfigs.map(e=>[e.config,e.source]),[t.config,"temporary config"]],i=new Set(Object.keys(r));for(let[e]of n)for(let t of Object.keys(e))i.add(t);let o={};for(let e of i){let t=r[e],i=n.map(([t])=>t[e]),a=n.map(([,e])=>e),s=t5.get(e);if(s&&s.annotatedSchema===t&&s.configSlices.length===i.length&&s.configSlices.every((e,t)=>e===i[t])&&s.sources.every((e,t)=>e===a[t])){o[e]=s.result;continue}let l=t??{};n.forEach(([,e],t)=>{let r=i[t];void 0!==r&&(l=tJ(l,function e(t,r){return rl(t)?Object.keys(t).reduce((n,i)=>(n[i]=e(t[i],r),n),{}):{_value:t,_source:r}}(r,e)))}),t5.set(e,{annotatedSchema:t,configSlices:i,sources:a,result:l}),o[e]=l}return o}(e,t)},void(ti(r.config,n.config)||tZ.setState(n))},tQ(),[].push(tI.subscribe(tX),t$.subscribe(tX),tL.subscribe(tX));let t0=new Map;function t1(e,t){t7(e,t);let r=tJ(t,rf);tI.setState(t=>({...t,schemas:{...t.schemas,[e]:r},moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function t3(e,t){t7(e,t);let r=tJ(t,rf);tI.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.`),tI.setState(t=>({...t,schemas:{...t.schemas,[e]:r}}))}function t4(e,t="provided"){tI.setState(r=>({...r,providedConfigs:[...r.providedConfigs,{source:t,config:e}]}))}function t2(e){var t,r,n;return t=tF(e),r=e=>!!(e.loaded&&e.config),n=e=>tO(e.config,["Display conditions","Translation overrides"]),new Promise(e=>{let i,o=!1;function a(t){!o&&r(t)&&(o=!0,e(n(t)),i?.())}a(t.getState()),o||(i=t.subscribe(a))})}let t6=new Map,t5=new Map,t8=new Map;function t9(e,t){return[...e.providedConfigs.map(e=>e.config),t.config]}function t7(e,t,r=""){let n="Please verify that you are running the latest version and, if so, alert the maintainer.";for(let i of Object.keys(t).filter(e=>!e.startsWith("_"))){let o=r+(r&&".")+i,a=t[i];if("Display conditions"===o&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${n}`),"Translation overrides"===o&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${n}`),!rl(a)){console.error(`${e} has bad config schema definition for key '${o}'. ${n}`);continue}a.hasOwnProperty("_default")||t7(e,a,o);let s=a._elements;if(rs(s)&&t7(e,s,o+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${o}' ${n}.
3
+ ${e.stack}`,T(t)}}function A(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(r){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 M(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 r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);return r.length===n.length&&r.every(r=>e[r]===t[r])}function N(e,t){let r;try{r=e()}catch(e){return}return{getItem:e=>{var n;let i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(n=r.getItem(e))?n:null;return o instanceof Promise?o.then(i):i(o)},setItem:(e,n)=>r.setItem(e,JSON.stringify(n,null==t?void 0:t.replacer)),removeItem:e=>r.removeItem(e)}}window.onerror=function(e){return console.error("Unexpected error: ",e),O({description:e??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),O({description:e.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})};let I=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>I(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>I(t)(e)}}},$=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.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."),r.clear()}},a=t=e(n,i,o);return o},L=e=>e?$(e):$;function F(){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 B={},V=Symbol.for("openmrs.esm-state.instanceCount"),U=globalThis,W=(U[V]??0)+1;function K(e,t,r="none"){let n=B[e];if(n)return n.active?F()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value.setState(t,!0),n.active=!0,n.value;{let n=G(e,t,r);return B[e]={value:n,active:!0},n}}function H(e,t){let r=B[e];return r?(r.active?F()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):r.value=t,r.active=!0,r.value):(B[e]={value:t,active:!0},t)}function z(e,t,r="none"){let n=B[e];if(!n){let n=G(e,t??{},r);return B[e]={value:n,active:!1},n}return n.value}function q(...e){let[t,r,n]=e,i=void 0===n?r:n,o=void 0===n?e=>e:r,a=o(t.getState());return i(a),t.subscribe(e=>{let t=o(e);M(a,t)||(a=t,i(t))})}function G(e,t,r){return"sessionStorage"===r?L()(((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."),(r,n,i)=>{let o,a,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.`),r(...e)},n,i);let d=I(s.serialize),f=()=>{let e,t=d({state:s.partialize({...n()}),version:s.version}).then(e=>o.setItem(s.name,e)).catch(t=>{e=t});if(e)throw e;return t},p=i.setState;i.setState=(e,t)=>{p(e,t),f()};let h=e((...e)=>{r(...e),f()},n,i),m=()=>{var e;if(!o)return;l=!1,u.forEach(e=>e(n()));let t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,n()))||void 0;return I(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 r(a=s.merge(e,null!=(t=n())?t:h),!0),f()}).then(()=>{null==t||t(a,void 0),l=!0,c.forEach(e=>e(a))}).catch(e=>{null==t||t(void 0,e)})};return i.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(o=e.getStorage())},clearStorage:()=>{null==o||o.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},m(),a||h};return(r,n,i)=>{let o,a={storage:N(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,l=new Set,u=new Set,c=a.storage;if(!c)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...e)},n,i);let d=()=>{let e=a.partialize({...n()});return c.setItem(a.name,{state:e,version:a.version})},f=i.setState;i.setState=(e,t)=>{f(e,t),d()};let p=e((...e)=>{r(...e),d()},n,i);i.getInitialState=()=>p;let h=()=>{var e,t;if(!c)return;s=!1,l.forEach(e=>{var t;return e(null!=(t=n())?t:p)});let i=(null==(t=a.onRehydrateStorage)?void 0:t.call(a,null!=(e=n())?e:p))||void 0;return I(c.getItem.bind(c))(a.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===a.version)return[!1,e.state];else{if(a.migrate)return[!0,a.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[i,s]=e;if(r(o=a.merge(s,null!=(t=n())?t:p),!0),i)return d()}).then(()=>{null==i||i(o,void 0),o=n(),s=!0,u.forEach(e=>e(o))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(c=e.storage)},clearStorage:()=>{null==c||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>s,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},a.skipHydration||h(),o||p}})(()=>t,{name:e,storage:N(()=>sessionStorage)})):L()(()=>t)}U[V]=W,W>1&&!F()&&console.error(`Detected ${W} 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=B)},1e3);let Z=function(e){return void 0===e};var Y,J,Q,X,ee,et,er,en,ei,eo,ea=r(76922),es=r(18348),el=r(15647),eu=r(53098),ec=Object.prototype,ed=Function.prototype.toString,ef=ec.hasOwnProperty,ep=ed.call(Object);let eh=function(e){if(!(0,eu.A)(e)||"[object Object]"!=(0,es.A)(e))return!1;var t=(0,el.A)(e);if(null===t)return!0;var r=ef.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ed.call(r)==ep};var em=r(20013),ey=r(52528),eg=r(66984);let eb=function(e,t,r){(void 0===r||(0,eg.A)(e[t],r))&&(void 0!==r||t in e)||(0,ey.A)(e,t,r)},ev=function(e,t,r){for(var n=-1,i=Object(e),o=r(e),a=o.length;a--;){var s=o[++n];if(!1===t(i[s],s,i))break}return e};var e_=r(80154),ew=r(1801),ex=r(39759),eE=r(62042),eS=r(20018),eD=r(92049),eO=r(38446),eP=r(55254),eC=r(89610),ek=r(23149),ej=r(79415);let eT=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var eR=r(22031),eA=r(87591);let eM=function(e,t,r,n,i,o,a){var s=eT(e,r),l=eT(t,r),u=a.get(l);if(u)return void eb(e,r,u);var c=o?o(s,l,r+"",e,t,a):void 0,d=void 0===c;if(d){var f=(0,eD.A)(l),p=!f&&(0,eP.A)(l),h=!f&&!p&&(0,ej.A)(l);(c=l,f||p||h)?(0,eD.A)(s)?c=s:(0,eu.A)(s)&&(0,eO.A)(s)?c=(0,ex.A)(s):p?(d=!1,c=(0,e_.A)(l,!0)):h?(d=!1,c=(0,ew.A)(l,!0)):c=[]:eh(l)||(0,eS.A)(l)?(c=s,(0,eS.A)(s))?c=(0,eR.A)(s,(0,eA.A)(s)):(!(0,ek.A)(s)||(0,eC.A)(s))&&(c=(0,eE.A)(l)):d=!1}d&&(a.set(l,c),i(c,l,n,o,a),a.delete(l)),eb(e,r,c)},eN=function e(t,r,n,i,o){t!==r&&ev(r,function(a,s){if(o||(o=new em.A),(0,ek.A)(a))eM(t,r,s,n,e,i,o);else{var l=i?i(eT(t,s),a,s+"",t,r,o):void 0;void 0===l&&(l=a),eb(t,s,l)}},eA.A)},eI=function(e){return e},e$=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)};var eL=Math.max;let eF=function(e,t,r){return t=eL(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=eL(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),e$(e,this,s)}};var eB=r(84171),eV=eB.A?function(e,t){return(0,eB.A)(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:eI,eU=Date.now,eW=(Y=0,J=0,function(){var e=eU(),t=16-(e-J);if(J=e,t>0){if(++Y>=800)return arguments[0]}else Y=0;return eV.apply(void 0,arguments)}),eK=r(25353);let eH=function(e,t,r){if(!(0,ek.A)(r))return!1;var n=typeof t;return("number"==n?!!((0,eO.A)(r)&&(0,eK.A)(t,r.length)):"string"==n&&t in r)&&(0,eg.A)(r[t],e)},ez=function(e){var t;return eW(eF(t=function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&eH(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,o)}return t},void 0,eI),t+"")};var eq=ez(function(e,t,r,n){eN(e,t,r,n)}),eG=r(51046);function eZ(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new eG.A;++t<r;)this.add(e[t])}eZ.prototype.add=eZ.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},eZ.prototype.has=function(e){return this.__data__.has(e)};let eY=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1},eJ=function(e,t,r,n,i,o){var a=1&r,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&r?new eZ:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var h=e[d],m=t[d];if(n)var y=a?n(m,h,d,t,e,o):n(h,m,d,e,t,o);if(void 0!==y){if(y)continue;f=!1;break}if(p){if(!eY(t,function(e,t){if(!p.has(t)&&(h===e||i(h,e,r,n,o)))return p.push(t)})){f=!1;break}}else if(!(h===m||i(h,m,r,n,o))){f=!1;break}}return o.delete(e),o.delete(t),f};var eQ=r(241),eX=r(43988);let e0=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r},e1=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r};var e3=eQ.A?eQ.A.prototype:void 0,e4=e3?e3.valueOf:void 0;let e2=function(e,t,r,n,i,o,a){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new eX.A(e),new eX.A(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return(0,eg.A)(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=e0;case"[object Set]":var l=1&n;if(s||(s=e1),e.size!=t.size&&!l)break;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var c=eJ(s(e),s(t),n,i,o,a);return a.delete(e),c;case"[object Symbol]":if(e4)return e4.call(e)==e4.call(t)}return!1};var e6=r(19042),e5=Object.prototype.hasOwnProperty;let e8=function(e,t,r,n,i,o){var a=1&r,s=(0,e6.A)(e),l=s.length;if(l!=(0,e6.A)(t).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in t:e5.call(t,c)))return!1}var d=o.get(e),f=o.get(t);if(d&&f)return d==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var h=a;++u<l;){var m=e[c=s[u]],y=t[c];if(n)var g=a?n(y,m,c,t,e,o):n(m,y,c,e,t,o);if(!(void 0===g?m===y||i(m,y,r,n,o):g)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var b=e.constructor,v=t.constructor;b!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v)&&(p=!1)}return o.delete(e),o.delete(t),p};var e9=r(57672),e7="[object Arguments]",te="[object Array]",tt="[object Object]",tr=Object.prototype.hasOwnProperty;let tn=function(e,t,r,n,i,o){var a=(0,eD.A)(e),s=(0,eD.A)(t),l=a?te:(0,e9.A)(e),u=s?te:(0,e9.A)(t);l=l==e7?tt:l,u=u==e7?tt:u;var c=l==tt,d=u==tt,f=l==u;if(f&&(0,eP.A)(e)){if(!(0,eP.A)(t))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new em.A),a||(0,ej.A)(e)?eJ(e,t,r,n,i,o):e2(e,t,l,r,n,i,o);if(!(1&r)){var p=c&&tr.call(e,"__wrapped__"),h=d&&tr.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,y=h?t.value():t;return o||(o=new em.A),i(m,y,r,n,o)}}return!!f&&(o||(o=new em.A),e8(e,t,r,n,i,o))},ti=function(e,t){return function e(t,r,n,i,o){return t===r||(null!=t&&null!=r&&((0,eu.A)(t)||(0,eu.A)(r))?tn(t,r,n,i,e,o):t!=t&&r!=r)}(e,t)};var to=r(45572),ta=r(10098),ts=r(61882),tl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tu=/^\w*$/;let tc=function(e,t){if((0,eD.A)(e))return!1;var r=typeof e;return!!("number"==r||"symbol"==r||"boolean"==r||null==e||(0,ts.A)(e))||tu.test(e)||!tl.test(e)||null!=t&&e in Object(t)};function td(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(td.Cache||eG.A),r}td.Cache=eG.A;var tf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tp=/\\(\\)?/g,th=(X=(Q=td(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(tf,function(e,r,n,i){t.push(n?i.replace(tp,"$1"):r||e)}),t},function(e){return 500===X.size&&X.clear(),e})).cache,Q),tm=r(24898);let ty=function(e,t){return(0,eD.A)(e)?e:tc(e,t)?[e]:th((0,tm.A)(e))},tg=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var tb=1/0;let tv=function(e){if("string"==typeof e||(0,ts.A)(e))return e;var t=e+"";return"0"==t&&1/e==-tb?"-0":t},t_=function(e,t){t=ty(t,e);for(var r=0,n=t.length;null!=e&&r<n;)e=e[tv(t[r++])];return r&&r==n?e:void 0};var tw=r(37688);let tx=function(e,t){var r,n;return t=ty(t,e),r=e,null==(e=(n=t).length<2?r:t_(r,(0,tw.A)(n,0,-1)))||delete e[tv(tg(t))]},tE=function(e){return eh(e)?void 0:e};var tS=r(76335),tD=r(83973),tO=eW(eF(ee=function(e,t){var r={};if(null==e)return r;var n=!1;t=(0,to.A)(t,function(t){return t=ty(t,e),n||(n=t.length>1),t}),(0,eR.A)(e,(0,tD.A)(e),r),n&&(r=(0,ta.A)(r,7,tE));for(var i=t.length;i--;)tx(r,t[i]);return r},void 0,function(e){return(null==e?0:e.length)?(0,tS.A)(e,1):[]}),ee+""),tP=r(20903),tC=((et={}).Array="Array",et.Boolean="Boolean",et.ConceptUuid="ConceptUuid",et.Number="Number",et.Object="Object",et.String="String",et.UUID="UUID",et.PersonAttributeTypeUuid="PersonAttributeTypeUuid",et.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",et);function tk(e,t){return r=>{if(!e(r))if("function"==typeof t)return t(r);else return t}}let tj=tk(e=>Array.isArray(e),"must be an array"),tT=tk(e=>"boolean"==typeof e,"must be a boolean"),tR=tk(e=>"number"==typeof e,"must be a number"),tA=tk(e=>"string"==typeof e,"must be a string"),tM=tk(e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,"must be an object (not an array or null)"),tN=tk(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"),tI=K("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),t$=K("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});t$.subscribe(e=>{var t=e.config;try{localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}catch(e){}});let tL=K("config-store-of-extension-state",{mountedExtensions:[]});function tF(e){return z(`config-module-${e}`,{config:null,loaded:!1,translationOverridesLoaded:!1})}function tB(){return z("config-extension-slots",{slots:{}})}function tV(){return z("config-extensions",{configs:{}})}function tU(e,t,r){return e.configs[t]?.[r]??{loaded:!1,config:null}}let tW=L()(()=>({config:{}})),tK=0,tH=!0,tz=!1;function tq(){if(tH&&n&&!tz){tz=!0,tH=!1;try{n()}catch(e){tH=!0,tG(e),console.error("Failed to derive the implementer tools config",e)}finally{tz=!1}}}function tG(e){tW.setState({derivationError:e instanceof Error?e.message:String(e)})}let tZ=H("config-implementer-tools",{...tW,getState:()=>(0===tK&&tq(),tW.getState()),setState:(...e)=>(tH=!1,tW.setState(...e)),subscribe(e){tK++,tq();let t=tW.subscribe(e),r=!1;return()=>{!r&&(r=!0,tK--),t()}}});function tY(e,t){if(Array.isArray(t))return t}function tJ(e,t){return eq({},e,t,tY)}function tQ(){let e=tI.getState(),t=t$.getState(),r=tL.getState();!function(e,t){for(let r of Object.keys(e.schemas)){let n,i=tF(r),o=e.schemas[r],a=!!e.moduleLoaded[r],s=t0.get(r);if(s&&s.schema===o&&s.moduleLoaded===a&&s.providedConfigs===e.providedConfigs&&s.temporaryConfig===t.config)n=s.state;else{let i=a?function(e,t,r){let n=t.schemas[e],i=re(e,t9(t,r));rr(n,i,e);let o=ra(n,i);return rn(n,o,e),delete o.extensionSlots,o}(r,e,t):function(e,t,r){let n=ra(rf,re(e,t9(t,r)));return rn(rf,n,e),delete n.extensionSlots,n}(r,e,t);n={translationOverridesLoaded:!0,loaded:a,config:i},t0.set(r,{schema:o,moduleLoaded:a,providedConfigs:e.providedConfigs,temporaryConfig:t.config,state:n})}let l=i.getState();l.loaded===n.loaded&&l.translationOverridesLoaded===n.translationOverridesLoaded&&ti(l.config,n.config)||i.setState(n)}}(e,t);let n=function(e,t){let r=rt(t9(e,t)),n=Object.keys(r).reduce((e,t)=>(r[t]?.extensionSlots&&(e[t]=r[t]?.extensionSlots),e),{});var i=n;for(let[e,t]of Object.entries(i))for(let[r,n]of Object.entries(t))!function(e,t,r){let n=`${t}.extensionSlots.${r}`,i=`Extension slot config '${n}'`,o=Object.keys(e).filter(e=>!["add","remove","order","configure"].includes(e));o.length&&rc(n,i+`' contains invalid keys '${o.join("', '")}'`),!e.add||Array.isArray(e.add)&&e.add.every(e=>"string"==typeof e)||rc(n,i+".add' is invalid. Must be an array of strings (extension IDs)"),!e.remove||Array.isArray(e.remove)&&e.remove.every(e=>"string"==typeof e)||rc(n,i+".remove' is invalid. Must be an array of strings (extension IDs)"),!e.order||Array.isArray(e.order)&&e.order.every(e=>"string"==typeof e)||rc(n,i+".order' is invalid. Must be an array of strings (extension IDs)"),e.configure&&!rl(e.configure)&&rc(n,i+".configure' is invalid. Must be an object with extension IDs for keys")}(n,e,r);let o={},a={};for(let e of Object.values(n))for(let[t,r]of Object.entries(e))o[t]=r,r.configure&&(a[t]??(a[t]=[])).push(r.configure);for(let[e,t]of Object.entries(a)){let r=1===t.length?t[0]:rt(t);o[e].configure!==r&&(o[e]={...o[e],configure:r})}return o}(e,t);(function(e){let t=tB(),r=t.getState().slots,n={},i=!1;for(let[t,o]of Object.entries(e)){let e=r[t];e?.loaded&&ti(e.config,o)?n[t]=e:(n[t]={loaded:!0,config:o},i=!0)}(i||Object.keys(r).length!==Object.keys(n).length)&&t.setState({slots:n})})(n),function(e,t,r,n){let i=tV(),o=i.getState().configs,a={},s=!1,l=0;for(let i of t.mountedExtensions){let t=function(e,t,r,n,i,o,a){let s=function(e){let[t]=e.split("#");return t}(n),l=i.schemas[s],u=JSON.stringify([r,n,e,t]),c=t6.get(u);if(c&&c.extensionSchema===l&&c.extensionModuleSchema===i.schemas[t]&&c.providedConfigs===i.providedConfigs&&c.temporaryConfig===o.config)return c.config;let d=l?s:t,f=t9(i,o),p=a?.configure?.[n]??{},h=re(e,f),m=h?.extensionSlots?.[r]?.configure?.[n]??{},y=rt([re(d,f),p,m]),g=l??i.schemas[t];rr(g,y,d);let b=ra(g,y);return rn(g,b,d),delete b.extensionSlots,t6.set(u,{extensionSchema:l,extensionModuleSchema:i.schemas[t],providedConfigs:i.providedConfigs,temporaryConfig:o.config,config:b}),b}(i.slotModuleName,i.extensionModuleName,i.slotName,i.extensionId,e,r,n[i.slotName]),u=o[i.slotName]?.[i.extensionId],c=u?.loaded&&ti(u.config,t)?u:{config:t,loaded:!0};c!==u&&(s=!0),a[i.slotName]||(a[i.slotName]={}),a[i.slotName][i.extensionId]=c,l++}for(let[e,t]of Object.entries(a)){let r=o[e];r&&Object.keys(r).length===Object.keys(t).length&&Object.entries(t).every(([e,t])=>r[e]===t)&&(a[e]=r)}s||(s=Object.keys(o).length!==Object.keys(a).length||Object.values(o).reduce((e,t)=>e+Object.keys(t).length,0)!==l),s&&i.setState({configs:a})}(e,r,t,n),tH=!0,tK>0&&tq()}function tX(){tW.getState().derivationError&&tW.setState({derivationError:void 0});try{tQ()}catch(e){tG(e),console.error("Failed to recompute the configuration",e)}}n=()=>{var e,t;let r,n;return e=tI.getState(),t=t$.getState(),r=tZ.getState(),n={config:function(e,t){let r=function(e){let t={};for(let[r,n]of Object.entries(e)){let e=t8.get(r);if(e&&e.schema===n)t[r]=e.annotated;else{let e=function e(t){return t.hasOwnProperty("_default")?{...t,_value:t._default,_source:"default"}:rl(t)?Object.keys(t).reduce((r,n)=>(r[n]=e(t[n]),r),{}):{}}((0,tP.A)(n));t8.set(r,{schema:n,annotated:e}),t[r]=e}}return t}(e.schemas),n=[...e.providedConfigs.map(e=>[e.config,e.source]),[t.config,"temporary config"]],i=new Set(Object.keys(r));for(let[e]of n)for(let t of Object.keys(e))i.add(t);let o={};for(let e of i){let t=r[e],i=n.map(([t])=>t[e]),a=n.map(([,e])=>e),s=t5.get(e);if(s&&s.annotatedSchema===t&&s.configSlices.length===i.length&&s.configSlices.every((e,t)=>e===i[t])&&s.sources.every((e,t)=>e===a[t])){o[e]=s.result;continue}let l=t??{};n.forEach(([,e],t)=>{let r=i[t];void 0!==r&&(l=tJ(l,function e(t,r){return rl(t)?Object.keys(t).reduce((n,i)=>(n[i]=e(t[i],r),n),{}):{_value:t,_source:r}}(r,e)))}),t5.set(e,{annotatedSchema:t,configSlices:i,sources:a,result:l}),o[e]=l}return o}(e,t)},void(ti(r.config,n.config)||tZ.setState(n))},tQ(),[].push(tI.subscribe(tX),t$.subscribe(tX),tL.subscribe(tX));let t0=new Map;function t1(e,t){t7(e,t);let r=tJ(t,rf);tI.setState(t=>({...t,schemas:{...t.schemas,[e]:r},moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function t3(e,t){t7(e,t);let r=tJ(t,rf);tI.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.`),tI.setState(t=>({...t,schemas:{...t.schemas,[e]:r}}))}function t4(e,t="provided"){tI.setState(r=>({...r,providedConfigs:[...r.providedConfigs,{source:t,config:e}]}))}function t2(e){var t,r,n;return t=tF(e),r=e=>!!(e.loaded&&e.config),n=e=>tO(e.config,["Display conditions","Translation overrides"]),new Promise(e=>{let i,o=!1;function a(t){!o&&r(t)&&(o=!0,e(n(t)),i?.())}a(t.getState()),o||(i=t.subscribe(a))})}let t6=new Map,t5=new Map,t8=new Map;function t9(e,t){return[...e.providedConfigs.map(e=>e.config),t.config]}function t7(e,t,r=""){let n="Please verify that you are running the latest version and, if so, alert the maintainer.";for(let i of Object.keys(t).filter(e=>!e.startsWith("_"))){let o=r+(r&&".")+i,a=t[i];if("Display conditions"===o&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${n}`),"Translation overrides"===o&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${n}`),!rl(a)){console.error(`${e} has bad config schema definition for key '${o}'. ${n}`);continue}a.hasOwnProperty("_default")||t7(e,a,o);let s=a._elements;if(rs(s)&&t7(e,s,o+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${o}' ${n}.
4
4
 
5
5
  If you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);let l=a._type;l&&!Object.values(tC).includes(l)&&console.error(`${e} has invalid type for key '${o}' ${n}.
6
6
 
@@ -8,20 +8,20 @@ If you're the maintainer: the allowed types are ${Object.values(tC).join(", ")}.
8
8
 
9
9
  If you're the maintainer: all config elements must have a default. Received ${JSON.stringify(a)}`),s&&l&&![tC.Array,tC.Object].includes(l)&&console.error(`${e} has bad config schema definition for key '${o}'. ${n}.
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 re(e,t){return rt(t.map(({[e]:t})=>t).filter(e=>!!e))}function rt(e){return e.reduce((e,t)=>eq(e,t,tY),{})}function rr(e,t,r=""){for(let n of Object.keys(t)){let i=t[n],o=r+"."+n,a=e[n];if(!e.hasOwnProperty(n)){("extensionSlots"!==n||""===r)&&rc(o,`Unknown config key '${o}' provided. Ignoring.`);continue}(function e(t,r,n){ri(n,t._type,r),rl(r)?t._type===tC.Object?function(t,r,n){if(t._elements)for(let i of Object.keys(r)){let o=r[i];e(t._elements,o,`${n}.${i}`)}}(t,r,n):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||rr(t,r,n):t._type===tC.Array&&function(t,r,n){if(ri(n,tC.Array,r)){if(rs(t._elements))for(let i=0;i<r.length;i++)e(t._elements,r[i],`${n}[${i}]`);for(let e=0;e<r.length;e++)ri(`${n}[${e}]`,t._elements?._type,r[e])}}(t,r,n)})(a,i,o)}}function rn(e,t,r=""){if(e){if(t!==e._default&&ro(r,e._validators,t),rl(t))for(let n of Object.keys(t)){let i=t[n],o=r+"."+n,a=e[n];e._type===tC.Object&&e._elements?rn(e._elements,i,o):rn(a,i,o)}else if(Array.isArray(t)&&e._elements)for(let n=0;n<t.length;n++)rn(e._elements,t[n],`${r}[${n}]`)}}function ri(e,t,r){return!t||ro(e,[{Array:tT,Boolean:tj,ConceptUuid:tN,Number:tR,Object:tM,String:tA,UUID:tN,PersonAttributeTypeUuid:tN,PatientIdentifierTypeUuid:tN}[t]],r)}function ro(e,t,r){let n=!0;if(t)try{for(let i of t){let t=i(r);if("string"==typeof t){let i="object"==typeof r?`Invalid configuration for ${e}: ${t}`:`Invalid configuration value ${r} for ${e}: ${t}`;rc(e,i),n=!1}}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error
12
- ${t}`)}return n}let ra=(e,t)=>{let r=structuredClone(t);if(!e)return r;for(let t of Object.keys(e)){let n=r[t],i=e[t];if(i&&(i.hasOwnProperty("_type")||i.hasOwnProperty("_default"))){r.hasOwnProperty(t)||(r[t]=i._default);let e=i._elements;if(n&&rs(e)){if(i._type===tC.Array&&Array.isArray(n)){let i=n.map(t=>ra(e,t));r[t]=i}else if(i._type===tC.Object)for(let t of Object.keys(n))n[t]=ra(e,n[t])}}else if(rl(i)){let e=n??{};rl(e)&&(r[t]=ra(i,e))}}return r};function rs(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function rl(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let ru=new Set;function rc(e,t){let r=`${e}:::${t}`;ru||(ru=new Set),ru.has(r)||(console.error(t),ru.add(r))}let rd={"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:tC.Object,_default:{},_validators:[tk(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(", ")}.`})]}},rf={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:tC.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:tC.String,_default:void 0}},...rd},rp=(e,t)=>tk(r=>e<=r&&r<=t,`must be between ${e} and ${t}`),rh=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return tk(e=>{if(!e||"string"!=typeof e)return!1;let r=/\${(.*?)}/g,n=r.exec(e);for(;n;){if(!t.includes(n[1]))return!1;n=r.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},rm=rh([]),ry=e=>tk(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),rg={inRange:rp,isUrl:rm,isUrlWithTemplateParameters:rh,oneOf:ry};var rb=r(48067);let rv=K("breadcrumbs",[]);function r_(e){return rw([e])}function rw(e){let t=[...rx(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,rb.pathToRegexp)(e.matcher).regexp:(0,rb.pathToRegexp)(e.path).regexp,settings:e}))];rv.setState(t,!0)}function rx(){return rv.getState()}function rE(e,t){if(t)return function(e,t){let[r]=e.filter(e=>e.matcher.test(t));return r}(e,t)||function(e,t){let r=t.split("/");for(;r.length>1;){r.pop();let t=rE(e,r.join("/"));if(t)return t}}(e,t)}function rS(e,t){if(e.length>0){let r=rE(e,t);if(r){let t=[r],n=rE(e,r.settings.parent);for(;void 0!==n;)t.push(n),n=rE(e,n.settings.parent);return t.reverse()}}return[]}function rD(e){return rS(rx(),e)}var rO=Object.freeze({__proto__:null,get start(){return nY},get ensureJQuerySupport(){return nD},get setBootstrapMaxTime(){return na},get setMountMaxTime(){return ns},get setUnmountMaxTime(){return nl},get setUnloadMaxTime(){return nu},get registerApplication(){return nI},get unregisterApplication(){return nL},get getMountedApps(){return nR},get getAppStatus(){return nM},get unloadApplication(){return nF},get checkActivityFunctions(){return n$},get getAppNames(){return nA},get pathToActiveWhen(){return nU},get navigateToUrl(){return ny},get patchHistoryApi(){return nx},get triggerAppChange(){return nz},get addErrorHandler(){return rj},get removeErrorHandler(){return rR},get mountRootParcel(){return nt},get NOT_LOADED(){return rN},get LOADING_SOURCE_CODE(){return rI},get NOT_BOOTSTRAPPED(){return r$},get BOOTSTRAPPING(){return rL},get NOT_MOUNTED(){return rF},get MOUNTING(){return rB},get UPDATING(){return rU},get LOAD_ERROR(){return rH},get MOUNTED(){return rV},get UNLOADING(){return rK},get UNMOUNTING(){return rW},get SKIP_BECAUSE_BROKEN(){return rz}}),rP=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,rC=!function(){try{var e=new rP("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 r=document.createEvent("CustomEvent");return t?r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):r.initCustomEvent(e,!1,!1,void 0),r}:function(e,t){var r=document.createEventObject();return r.type=e,t?(r.bubbles=!!t.bubbles,r.cancelable=!!t.cancelable,r.detail=t.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r}:rP;let rk=[];function rT(e,t,r){let n=rM(e,t,r);rk.length?rk.forEach(e=>e(n)):setTimeout(()=>{throw n})}function rj(e){if("function"!=typeof e)throw Error(rA(28,!1));rk.push(e)}function rR(e){if("function"!=typeof e)throw Error(rA(29,!1));let t=!1;return rk=rk.filter(r=>{let n=r===e;return t=t||n,!n}),t}function rA(e,t,...r){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${r.length?`&arg=${r.join("&arg=")}`:""}`}function rM(e,t,r){let n,i=`${rJ(t)} '${rZ(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=i+e.message}catch(e){}n=e}else{console.warn(rA(30,!1,t.status,rZ(t)));try{n=Error(i+JSON.stringify(e))}catch(t){n=e}}return n.appOrParcelName=rZ(t),t.status=r,n}let rN="NOT_LOADED",rI="LOADING_SOURCE_CODE",r$="NOT_BOOTSTRAPPED",rL="BOOTSTRAPPING",rF="NOT_MOUNTED",rB="MOUNTING",rV="MOUNTED",rU="UPDATING",rW="UNMOUNTING",rK="UNLOADING",rH="LOAD_ERROR",rz="SKIP_BECAUSE_BROKEN";function rq(e){return e.status===rV}function rG(e){try{return e.activeWhen(window.location)}catch(t){return rT(t,e,rz),!1}}function rZ(e){return e.name}function rY(e){return!!e.unmountThisParcel}function rJ(e){return rY(e)?"parcel":"application"}function rQ(){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 rX(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r];return null}function r0(e){return e&&("function"==typeof e||Array.isArray(e)&&!rX(e,e=>"function"!=typeof e))}function r1(e,t){let r=e[t]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[()=>Promise.resolve()]);let n=rJ(e),i=rZ(e);return function(e){return r.reduce((r,o,a)=>r.then(()=>{let r=o(e);return r3(r)?r:Promise.reject(rA(15,!1,n,i,t,a))}),Promise.resolve())}}function r3(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let r4=[];function r2(e,t){return Promise.resolve().then(()=>e.status!==r$?e:(e.status=rL,e.bootstrap?nc(e,"bootstrap").then(r).catch(r=>{if(t)throw rM(r,e,rz);return rT(r,e,rz),e}):Promise.resolve().then(r)));function r(){return e.status=rF,e}}function r6(e,t){return Promise.resolve().then(()=>{if(e.status!==rV)return e;return e.status=rW,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(r,n=>r().then(()=>{let r=Error(n.message);if(t)throw rM(r,e,rz);rT(r,e,rz)})).then(()=>e);function r(){return nc(e,"unmount").then(()=>{e.status=rF},r=>{if(t)throw rM(r,e,rz);rT(r,e,rz)})}})}let r5=!1,r8=!1;function r9(e,t){return Promise.resolve().then(()=>e.status!==rF?e:(r5||(window.dispatchEvent(new rC("single-spa:before-first-mount")),r5=!0),e.status=rB,nc(e,"mount").then(()=>(e.status=rV,r8||(window.dispatchEvent(new rC("single-spa:first-mount")),r8=!0),e)).catch(r=>{return e.status=rV,r6(e,!0).then(n,n);function n(){if(t)throw rM(r,e,rz);return rT(r,e,rz),e}})))}let r7=0,ne={parcels:{}};function nt(){return nr.apply(ne,arguments)}function nr(e,t){let r,n,i,o=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(rA(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(rA(3,!1,typeof e.name));let a=r7++,s=e.name||`parcel-${a}`;if("object"!=typeof t)throw Error(rA(4,!1,s,typeof t));if(!t.domElement)throw Error(rA(5,!1,s));let l="function"==typeof e,u=l?e:()=>Promise.resolve(e),c={id:a,parcels:{},status:l?rI:r$,customProps:t,parentName:rZ(o),unmountThisParcel:()=>p.then(()=>{if(c.status!==rV)throw Error(rA(6,!1,s,c.status));return r6(c,!0)}).then(e=>(c.parentName&&delete o.parcels[c.id],e)).then(e=>(n(e),e)).catch(e=>{throw c.status=rz,i(e),e})};o.parcels[a]=c;let d=u();if(!d||"function"!=typeof d.then)throw Error(rA(7,!1));let f=(d=d.then(e=>{if(!e)throw Error(rA(8,!1));if(s=e.name||`parcel-${a}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!r0(e.bootstrap))throw Error(rA(9,!1,s));if(!r0(e.mount))throw Error(rA(10,!1,s));if(!r0(e.unmount))throw Error(rA(11,!1,s));if(e.update&&!r0(e.update))throw Error(rA(12,!1,s));let t=r1(e,"bootstrap"),n=r1(e,"mount"),i=r1(e,"unmount");c.status=r$,c.name=s,c.bootstrap=t,c.mount=n,c.unmount=i,c.timeouts=nd(e.timeouts),e.update&&(c.update=r1(e,"update"),r.update=function(e){return c.customProps=e,nn(Promise.resolve().then(()=>{if(c.status!==rV)throw Error(rA(32,!1,rZ(c)));return c.status=rU,nc(c,"update").then(()=>(c.status=rV,c)).catch(e=>{throw rM(e,c,rz)})}))})})).then(()=>r2(c,!0)),p=f.then(()=>r9(c,!0)),h=new Promise((e,t)=>{n=e,i=t});return r={mount:()=>nn(Promise.resolve().then(()=>{if(c.status!==rF)throw Error(rA(13,!1,s,c.status));return o.parcels[a]=c,r9(c)})),unmount:()=>nn(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:nn(d),bootstrapPromise:nn(f),mountPromise:nn(p),unmountPromise:nn(h)}}function nn(e){return e.then(()=>null)}function ni(e){let t=rZ(e),r="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(rA(40,!1),t,r));let n=rQ({},r,{name:t,mountParcel:nr.bind(e),singleSpa:rO});return rY(e)&&(n.unmountSelf=e.unmountThisParcel),n}let no={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 na(e,t,r){if("number"!=typeof e||e<=0)throw Error(rA(16,!1));no.bootstrap={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function ns(e,t,r){if("number"!=typeof e||e<=0)throw Error(rA(17,!1));no.mount={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nl(e,t,r){if("number"!=typeof e||e<=0)throw Error(rA(18,!1));no.unmount={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nu(e,t,r){if("number"!=typeof e||e<=0)throw Error(rA(19,!1));no.unload={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nc(e,t){let r=e.timeouts[t],n=r.warningMillis,i=rJ(e);return new Promise((o,a)=>{let s=!1,l=!1;e[t](ni(e)).then(e=>{s=!0,o(e)}).catch(e=>{s=!0,a(e)}),setTimeout(()=>c(1),n),setTimeout(()=>c(!0),r.millis);let u=rA(31,!1,t,i,rZ(e),r.millis);function c(e){s||(!0===e?(l=!0,r.dieOnTimeout?a(Error(u)):console.error(u)):!l&&(console.warn(u),e*n+n<r.millis&&setTimeout(()=>c(e+1),n)))}})}function nd(e){let t={};for(let r in no)t[r]=rQ({},no[r],e&&e[r]||{});return t}function nf(e){return Promise.resolve().then(()=>{let t,r;return e.loadPromise?e.loadPromise:e.status!==rN&&e.status!==rH?e:(e.status=rI,e.loadPromise=Promise.resolve().then(()=>{let n=e.loadApp(ni(e));if(!r3(n))throw r=!0,Error(rA(33,!1,rZ(e)));return n.then(r=>{let n;e.loadErrorTime=null,"object"!=typeof(t=r)&&(n=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!r0(t.bootstrap)&&(n=35),r0(t.mount)||(n=36),r0(t.unmount)||(n=37);let i=rJ(t);if(n){let r;try{r=JSON.stringify(t)}catch(e){}return console.error(rA(n,!1,i,rZ(e),r),t),rT(void 0,e,rz),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=rQ({},e.devtools.overlays,t.devtools.overlays)),e.status=r$,e.bootstrap=r1(t,"bootstrap"),e.mount=r1(t,"mount"),e.unmount=r1(t,"unmount"),e.unload=r1(t,"unload"),e.timeouts=nd(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let n;return delete e.loadPromise,r?n=rz:(n=rH,e.loadErrorTime=(new Date).getTime()),rT(t,e,n),e}))})}let np="u">typeof window,nh={hashchange:[],popstate:[]},nm=["hashchange","popstate"];function ny(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(rA(14,!1));t=e.currentTarget.href,e.preventDefault()}let r=nE(window.location.href),n=nE(t);0===t.indexOf("#")?window.location.hash=n.hash:r.host!==n.host&&n.host?window.location.href=t:n.pathname===r.pathname&&n.search===r.search?window.location.hash=n.hash:window.history.pushState(null,null,t)}function ng(e){if(e){let t=e[0].type;nm.indexOf(t)>=0&&nh[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function nb(){nq([],arguments)}function nv(e,t){return function(){let r=window.location.href,n=e.apply(this,arguments),o=window.location.href;return i&&r===o||window.dispatchEvent(function(e,t){let r;try{r=new PopStateEvent("popstate",{state:e})}catch(t){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return r.singleSpa=!0,r.singleSpaTrigger=t,r}(window.history.state,t)),n}}let n_=null,nw=!1;function nx(e){if(nw)throw Error(rA(43,!1));i=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,nw=!0,n_=window.history.replaceState,window.addEventListener("hashchange",nb),window.addEventListener("popstate",nb);let t=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(e,r){if(!("function"==typeof r&&nm.indexOf(e)>=0)||rX(nh[e],e=>e===r))return t.apply(this,arguments);nh[e].push(r)},window.removeEventListener=function(e,t){return"function"==typeof t&&nm.indexOf(e)>=0&&(nh[e]=nh[e].filter(e=>e!==t)),r.apply(this,arguments)},window.history.pushState=nv(window.history.pushState,"pushState"),window.history.replaceState=nv(n_,"replaceState")}function nE(e){let t=document.createElement("a");return t.href=e,t}np&&(window.singleSpaNavigate?console.warn(rA(41,!1)):window.singleSpaNavigate=ny);let nS=!1;function nD(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!nS){let t=e.fn.on,r=e.fn.off;e.fn.on=function(e,r){return nO.call(this,t,window.addEventListener,e,r,arguments)},e.fn.off=function(e,t){return nO.call(this,r,window.removeEventListener,e,t,arguments)},nS=!0}}function nO(e,t,r,n,i){return"string"!=typeof r?e.apply(this,i):(r.split(/\s+/).forEach(e=>{nm.indexOf(e)>=0&&(t(e,n),r=r.replace(e,""))}),""===r.trim()?this:e.apply(this,i))}let nP={};function nC(e){return Promise.resolve().then(()=>{let t=nP[rZ(e)];if(!t)return e;if(e.status===rN)return nk(e,t),e;if(e.status===rK)return t.promise.then(()=>e);if(e.status!==rF&&e.status!==rH)return e;let r=e.status===rH?Promise.resolve():nc(e,"unload");return e.status=rK,r.then(()=>(nk(e,t),e)).catch(r=>(delete nP[rZ(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,rT(r,e,rz),t.reject(r),e))})}function nk(e,t){delete nP[rZ(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=rN,t.resolve()}function nT(e,t,r,n){nP[rZ(e)]={app:e,resolve:r,reject:n},Object.defineProperty(nP[rZ(e)],"promise",{get:t})}let nj=[];function nR(){return nj.filter(rq).map(rZ)}function nA(){return nj.map(rZ)}function nM(e){let t=rX(nj,t=>rZ(t)===e);return t?t.status:null}let nN=!1;function nI(e,t,r,n){var i,o;let a,s,l=(a={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(rA(39,!1));let t=["name","app","activeWhen","customProps"],r=Object.keys(e).reduce((e,r)=>t.indexOf(r)>=0?e:e.concat(r),[]);if(0!==r.length)throw Error(rA(38,!1,t.join(", "),r.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(rA(20,!1));let n=e=>"string"==typeof e||"function"==typeof e;if(!(n(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(n)))throw Error(rA(24,!1));if(!nV(e.customProps))throw Error(rA(22,!1))}(e),a.name=e.name,a.loadApp=e.app,a.activeWhen=e.activeWhen,a.customProps=e.customProps):(function(e,t,r,n){if("string"!=typeof e||0===e.length)throw Error(rA(20,!1));if(!t)throw Error(rA(23,!1));if("function"!=typeof r)throw Error(rA(24,!1));if(!nV(n))throw Error(rA(22,!1))}(e,t,r,n),a.name=e,a.loadApp=t,a.activeWhen=r,a.customProps=n),a.loadApp="function"!=typeof(i=a.loadApp)?()=>Promise.resolve(i):i,a.customProps=a.customProps||{},s=(s=Array.isArray(o=a.activeWhen)?o:[o]).map(e=>"function"==typeof e?e:nU(e)),a.activeWhen=e=>s.some(t=>t(e)),a);if(nZ||nN||(nN=!0,setTimeout(()=>{nZ||console.warn(rA(1,!1))},5e3)),-1!==nA().indexOf(l.name))throw Error(rA(21,!1,l.name));nj.push(rQ({loadErrorTime:null,status:rN,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),np&&(nD(),nq())}function n$(e=window.location){return nj.filter(t=>t.activeWhen(e)).map(rZ)}function nL(e){if(0===nj.filter(t=>rZ(t)===e).length)throw Error(rA(25,!1,e));return(np?nF(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=nj.map(rZ).indexOf(e);nj.splice(t,1)})}function nF(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(rA(26,!1));let r=rX(nj,t=>rZ(t)===e);if(!r)throw Error(rA(27,!1,e));let n=nP[rZ(r)];if(t&&t.waitForUnmount){if(n)return n.promise;{let e=new Promise((t,n)=>{nT(r,()=>e,t,n)});return e}}{let e;return n?(e=n.promise,nB(r,n.resolve,n.reject)):e=new Promise((t,n)=>{nT(r,()=>e,t,n),nB(r,t,n)}),e}}function nB(e,t,r){Promise.resolve().then(()=>{if(rX(n$(),t=>t===rZ(e)))return nz()}).then(()=>r6(e).then(nC).then(()=>{t(),setTimeout(()=>{nq()})})).catch(r)}function nV(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function nU(e,t){let r=function(e,t){let r=0,n=!1,i="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let r=e[t],i=n&&"/"===r;(!n&&":"===r||i)&&o(t)}return o(e.length),RegExp(i,"i");function o(o){let a=e.slice(r,o).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=n?"[^/]+/?":a,o===e.length)if(n)t&&(i+="$");else{let e=t?"":".*";i="/"===i.charAt(i.length-1)?`${i}${e}$`:`${i}(/${e})?(#.*)?$`}n=!n,r=o}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let n=e.href.replace(t,"").replace(e.search,"").split("?")[0];return r.test(n)}}let nW=!1,nK=[],nH=np&&window.location.href;function nz(){return nq()}function nq(e=[],t,r=!1){let n,i,o,a,s;if(nW)return new Promise((e,r)=>{nK.push({resolve:e,reject:r,eventArguments:t})});let{appsToUnload:l,appsToUnmount:u,appsToLoad:c,appsToMount:d}=(n=[],i=[],o=[],a=[],s=(new Date).getTime(),nj.forEach(e=>{let t=e.status!==rz&&rG(e);switch(e.status){case rH:t&&s-e.loadErrorTime>=200&&o.push(e);break;case rN:case rI:t&&o.push(e);break;case r$:case rF:!t&&nP[rZ(e)]?n.push(e):t&&a.push(e);break;case rV:t||i.push(e)}}),{appsToUnload:n,appsToUnmount:i,appsToLoad:o,appsToMount:a}),f,p=[],h=nH,m=nH=window.location.href;return nZ?(nW=!0,f=l.concat(c,u,d),Promise.resolve().then(()=>(w(0===f.length?"before-no-app-change":"before-app-change",v(!0)),w("before-routing-event",v(!0,{cancelNavigation:y})),Promise.all(p).then(r=>{if(r.some(e=>e))return n_.call(window.history,history.state,"",h.substring(location.origin.length)),nH=location.href,nW=!1,nq(e,t,!0);let n=l.map(nC),i=Promise.all(u.map(r6).map(e=>e.then(nC)).concat(n));i.then(()=>{w("before-mount-routing-event",v(!0))},e=>{throw e});let o=c.map(e=>nf(e).then(e=>nG(e,i))),a=d.filter(e=>0>c.indexOf(e)).map(e=>nG(e,i));return i.catch(e=>{throw b(),e}).then(()=>(b(),Promise.all(o.concat(a)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(g).then(()=>{},e=>{throw e})))})))):(f=c,Promise.resolve().then(()=>Promise.all(c.map(nf)).then(b).then(()=>[]).catch(e=>{throw b(),e}).finally(()=>{})));function y(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);p.push(t.catch(e=>(console.warn(Error(rA(42,!1))),console.warn(e),!1)))}function g(){let t=nR();e.forEach(e=>e.resolve(t));try{w(0===f.length?"no-app-change":"app-change",v()),w("routing-event",v())}catch(e){setTimeout(()=>{throw e})}if(nW=!1,nK.length>0){let e=nK;nK=[],nq(e)}return t}function b(){r||(e.forEach(e=>{ng(e.eventArguments)}),ng(t))}function v(e=!1,r){let n={},i={[rV]:[],[rF]:[],[rN]:[],[rz]:[]};e?(c.concat(d).forEach((e,t)=>{a(e,rV)}),l.forEach(e=>{a(e,rN)}),u.forEach(e=>{a(e,rF)})):f.forEach(e=>{a(e)});let o={detail:{newAppStatuses:n,appsByNewStatus:i,totalAppChanges:f.length,originalEvent:null==t?void 0:t[0],oldUrl:h,newUrl:m}};return r&&rQ(o.detail,r),o;function a(e,t){let r=rZ(e);t=t||nM(r),n[r]=t,(i[t]=i[t]||[]).push(r)}}function w(e,t){r||window.dispatchEvent(new rC(`single-spa:${e}`,t))}}function nG(e,t){return rG(e)?r2(e).then(e=>t.then(()=>rG(e)?r9(e):e)):t.then(()=>e)}let nZ=!1;function nY(e){nZ=!0,np&&(nx(e),nq())}function nJ(e,t){let r=window.getOpenmrsSpaBase().replace(/\/$/,"");return nQ(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:r,...t}).replace(/^\/\//,"/")}function nQ(e,t){return Object.keys(t).reduce((e,r)=>e.split("${"+r+"}").join(t[r]),e)}function nX({to:e,templateParams:t}){let r=window.getOpenmrsSpaBase().replace(/\/$/,""),n=nJ(e,t).replace(window.location.origin,"");n.startsWith(r)?ny(n):window.location.assign(n)}np&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...nj]},reroute:nq,NOT_LOADED:rN,toLoadPromise:nf,toBootstrapPromise:r2,unregisterApplication:nL,getProfilerData:function(){return r4}});let n0="openmrs:history";function n1(){return JSON.parse(sessionStorage.getItem(n0)??"[]")}function n3({toUrl:e}){let t=n1(),r=t.lastIndexOf(e);if(-1!=r){let e=t.slice(0,r+1);nX({to:t[r]}),sessionStorage.setItem(n0,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function n4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}tC.Boolean,tC.String,rg.isUrl,tC.Array,tC.Number,rg.inRange(100,600),tC.Boolean,tC.Boolean;let n2="/ws/rest/v1",n6="/ws/fhir2/R4",n5=`${n2}/session`;function n8(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function n9(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 r=n8(e);if(t.headers||(t.headers={}),eh(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,e.startsWith(n2)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(n6)){let e=new URL(r,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),r=e.toString())}let n=Error();return window.fetch(r,t).then(async e=>{let{redirectAuthFailure:t,followRedirects:i}=await t2("@openmrs/esm-api");if(e.ok){let t=e.headers.get("location");return(i&&t&&(r===n8(n5)||204===e.status)&&nX({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 r===n8(n5)&&403===e.status||t.enabled&&t.errors.includes(e.status)?(sessionStorage.removeItem(n0),nX({to:t.url||e.headers.get("location")||"${openmrsSpaBase}/login"}),t.resolvePromise?Promise.resolve():new Promise(()=>{})):e.clone().text().then(t=>{let i=t;try{i=JSON.parse(t)}catch(e){}throw new ie(r,e,i,n)},t=>{throw new ie(r,e,null,n)})})}function n7(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");let r=new AbortController;return t.signal=r.signal,new ea.Observable(n=>{let i=!1;return n9(e,t).then(e=>{i=!0,n.next(e),n.complete()},e=>{i=!0,n.error(e)}),()=>{i||r.abort()}})}class ie extends Error{constructor(e,t,r,n){super(),n4(this,"response",void 0),n4(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`,n.message=this.message,this.responseBody=r,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 re(e,t){return rt(t.map(({[e]:t})=>t).filter(e=>!!e))}function rt(e){return e.reduce((e,t)=>eq(e,t,tY),{})}function rr(e,t,r=""){for(let n of Object.keys(t)){let i=t[n],o=r+"."+n,a=e[n];if(!e.hasOwnProperty(n)){("extensionSlots"!==n||""===r)&&rc(o,`Unknown config key '${o}' provided. Ignoring.`);continue}(function e(t,r,n){ri(n,t._type,r),rl(r)?t._type===tC.Object?function(t,r,n){if(t._elements)for(let i of Object.keys(r)){let o=r[i];e(t._elements,o,`${n}.${i}`)}}(t,r,n):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||rr(t,r,n):t._type===tC.Array&&function(t,r,n){if(ri(n,tC.Array,r)){if(rs(t._elements))for(let i=0;i<r.length;i++)e(t._elements,r[i],`${n}[${i}]`);for(let e=0;e<r.length;e++)ri(`${n}[${e}]`,t._elements?._type,r[e])}}(t,r,n)})(a,i,o)}}function rn(e,t,r=""){if(e){if(t!==e._default&&ro(r,e._validators,t),rl(t))for(let n of Object.keys(t)){let i=t[n],o=r+"."+n,a=e[n];e._type===tC.Object&&e._elements?rn(e._elements,i,o):rn(a,i,o)}else if(Array.isArray(t)&&e._elements)for(let n=0;n<t.length;n++)rn(e._elements,t[n],`${r}[${n}]`)}}function ri(e,t,r){return!t||ro(e,[{Array:tj,Boolean:tT,ConceptUuid:tN,Number:tR,Object:tM,String:tA,UUID:tN,PersonAttributeTypeUuid:tN,PatientIdentifierTypeUuid:tN}[t]],r)}function ro(e,t,r){let n=!0;if(t)try{for(let i of t){let t=i(r);if("string"==typeof t){let i="object"==typeof r?`Invalid configuration for ${e}: ${t}`:`Invalid configuration value ${r} for ${e}: ${t}`;rc(e,i),n=!1}}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error
12
+ ${t}`)}return n}let ra=(e,t)=>{let r=structuredClone(t);if(!e)return r;for(let t of Object.keys(e)){let n=r[t],i=e[t];if(i&&(i.hasOwnProperty("_type")||i.hasOwnProperty("_default"))){r.hasOwnProperty(t)||(r[t]=i._default);let e=i._elements;if(n&&rs(e)){if(i._type===tC.Array&&Array.isArray(n)){let i=n.map(t=>ra(e,t));r[t]=i}else if(i._type===tC.Object)for(let t of Object.keys(n))n[t]=ra(e,n[t])}}else if(rl(i)){let e=n??{};rl(e)&&(r[t]=ra(i,e))}}return r};function rs(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function rl(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let ru=new Set;function rc(e,t){let r=`${e}:::${t}`;ru||(ru=new Set),ru.has(r)||(console.error(t),ru.add(r))}let rd={"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:tC.Object,_default:{},_validators:[tk(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(", ")}.`})]}},rf={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:tC.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:tC.String,_default:void 0}},...rd},rp=(e,t)=>tk(r=>e<=r&&r<=t,`must be between ${e} and ${t}`),rh=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return tk(e=>{if(!e||"string"!=typeof e)return!1;let r=/\${(.*?)}/g,n=r.exec(e);for(;n;){if(!t.includes(n[1]))return!1;n=r.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},rm=rh([]),ry=e=>tk(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),rg={inRange:rp,isUrl:rm,isUrlWithTemplateParameters:rh,oneOf:ry};var rb=r(48067);let rv=K("breadcrumbs",[]);function r_(e){return rw([e])}function rw(e){let t=[...rx(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,rb.pathToRegexp)(e.matcher).regexp:(0,rb.pathToRegexp)(e.path).regexp,settings:e}))];rv.setState(t,!0)}function rx(){return rv.getState()}function rE(e,t){if(t)return function(e,t){let[r]=e.filter(e=>e.matcher.test(t));return r}(e,t)||function(e,t){let r=t.split("/");for(;r.length>1;){r.pop();let t=rE(e,r.join("/"));if(t)return t}}(e,t)}function rS(e,t){if(e.length>0){let r=rE(e,t);if(r){let t=[r],n=rE(e,r.settings.parent);for(;void 0!==n;)t.push(n),n=rE(e,n.settings.parent);return t.reverse()}}return[]}function rD(e){return rS(rx(),e)}var rO=Object.freeze({__proto__:null,get start(){return nY},get ensureJQuerySupport(){return nD},get setBootstrapMaxTime(){return na},get setMountMaxTime(){return ns},get setUnmountMaxTime(){return nl},get setUnloadMaxTime(){return nu},get registerApplication(){return nI},get unregisterApplication(){return nL},get getMountedApps(){return nR},get getAppStatus(){return nM},get unloadApplication(){return nF},get checkActivityFunctions(){return n$},get getAppNames(){return nA},get pathToActiveWhen(){return nU},get navigateToUrl(){return ny},get patchHistoryApi(){return nx},get triggerAppChange(){return nz},get addErrorHandler(){return rT},get removeErrorHandler(){return rR},get mountRootParcel(){return nt},get NOT_LOADED(){return rN},get LOADING_SOURCE_CODE(){return rI},get NOT_BOOTSTRAPPED(){return r$},get BOOTSTRAPPING(){return rL},get NOT_MOUNTED(){return rF},get MOUNTING(){return rB},get UPDATING(){return rU},get LOAD_ERROR(){return rH},get MOUNTED(){return rV},get UNLOADING(){return rK},get UNMOUNTING(){return rW},get SKIP_BECAUSE_BROKEN(){return rz}}),rP=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,rC=!function(){try{var e=new rP("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 r=document.createEvent("CustomEvent");return t?r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):r.initCustomEvent(e,!1,!1,void 0),r}:function(e,t){var r=document.createEventObject();return r.type=e,t?(r.bubbles=!!t.bubbles,r.cancelable=!!t.cancelable,r.detail=t.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r}:rP;let rk=[];function rj(e,t,r){let n=rM(e,t,r);rk.length?rk.forEach(e=>e(n)):setTimeout(()=>{throw n})}function rT(e){if("function"!=typeof e)throw Error(rA(28,!1));rk.push(e)}function rR(e){if("function"!=typeof e)throw Error(rA(29,!1));let t=!1;return rk=rk.filter(r=>{let n=r===e;return t=t||n,!n}),t}function rA(e,t,...r){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${r.length?`&arg=${r.join("&arg=")}`:""}`}function rM(e,t,r){let n,i=`${rJ(t)} '${rZ(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=i+e.message}catch(e){}n=e}else{console.warn(rA(30,!1,t.status,rZ(t)));try{n=Error(i+JSON.stringify(e))}catch(t){n=e}}return n.appOrParcelName=rZ(t),t.status=r,n}let rN="NOT_LOADED",rI="LOADING_SOURCE_CODE",r$="NOT_BOOTSTRAPPED",rL="BOOTSTRAPPING",rF="NOT_MOUNTED",rB="MOUNTING",rV="MOUNTED",rU="UPDATING",rW="UNMOUNTING",rK="UNLOADING",rH="LOAD_ERROR",rz="SKIP_BECAUSE_BROKEN";function rq(e){return e.status===rV}function rG(e){try{return e.activeWhen(window.location)}catch(t){return rj(t,e,rz),!1}}function rZ(e){return e.name}function rY(e){return!!e.unmountThisParcel}function rJ(e){return rY(e)?"parcel":"application"}function rQ(){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 rX(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r];return null}function r0(e){return e&&("function"==typeof e||Array.isArray(e)&&!rX(e,e=>"function"!=typeof e))}function r1(e,t){let r=e[t]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[()=>Promise.resolve()]);let n=rJ(e),i=rZ(e);return function(e){return r.reduce((r,o,a)=>r.then(()=>{let r=o(e);return r3(r)?r:Promise.reject(rA(15,!1,n,i,t,a))}),Promise.resolve())}}function r3(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let r4=[];function r2(e,t){return Promise.resolve().then(()=>e.status!==r$?e:(e.status=rL,e.bootstrap?nc(e,"bootstrap").then(r).catch(r=>{if(t)throw rM(r,e,rz);return rj(r,e,rz),e}):Promise.resolve().then(r)));function r(){return e.status=rF,e}}function r6(e,t){return Promise.resolve().then(()=>{if(e.status!==rV)return e;return e.status=rW,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(r,n=>r().then(()=>{let r=Error(n.message);if(t)throw rM(r,e,rz);rj(r,e,rz)})).then(()=>e);function r(){return nc(e,"unmount").then(()=>{e.status=rF},r=>{if(t)throw rM(r,e,rz);rj(r,e,rz)})}})}let r5=!1,r8=!1;function r9(e,t){return Promise.resolve().then(()=>e.status!==rF?e:(r5||(window.dispatchEvent(new rC("single-spa:before-first-mount")),r5=!0),e.status=rB,nc(e,"mount").then(()=>(e.status=rV,r8||(window.dispatchEvent(new rC("single-spa:first-mount")),r8=!0),e)).catch(r=>{return e.status=rV,r6(e,!0).then(n,n);function n(){if(t)throw rM(r,e,rz);return rj(r,e,rz),e}})))}let r7=0,ne={parcels:{}};function nt(){return nr.apply(ne,arguments)}function nr(e,t){let r,n,i,o=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(rA(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(rA(3,!1,typeof e.name));let a=r7++,s=e.name||`parcel-${a}`;if("object"!=typeof t)throw Error(rA(4,!1,s,typeof t));if(!t.domElement)throw Error(rA(5,!1,s));let l="function"==typeof e,u=l?e:()=>Promise.resolve(e),c={id:a,parcels:{},status:l?rI:r$,customProps:t,parentName:rZ(o),unmountThisParcel:()=>p.then(()=>{if(c.status!==rV)throw Error(rA(6,!1,s,c.status));return r6(c,!0)}).then(e=>(c.parentName&&delete o.parcels[c.id],e)).then(e=>(n(e),e)).catch(e=>{throw c.status=rz,i(e),e})};o.parcels[a]=c;let d=u();if(!d||"function"!=typeof d.then)throw Error(rA(7,!1));let f=(d=d.then(e=>{if(!e)throw Error(rA(8,!1));if(s=e.name||`parcel-${a}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!r0(e.bootstrap))throw Error(rA(9,!1,s));if(!r0(e.mount))throw Error(rA(10,!1,s));if(!r0(e.unmount))throw Error(rA(11,!1,s));if(e.update&&!r0(e.update))throw Error(rA(12,!1,s));let t=r1(e,"bootstrap"),n=r1(e,"mount"),i=r1(e,"unmount");c.status=r$,c.name=s,c.bootstrap=t,c.mount=n,c.unmount=i,c.timeouts=nd(e.timeouts),e.update&&(c.update=r1(e,"update"),r.update=function(e){return c.customProps=e,nn(Promise.resolve().then(()=>{if(c.status!==rV)throw Error(rA(32,!1,rZ(c)));return c.status=rU,nc(c,"update").then(()=>(c.status=rV,c)).catch(e=>{throw rM(e,c,rz)})}))})})).then(()=>r2(c,!0)),p=f.then(()=>r9(c,!0)),h=new Promise((e,t)=>{n=e,i=t});return r={mount:()=>nn(Promise.resolve().then(()=>{if(c.status!==rF)throw Error(rA(13,!1,s,c.status));return o.parcels[a]=c,r9(c)})),unmount:()=>nn(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:nn(d),bootstrapPromise:nn(f),mountPromise:nn(p),unmountPromise:nn(h)}}function nn(e){return e.then(()=>null)}function ni(e){let t=rZ(e),r="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(rA(40,!1),t,r));let n=rQ({},r,{name:t,mountParcel:nr.bind(e),singleSpa:rO});return rY(e)&&(n.unmountSelf=e.unmountThisParcel),n}let no={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 na(e,t,r){if("number"!=typeof e||e<=0)throw Error(rA(16,!1));no.bootstrap={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function ns(e,t,r){if("number"!=typeof e||e<=0)throw Error(rA(17,!1));no.mount={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nl(e,t,r){if("number"!=typeof e||e<=0)throw Error(rA(18,!1));no.unmount={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nu(e,t,r){if("number"!=typeof e||e<=0)throw Error(rA(19,!1));no.unload={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nc(e,t){let r=e.timeouts[t],n=r.warningMillis,i=rJ(e);return new Promise((o,a)=>{let s=!1,l=!1;e[t](ni(e)).then(e=>{s=!0,o(e)}).catch(e=>{s=!0,a(e)}),setTimeout(()=>c(1),n),setTimeout(()=>c(!0),r.millis);let u=rA(31,!1,t,i,rZ(e),r.millis);function c(e){s||(!0===e?(l=!0,r.dieOnTimeout?a(Error(u)):console.error(u)):!l&&(console.warn(u),e*n+n<r.millis&&setTimeout(()=>c(e+1),n)))}})}function nd(e){let t={};for(let r in no)t[r]=rQ({},no[r],e&&e[r]||{});return t}function nf(e){return Promise.resolve().then(()=>{let t,r;return e.loadPromise?e.loadPromise:e.status!==rN&&e.status!==rH?e:(e.status=rI,e.loadPromise=Promise.resolve().then(()=>{let n=e.loadApp(ni(e));if(!r3(n))throw r=!0,Error(rA(33,!1,rZ(e)));return n.then(r=>{let n;e.loadErrorTime=null,"object"!=typeof(t=r)&&(n=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!r0(t.bootstrap)&&(n=35),r0(t.mount)||(n=36),r0(t.unmount)||(n=37);let i=rJ(t);if(n){let r;try{r=JSON.stringify(t)}catch(e){}return console.error(rA(n,!1,i,rZ(e),r),t),rj(void 0,e,rz),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=rQ({},e.devtools.overlays,t.devtools.overlays)),e.status=r$,e.bootstrap=r1(t,"bootstrap"),e.mount=r1(t,"mount"),e.unmount=r1(t,"unmount"),e.unload=r1(t,"unload"),e.timeouts=nd(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let n;return delete e.loadPromise,r?n=rz:(n=rH,e.loadErrorTime=(new Date).getTime()),rj(t,e,n),e}))})}let np="u">typeof window,nh={hashchange:[],popstate:[]},nm=["hashchange","popstate"];function ny(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(rA(14,!1));t=e.currentTarget.href,e.preventDefault()}let r=nE(window.location.href),n=nE(t);0===t.indexOf("#")?window.location.hash=n.hash:r.host!==n.host&&n.host?window.location.href=t:n.pathname===r.pathname&&n.search===r.search?window.location.hash=n.hash:window.history.pushState(null,null,t)}function ng(e){if(e){let t=e[0].type;nm.indexOf(t)>=0&&nh[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function nb(){nq([],arguments)}function nv(e,t){return function(){let r=window.location.href,n=e.apply(this,arguments),o=window.location.href;return i&&r===o||window.dispatchEvent(function(e,t){let r;try{r=new PopStateEvent("popstate",{state:e})}catch(t){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return r.singleSpa=!0,r.singleSpaTrigger=t,r}(window.history.state,t)),n}}let n_=null,nw=!1;function nx(e){if(nw)throw Error(rA(43,!1));i=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,nw=!0,n_=window.history.replaceState,window.addEventListener("hashchange",nb),window.addEventListener("popstate",nb);let t=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(e,r){if(!("function"==typeof r&&nm.indexOf(e)>=0)||rX(nh[e],e=>e===r))return t.apply(this,arguments);nh[e].push(r)},window.removeEventListener=function(e,t){return"function"==typeof t&&nm.indexOf(e)>=0&&(nh[e]=nh[e].filter(e=>e!==t)),r.apply(this,arguments)},window.history.pushState=nv(window.history.pushState,"pushState"),window.history.replaceState=nv(n_,"replaceState")}function nE(e){let t=document.createElement("a");return t.href=e,t}np&&(window.singleSpaNavigate?console.warn(rA(41,!1)):window.singleSpaNavigate=ny);let nS=!1;function nD(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!nS){let t=e.fn.on,r=e.fn.off;e.fn.on=function(e,r){return nO.call(this,t,window.addEventListener,e,r,arguments)},e.fn.off=function(e,t){return nO.call(this,r,window.removeEventListener,e,t,arguments)},nS=!0}}function nO(e,t,r,n,i){return"string"!=typeof r?e.apply(this,i):(r.split(/\s+/).forEach(e=>{nm.indexOf(e)>=0&&(t(e,n),r=r.replace(e,""))}),""===r.trim()?this:e.apply(this,i))}let nP={};function nC(e){return Promise.resolve().then(()=>{let t=nP[rZ(e)];if(!t)return e;if(e.status===rN)return nk(e,t),e;if(e.status===rK)return t.promise.then(()=>e);if(e.status!==rF&&e.status!==rH)return e;let r=e.status===rH?Promise.resolve():nc(e,"unload");return e.status=rK,r.then(()=>(nk(e,t),e)).catch(r=>(delete nP[rZ(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,rj(r,e,rz),t.reject(r),e))})}function nk(e,t){delete nP[rZ(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=rN,t.resolve()}function nj(e,t,r,n){nP[rZ(e)]={app:e,resolve:r,reject:n},Object.defineProperty(nP[rZ(e)],"promise",{get:t})}let nT=[];function nR(){return nT.filter(rq).map(rZ)}function nA(){return nT.map(rZ)}function nM(e){let t=rX(nT,t=>rZ(t)===e);return t?t.status:null}let nN=!1;function nI(e,t,r,n){var i,o;let a,s,l=(a={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(rA(39,!1));let t=["name","app","activeWhen","customProps"],r=Object.keys(e).reduce((e,r)=>t.indexOf(r)>=0?e:e.concat(r),[]);if(0!==r.length)throw Error(rA(38,!1,t.join(", "),r.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(rA(20,!1));let n=e=>"string"==typeof e||"function"==typeof e;if(!(n(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(n)))throw Error(rA(24,!1));if(!nV(e.customProps))throw Error(rA(22,!1))}(e),a.name=e.name,a.loadApp=e.app,a.activeWhen=e.activeWhen,a.customProps=e.customProps):(function(e,t,r,n){if("string"!=typeof e||0===e.length)throw Error(rA(20,!1));if(!t)throw Error(rA(23,!1));if("function"!=typeof r)throw Error(rA(24,!1));if(!nV(n))throw Error(rA(22,!1))}(e,t,r,n),a.name=e,a.loadApp=t,a.activeWhen=r,a.customProps=n),a.loadApp="function"!=typeof(i=a.loadApp)?()=>Promise.resolve(i):i,a.customProps=a.customProps||{},s=(s=Array.isArray(o=a.activeWhen)?o:[o]).map(e=>"function"==typeof e?e:nU(e)),a.activeWhen=e=>s.some(t=>t(e)),a);if(nZ||nN||(nN=!0,setTimeout(()=>{nZ||console.warn(rA(1,!1))},5e3)),-1!==nA().indexOf(l.name))throw Error(rA(21,!1,l.name));nT.push(rQ({loadErrorTime:null,status:rN,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),np&&(nD(),nq())}function n$(e=window.location){return nT.filter(t=>t.activeWhen(e)).map(rZ)}function nL(e){if(0===nT.filter(t=>rZ(t)===e).length)throw Error(rA(25,!1,e));return(np?nF(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=nT.map(rZ).indexOf(e);nT.splice(t,1)})}function nF(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(rA(26,!1));let r=rX(nT,t=>rZ(t)===e);if(!r)throw Error(rA(27,!1,e));let n=nP[rZ(r)];if(t&&t.waitForUnmount){if(n)return n.promise;{let e=new Promise((t,n)=>{nj(r,()=>e,t,n)});return e}}{let e;return n?(e=n.promise,nB(r,n.resolve,n.reject)):e=new Promise((t,n)=>{nj(r,()=>e,t,n),nB(r,t,n)}),e}}function nB(e,t,r){Promise.resolve().then(()=>{if(rX(n$(),t=>t===rZ(e)))return nz()}).then(()=>r6(e).then(nC).then(()=>{t(),setTimeout(()=>{nq()})})).catch(r)}function nV(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function nU(e,t){let r=function(e,t){let r=0,n=!1,i="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let r=e[t],i=n&&"/"===r;(!n&&":"===r||i)&&o(t)}return o(e.length),RegExp(i,"i");function o(o){let a=e.slice(r,o).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=n?"[^/]+/?":a,o===e.length)if(n)t&&(i+="$");else{let e=t?"":".*";i="/"===i.charAt(i.length-1)?`${i}${e}$`:`${i}(/${e})?(#.*)?$`}n=!n,r=o}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let n=e.href.replace(t,"").replace(e.search,"").split("?")[0];return r.test(n)}}let nW=!1,nK=[],nH=np&&window.location.href;function nz(){return nq()}function nq(e=[],t,r=!1){let n,i,o,a,s;if(nW)return new Promise((e,r)=>{nK.push({resolve:e,reject:r,eventArguments:t})});let{appsToUnload:l,appsToUnmount:u,appsToLoad:c,appsToMount:d}=(n=[],i=[],o=[],a=[],s=(new Date).getTime(),nT.forEach(e=>{let t=e.status!==rz&&rG(e);switch(e.status){case rH:t&&s-e.loadErrorTime>=200&&o.push(e);break;case rN:case rI:t&&o.push(e);break;case r$:case rF:!t&&nP[rZ(e)]?n.push(e):t&&a.push(e);break;case rV:t||i.push(e)}}),{appsToUnload:n,appsToUnmount:i,appsToLoad:o,appsToMount:a}),f,p=[],h=nH,m=nH=window.location.href;return nZ?(nW=!0,f=l.concat(c,u,d),Promise.resolve().then(()=>(w(0===f.length?"before-no-app-change":"before-app-change",v(!0)),w("before-routing-event",v(!0,{cancelNavigation:y})),Promise.all(p).then(r=>{if(r.some(e=>e))return n_.call(window.history,history.state,"",h.substring(location.origin.length)),nH=location.href,nW=!1,nq(e,t,!0);let n=l.map(nC),i=Promise.all(u.map(r6).map(e=>e.then(nC)).concat(n));i.then(()=>{w("before-mount-routing-event",v(!0))},e=>{throw e});let o=c.map(e=>nf(e).then(e=>nG(e,i))),a=d.filter(e=>0>c.indexOf(e)).map(e=>nG(e,i));return i.catch(e=>{throw b(),e}).then(()=>(b(),Promise.all(o.concat(a)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(g).then(()=>{},e=>{throw e})))})))):(f=c,Promise.resolve().then(()=>Promise.all(c.map(nf)).then(b).then(()=>[]).catch(e=>{throw b(),e}).finally(()=>{})));function y(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);p.push(t.catch(e=>(console.warn(Error(rA(42,!1))),console.warn(e),!1)))}function g(){let t=nR();e.forEach(e=>e.resolve(t));try{w(0===f.length?"no-app-change":"app-change",v()),w("routing-event",v())}catch(e){setTimeout(()=>{throw e})}if(nW=!1,nK.length>0){let e=nK;nK=[],nq(e)}return t}function b(){r||(e.forEach(e=>{ng(e.eventArguments)}),ng(t))}function v(e=!1,r){let n={},i={[rV]:[],[rF]:[],[rN]:[],[rz]:[]};e?(c.concat(d).forEach((e,t)=>{a(e,rV)}),l.forEach(e=>{a(e,rN)}),u.forEach(e=>{a(e,rF)})):f.forEach(e=>{a(e)});let o={detail:{newAppStatuses:n,appsByNewStatus:i,totalAppChanges:f.length,originalEvent:null==t?void 0:t[0],oldUrl:h,newUrl:m}};return r&&rQ(o.detail,r),o;function a(e,t){let r=rZ(e);t=t||nM(r),n[r]=t,(i[t]=i[t]||[]).push(r)}}function w(e,t){r||window.dispatchEvent(new rC(`single-spa:${e}`,t))}}function nG(e,t){return rG(e)?r2(e).then(e=>t.then(()=>rG(e)?r9(e):e)):t.then(()=>e)}let nZ=!1;function nY(e){nZ=!0,np&&(nx(e),nq())}function nJ(e,t){let r=window.getOpenmrsSpaBase().replace(/\/$/,"");return nQ(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:r,...t}).replace(/^\/\//,"/")}function nQ(e,t){return Object.keys(t).reduce((e,r)=>e.split("${"+r+"}").join(t[r]),e)}function nX({to:e,templateParams:t}){let r=window.getOpenmrsSpaBase().replace(/\/$/,""),n=nJ(e,t).replace(window.location.origin,"");n.startsWith(r)?ny(n):window.location.assign(n)}np&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...nT]},reroute:nq,NOT_LOADED:rN,toLoadPromise:nf,toBootstrapPromise:r2,unregisterApplication:nL,getProfilerData:function(){return r4}});let n0="openmrs:history";function n1(){return JSON.parse(sessionStorage.getItem(n0)??"[]")}function n3({toUrl:e}){let t=n1(),r=t.lastIndexOf(e);if(-1!=r){let e=t.slice(0,r+1);nX({to:t[r]}),sessionStorage.setItem(n0,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function n4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}tC.Boolean,tC.String,rg.isUrl,tC.Array,tC.Number,rg.inRange(100,600),tC.Boolean,tC.Boolean;let n2="/ws/rest/v1",n6="/ws/fhir2/R4",n5=`${n2}/session`;function n8(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function n9(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 r=n8(e);if(t.headers||(t.headers={}),eh(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,e.startsWith(n2)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(n6)){let e=new URL(r,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),r=e.toString())}let n=Error();return window.fetch(r,t).then(async e=>{let{redirectAuthFailure:t,followRedirects:i}=await t2("@openmrs/esm-api");if(e.ok){let t=e.headers.get("location");return(i&&t&&(r===n8(n5)||204===e.status)&&nX({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 r===n8(n5)&&403===e.status||t.enabled&&t.errors.includes(e.status)?(sessionStorage.removeItem(n0),nX({to:t.url||e.headers.get("location")||"${openmrsSpaBase}/login"}),t.resolvePromise?Promise.resolve():new Promise(()=>{})):e.clone().text().then(t=>{let i=t;try{i=JSON.parse(t)}catch(e){}throw new ie(r,e,i,n)},t=>{throw new ie(r,e,null,n)})})}function n7(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");let r=new AbortController;return t.signal=r.signal,new ea.Observable(n=>{let i=!1;return n9(e,t).then(e=>{i=!0,n.next(e),n.complete()},e=>{i=!0,n.error(e)}),()=>{i||r.abort()}})}class ie extends Error{constructor(e,t,r,n){super(),n4(this,"response",void 0),n4(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`,n.message=this.message,this.responseBody=r,this.response=t,this.stack=`Stacktrace for outgoing request:
13
13
  ${n.stack}
14
14
  Stacktrace for incoming response:
15
- ${this.stack}`}}let it=K("session",{loaded:!1,session:null}),ir=0;function ii(e={includeAuthStatus:!0}){return(ir<Date.now()-6e4||!it.getState().loaded)&&is(),new ea.Observable(t=>{let r=r=>{r.loaded&&(e.includeAuthStatus?t.next(r.session):t.next(r.session?.user))};return r(it.getState()),it.subscribe(r)})}function io(){return(ir<Date.now()-6e4||!it.getState().loaded)&&is(),it}function ia(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 is(e,t){ir=Date.now();let r={};return e&&t&&(r.Authorization=`Basic ${window.btoa(`${e}:${t}`)}`),im(n9(n5,{headers:r}))}function il(){it.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function iu(e,t){var r,n;if(void 0===t)return!e;if(!e)return!0;return r=e,n=t,("string"==typeof r?!Z(n.privileges.find(e=>r===e.display)):Array.isArray(r)?r.every(e=>!Z(n.privileges.find(t=>e===t.display))):(Z(r)||console.error(`Could not understand privileges "${r}"`),!0))||!Z(t.roles.find(e=>"System Developer"===e.display))}function ic(){let e,t;return new Promise(r=>{let n=n=>{n.loaded&&n.session.user&&(e=n.session.user,r(n.session.user),t&&t())};n(it.getState()),e||(t=it.subscribe(n))})}function id(){return new Promise((e,t)=>{ii().subscribe(t=>{e(t.sessionLocation)},t).unsubscribe()})}async function ip(e,t){return im(n9(n5,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}))}async function ih(e,t,r){return r||(r=new AbortController),await n9(`${n2}/user/${e}`,{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:r.signal}),is()}function im(e){return new Promise((t,r)=>{e.then(e=>{let n;"object"==typeof e?.data?(n={loaded:!0,session:e.data},it.setState(n),t(n)):(n={loaded:!1,session:null},it.setState(n),r(n))}).catch(e=>{j(`Failed to fetch new session information: ${e}`);let t={loaded:!1,session:null};it.setState(t),r(t)})})}function iy(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}it.subscribe(e=>{e.loaded&&e.session&&ia(e.session)});let ig={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"},ib=L()(()=>({}));H("openmrs-app-context",ib);let iv={};function i_(e,t=iv){ib.setState(r=>{if(e in r)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({},r,{[e]:t===iv?{}:t})})}function iw(e){ib.setState(t=>(e in t&&delete t[e],t))}function ix(e,t=e=>e){let r=ib.getState();return e in r?Object.freeze(Object.assign({},t?t(r[e]):r[e])):null}function iE(e,t){ib.setState(r=>(e in r||(r[e]={}),r[e]=t(r[e]),Object.assign({},r)))}function iS(e,t){let r=ix(e);return t(iD(r)),ib.subscribe(n=>{let i=e in n?n[e]:null;i!==r&&(r=i,t(iD(i)))})}function iD(e){return null===e?null:Object.freeze(Object.assign({},e))}let iO={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",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"},iP=e=>"string"==typeof e,iC=()=>{let e,t,r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},ik=e=>null==e?"":""+e,iT=/###/g,ij=e=>e&&e.indexOf("###")>-1?e.replace(iT,"."):e,iR=e=>!e||iP(e),iA=(e,t,r)=>{let n=iP(t)?t.split("."):t,i=0;for(;i<n.length-1;){if(iR(e))return{};let t=ij(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return iR(e)?{}:{obj:e,k:ij(n[i])}},iM=(e,t,r)=>{let{obj:n,k:i}=iA(e,t,Object);if(void 0!==n||1===t.length){n[i]=r;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=iA(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,s=iA(e,a=a.slice(0,a.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=r},iN=(e,t)=>{let{obj:r,k:n}=iA(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},iI=(e,t,r)=>{for(let n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?iP(e[n])||e[n]instanceof String||iP(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):iI(e[n],t[n],r):e[n]=t[n]);return e};var i$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let iL=e=>iP(e)?e.replace(/[&<>"'\/]/g,e=>i$[e]):e,iF=[" ",",","?","!",";"],iB=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 r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),iV=(e,t,r=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let n=t.split(r),i=e;for(let e=0;e<n.length;){let t;if(!i||"object"!=typeof i)return;let o="";for(let a=e;a<n.length;++a)if(a!==e&&(o+=r),o+=n[a],void 0!==(t=i[o])){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<n.length-1)continue;e+=a-e+1;break}i=t}return i},iU=e=>e?.replace("_","-"),iW={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 iK{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||iW,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,r,n){return n&&!this.debug?null:(iP(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new iK(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new iK(this.logger,e)}}var iH=new iK;class iz{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let r=this.observers[e].get(t)||0;this.observers[e].set(t,r+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,r])=>{for(let n=0;n<r;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r.apply(r,[e,...t])})}}class iq extends iz{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,r,n={}){let i,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],r&&(Array.isArray(r)?i.push(...r):iP(r)&&o?i.push(...r.split(o)):i.push(r)));let s=iN(this.data,i);return(!s&&!t&&!r&&e.indexOf(".")>-1&&(e=i[0],t=i[1],r=i.slice(2).join(".")),!s&&a&&iP(r))?iV(this.data?.[e]?.[t],r,o):s}addResource(e,t,r,n,i={silent:!1}){let o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),iM(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(let n in r)(iP(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=r,r=t,t=a[1]),this.addNamespaces(t);let s=iN(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?iI(s,r,i):s={...s,...r},iM(this.data,a,s),o.silent||this.emit("added",e,t,r)}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 iG={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(e=>{t=this.processors[e]?.process(t,r,n,i)??t}),t}};let iZ=Symbol("i18next/PATH_KEY");function iY(e,t){let r,n,i,{[iZ]:o}=e((n=[],(i=Object.create(null)).get=(e,t)=>(r?.revoke?.(),t===iZ)?n:(n.push(t),(r=Proxy.revocable(e,i)).proxy),Proxy.revocable(Object.create(null),i).proxy));return o.join(t?.keySeparator??".")}let iJ={},iQ=e=>!iP(e)&&"boolean"!=typeof e&&"number"!=typeof e;class iX extends iz{constructor(e,t={}){super(),((e,t,r)=>{e.forEach(e=>{t[e]&&(r[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=iH.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let r={...t};if(null==e)return!1;let n=this.resolve(e,r);if(n?.res===void 0)return!1;let i=iQ(n.res);return!1!==r.returnObjects||!i}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,r)=>{t=t||"",r=r||"";let n=iF.filter(e=>0>t.indexOf(e)&&0>r.indexOf(e));if(0===n.length)return!0;let i=iB.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`),o=!i.test(e);if(!o){let t=e.indexOf(r);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,r,n);if(o&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:iP(i)?[i]:i};let o=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(n)}return{key:e,namespaces:iP(i)?[i]:i}}translate(e,t,r){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=iY(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);let i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1],u=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?i?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a;let f=this.resolve(e,n),p=f?.res,h=f?.usedKey||a,m=f?.exactUsedKey||a,y=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==n.count&&!iP(n.count),v=iX.hasDefaultValue(n),w=b?this.pluralResolver.getSuffix(c,n.count,n):"",x=n.ordinal&&b?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",E=b&&!n.ordinal&&0===n.count,S=E&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${w}`]||n[`defaultValue${x}`]||n.defaultValue,D=p;g&&!p&&v&&(D=S);let O=iQ(D),P=Object.prototype.toString.apply(D);if(g&&D&&O&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(P)&&!(iP(y)&&Array.isArray(D))){if(!n.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(h,D,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(f.res=e,f.usedParams=this.getUsedParamsDetails(n),f):e}if(o){let e=Array.isArray(D),t=e?[]:{},r=e?m:h;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let i=`${r}${o}${e}`;v&&!p?t[e]=this.translate(i,{...n,defaultValue:iQ(S)?S[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(i,{...n,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=D[e])}p=t}}else if(g&&iP(y)&&Array.isArray(p))(p=p.join(y))&&(p=this.extendTranslation(p,e,n,r));else{let t=!1,i=!1;!this.isValidLookup(p)&&v&&(t=!0,p=S),this.isValidLookup(p)||(i=!0,p=a);let s=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:p,d=v&&S!==p&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,a,d?S:p),o){let e=this.resolve(a,{...n,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,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=v&&r!==p?r:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,n),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);E&&n[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],a+t,n[`defaultValue${t}`]||S)})}):r(e,a,S))}p=this.extendTranslation(p,e,n,f,r),i&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}${u}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,t?p:void 0,n))}return i?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(e,t,r,n,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let o;r.interpolation&&this.interpolator.init({...r,...{interpolation:{...this.options.interpolation,...r.interpolation}}});let a=iP(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=r.replace&&!iP(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,r.lng||this.language||n.usedLng,r),a){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||r.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}let o=r.postProcess||this.options.postProcess,a=iP(o)?[o]:o;return null!=e&&a?.length&&!1!==r.applyPostProcessor&&(e=iG.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,n,i,o,a;return iP(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(r))return;let s=this.extractFromKey(e,t),l=s.key;n=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==t.count&&!iP(t.count),d=c&&!t.ordinal&&0===t.count,f=void 0!==t.context&&(iP(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(r)||(a=e,!iJ[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(iJ[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" 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(n=>{let a;if(this.isValidLookup(r))return;o=n;let s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,n,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(n,t.count,t));let r=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(i)&&s.push(l+e.replace(i,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+r)),f){let n=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(n),c&&(t.ordinal&&0===e.indexOf(i)&&s.push(n+e.replace(i,this.options.pluralSeparator)),s.push(n+e),d&&s.push(n+r))}}for(;a=s.pop();)this.isValidLookup(r)||(i=a,r=this.getResource(n,e,a,t))}))})}),{res:r,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(e={}){let t=e.replace&&!iP(e.replace),r=t?e.replace:e;if(t&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!t)for(let e of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[e];return r}static hasDefaultValue(e){let t="defaultValue";for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}class i0{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=iH.create("languageUtils")}getScriptPartFromCode(e){if(!(e=iU(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=iU(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(iP(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 r=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(r))&&(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let r=this.getScriptPartFromCode(e);if(this.isSupportedCode(r))return t=r;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&(e.indexOf("-")>0&&0>n.indexOf("-")&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.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)),iP(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){let r=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],i=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return iP(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):iP(e)&&i(this.formatLanguageCode(e)),r.forEach(e=>{0>n.indexOf(e)&&i(this.formatLanguageCode(e))}),n}}let i1={zero:0,one:1,two:2,few:3,many:4,other:5},i3={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class i4{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=iH.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let r,n=iU("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{r=new Intl.PluralRules(n,{type:i})}catch(i){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),i3;if(!e.match(/-|_/))return i3;let n=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(n,t)}return this.pluralRulesCache[o]=r,r}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return(r||(r=this.getRule("dev",t)),r)?r.resolvedOptions().pluralCategories.sort((e,t)=>i1[e]-i1[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,r={}){let n=this.getRule(e,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}let i2=(e,t,r,n=".",i=!0)=>{let o,a=void 0!==(o=iN(e,r))?o:iN(t,r);return!a&&i&&iP(r)&&void 0===(a=iV(e,r,n))&&(a=iV(t,r,n)),a};class i6{constructor(e={}){this.logger=iH.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:r,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:g}=e.interpolation;this.escape=void 0!==t?t:iL,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):o||"{{",this.suffix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==g&&g,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,r,n){let i,o,a,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(0>e.indexOf(this.formatSeparator)){let i=i2(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,r,{...n,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(i2(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,r,{...n,...t,interpolationkey:o})};this.resetRegExp();let u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.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(a=0;i=t.regex.exec(e);){let r=i[1].trim();if(void 0===(o=l(r)))if("function"==typeof u){let t=u(e,i,n);o=iP(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))o="";else if(c){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),o="";else iP(o)||this.useRawValueToEscape||(o=ik(o));let s=t.safeValue(o);if(e=e.replace(i[0],s),c?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t,r={}){let n,i,o,a=(e,t)=>{let r=this.nestingOptionsSeparator;if(0>e.indexOf(r))return e;let n=e.split(RegExp(`${r}[ ]*{`)),i=`{${n[1]}`;e=n[0];let a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);((a?.length??0)%2!=0||s)&&s.length%2==0||(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];(o=(o={...r}).replace&&!iP(o.replace)?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let l=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==l&&(s=n[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,l)),(i=t(a.call(this,n[1].trim(),o),o))&&n[0]===e&&!iP(i))return i;iP(i)||(i=ik(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}let i5=e=>{let t={};return(r,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});let a=n+JSON.stringify(o),s=t[a];return s||(s=e(iU(n),i),t[a]=s),s(r)}},i8=e=>(t,r,n)=>e(iU(r),n)(t);class i9{constructor(e={}){this.logger=iH.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let r=t.cacheInBuiltFormats?i5:i8;this.formats={number:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:r((e,t)=>{let r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:r((e,t)=>{let r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:r((e,t)=>{let r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=i5(t)}format(e,t,r,n={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&0>i[0].indexOf(")")&&i.find(e=>e.indexOf(")")>-1)){let e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){let n=e.split("(");t=n[0].toLowerCase().trim();let i=n[1].substring(0,n[1].length-1);"currency"===t&&0>i.indexOf(":")?r.currency||(r.currency=i.trim()):"relativetime"===t&&0>i.indexOf(":")?r.range||(r.range=i.trim()):i.split(";").forEach(e=>{if(e){let[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();r[o]||(r[o]=i),"false"===i&&(r[o]=!1),"true"===i&&(r[o]=!0),isNaN(i)||(r[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:r}})(t);if(this.formats[i]){let t=e;try{let a=n?.formatParams?.[n.interpolationkey]||{},s=a.locale||a.lng||n.locale||n.lng||r;t=this.formats[i](e,s,{...o,...n,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}}class i7 extends iz{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=iH.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(e,t,r,n){let i={},o={},a={},s={};return e.forEach(e=>{let n=!0;t.forEach(t=>{let a=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,n=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,r){let n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);let a={};this.queue.forEach(r=>{((e,t,r,n)=>{let{obj:i,k:o}=iA(e,t,Object);i[o]=i[o]||[],i[o].push(r)})(r.loaded,[i],o),void 0!==r.pending[e]&&(delete r.pending[e],r.pendingCount--),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{a[e]||(a[e]={});let t=r.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:i,callback:o});this.readingCalls++;let a=(a,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)}a&&s&&n<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,r,n+1,2*i,o)},i):o(a,s)},s=this.backend[r].bind(this.backend);if(2===s.length){try{let r=s(e,t);r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}return}return s(e,t,a)}prepareLoading(e,t,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();iP(e)&&(e=this.languageUtils.toResolveHierarchy(e)),iP(t)&&(t=[t]);let i=this.queueLoad(e,t,r,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e,t=""){let r=e.split("|"),n=r[0],i=r[1];this.read(n,i,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,r),!r&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,r,o)})}saveMissing(e,t,r,n,i,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${r}" 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!=r&&""!==r){if(this.backend?.create){let s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;(i=5===l.length?l(e,t,r,n,s):l(e,t,r,n))&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,r,n,a,s)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}let oe=()=>({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]),iP(e[1])&&(t.defaultValue=e[1]),iP(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ot=e=>(iP(e.ns)&&(e.ns=[e.ns]),iP(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),iP(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),or=()=>{};class on extends iz{constructor(e={},t){if(super(),this.options=ot(e),this.services={},this.logger=iH,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&&(iP(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let r=oe();this.options={...r,...this.options,...ot(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?iH.init(n(this.modules.logger),this.options):iH.init(null,this.options),e=this.modules.formatter?this.modules.formatter:i9;let t=new i0(this.options);this.store=new iq(this.options.resources,this.options);let i=this.services;i.logger=iH,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new i4(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.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===r.interpolation.format)&&(i.formatter=n(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new i6(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new i7(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new iX(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=or),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 i=iC(),o=()=>{let e=(e,r)=>{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),i.resolve(r),t(e,r)};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),i}loadResources(e,t=or){let r=t,n=iP(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return r();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};n?t(n):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),r(e)})}else r(null)}reloadResources(e,t,r){let n=iC();return"function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=or),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}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&&iG.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 r=iC();this.emit("languageChanging",e);let n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,r.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);let r=iP(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(iP(t)?[t]:t);o&&(this.language||n(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(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()),r}getFixedT(e,t,r){let n=(e,t,...i)=>{let o,a;(o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t}).lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||r||n.keyPrefix);let s=this.options.keySeparator||".";return o.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=iY(e,{...this.options,...t})),`${o.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=iY(e,{...this.options,...t})),a=o.keyPrefix?`${o.keyPrefix}${s}${e}`:e),this.t(a,o)};return iP(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=r,n}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 r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let o=(e,t)=>{let r=this.services.backendConnector.state[`${e}|${t}`];return -1===r||0===r||2===r};if(t.precheck){let e=t.precheck(this,o);if(void 0!==e)return e}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!n||o(i,e)))}loadNamespaces(e,t){let r=iC();return this.options.ns?(iP(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){let r=iC();iP(e)&&(e=[e]);let n=this.options.preload||[],i=e.filter(e=>0>n.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=n.concat(i),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(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 i0(oe());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 on(e,t)}cloneInstance(e={},t=or){let r=e.forkResourceStore;r&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},i=new on(n);return(void 0!==e.debug||void 0!==e.prefix)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new iq(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((r,n)=>(r[n]={...e[t][n]},r),e[t]),e),{}),n),i.services.resourceStore=i.store),i.translator=new iX(i.services,n),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let oi=on.createInstance();oi.createInstance=on.createInstance,oi.createInstance,oi.dir,oi.init,oi.loadResources,oi.reloadResources,oi.use,oi.changeLanguage,oi.getFixedT,oi.t,oi.exists,oi.setDefaultNamespace,oi.hasLoadedNamespace,oi.loadNamespaces,oi.loadLanguages;let oo=oi.default||oi;function oa(e,t,r,n){return oo.t(t,{ns:e,defaultValue:r,...n})}function os(e,t,r){return iO[e]?oa("core",e,t??iO[e],r):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}oo.on("initialized",function(){window.i18next.loadNamespaces(["core"])});let ol=null;async function ou(){return ol??(ol=oc().then(({map:e,complete:t})=>(t||(ol=null),e))),ol}async function oc(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[],r=!0;for(let n=0;n<e.length;n++){let i=e[n];try{if(i.src){let e=await fetch(i.src);if(!e.ok)throw Error(`Request for ${i.src} returned ${e.status} ${e.statusText}`);t.push(await e.json())}else i.textContent&&t.push(JSON.parse(i.textContent))}catch(e){r=!1,console.warn(`[import-maps] Failed to parse import map from script tag at index ${n}`,e)}}return{map:function(e){let t={imports:{}};for(let r of e)r?.imports&&Object.assign(t.imports,r.imports);return t}(t),complete:r}}async function od(){return await ou()}function of(e){return e.replace(/[\/\-@]/g,"_")}async function op(e,t="./start",n){var i;let o,a=!n?.maxLoadingTime||n.maxLoadingTime<=0?6e5:n.maxLoadingTime;await Promise.race([oh(e,n?.importMap),new Promise((t,r)=>{o=setTimeout(()=>{var t;r(Error(`Could not resolve requested script, ${e}, within ${(t=a)<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`}.`))},a)})]),o&&clearTimeout(o);let s=of(e),l=window[s];if(!("object"==typeof(i=l)&&null!==i&&"init"in i&&"function"==typeof i.init&&"get"in i&&"function"==typeof i.get)){let e=`The global variable ${s} does not refer to a federated module`;throw console.error(e),Error(e)}l.init(r.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 oh(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 r=of(e);if(!window[r]){let r=t??await om();if(!r.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let n=r.imports[e];n.startsWith("./")&&(n=window.spaBase+n.substring(1));let i=e in{};try{return await function(e){var t;let r=(t=window)[oy]??(t[oy]=new Map),n=r.get(e);if(n)return n;if(document.head.querySelector(`script[src="${e}"]`))return console.warn(`Script at ${e} already loaded. Not loading it again.`),Promise.resolve();let i=document.createElement("script");i.src=e,i.type="text/javascript",i.async=!0;let o=new Promise((t,n)=>{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 a(){clearTimeout(o),i.removeEventListener("load",s),i.removeEventListener("error",l)}function s(){a(),t()}function l(t){a(),r.delete(e),i.remove();let o=`Failed to load script from ${e}`;console.error(o,t),n(t.message??o)}i.addEventListener("load",s),i.addEventListener("error",l),document.head.appendChild(i)});return r.set(e,o),o}(n)}catch(e){return i&&O({kind:"error",title:os("scriptLoadingFailed","Error: Script failed to load"),description:os("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:n}),actionButtonLabel:os("resetOverrides","Reset overrides"),onActionButtonClick(){console.warn("[Security] Import map overrides are disabled in production mode."),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function om(){return od()}let oy=Symbol.for("__openmrs_script_loading"),og=`${n2}/attachment`;function ob(e,t){return n9(`${og}/${e}`,{signal:t.signal})}function ov(e,t,r){return n9(`${og}?patient=${e}&includeEncounterless=${t}`,{signal:r.signal})}async function o_(e,t){let r=new FormData;return r.append("fileCaption",t.fileDescription),r.append("patient",e),t.file?r.append("file",t.file,t.fileName):(r.append("file",new File([""],t.fileName),t.fileName),r.append("base64Content",t.base64Content)),n9(`${og}`,{method:"POST",body:r})}function ow(e,t){return n9(`${og}/${e}`,{method:"DELETE",signal:t.signal})}try{self["workbox:window:6.5.4"]&&_()}catch(e){}function ox(e,t){return new Promise(function(r){var n=new MessageChannel;n.port1.onmessage=function(e){r(e.data)},e.postMessage(t,[n.port2])})}function oE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oS(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var oD=function(){var e=this;this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r})};function oO(e,t){var r=location.href;return new URL(e,r).href===new URL(t,r).href}var oP=function(e,t){this.type=e,Object.assign(this,t)};function oC(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ok(){}var oT={type:"SKIP_WAITING"};function oj(e,t){if(!t)return e&&e.then?e.then(ok):Promise.resolve()}async function oR(e){let t=await (f??Promise.resolve(void 0));return t?await t.messageSW(e):{success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."}}!function(e){function t(t,r){var n,i;return void 0===r&&(r={}),(n=e.call(this)||this).nn={},n.tn=0,n.rn=new oD,n.en=new oD,n.on=new oD,n.un=0,n.an=new Set,n.cn=function(){var e=n.fn,t=e.installing;n.tn>0||!oO(t.scriptURL,n.sn.toString())||performance.now()>n.un+6e4?(n.vn=t,e.removeEventListener("updatefound",n.cn)):(n.hn=t,n.an.add(t),n.rn.resolve(t)),++n.tn,t.addEventListener("statechange",n.ln)},n.ln=function(e){var t=n.fn,r=e.target,i=r.state,o=r===n.vn,a={sw:r,isExternal:o,originalEvent:e};!o&&n.mn&&(a.isUpdate=!0),n.dispatchEvent(new oP(i,a)),"installed"===i?n.wn=self.setTimeout(function(){"installed"===i&&t.waiting===r&&n.dispatchEvent(new oP("waiting",a))},200):"activating"===i&&(clearTimeout(n.wn),o||n.en.resolve(r))},n.dn=function(e){var t=n.hn,r=t!==navigator.serviceWorker.controller;n.dispatchEvent(new oP("controlling",{isExternal:r,originalEvent:e,sw:t,isUpdate:n.mn})),r||n.on.resolve(t)},i=function(e){var t=e.data,r=e.ports,i=e.source;return oC(n.getSW(),function(){n.an.has(i)&&n.dispatchEvent(new oP("message",{data:t,originalEvent:e,ports:r,sw:i}))})},n.gn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}},n.sn=t,n.nn=r,navigator.serviceWorker.addEventListener("message",n.gn),n}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var r,n=t.prototype;n.register=function(e){var t=(void 0===e?{}:e).immediate,r=void 0!==t&&t;try{var n,i,o,a=this;return n=function(){if(!r&&"complete"!==document.readyState)return oj(new Promise(function(e){return window.addEventListener("load",e)}))},i=function(){return a.mn=!!navigator.serviceWorker.controller,a.yn=a.pn(),oC(a.bn(),function(e){a.fn=e,a.yn&&(a.hn=a.yn,a.en.resolve(a.yn),a.on.resolve(a.yn),a.yn.addEventListener("statechange",a.ln,{once:!0}));var t=a.fn.waiting;return t&&oO(t.scriptURL,a.sn.toString())&&(a.hn=t,Promise.resolve().then(function(){a.dispatchEvent(new oP("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),a.hn&&(a.rn.resolve(a.hn),a.an.add(a.hn)),a.fn.addEventListener("updatefound",a.cn),navigator.serviceWorker.addEventListener("controllerchange",a.dn),a.fn})},(o=n())&&o.then?o.then(i):i(o)}catch(e){return Promise.reject(e)}},n.update=function(){try{return this.fn?oj(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},n.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},n.messageSW=function(e){try{return oC(this.getSW(),function(t){return ox(t,e)})}catch(e){return Promise.reject(e)}},n.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&ox(this.fn.waiting,oT)},n.pn=function(){var e=navigator.serviceWorker.controller;return e&&oO(e.scriptURL,this.sn.toString())?e:void 0},n.bn=function(){try{var e=this;return function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){return oC(navigator.serviceWorker.register(e.sn,e.nn),function(t){return e.un=performance.now(),t})},function(e){throw e})}catch(e){return Promise.reject(e)}},oE(t.prototype,[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}]),r&&oE(t,r)}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,r=function(e){var t;if("u"<typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return oS(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?oS(e,void 0):void 0}}(e))){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(this.Sn(e.type));!(t=r()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());let oA="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,oM=Object.keys,oN=Array.isArray;function oI(e,t){return"object"!=typeof t||oM(t).forEach(function(r){e[r]=t[r]}),e}"u"<typeof Promise||oA.Promise||(oA.Promise=Promise);let o$=Object.getPrototypeOf,oL={}.hasOwnProperty;function oF(e,t){return oL.call(e,t)}function oB(e,t){"function"==typeof t&&(t=t(o$(e))),("u"<typeof Reflect?oM:Reflect.ownKeys)(t).forEach(r=>{oU(e,r,t[r])})}let oV=Object.defineProperty;function oU(e,t,r,n){oV(e,t,oI(r&&oF(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function oW(e){return{from:function(t){return e.prototype=Object.create(t.prototype),oU(e.prototype,"constructor",e),{extend:oB.bind(null,e.prototype)}}}}let oK=Object.getOwnPropertyDescriptor;function oH(e,t){let r;return oK(e,t)||(r=o$(e))&&oH(r,t)}let oz=[].slice;function oq(e,t,r){return oz.call(e,t,r)}function oG(e,t){return t(e)}function oZ(e){if(!e)throw Error("Assertion Failed")}function oY(e){oA.setImmediate?setImmediate(e):setTimeout(e,0)}function oJ(e,t){return e.reduce((e,r,n)=>{var i=t(r,n);return i&&(e[i[0]]=i[1]),e},{})}function oQ(e,t){if("string"==typeof t&&oF(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=oQ(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return null==s?void 0:oQ(s,t.substr(a+1))}}function oX(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){oZ("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)oX(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?oN(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=r;else{var l=e[a];l&&oF(e,a)||(l=e[a]={}),oX(l,s,r)}}else void 0===r?oN(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function o0(e){var t={};for(var r in e)oF(e,r)&&(t[r]=e[r]);return t}let o1=[].concat;function o3(e){return o1.apply([],e)}let o4="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(o3([8,16,32,64].map(e=>["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>oA[e]),o2=o4.map(e=>oA[e]);oJ(o4,e=>[e,!0]);let o6=null;function o5(e){o6="u">typeof WeakMap&&new WeakMap;let t=function e(t){if(!t||"object"!=typeof t)return t;let r=o6&&o6.get(t);if(r)return r;if(oN(t)){r=[],o6&&o6.set(t,r);for(var n=0,i=t.length;n<i;++n)r.push(e(t[n]))}else if(o2.indexOf(t.constructor)>=0)r=t;else{let n=o$(t);for(var o in r=n===Object.prototype?{}:Object.create(n),o6&&o6.set(t,r),t)oF(t,o)&&(r[o]=e(t[o]))}return r}(e);return o6=null,t}let{toString:o8}={};function o9(e){return o8.call(e).slice(8,-1)}let o7="u">typeof Symbol?Symbol.iterator:"@@iterator",ae="symbol"==typeof o7?function(e){var t;return null!=e&&(t=e[o7])&&t.apply(e)}:function(){return null},at={};function ar(e){var t,r,n,i;if(1==arguments.length){if(oN(e))return e.slice();if(this===at&&"string"==typeof e)return[e];if(i=ae(e)){for(r=[];!(n=i.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=Array(t);t--;)r[t]=arguments[t];return r}let an="u">typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var ai="u">typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),ao=()=>!0;let aa=!Error("").stack;function as(){if(aa)try{throw as.arguments,Error()}catch(e){return e}return Error()}function al(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(ao).map(e=>"\n"+e).join("")):""}var au=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ac=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(au),ad={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function af(e,t){this._e=as(),this.name=e,this.message=t}function ap(e,t){return e+". Errors: "+Object.keys(t).map(e=>t[e].toString()).filter((e,t,r)=>r.indexOf(e)===t).join("\n")}function ah(e,t,r,n){this._e=as(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=ap(e,t)}function am(e,t){this._e=as(),this.name="BulkError",this.failures=Object.keys(t).map(e=>t[e]),this.failuresByPos=t,this.message=ap(e,t)}oW(af).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+al(this._e,2))}},toString:function(){return this.name+": "+this.message}}),oW(ah).from(af),oW(am).from(af);var ay=ac.reduce((e,t)=>(e[t]=t+"Error",e),{}),ag=ac.reduce((e,t)=>{var r=t+"Error";function n(e,n){this._e=as(),this.name=r,e?"string"==typeof e?(this.message=`${e}${n?"\n "+n:""}`,this.inner=n||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=ad[t]||r,this.inner=null)}return oW(n).from(af),e[t]=n,e},{});ag.Syntax=SyntaxError,ag.Type=TypeError,ag.Range=RangeError;var ab=au.reduce((e,t)=>(e[t+"Error"]=ag[t],e),{}),av=ac.reduce((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=ag[t]),e),{});function a_(){}function aw(e){return e}function ax(e,t){return null==e||e===aw?t:function(r){return t(e(r))}}function aE(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function aS(e,t){return e===a_?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?aE(n,this.onsuccess):n),i&&(this.onerror=this.onerror?aE(i,this.onerror):i),void 0!==o?o:r}}function aD(e,t){return e===a_?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?aE(r,this.onsuccess):r),n&&(this.onerror=this.onerror?aE(n,this.onerror):n)}}function aO(e,t){return e===a_?t:function(r){var n=e.apply(this,arguments);oI(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?aE(i,this.onsuccess):i),o&&(this.onerror=this.onerror?aE(o,this.onerror):o),void 0===n?void 0===a?void 0:a:oI(n,a)}}function aP(e,t){return e===a_?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function aC(e,t){return e===a_?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return r.then(function(){return t.apply(n,o)})}return t.apply(this,arguments)}}av.ModifyError=ah,av.DexieError=af,av.BulkError=am;var ak={};let[aT,aj,aR]="u"<typeof Promise?[]:(()=>{let e=Promise.resolve();if("u"<typeof crypto||!crypto.subtle)return[e,o$(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,o$(t),e]})(),aA=aj&&aj.then,aM=aT&&aT.constructor,aN=!!aR;var aI=!1,a$=aR?()=>{aR.then(a2)}:oA.setImmediate?setImmediate.bind(null,a2):oA.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{a2(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(a2,0)},aL=function(e,t){aq.push([e,t]),aB&&(a$(),aB=!1)},aF=!0,aB=!0,aV=[],aU=[],aW=null,aK=aw,aH={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:sb,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{sb(e[0],e[1])}catch(e){}})}},az=aH,aq=[],aG=0,aZ=[];function aY(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=a_,this._lib=!1;var t=this._PSD=az;if(ai&&(this._stackHolder=as(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==ak)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&aX(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,r){try{r(r=>{if(null===t._state){if(r===t)throw TypeError("A promise cannot be resolved with itself.");var n=t._lib&&a6();r&&"function"==typeof r.then?e(t,(e,t)=>{r instanceof aY?r._then(e,t):r.then(e,t)}):(t._state=!0,t._value=r,a0(t)),n&&a5()}},aX.bind(null,t))}catch(e){aX(t,e)}}(this,e)}let aJ={get:function(){var e=az,t=si;function r(r,n){var i=!e.global&&(e!==az||t!==si);let o=i&&!sl();var a=new aY((t,a)=>{a1(this,new aQ(sm(r,e,i,o),sm(n,e,i,o),t,a,e))});return ai&&a4(a,this),a}return r.prototype=ak,r},set:function(e){oU(this,"then",e&&e.prototype===ak?aJ:{get:function(){return e},set:aJ.set})}};function aQ(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function aX(e,t){if(aU.push(t),null===e._state){var r=e._lib&&a6();t=aK(t),e._state=!1,e._value=t,ai&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}(()=>{var r=oH(t,"stack");t._promise=e,oU(t,"stack",{get:()=>aI?r&&(r.get?r.get.apply(t):r.value):e.stack})}),aV.some(t=>t._value===e._value)||aV.push(e),a0(e),r&&a5()}}function a0(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)a1(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===aG&&(++aG,aL(()=>{0==--aG&&a8()},[]))}function a1(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++aG,aL(a3,[r,e,t])}else e._listeners.push(t)}function a3(e,t,r){try{aW=t;var n,i=t._value;t._state?n=e(i):(aU.length&&(aU=[]),n=e(i),-1===aU.indexOf(i)&&function(e){for(var t=aV.length;t;)if(aV[--t]._value===e._value)return void aV.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{aW=null,0==--aG&&a8(),--r.psd.ref||r.psd.finalize()}}function a4(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function a2(){a6()&&a5()}function a6(){var e=aF;return aF=!1,aB=!1,e}function a5(){var e,t,r;do for(;aq.length>0;)for(e=aq,aq=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}while(aq.length>0);aF=!0,aB=!0}function a8(){var e=aV;aV=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var t=aZ.slice(0),r=t.length;r;)t[--r]()}function a9(e){return new aY(ak,!1,e)}function a7(e,t){var r=az;return function(){var n=a6(),i=az;try{return sf(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{sf(i,!1),n&&a5()}}}oB(aY.prototype,{then:aJ,_then:function(e,t){a1(this,new aQ(null,null,e,t,az))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,e=>e instanceof t?r(e):a9(e)):this.then(null,e=>e&&e.name===t?r(e):a9(e))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),a9(t)))},stack:{get:function(){if(this._stack)return this._stack;try{aI=!0;var e=(function e(t,r,n){if(r.length===n)return r;var i="";if(!1===t._state){var o,a,s=t._value;null!=s?(o=s.name||"Error",a=s.message||s,i=al(s,0)):(o=s,a=""),r.push(o+(a?": "+a:"")+i)}return ai&&((i=al(t._stackHolder,2))&&-1===r.indexOf(i)&&r.push(i),t._prev&&e(t._prev,r,n)),r})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{aI=!1}}},timeout:function(e,t){return e<1/0?new aY((r,n)=>{var i=setTimeout(()=>n(new ag.Timeout(t)),e);this.then(r,n).finally(clearTimeout.bind(null,i))}):this}}),"u">typeof Symbol&&Symbol.toStringTag&&oU(aY.prototype,Symbol.toStringTag,"Dexie.Promise"),aH.env=sp(),oB(aY,{all:function(){var e=ar.apply(null,arguments).map(su);return new aY(function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((i,o)=>aY.resolve(i).then(r=>{e[o]=r,--n||t(e)},r))})},resolve:e=>{if(e instanceof aY)return e;if(e&&"function"==typeof e.then)return new aY((t,r)=>{e.then(t,r)});var t=new aY(ak,!0,e);return a4(t,aW),t},reject:a9,race:function(){var e=ar.apply(null,arguments).map(su);return new aY((t,r)=>{e.map(e=>aY.resolve(e).then(t,r))})},PSD:{get:()=>az,set:e=>az=e},totalEchoes:{get:()=>si},newPSD:sa,usePSD:sh,scheduler:{get:()=>aL,set:e=>{aL=e}},rejectionMapper:{get:()=>aK,set:e=>{aK=e}},follow:(e,t)=>new aY((r,n)=>sa((t,r)=>{var n=az;n.unhandleds=[],n.onunhandled=r,n.finalize=aE(function(){var e;e=()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])},aZ.push(function t(){e(),aZ.splice(aZ.indexOf(t),1)}),++aG,aL(()=>{0==--aG&&a8()},[])},n.finalize),e()},t,r,n))}),aM&&(aM.allSettled&&oU(aY,"allSettled",function(){let e=ar.apply(null,arguments).map(su);return new aY(t=>{0===e.length&&t([]);let r=e.length,n=Array(r);e.forEach((e,i)=>aY.resolve(e).then(e=>n[i]={status:"fulfilled",value:e},e=>n[i]={status:"rejected",reason:e}).then(()=>--r||t(n)))})}),aM.any&&"u">typeof AggregateError&&oU(aY,"any",function(){let e=ar.apply(null,arguments).map(su);return new aY((t,r)=>{0===e.length&&r(AggregateError([]));let n=e.length,i=Array(n);e.forEach((e,o)=>aY.resolve(e).then(e=>t(e),e=>{i[o]=e,--n||r(AggregateError(i))}))})}));let se={awaits:0,echoes:0,id:0};var st=0,sr=[],sn=0,si=0,so=0;function sa(e,t,r,n){var i=az,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++so;var a=aH.env;o.env=aN?{Promise:aY,PromiseProp:{value:aY,configurable:!0,writable:!0},all:aY.all,race:aY.race,allSettled:aY.allSettled,any:aY.any,resolve:aY.resolve,reject:aY.reject,nthen:sy(a.nthen,o),gthen:sy(a.gthen,o)}:{},t&&oI(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=sh(o,e,r,n);return 0===o.ref&&o.finalize(),s}function ss(){return se.id||(se.id=++st),++se.awaits,se.echoes+=100,se.id}function sl(){return!!se.awaits&&(0==--se.awaits&&(se.id=0),se.echoes=100*se.awaits,!0)}function su(e){return se.echoes&&e&&e.constructor===aM?(ss(),e.then(e=>(sl(),e),e=>(sl(),sv(e)))):e}function sc(e){++si,se.echoes&&0!=--se.echoes||(se.echoes=se.id=0),sr.push(az),sf(e,!0)}function sd(){var e=sr[sr.length-1];sr.pop(),sf(e,!1)}function sf(e,t){var r,n=az;if((t?!se.echoes||sn++&&e===az:!sn||--sn&&e===az)||(r=t?sc.bind(null,e):sd,aA.call(aT,r)),e!==az&&(az=e,n===aH&&(aH.env=sp()),aN)){var i=aH.env.Promise,o=e.env;aj.then=o.nthen,i.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(oA,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject,o.allSettled&&(i.allSettled=o.allSettled),o.any&&(i.any=o.any))}}function sp(){var e=oA.Promise;return aN?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(oA,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:aj.then,gthen:e.prototype.then}:{}}function sh(e,t,r,n,i){var o=az;try{return sf(e,!0),t(r,n,i)}finally{sf(o,!1)}}function sm(e,t,r,n){return"function"!=typeof e?e:function(){var i,o=az;r&&ss(),sf(t,!0);try{return e.apply(this,arguments)}finally{sf(o,!1),n&&(i=sl,aA.call(aT,i))}}}function sy(e,t){return function(r,n){return e.call(this,sm(r,t),sm(n,t))}}-1===(""+aA).indexOf("[native code]")&&(ss=sl=a_);let sg="unhandledrejection";function sb(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(oA.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(sg,!0,!0),oI(n,i)):oA.CustomEvent&&oI(n=new CustomEvent(sg,{detail:i}),i),n&&oA.dispatchEvent&&(dispatchEvent(n),!oA.PromiseRejectionEvent&&oA.onunhandledrejection))try{oA.onunhandledrejection(n)}catch(e){}ai&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}var sv=aY.reject;let s_="3.2.7",sw=String.fromCharCode(65535),sx=-1/0,sE="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",sS="String expected.",sD=[],sO="u">typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),sP=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),sC="__dbnames",sk="readonly",sT="readwrite";function sj(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}let sR={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function sA(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=o5(t))[e],t)}class sM{_trans(e,t,r){let n=this._tx||az.trans,i=this.name;function o(e,r,n){if(!n.schema[i])throw new ag.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}let a=a6();try{return n&&n.db===this.db?n===az.trans?n._promise(e,o,r):sa(()=>n._promise(e,o,r),{trans:n,transless:az.transless||az}):function e(t,r,n,i){if(t.idbdb&&(t._state.openComplete||az.letThrough||t._vip)){var o=t._createTransaction(r,n,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===ay.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,r,n,i))):sv(o)}return o._promise(r,(e,t)=>sa(()=>(az.trans=o,i(e,t,o)))).then(e=>o._completion.then(()=>e))}if(t._state.openComplete)return sv(new ag.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return sv(new ag.DatabaseClosed);t.open().catch(a_)}return t._state.dbReadyPromise.then(()=>e(t,r,n,i))}(this.db,e,[this.name],o)}finally{a&&a5()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",t=>this.core.get({trans:t,key:e}).then(e=>this.hook.reading.fire(e))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(oN(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let t=oM(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);let r=this.schema.indexes.concat(this.schema.primKey).filter(e=>{if(e.compound&&t.every(t=>e.keyPath.indexOf(t)>=0)){for(let r=0;r<t.length;++r)if(-1===t.indexOf(e.keyPath[r]))return!1;return!0}return!1}).sort((e,t)=>e.keyPath.length-t.keyPath.length)[0];if(r&&this.db._maxKey!==sw){let n=r.keyPath.slice(0,t.length);return this.where(n).equals(n.map(t=>e[t]))}!r&&ai&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);let{idxByName:n}=this.schema,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}let[a,s]=t.reduce(([t,r],i)=>{let a=n[i],s=e[i];return[t||a,t||!a?sj(r,a&&a.multi?e=>{let t=oQ(e,i);return oN(t)&&t.some(e=>o(s,e))}:e=>o(s,oQ(e,i))):r]},[null,null]);return a?this.where(a.name).equals(e[a.keyPath]).filter(s):r?this.filter(s):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,oN(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let t=t=>{if(!t)return t;let r=Object.create(e.prototype);for(var n in t)if(oF(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass(function(e){oI(this,e)})}add(e,t){let{auto:r,keyPath:n}=this.schema.primKey,i=e;return n&&r&&(i=sA(n)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]})).then(e=>e.numFailures?aY.reject(e.failures[0]):e.lastResult).then(t=>{if(n)try{oX(e,n,t)}catch(e){}return t})}update(e,t){if("object"!=typeof e||oN(e))return this.where(":id").equals(e).modify(t);{let r=oQ(e,this.schema.primKey.keyPath);if(void 0===r)return sv(new ag.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?oM(t).forEach(r=>{oX(e,r,t[r])}):t(e,{value:e,primKey:r})}catch(e){}return this.where(":id").equals(r).modify(t)}}put(e,t){let{auto:r,keyPath:n}=this.schema.primKey,i=e;return n&&r&&(i=sA(n)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null})).then(e=>e.numFailures?aY.reject(e.failures[0]):e.lastResult).then(t=>{if(n)try{oX(e,n,t)}catch(e){}return t})}delete(e){return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:[e]})).then(e=>e.numFailures?aY.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:sR})).then(e=>e.numFailures?aY.reject(e.failures[0]):void 0)}bulkGet(e){return this._trans("readonly",t=>this.core.getMany({keys:e,trans:t}).then(e=>e.map(e=>this.hook.reading.fire(e))))}bulkAdd(e,t,r){let n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:r,keyPath:o}=this.schema.primKey;if(o&&n)throw new ag.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new ag.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=o&&r?e.map(sA(o)):e;return this.core.mutate({trans:t,type:"add",keys:n,values:s,wantResults:i}).then(({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new am(`${this.name}.bulkAdd(): ${e} of ${a} operations failed`,n)})})}bulkPut(e,t,r){let n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:r,keyPath:o}=this.schema.primKey;if(o&&n)throw new ag.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new ag.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=o&&r?e.map(sA(o)):e;return this.core.mutate({trans:t,type:"put",keys:n,values:s,wantResults:i}).then(({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new am(`${this.name}.bulkPut(): ${e} of ${a} operations failed`,n)})})}bulkDelete(e){let t=e.length;return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:e})).then(({numFailures:e,lastResult:r,failures:n})=>{if(0===e)return r;throw new am(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)})}}function sN(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"!=typeof e){n||(n=aP),i||(i=a_);var a={subscribers:[],fire:i,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=n(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter(function(t){return t!==e}),a.fire=a.subscribers.reduce(n,i)}};return t[e]=r[e]=a,a}oM(e).forEach(function(t){var r=e[t];if(oN(r))o(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new ag.InvalidArgument("Invalid event config");var n=o(t,aw,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){oY(function(){e.apply(null,t)})})})}})}}function sI(e,t){return oW(t).from({prototype:e}),t}function s$(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function sL(e,t){e.filter=sj(e.filter,t)}function sF(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>sj(n(),t()):t,e.justLimit=r&&!n}function sB(e,t){if(e.isPrimKey)return t.primaryKey;let r=t.getIndexByKeyPath(e.index);if(!r)throw new ag.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function sV(e,t,r){let n=sB(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function sU(e,t,r,n){let i=e.replayFilter?sj(e.filter,e.replayFilter()):e.filter;if(e.or){let o={},a=(e,r,n)=>{if(!i||i(r,n,e=>r.stop(e),e=>r.fail(e))){var a=r.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),oF(o,s)||(o[s]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(a,r),sW(sV(e,n,r),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return sW(sV(e,n,r),sj(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function sW(e,t,r,n){var i=a7(n?(e,t,i)=>r(n(e),t,i):r);return e.then(e=>{if(e)return e.start(()=>{var r=()=>e.continue();t&&!t(e,e=>r=e,t=>{e.stop(t),r=a_},t=>{e.fail(t),r=a_})||i(e.value,e,e=>r=e),r()})})}function sK(e,t){try{let r=sH(e),n=sH(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){let r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return r===n?0:r<n?-1:1}(sz(e),sz(t));case"Array":return function(e,t){let r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r){let n=sK(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function sH(e){let t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";let r=o9(e);return"ArrayBuffer"===r?"binary":r}function sz(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class sq{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,sv.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,sv.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=sj(t.algorithm,e)}_iterate(e,t){return sU(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&oI(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read(r=>sU(t,e,r,t.table.core))}count(e){return this._read(e=>{let t=this._ctx,r=t.table.core;if(s$(t,!0))return r.count({trans:e,query:{index:sB(t,r.schema),range:t.range}}).then(e=>Math.min(e,t.limit));var n=0;return sU(t,()=>(++n,!1),e,r).then(()=>n)}).then(e)}sortBy(e,t){let r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a:0}return this.toArray(function(e){return e.sort(s)}).then(t)}toArray(e){return this._read(e=>{var t=this._ctx;if("next"===t.dir&&s$(t,!0)&&t.limit>0){let{valueMapper:r}=t,n=sB(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:n,range:t.range}}).then(({result:e})=>r?e.map(r):e)}{let r=[];return sU(t,e=>r.push(e),e,t.table.core).then(()=>r)}},e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,s$(t)?sF(t,()=>{var t=e;return(e,r)=>0===t||(1===t?--t:r(()=>{e.advance(t),t=0}),!1)}):sF(t,()=>{var t=e;return()=>--t<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),sF(this._ctx,()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}},!0),this}until(e,t){return sL(this._ctx,function(r,n,i){return!e(r.value)||(n(i),t)}),this}first(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)}last(e){return this.reverse().first(e)}filter(e){var t;return sL(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=sj(t.isMatch,e),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,r){e(r.key,r)})}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,r){e(r.primaryKey,r)})}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each(function(e,t){r.push(t.key)}).then(function(){return r}).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&s$(t,!0)&&t.limit>0)return this._read(e=>{var r=sB(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})}).then(({result:e})=>e).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each(function(e,t){r.push(t.primaryKey)}).then(function(){return r}).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys(function(e){return e[0]}).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return sL(this._ctx,function(e){var t=e.primaryKey.toString(),n=oF(r,t);return r[t]=!0,!n}),this}modify(e){var t=this._ctx;return this._write(r=>{var n;if("function"==typeof e)n=e;else{var i=oM(e),o=i.length;n=function(t){for(var r=!1,n=0;n<o;++n){var a=i[n],s=e[a];oQ(t,a)!==s&&(oX(t,a,s),r=!0)}return r}}let a=t.table.core,{outbound:s,extractKey:l}=a.schema.primaryKey,u=this.db._options.modifyChunkSize||200,c=[],d=0,f=[],p=(e,t)=>{let{failures:r,numFailures:n}=t;for(let t of(d+=e-n,oM(r)))c.push(r[t])};return this.clone().primaryKeys().then(i=>{let o=c=>{let d=Math.min(u,i.length-c);return a.getMany({trans:r,keys:i.slice(c,c+d),cache:"immutable"}).then(f=>{let h=[],m=[],y=s?[]:null,g=[];for(let e=0;e<d;++e){let t=f[e],r={value:o5(t),primKey:i[c+e]};!1!==n.call(r,r.value,r)&&(null==r.value?g.push(i[c+e]):s||0===sK(l(t),l(r.value))?(m.push(r.value),s&&y.push(i[c+e])):(g.push(i[c+e]),h.push(r.value)))}let b=s$(t)&&t.limit===1/0&&("function"!=typeof e||e===sG)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&a.mutate({trans:r,type:"add",values:h}).then(e=>{for(let t in e.failures)g.splice(parseInt(t),1);p(h.length,e)})).then(()=>(m.length>0||b&&"object"==typeof e)&&a.mutate({trans:r,type:"put",keys:y,values:m,criteria:b,changeSpec:"function"!=typeof e&&e}).then(e=>p(m.length,e))).then(()=>(g.length>0||b&&e===sG)&&a.mutate({trans:r,type:"delete",keys:g,criteria:b}).then(e=>p(g.length,e))).then(()=>i.length>c+d&&o(c+u))})};return o(0).then(()=>{if(c.length>0)throw new ah("Error modifying one or more objects",c,d,f);return i.length})})})}delete(){var e=this._ctx,t=e.range;return s$(e)&&(e.isPrimKey&&!sO||3===t.type)?this._write(r=>{let{primaryKey:n}=e.table.core.schema;return e.table.core.count({trans:r,query:{index:n,range:t}}).then(n=>e.table.core.mutate({trans:r,type:"deleteRange",range:t}).then(({failures:e,lastResult:t,results:r,numFailures:i})=>{if(i)throw new ah("Could not delete some values",Object.keys(e).map(t=>e[t]),n-i);return n-i}))}):this.modify(sG)}}let sG=(e,t)=>t.value=null;function sZ(e,t){return e<t?-1:+(e!==t)}function sY(e,t){return e>t?-1:+(e!==t)}function sJ(e,t,r){var n=e instanceof s3?new e.Collection(e):e;return n._ctx.error=r?new r(t):TypeError(t),n}function sQ(e){return new e.Collection(e,()=>s1("")).limit(0)}function sX(e,t,r,n){var i,o,a,s,l,u,c,d=r.length;if(!r.every(e=>"string"==typeof e))return sJ(e,sS);function f(e){i="next"===e?e=>e.toUpperCase():e=>e.toLowerCase(),o="next"===e?e=>e.toLowerCase():e=>e.toUpperCase(),a="next"===e?sZ:sY;var t=r.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return a(e.lower,t.lower)});s=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),u=e,c="next"===e?"":n}f("next");var p=new e.Collection(e,()=>s0(s[0],l[d-1]+n));p._ondirectionchange=function(e){f(e)};var h=0;return p._addAlgorithm(function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,l,h))return!0;for(var p=null,m=h;m<d;++m){var y=function(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,l=0;l<a;++l){var u=t[l];if(u!==n[l])return 0>i(e[l],r[l])?e.substr(0,l)+r[l]+r.substr(l+1):0>i(e[l],n[l])?e.substr(0,l)+n[l]+r.substr(l+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;0>i(e[l],u)&&(s=l)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}(i,f,s[m],l[m],a,u);null===y&&null===p?h=m+1:(null===p||a(p,y)>0)&&(p=y)}return r(null!==p?function(){e.continue(p+c)}:n),!1}),p}function s0(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function s1(e){return{type:1,lower:e,upper:e}}class s3{get Collection(){return this._ctx.table.db.Collection}between(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?sQ(this):new this.Collection(this,()=>s0(e,t,!r,!n))}catch(e){return sJ(this,sE)}}equals(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s1(e))}above(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s0(e,void 0,!0))}aboveOrEqual(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s0(e,void 0,!1))}below(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s0(void 0,e,!1,!0))}belowOrEqual(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s0(void 0,e))}startsWith(e){return"string"!=typeof e?sJ(this,sS):this.between(e,e+sw,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):sX(this,(e,t)=>0===e.indexOf(t[0]),[e],sw)}equalsIgnoreCase(e){return sX(this,(e,t)=>e===t[0],[e],"")}anyOfIgnoreCase(){var e=ar.apply(at,arguments);return 0===e.length?sQ(this):sX(this,(e,t)=>-1!==t.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=ar.apply(at,arguments);return 0===e.length?sQ(this):sX(this,(e,t)=>t.some(t=>0===e.indexOf(t)),e,sw)}anyOf(){let e=ar.apply(at,arguments),t=this._cmp;try{e.sort(t)}catch(e){return sJ(this,sE)}if(0===e.length)return sQ(this);let r=new this.Collection(this,()=>s0(e[0],e[e.length-1]));r._ondirectionchange=r=>{t="next"===r?this._ascending:this._descending,e.sort(t)};let n=0;return r._addAlgorithm((r,i,o)=>{let a=r.key;for(;t(a,e[n])>0;)if(++n===e.length)return i(o),!1;return 0===t(a,e[n])||(i(()=>{r.continue(e[n])}),!1)}),r}notEqual(e){return this.inAnyRange([[sx,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=ar.apply(at,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return sJ(this,sE)}let t=e.reduce((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[sx,t]],null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){let r=this._cmp,n=this._ascending,i=this._descending,o=this._min,a=this._max;if(0===e.length)return sQ(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=n(e[0],e[1])))return sJ(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ag.InvalidArgument);let s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,u,c=n;function d(e,t){return c(e[0],t[0])}try{(u=e.reduce(function(e,t){let n=0,i=e.length;for(;n<i;++n){let i=e[n];if(0>r(t[0],i[1])&&r(t[1],i[0])>0){i[0]=o(i[0],t[0]),i[1]=a(i[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(d)}catch(e){return sJ(this,sE)}let f=0,p=l?e=>n(e,u[f][1])>0:e=>n(e,u[f][1])>=0,h=s?e=>i(e,u[f][0])>0:e=>i(e,u[f][0])>=0,m=p,y=new this.Collection(this,()=>s0(u[0][0],u[u.length-1][1],!s,!l));return y._ondirectionchange=e=>{"next"===e?(m=p,c=n):(m=h,c=i),u.sort(d)},y._addAlgorithm((e,t,r)=>{for(var i=e.key;m(i);)if(++f===u.length)return t(r),!1;return!!(!p(i)&&!h(i))||(0===this._cmp(i,u[f][1])||0===this._cmp(i,u[f][0])||t(()=>{c===n?e.continue(u[f][0]):e.continue(u[f][1])}),!1)}),y}startsWithAnyOf(){let e=ar.apply(at,arguments);return e.every(e=>"string"==typeof e)?0===e.length?sQ(this):this.inAnyRange(e.map(e=>[e,e+sw])):sJ(this,"startsWithAnyOf() only works with strings")}}function s4(e){return a7(function(t){return s2(t),e(t.target.error),!1})}function s2(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let s6="storagemutated",s5="x-storagemutated-1",s8=sN(null,s6);class s9{_lock(){return oZ(!az.global),++this._reculock,1!==this._reculock||az.global||(az.lockOwnerFor=this),this}_unlock(){if(oZ(!az.global),0==--this._reculock)for(az.global||(az.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{sh(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&az.lockOwnerFor!==this}create(e){if(!this.mode)return this;let t=this.db.idbdb,r=this.db._state.dbOpenError;if(oZ(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new ag.DatabaseClosed(r);case"MissingAPIError":throw new ag.MissingAPI(r.message,r);default:throw new ag.OpenFailed(r)}if(!this.active)throw new ag.TransactionInactive;return oZ(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=a7(t=>{s2(t),this._reject(e.error)}),e.onabort=a7(t=>{s2(t),this.active&&this._reject(new ag.Abort(e.error)),this.active=!1,this.on("abort").fire(t)}),e.oncomplete=a7(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&s8.storagemutated.fire(e.mutatedParts)}),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return sv(new ag.ReadOnly("Transaction is readonly"));if(!this.active)return sv(new ag.TransactionInactive);if(this._locked())return new aY((n,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,i)},az])});if(r)return sa(()=>{var e=new aY((e,r)=>{this._lock();let n=t(e,r,this);n&&n.then&&n.then(e,r)});return e.finally(()=>this._unlock()),e._lib=!0,e});var n=new aY((e,r)=>{var n=t(e,r,this);n&&n.then&&n.then(e,r)});return n._lib=!0,n}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();let r=aY.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(()=>r);else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new aY((e,n)=>{r.then(r=>t._waitingQueue.push(a7(e.bind(null,r))),e=>t._waitingQueue.push(a7(n.bind(null,e)))).finally(()=>{t._waitingFor===i&&(t._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ag.Abort))}table(e){let t=this._memoizedTables||(this._memoizedTables={});if(oF(t,e))return t[e];let r=this.schema[e];if(!r)throw new ag.NotFound("Table "+e+" not part of transaction");let n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n}}function s7(e,t,r,n,i,o,a){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:o,src:(r&&!a?"&":"")+(n?"*":"")+(i?"++":"")+le(t)}}function le(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function lt(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:oJ(r,e=>[e.name,e])}}let lr=e=>{try{return e.only([[]]),lr=()=>[[]],[[]]}catch(e){return lr=()=>sw,sw}};function ln(e){return null==e?()=>{}:"string"==typeof e?1===e.split(".").length?t=>t[e]:t=>oQ(t,e):t=>oQ(t,e)}function li(e){return[].slice.call(e)}let lo=0;function la(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function ls({_novip:e},t){let r=t.db,n=function(e,t,{IDBKeyRange:r,indexedDB:n},i){var o;return{dbcore:(o=function(e,t,r){let n;function i(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:r,upper:n,lowerOpen:i,upperOpen:o}=e;return void 0===r?void 0===n?null:t.upperBound(n,!!o):void 0===n?t.lowerBound(r,!!i):t.bound(r,n,!!i,!!o)}let{schema:o,hasGetAll:a}=(n=li(e.objectStoreNames),{schema:{name:e.name,tables:n.map(e=>r.objectStore(e)).map(e=>{let{keyPath:t,autoIncrement:r}=e,n=oN(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:ln(t)},indexes:li(e.indexNames).map(t=>e.index(t)).map(e=>{let{name:t,unique:r,multiEntry:n,keyPath:i}=e,a={name:t,compound:oN(i),keyPath:i,unique:r,multiEntry:n,extractKey:ln(i)};return o[la(i)]=a,a}),getIndexByKeyPath:e=>o[la(e)]};return o[":id"]=a.primaryKey,null!=t&&(o[la(t)]=a.primaryKey),a})},hasGetAll:n.length>0&&"getAll"in r.objectStore(n[0])&&!("u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),s=o.tables.map(e=>{let t;return{name:t=e.name,schema:e,mutate:function({trans:e,type:r,keys:n,values:o,range:a}){return new Promise((s,l)=>{let u;s=a7(s);let c=e.objectStore(t),d=null==c.keyPath,f="put"===r||"add"===r;if(!f&&"delete"!==r&&"deleteRange"!==r)throw Error("Invalid operation type: "+r);let{length:p}=n||o||{length:1};if(n&&o&&n.length!==o.length)throw Error("Given keys array must have same length as given values array.");if(0===p)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let h=[],m=[],y=0,g=e=>{++y,s2(e)};if("deleteRange"===r){if(4===a.type)return s({numFailures:y,failures:m,results:[],lastResult:void 0});3===a.type?h.push(u=c.clear()):h.push(u=c.delete(i(a)))}else{let[e,t]=f?d?[o,n]:[o,null]:[n,null];if(f)for(let n=0;n<p;++n)h.push(u=t&&void 0!==t[n]?c[r](e[n],t[n]):c[r](e[n])),u.onerror=g;else for(let t=0;t<p;++t)h.push(u=c[r](e[t])),u.onerror=g}let b=e=>{let t=e.target.result;h.forEach((e,t)=>null!=e.error&&(m[t]=e.error)),s({numFailures:y,failures:m,results:"delete"===r?n:h.map(e=>e.result),lastResult:t})};u.onerror=e=>{g(e),b(e)},u.onsuccess=b})},getMany:({trans:e,keys:r})=>new Promise((n,i)=>{n=a7(n);let o=e.objectStore(t),a=r.length,s=Array(a),l,u=0,c=0,d=e=>{let t=e.target;s[t._pos]=t.result,++c===u&&n(s)},f=s4(i);for(let e=0;e<a;++e)null!=r[e]&&((l=o.get(r[e]))._pos=e,l.onsuccess=d,l.onerror=f,++u);0===u&&n(s)}),get:({trans:e,key:r})=>new Promise((n,i)=>{n=a7(n);let o=e.objectStore(t).get(r);o.onsuccess=e=>n(e.target.result),o.onerror=s4(i)}),query:e=>new Promise((r,n)=>{r=a7(r);let{trans:o,values:s,limit:l,query:u}=e,c=l===1/0?void 0:l,{index:d,range:f}=u,p=o.objectStore(t),h=d.isPrimaryKey?p:p.index(d.name),m=i(f);if(0===l)return r({result:[]});if(a){let e=s?h.getAll(m,c):h.getAllKeys(m,c);e.onsuccess=e=>r({result:e.target.result}),e.onerror=s4(n)}else{let e=0,t=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),i=[];t.onsuccess=n=>{let o=t.result;return o?(i.push(s?o.value:o.primaryKey),++e===l?r({result:i}):void o.continue()):r({result:i})},t.onerror=s4(n)}}),openCursor:function({trans:e,values:r,query:n,reverse:o,unique:a}){return new Promise((s,l)=>{s=a7(s);let{index:u,range:c}=n,d=e.objectStore(t),f=u.isPrimaryKey?d:d.index(u.name),p=o?a?"prevunique":"prev":a?"nextunique":"next",h=!r&&"openKeyCursor"in f?f.openKeyCursor(i(c),p):f.openCursor(i(c),p);h.onerror=s4(l),h.onsuccess=a7(t=>{let r=h.result;if(!r)return void s(null);r.___id=++lo,r.done=!1;let n=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));let o=r.advance.bind(r),a=()=>{throw Error("Cursor not stopped")};r.trans=e,r.stop=r.continue=r.continuePrimaryKey=r.advance=()=>{throw Error("Cursor not started")},r.fail=a7(l),r.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},r.start=e=>{let t=new Promise((e,t)=>{e=a7(e),h.onerror=s4(t),r.fail=t,r.stop=t=>{r.stop=r.continue=r.continuePrimaryKey=r.advance=a,e(t)}}),s=()=>{if(h.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=()=>{throw Error("Cursor behind last entry")},r.stop()};return h.onsuccess=a7(e=>{h.onsuccess=s,s()}),r.continue=n,r.continuePrimaryKey=i,r.advance=o,s(),t},s(r)},l)})},count({query:e,trans:r}){let{index:n,range:o}=e;return new Promise((e,a)=>{let s=r.objectStore(t),l=n.isPrimaryKey?s:s.index(n.name),u=i(o),c=u?l.count(u):l.count();c.onsuccess=a7(t=>e(t.target.result)),c.onerror=s4(a)})}}}),l={};return s.forEach(e=>l[e.name]=e),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!l[e])throw Error(`Table '${e}' not found`);return l[e]},MIN_KEY:-1/0,MAX_KEY:lr(t),schema:o}}(t,r,i),e.dbcore.reduce((e,{create:t})=>({...e,...t(e)}),o))}}(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach(t=>{let r=t.name;e.core.schema.tables.some(e=>e.name===r)&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))})}function ll({_novip:e},t,r,n){r.forEach(r=>{let i=n[r];t.forEach(t=>{let n=oH(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?oU(t,r,{get(){return this.table(r)},set(e){oV(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))})})}function lu({_novip:e},t){t.forEach(t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]})}function lc(e,t){return e._cfg.version-t._cfg.version}function ld(e,t){let r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){let i=e[r],o=t[r];if(i){let e={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")==""+(o.primKey.keyPath||"")&&(i.primKey.auto===o.primKey.auto||sO)){let t,r=i.idxByName,a=o.idxByName;for(t in r)a[t]||e.del.push(t);for(t in a){let n=r[t],i=a[t];n?n.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}else e.recreate=!0,n.change.push(e)}else n.add.push([r,o])}return n}function lf(e,t,r,n){let i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach(e=>lp(i,e)),i}function lp(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function lh(e,t,r){let n={};return oq(t.objectStoreNames,0).forEach(e=>{let t=r.objectStore(e),i=t.keyPath,o=s7(le(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[];for(let e=0;e<t.indexNames.length;++e){let r=t.index(t.indexNames[e]);i=r.keyPath;var s=s7(r.name,i,!!r.unique,!!r.multiEntry,!1,i&&"string"!=typeof i,!1);a.push(s)}n[e]=lt(e,o,a)}),n}function lm({_novip:e},t,r){let n=r.db.objectStoreNames;for(let i=0;i<n.length;++i){let o=n[i],a=r.objectStore(o);e._hasGetAll="getAll"in a;for(let e=0;e<a.indexNames.length;++e){let r=a.indexNames[e],n=a.index(r).keyPath,i="string"==typeof n?n:"["+oq(n).join("+")+"]";if(t[o]){let e=t[o].idxByName[i];e&&(e.name=r,delete t[o].idxByName[i],t[o].idxByName[r]=e)}}}"u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&oA.WorkerGlobalScope&&oA instanceof oA.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class ly{_parseStoresSpec(e,t){oM(e).forEach(r=>{if(null!==e[r]){var n=e[r].split(",").map((e,t)=>{let r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return s7(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),oN(n),0===t)}),i=n.shift();if(i.multi)throw new ag.Schema("Primary key cannot be multi-valued");n.forEach(e=>{if(e.auto)throw new ag.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new ag.Schema("Index must have a name and cannot be an empty string")}),t[r]=lt(r,i,n)}})}stores(e){let t=this.db;this._cfg.storesSource=this._cfg.storesSource?oI(this._cfg.storesSource,e):e;let r=t._versions,n={},i={};return r.forEach(e=>{oI(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)}),t._dbSchema=i,lu(t,[t._allTables,t,t.Transaction.prototype]),ll(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],oM(i),i),t._storeNames=oM(i),this}upgrade(e){return this._cfg.contentUpgrade=aC(this._cfg.contentUpgrade||a_,e),this}}function lg(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new lI(sC,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),r.table("dbnames")}function lb(e){return e&&"function"==typeof e.databases}function lv(e){return sa(function(){return az.letThrough=!0,e()})}function l_(e){var t=t=>e.next(t),r=i(t),n=i(t=>e.throw(t));function i(e){return t=>{var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):oN(o)?Promise.all(o).then(r,n):r(o)}}return i(t)()}function lw(e,t,r){var n=arguments.length;if(n<2)throw new ag.InvalidArgument("Too few arguments");for(var i=Array(n-1);--n;)i[n-1]=arguments[n];return r=i.pop(),[e,o3(i),r]}function lx(e,t,r){let n=oN(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}let lE={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){let r=e.table(t),{schema:n}=r,i={},o=[];function a(e,t,r){let n=la(e),s=i[n]=i[n]||[],l=null==e?0:"string"==typeof e?1:e.length,u=t>0,c={...r,isVirtual:u,keyTail:t,keyLength:l,extractKey:ln(e),unique:!u&&r.unique};return s.push(c),c.isPrimaryKey||o.push(c),l>1&&a(2===l?e[0]:e.slice(0,l-1),t+1,r),s.sort((e,t)=>e.keyTail-t.keyTail),c}let s=a(n.primaryKey.keyPath,0,n.primaryKey);for(let e of(i[":id"]=[s],n.indexes))a(e.keyPath,0,e);function l(t){var r,n;let i=t.query.index;return i.isVirtual?{...t,query:{index:i,range:(r=t.query.range,n=i.keyTail,{type:1===r.type?2:r.type,lower:lx(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:lx(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}:t}return{...r,schema:{...n,primaryKey:s,indexes:o,getIndexByKeyPath:function(e){let t=i[la(e)];return t&&t[0]}},count:e=>r.count(l(e)),query:e=>r.query(l(e)),openCursor(t){let{keyTail:n,isVirtual:i,keyLength:o}=t.query.index;return i?r.openCursor(l(t)).then(r=>r&&Object.create(r,{continue:{value:function(i){null!=i?r.continue(lx(i,t.reverse?e.MAX_KEY:e.MIN_KEY,n)):t.unique?r.continue(r.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,n)):r.continue()}},continuePrimaryKey:{value(t,i){r.continuePrimaryKey(lx(t,e.MAX_KEY,n),i)}},primaryKey:{get:()=>r.primaryKey},key:{get(){let e=r.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>r.value}})):r.openCursor(t)}}}}}};function lS(e,t,r,n){return r=r||{},n=n||"",oM(e).forEach(i=>{if(oF(t,i)){var o=e[i],a=t[i];if("object"==typeof o&&"object"==typeof a&&o&&a){let e=o9(o);e!==o9(a)?r[n+i]=t[i]:"Object"===e?lS(o,a,r,n+i+"."):o!==a&&(r[n+i]=t[i])}else o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0}),oM(t).forEach(i=>{oF(e,i)||(r[n+i]=t[i])}),r}let lD={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){let r=e.table(t),{primaryKey:n}=r.schema;return{...r,mutate(e){let i=az.trans,{deleting:o,creating:a,updating:s}=i.table(t).hook;switch(e.type){case"add":if(a.fire===a_)break;return i._promise("readwrite",()=>l(e),!0);case"put":if(a.fire===a_&&s.fire===a_)break;return i._promise("readwrite",()=>l(e),!0);case"delete":if(o.fire===a_)break;return i._promise("readwrite",()=>l(e),!0);case"deleteRange":if(o.fire===a_)break;return i._promise("readwrite",()=>(function e(t,i,o){return r.query({trans:t,values:!1,query:{index:n,range:i},limit:o}).then(({result:r})=>l({type:"delete",keys:r,trans:t}).then(n=>n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:e(t,{...i,lower:r[r.length-1],lowerOpen:!0},o)))})(e.trans,e.range,1e4),!0)}return r.mutate(e);function l(e){var t,i;let l=az.trans,u=e.keys||("delete"===(t=e).type?t.keys:t.keys||t.values.map(n.extractKey));if(!u)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:u}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),("add"===(i=e).type?Promise.resolve([]):r.getMany({trans:i.trans,keys:u,cache:"immutable"})).then(t=>{let i=u.map((r,i)=>{let u=t[i],c={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(c,r,u,l);else if("add"===e.type||void 0===u){let t=a.fire.call(c,r,e.values[i],l);null==r&&null!=t&&(r=t,e.keys[i]=r,n.outbound||oX(e.values[i],n.keyPath,r))}else{let t=lS(u,e.values[i]),n=s.fire.call(c,t,r,u,l);if(n){let t=e.values[i];Object.keys(n).forEach(e=>{oF(t,e)?t[e]=n[e]:oX(t,e,n[e])})}}return c});return r.mutate(e).then(({failures:r,results:n,numFailures:o,lastResult:a})=>{for(let o=0;o<u.length;++o){let a=n?n[o]:u[o],s=i[o];null==a?s.onerror&&s.onerror(r[o]):s.onsuccess&&s.onsuccess("put"===e.type&&t[o]?e.values[o]:a)}return{failures:r,results:n,numFailures:o,lastResult:a}}).catch(e=>(i.forEach(t=>t.onerror&&t.onerror(e)),Promise.reject(e)))})}}}}})};function lO(e,t,r){try{if(!t||t.keys.length<e.length)return null;let n=[];for(let i=0,o=0;i<t.keys.length&&o<e.length;++i)0===sK(t.keys[i],e[o])&&(n.push(r?o5(t.values[i]):t.values[i]),++o);return n.length===e.length?n:null}catch(e){return null}}let lP={stack:"dbcore",level:-1,create:e=>({table:t=>{let r=e.table(t);return{...r,getMany:e=>{if(!e.cache)return r.getMany(e);let t=lO(e.keys,e.trans._cache,"clone"===e.cache);return t?aY.resolve(t):r.getMany(e).then(t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?o5(t):t},t))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function lC(e){return!("from"in e)}let lk=function(e,t){if(!this){let t=new lk;return e&&"d"in e&&oI(t,e),t}oI(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function lT(e,t,r){let n=sK(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(lC(e))return oI(e,{from:t,to:r,d:1});let i=e.l,o=e.r;if(0>sK(r,e.from))return i?lT(i,t,r):e.l={from:t,to:r,d:1,l:null,r:null},lA(e);if(sK(t,e.to)>0)return o?lT(o,t,r):e.r={from:t,to:r,d:1,l:null,r:null},lA(e);0>sK(t,e.from)&&(e.from=t,e.l=null,e.d=o?o.d+1:1),sK(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);let a=!e.r;i&&!e.l&&lj(e,i),o&&a&&lj(e,o)}function lj(e,t){lC(t)||function e(t,{from:r,to:n,l:i,r:o}){lT(t,r,n),i&&e(t,i),o&&e(t,o)}(e,t)}function lR(e){let t=lC(e)?null:{s:0,n:e};return{next(e){let r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&0>sK(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||0>=sK(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function lA(e){var t,r;let n=((null==(t=e.r)?void 0:t.d)||0)-((null==(r=e.l)?void 0:r.d)||0),i=n>1?"r":n<-1?"l":"";if(i){let t="r"===i?"l":"r",r={...e},n=e[i];e.from=n.from,e.to=n.to,e[i]=n[i],r[i]=n[t],e[t]=r,r.d=lM(r)}e.d=lM(e)}function lM({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}oB(lk.prototype,{add(e){return lj(this,e),this},addKey(e){return lT(this,e,e),this},addKeys(e){return e.forEach(e=>lT(this,e,e)),this},[o7](){return lR(this)}});let lN={stack:"dbcore",level:0,create:e=>{let t=e.schema.name,r=new lk(e.MIN_KEY,e.MAX_KEY);return{...e,table:n=>{let i=e.table(n),{schema:o}=i,{primaryKey:a}=o,{extractKey:s,outbound:l}=a,u={...i,mutate:e=>{let a=e.trans,s=a.mutatedParts||(a.mutatedParts={}),l=e=>{let r=`idb://${t}/${n}/${e}`;return s[r]||(s[r]=new lk)},u=l(""),c=l(":dels"),{type:d}=e,[f,p]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return i.mutate(e).then(e=>{if(oN(f)){"delete"!==d&&(f=e.results),u.addKeys(f);let t=lO(f,h);t||"add"===d||c.addKeys(f),(t||p)&&o.indexes.forEach(function(e){let r=l(e.name||"");function n(t){return null!=t?e.extractKey(t):null}let i=t=>e.multiEntry&&oN(t)?t.forEach(e=>r.addKey(e)):r.addKey(t);(t||p).forEach((e,r)=>{let o=t&&n(t[r]),a=p&&n(p[r]);0!==sK(o,a)&&(null!=o&&i(o),null!=a&&i(a))})})}else if(f){let e={from:f.lower,to:f.upper};c.add(e),u.add(e)}else u.add(r),c.add(r),o.indexes.forEach(e=>l(e.name).add(r));return e})}},c=({query:{index:t,range:r}})=>{var n,i;return[t,new lk(null!=(n=r.lower)?n:e.MIN_KEY,null!=(i=r.upper)?i:e.MAX_KEY)]},d={get:e=>[a,new lk(e.key)],getMany:e=>[a,(new lk).addKeys(e.keys)],count:c,query:c,openCursor:c};return oM(d).forEach(e=>{u[e]=function(o){let{subscr:a}=az;if(a){let u=e=>{let r=`idb://${t}/${n}/${e}`;return a[r]||(a[r]=new lk)},c=u(""),f=u(":dels"),[p,h]=d[e](o);if(u(p.name||"").add(h),!p.isPrimaryKey){if("count"!==e){let t="query"===e&&l&&o.values&&i.query({...o,values:!1});return i[e].apply(this,arguments).then(r=>{if("query"===e){if(l&&o.values)return t.then(({result:e})=>(c.addKeys(e),r));let e=o.values?r.result.map(s):r.result;o.values?c.addKeys(e):f.addKeys(e)}else if("openCursor"===e){let e=o.values;return r&&Object.create(r,{key:{get:()=>(f.addKey(r.primaryKey),r.key)},primaryKey:{get(){let e=r.primaryKey;return f.addKey(e),e}},value:{get:()=>(e&&c.addKey(r.primaryKey),r.value)}})}return r})}f.add(r)}}return i[e].apply(this,arguments)}}),u}}}};class lI{constructor(e,t){var r;this._middlewares={},this.verno=0;const n=lI.dependencies;this._options=t={addons:lI.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:i}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:a_,dbReadyPromise:null,cancelOpen:a_,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};o.dbReadyPromise=new aY(e=>{o.dbReadyResolve=e}),o.openCanceller=new aY((e,t)=>{o.cancelOpen=t}),this._state=o,this.name=e,this.on=sN(this,"populate","blocked","versionchange","close",{ready:[aC,a_]}),this.on.ready.subscribe=oG(this.on.ready.subscribe,e=>(t,r)=>{lI.vip(()=>{let n=this._state;if(n.openComplete)n.dbOpenError||aY.resolve().then(t),r&&e(t);else if(n.onReadyBeingFired)n.onReadyBeingFired.push(t),r&&e(t);else{e(t);let n=this;r||e(function e(){n.on.ready.unsubscribe(t),n.on.ready.unsubscribe(e)})}})}),this.Collection=(r=this,sI(sq.prototype,function(e,t){this.db=r;let n=sR,i=null;if(t)try{n=t()}catch(e){i=e}let o=e._ctx,a=o.table,s=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:s!==aw?s:null}})),this.Table=function(e){return sI(sM.prototype,function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:sN(null,{creating:[aS,a_],reading:[ax,aw],updating:[aO,a_],deleting:[aD,a_]})})}(this),this.Transaction=function(e){return sI(s9.prototype,function(t,r,n,i,o){this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=sN(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new aY((e,t)=>{this._resolve=e,this._reject=t}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),sv(e)})})}(this),this.Version=function(e){return sI(ly.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return sI(s3.prototype,function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};let i=e._deps.indexedDB;if(!i)throw new ag.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>0>i.cmp(e,t)?e:t,this._IDBKeyRange=e._deps.IDBKeyRange})}(this),this.on("versionchange",e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)}),this._maxKey=lr(t.IDBKeyRange),this._createTransaction=(e,t,r,n)=>new this.Transaction(e,t,r,this._options.chromeTransactionDurability,n),this._fireOnBlocked=e=>{this.on("blocked").fire(e),sD.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(t=>t.on("versionchange").fire(e))},this.use(lE),this.use(lD),this.use(lN),this.use(lP),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new ag.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new ag.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let t=this._versions;var r=t.filter(t=>t._cfg.version===e)[0];return r||(r=new this.Version(e),t.push(r),t.sort(lc),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||az.letThrough||this._vip)?e():new aY((e,t)=>{if(this._state.openComplete)return t(new ag.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new ag.DatabaseClosed);this.open().catch(a_)}this._state.dbReadyPromise.then(e,t)}).then(e)}use({stack:e,create:t,level:r,name:n}){n&&this.unuse({stack:e,name:n});let i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==r?10:r,name:n}),i.sort((e,t)=>e.level-t.level),this}unuse({stack:e,name:t,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter(e=>r?e.create!==r:!!t&&e.name!==t)),this}open(){return function(e){var t;let r=e._state,{indexedDB:n}=e._deps;if(r.isBeingOpened||e.idbdb)return r.dbReadyPromise.then(()=>r.dbOpenError?sv(r.dbOpenError):e);ai&&(r.openCanceller._stackHolder=as()),r.isBeingOpened=!0,r.dbOpenError=null,r.openComplete=!1;let i=r.openCanceller;function o(){if(r.openCanceller!==i)throw new ag.DatabaseClosed("db.open() was cancelled")}let a=r.dbReadyResolve,s=null,l=!1,u=()=>new aY((t,i)=>{if(o(),!n)throw new ag.MissingAPI;let a=e.name,u=r.autoSchema?n.open(a):n.open(a,Math.round(10*e.verno));if(!u)throw new ag.MissingAPI;u.onerror=s4(i),u.onblocked=a7(e._fireOnBlocked),u.onupgradeneeded=a7(t=>{if(s=u.transaction,r.autoSchema&&!e._options.allowEmptyDB){u.onerror=s2,s.abort(),u.result.close();let e=n.deleteDatabase(a);e.onsuccess=e.onerror=a7(()=>{i(new ag.NoSuchDatabase(`Database ${a} doesnt exist`))})}else{let r,n,a,f;s.onerror=s4(i);var o,c,d=t.oldVersion>0x4000000000000000?0:t.oldVersion;l=d<1,e._novip.idbdb=u.result,o=d/10,c=s,r=e._dbSchema,(n=e._createTransaction("readwrite",e._storeNames,r)).create(c),n._completion.catch(i),a=n._reject.bind(n),f=az.transless||az,sa(()=>{az.trans=n,az.transless=f,0===o?(oM(r).forEach(e=>{lf(c,e,r[e].primKey,r[e].indexes)}),ls(e,c),aY.follow(()=>e.on.populate.fire(n)).catch(a)):(function({_novip:e},t,r,n){let i=[],o=e._versions,a=e._dbSchema=lh(e,e.idbdb,n),s=!1;return o.filter(e=>e._cfg.version>=t).forEach(o=>{i.push(()=>{let i=a,l=o._cfg.dbschema;lm(e,i,n),lm(e,l,n),a=e._dbSchema=l;let u=ld(i,l);u.add.forEach(e=>{lf(n,e[0],e[1].primKey,e[1].indexes)}),u.change.forEach(e=>{if(e.recreate)throw new ag.Upgrade("Not yet support for changing primary key");{let t=n.objectStore(e.name);e.add.forEach(e=>lp(t,e)),e.change.forEach(e=>{t.deleteIndex(e.name),lp(t,e)}),e.del.forEach(e=>t.deleteIndex(e))}});let c=o._cfg.contentUpgrade;if(c&&o._cfg.version>t){let t;ls(e,n),r._memoizedTables={},s=!0;let o=o0(l);u.del.forEach(e=>{o[e]=i[e]}),lu(e,[e.Transaction.prototype]),ll(e,[e.Transaction.prototype],oM(o),o),r.schema=o;let a=an(c);a&&ss();let d=aY.follow(()=>{if((t=c(r))&&a){var e=sl.bind(null,null);t.then(e,e)}});return t&&"function"==typeof t.then?aY.resolve(t):d.then(()=>t)}}),i.push(t=>{var n;s&&sO||(n=o._cfg.dbschema,[].slice.call(t.db.objectStoreNames).forEach(e=>null==n[e]&&t.db.deleteObjectStore(e))),lu(e,[e.Transaction.prototype]),ll(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema})}),(function e(){return i.length?aY.resolve(i.shift()(r.idbtrans)).then(e):aY.resolve()})().then(()=>{var e;oM(e=a).forEach(t=>{n.db.objectStoreNames.contains(t)||lf(n,t,e[t].primKey,e[t].indexes)})})})(e,o,n,c).catch(a)})}},i),u.onsuccess=a7(()=>{s=null;let n=e._novip.idbdb=u.result,i=oq(n.objectStoreNames);if(i.length>0)try{let t,o=n.transaction(1===i.length?i[0]:i,"readonly");r.autoSchema?function({_novip:e},t,r){e.verno=t.version/10;let n=e._dbSchema=lh(0,t,r);e._storeNames=oq(t.objectStoreNames,0),ll(e,[e._allTables],oM(n),n)}(e,n,o):(lm(e,e._dbSchema,o),((t=ld(lh(0,e.idbdb,o),e._dbSchema)).add.length||t.change.some(e=>e.add.length||e.change.length))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),ls(e,o)}catch(e){}sD.push(e),n.onversionchange=a7(t=>{r.vcFired=!0,e.on("versionchange").fire(t)}),n.onclose=a7(t=>{e.on("close").fire(t)}),l&&function({indexedDB:e,IDBKeyRange:t},r){lb(e)||r===sC||lg(e,t).put({name:r}).catch(a_)}(e._deps,a),t()},i)}).catch(e=>e&&"UnknownError"===e.name&&r.PR1398_maxLoop>0?(r.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),u()):aY.reject(e));return aY.race([i,("u"<typeof navigator?aY.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var r=function(){return indexedDB.databases().finally(e)};t=setInterval(r,100),r()}).finally(function(){return clearInterval(t)}):Promise.resolve()).then(u)]).then(()=>(o(),r.onReadyBeingFired=[],aY.resolve(lv(()=>e.on.ready.fire(e.vip))).then(function t(){if(r.onReadyBeingFired.length>0){let n=r.onReadyBeingFired.reduce(aC,a_);return r.onReadyBeingFired=[],aY.resolve(lv(()=>n(e.vip))).then(t)}}))).finally(()=>{r.onReadyBeingFired=null,r.isBeingOpened=!1}).then(()=>e).catch(t=>{r.dbOpenError=t;try{s&&s.abort()}catch(e){}return i===r.openCanceller&&e._close(),sv(t)}).finally(()=>{r.openComplete=!0,a()})}(this)}_close(){let e=this._state,t=sD.indexOf(this);if(t>=0&&sD.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new aY(t=>{e.dbReadyResolve=t}),e.openCanceller=new aY((t,r)=>{e.cancelOpen=r})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new ag.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,t=this._state;return new aY((r,n)=>{let i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=a7(()=>{!function({indexedDB:e,IDBKeyRange:t},r){lb(e)||r===sC||lg(e,t).delete(r).catch(a_)}(this._deps,this.name),r()}),e.onerror=s4(n),e.onblocked=this._fireOnBlocked};if(e)throw new ag.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()})}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){let e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return oM(this._allTables).map(e=>this._allTables[e])}transaction(){let e=lw.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n,i,o=az.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);let a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(i=t.map(e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||e===sk)n=sk;else{if("rw"!=e&&e!=sT)throw new ag.InvalidArgument("Invalid transaction mode: "+e);n=sT}if(o){if(o.mode===sk&&n===sT){if(!a)throw new ag.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&i.forEach(e=>{if(o&&-1===o.storeNames.indexOf(e)){if(!a)throw new ag.SubTransaction("Table "+e+" not included in parent transaction.");o=null}}),a&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(t,r)=>{r(e)}):sv(e)}let s=(function e(t,r,n,i,o){return aY.resolve().then(()=>{let a,s=az.transless||az,l=t._createTransaction(r,n,t._dbSchema,i);if(i)l.idbtrans=i.idbtrans;else try{l.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===ay.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,r,n,null,o))):sv(i)}let u=an(o);u&&ss();let c=aY.follow(()=>{if(a=o.call(l,l))if(u){var e=sl.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=l_(a))},{trans:l,transless:s});return(a&&"function"==typeof a.then?aY.resolve(a).then(e=>l.active?e:sv(new ag.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>a)).then(e=>(i&&l._resolve(),l._completion.then(()=>e))).catch(e=>(l._reject(e),sv(e)))})}).bind(null,this,n,i,o,r);return o?o._promise(n,s,"lock"):az.trans?sh(az.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!oF(this._allTables,e))throw new ag.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let l$="u">typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class lL{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[l$](){return this}}function lF(e,t){return oM(t).forEach(r=>{lj(e[r]||(e[r]=new lk),t[r])}),e}try{o={indexedDB:oA.indexedDB||oA.mozIndexedDB||oA.webkitIndexedDB||oA.msIndexedDB,IDBKeyRange:oA.IDBKeyRange||oA.webkitIDBKeyRange}}catch(e){o={indexedDB:null,IDBKeyRange:null}}function lB(e){let t=lV;try{lV=!0,s8.storagemutated.fire(e)}finally{lV=t}}oB(lI,{...av,delete:e=>new lI(e,{addons:[]}).delete(),exists:e=>new lI(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:t}){return lb(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>e!==sC)):lg(e,t).toCollection().primaryKeys()})(lI.dependencies).then(e)}catch(e){return sv(new ag.MissingAPI)}},defineClass:()=>function(e){oI(this,e)},ignoreTransaction:e=>az.trans?sh(az.transless,e):e(),vip:lv,async:function(e){return function(){try{var t=l_(e.apply(this,arguments));return t&&"function"==typeof t.then?t:aY.resolve(t)}catch(e){return sv(e)}}},spawn:function(e,t,r){try{var n=l_(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:aY.resolve(n)}catch(e){return sv(e)}},currentTransaction:{get:()=>az.trans||null},waitFor:function(e,t){let r=aY.resolve("function"==typeof e?lI.ignoreTransaction(e):e).timeout(t||6e4);return az.trans?az.trans.waitFor(r):r},Promise:aY,debug:{get:()=>ai,set:e=>{ai=e,ao="dexie"===e?()=>!0:sP}},derive:oW,extend:oI,props:oB,override:oG,Events:sN,on:s8,liveQuery:function(e){let t,r=!1,n=new lL(n=>{let i=an(e),o=!1,a={},s={},l={get closed(){return o},unsubscribe:()=>{o=!0,s8.storagemutated.unsubscribe(f)}};n.start&&n.start(l);let u=!1,c=!1;function d(){return oM(s).some(e=>a[e]&&function(e,t){let r=lR(t),n=r.next();if(n.done)return!1;let i=n.value,o=lR(e),a=o.next(i.from),s=a.value;for(;!n.done&&!a.done;){if(0>=sK(s.from,i.to)&&sK(s.to,i.from)>=0)return!0;0>sK(i.from,s.from)?i=(n=r.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}(a[e],s[e]))}let f=e=>{lF(a,e),d()&&p()},p=()=>{let h,m;if(u||o)return;a={};let y={},g=(i&&ss(),h=()=>sa(e,{subscr:y,trans:null}),m=az.trans?sh(az.transless,h):h(),i&&m.then(sl,sl),m);c||(s8(s6,f),c=!0),u=!0,Promise.resolve(g).then(e=>{r=!0,t=e,u=!1,o||(d()?p():(a={},s=y,n.next&&n.next(e)))},e=>{u=!1,r=!1,n.error&&n.error(e),l.unsubscribe()})};return p(),l});return n.hasValue=()=>r,n.getValue=()=>t,n},extendObservabilitySet:lF,getByKeyPath:oQ,setByKeyPath:oX,delByKeyPath:function(e,t){"string"==typeof t?oX(e,t,void 0):"length"in t&&[].map.call(t,function(t){oX(e,t,void 0)})},shallowClone:o0,deepClone:o5,getObjectDiff:lS,cmp:sK,asap:oY,minKey:sx,addons:[],connections:sD,errnames:ay,dependencies:o,semVer:s_,version:s_.split(".").map(e=>parseInt(e)).reduce((e,t,r)=>e+t/Math.pow(10,2*r))}),lI.maxKey=lr(lI.dependencies.IDBKeyRange),"u">typeof dispatchEvent&&"u">typeof addEventListener&&(s8(s6,e=>{if(!lV){let t;sO?(t=document.createEvent("CustomEvent")).initCustomEvent(s5,!0,!0,e):t=new CustomEvent(s5,{detail:e}),lV=!0,dispatchEvent(t),lV=!1}}),addEventListener(s5,({detail:e})=>{lV||lB(e)}));let lV=!1;if("u">typeof BroadcastChannel){let e=new BroadcastChannel(s5);"function"==typeof e.unref&&e.unref(),s8(s6,t=>{lV||e.postMessage(t)}),e.onmessage=e=>{e.data&&lB(e.data)}}else if("u">typeof self&&"u">typeof navigator){s8(s6,e=>{try{lV||("u">typeof localStorage&&localStorage.setItem(s5,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(t=>t.postMessage({type:s5,changedParts:e})))}catch(e){}}),"u">typeof addEventListener&&addEventListener("storage",e=>{if(e.key===s5){let t=JSON.parse(e.newValue);t&&lB(t.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&e.type===s5&&lB(e.changedParts)})}function lU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}aY.rejectionMapper=function(e,t){if(!e||e instanceof af||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ab[e.name])return e;var r=new ab[e.name](t||e.message,e);return"stack"in e&&oU(r,"stack",{get:function(){return this.inner.stack}}),r},ao=sP;class lW extends lI{constructor(){super("EsmOffline"),lU(this,"syncQueue",void 0),lU(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}}function lK(){return new lW}let lH=new lW,lz={};async function lq(){let e=await ic();return e?.uuid||"*"}async function lG(e,t,r,n){let i=n&&n.id;return void 0!==i&&await lH.syncQueue.where({type:t,userId:e}).filter(e=>e?.descriptor.id===i).delete().catch(lI.errnames.DatabaseClosed),await lH.syncQueue.add({type:t,content:r,userId:e,descriptor:n||{},createdOn:new Date}).catch(lI.errnames.DatabaseClosed,()=>-1)}async function lZ(e,t,r){let n=await lq();return await lG(n,e,t,r)}async function lY(e,t){return(await lJ(e,t)).map(e=>e.content)}async function lJ(e,t){return await lH.syncQueue.where(t?{type:t,userId:e}:{userId:e}).toArray().catch(lI.errnames.DatabaseClosed,()=>[])}async function lQ(e){let t=await lq();return await lY(t,e)}async function lX(e){let t=await lq();return await lJ(t,e)}async function l0(e){return await lH.syncQueue.get(e).catch(lI.errnames.DatabaseClosed,()=>void 0)}function l1(e){return!!lz[e]?.options.onBeginEditSyncItem}async function l3(e){let t=await l0(e);if(!t)throw Error(`No sync item with the ID ${e} exists.`);let r=lz[t.type]?.options.onBeginEditSyncItem;if(!r)throw Error(`A sync item with the ID ${e} exists, but the associated handler (if one exists) doesn't support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "${t.type}" supports editing items.`);r(t)}async function l4(e){await lH.syncQueue.delete(e).catch(lI.errnames.DatabaseClosed)}function l2(e,t,r,n={}){lz[e]={type:e,dependsOn:t,process:r,options:n}}K("offline-synchronization",{});let l6={};function l5(){return Object.values(l6)}function l8(e){l6[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${e.id}" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.`),l6[e.id]=e}async function l9(e){let t=await ua();return await l7(t,e)}async function l7(e,t){let r=new lW;return await r.dynamicOfflineData.where(t?{type:t,users:e}:{users:e}).toArray().catch(lI.errnames.DatabaseClosed,()=>[])}async function ue(e,t){let r=await ua();return await ut(r,e,t)}async function ut(e,t,r){let n=new lW,i=await n.dynamicOfflineData.get({type:t,identifier:r}).catch(lI.errnames.DatabaseClosed,()=>void 0);i?i.users.includes(e)||await n.dynamicOfflineData.update(i.id,{users:[...i.users,e]}).catch(lI.errnames.DatabaseClosed):await n.dynamicOfflineData.add({users:[e],type:t,identifier:r}).catch(lI.errnames.DatabaseClosed)}async function ur(e,t){let r=await ua();return await un(r,e,t)}async function un(e,t,r){let n=new lW,i=await n.dynamicOfflineData.get({type:t,identifier:r,users:e}).catch(lI.errnames.DatabaseClosed,()=>void 0);i&&(i.users.length>1?await n.dynamicOfflineData.update(i.id,{users:i.users.filter(t=>t!==e)}).catch(lI.errnames.DatabaseClosed):await n.dynamicOfflineData.delete(i.id).catch(lI.errnames.DatabaseClosed))}async function ui(e,t){let r=await l9(e);await Promise.all(r.map(async e=>uo(e.type,e.identifier,t)))}async function uo(e,t,r){await ue(e,t);let n=new lW,i=await ua(),o=await n.dynamicOfflineData.get({type:e,identifier:t}).catch(lI.errnames.DatabaseClosed,()=>void 0),a=l5().filter(t=>t.type===e);if(!o)return;let s=await Promise.all(a.map(async e=>{try{return e.sync(t,r),{id:e.id,error:void 0}}catch(r){let t=r.message?.toString()??r.toString();return{id:e.id,error:t}}})),l=s.filter(e=>!e.error).map(e=>e.id),u=s.filter(e=>e.error).map(e=>e.id),c=s.filter(e=>e.error).map(e=>({handlerId:e.id,message:e.error})),d={syncedOn:new Date,syncedBy:i,succeededHandlers:l,erroredHandlers:u,errors:c};o.id&&await n.dynamicOfflineData.update(o.id,{syncState:d}).catch(lI.errnames.DatabaseClosed)}async function ua(){let e=(await ic()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let us=K("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function ul(){return ud(),us}function uu(e,t){ud(),l8({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,r)=>t.onOfflinePatientAdded({patientUuid:e,signal:r??new AbortController().signal})})}async function uc(e){ud(),await uo("patient",e)}function ud(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")}async function uf(e,t,r=!0){if(e){let n=null,[i,o]=await Promise.all([n9(`${n6}/Patient/${e}`,t).catch(e=>n=e),r?up(e):Promise.resolve(null)]);if(i.ok)return i.data;if(o)return o;if(n)throw n}return null}async function up(e){let t=(await lQ("patient-registration")).find(t=>t.fhirPatient.id===e);return t?.fhirPatient??null}function uh(e,t){let r=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,r),()=>{window.removeEventListener(`openmrs:${e}`,r)}}var um=((er={}).NEWVISIT="startVisit",er.EDITVISIT="editVisit",er.LOADING="loadingVisit",er),uy=((en={}).NOTSTARTED="notStarted",en.ONGOING="ongoing",en);let ug="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))",ub=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};function uv(){return z("visit",ub)}function u_(e,t){uv().setState({patientUuid:e,manuallySetVisitUuid:t})}function uw(e,t){return n9(`${n2}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function ux(e,t,r){return n9(`${n2}/visit/${e}`,{signal:r.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function uE(e,t,r){return n9(`${n2}/visit?patient=${e}&v=${r??ug}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}uv().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});let uS=new ea.BehaviorSubject(null);var uD=r(56170);function uO(e){return{uuid:e.uuid,display:e.display,name:e.name}}function uP(){return n7(`${n2}/visittype`).pipe((0,uD.map)(e=>e.data.results.map(uO))).pipe((0,uD.take)(1))}function uC(e){return{uuid:e.uuid,display:e.display}}function uk(e=null,t=null){let r=new URLSearchParams;e&&r.set("tag",e),t&&r.set("q",t);let n=r.toString();return n7(`${n2}/location${n?"?"+n:""}`).pipe((0,uD.map)(e=>e.data.results.map(uC))).pipe((0,uD.take)(1))}class uT{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+uT.version}static addUnaryOp(e){return uT.max_unop_len=Math.max(e.length,uT.max_unop_len),uT.unary_ops[e]=1,uT}static addBinaryOp(e,t,r){return uT.max_binop_len=Math.max(e.length,uT.max_binop_len),uT.binary_ops[e]=t,r?uT.right_associative.add(e):uT.right_associative.delete(e),uT}static addIdentifierChar(e){return uT.additional_identifier_chars.add(e),uT}static addLiteral(e,t){return uT.literals[e]=t,uT}static removeUnaryOp(e){return delete uT.unary_ops[e],e.length===uT.max_unop_len&&(uT.max_unop_len=uT.getMaxKeyLen(uT.unary_ops)),uT}static removeAllUnaryOps(){return uT.unary_ops={},uT.max_unop_len=0,uT}static removeIdentifierChar(e){return uT.additional_identifier_chars.delete(e),uT}static removeBinaryOp(e){return delete uT.binary_ops[e],e.length===uT.max_binop_len&&(uT.max_binop_len=uT.getMaxKeyLen(uT.binary_ops)),uT.right_associative.delete(e),uT}static removeAllBinaryOps(){return uT.binary_ops={},uT.max_binop_len=0,uT}static removeLiteral(e){return delete uT.literals[e],uT}static removeAllLiterals(){return uT.literals={},uT}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 uT(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 uT.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!uT.binary_ops[String.fromCharCode(e)]||uT.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return uT.isIdentifierStart(e)||uT.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(uT.hooks[e]){let r={context:this,node:t};return uT.hooks.run(e,r),r.node}return t}searchHook(e){if(uT.hooks[e]){let t={context:this};return uT.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===uT.SPACE_CODE||e===uT.TAB_CODE||e===uT.LF_CODE||e===uT.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:uT.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],r,n;for(;this.index<this.expr.length;)if((r=this.code)===uT.SEMCOL_CODE||r===uT.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())t.push(n);else if(this.index<this.expr.length){if(r===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,uT.max_binop_len),t=e.length;for(;t>0;){if(uT.binary_ops.hasOwnProperty(e)&&(!uT.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!uT.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,n,i,o,a,s,l;if(!(o=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return o;for(i={value:t,prec:uT.binaryPrecedence(t),right_a:uT.right_associative.has(t)},(a=this.gobbleToken())||this.throwError("Expected expression after "+t),n=[o,i,a];t=this.gobbleBinaryOp();){if(0===(r=uT.binaryPrecedence(t))){this.index-=t.length;break}i={value:t,prec:r,right_a:uT.right_associative.has(t)},l=t;let s=e=>i.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;n.length>2&&s(n[n.length-2]);)a=n.pop(),t=n.pop().value,o=n.pop(),e={type:uT.BINARY_EXP,operator:t,left:o,right:a},n.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),n.push(i,e)}for(s=n.length-1,e=n[s];s>1;)e={type:uT.BINARY_EXP,operator:n[s-1].value,left:n[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,r,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"))return this.runHook("after-token",n);if(e=this.code,uT.isDecimalDigit(e)||e===uT.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===uT.SQUOTE_CODE||e===uT.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===uT.OBRACK_CODE)n=this.gobbleArray();else{for(r=(t=this.expr.substr(this.index,uT.max_unop_len)).length;r>0;){if(uT.unary_ops.hasOwnProperty(t)&&(!uT.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!uT.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:uT.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}uT.isIdentifierStart(e)?(n=this.gobbleIdentifier(),uT.literals.hasOwnProperty(n.name)?n={type:uT.LITERAL,value:uT.literals[n.name],raw:n.name}:n.name===uT.this_str&&(n={type:uT.THIS_EXP})):e===uT.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===uT.PERIOD_CODE||t===uT.OBRACK_CODE||t===uT.OPAREN_CODE||t===uT.QUMARK_CODE;){let r;if(t===uT.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==uT.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===uT.OBRACK_CODE?((e={type:uT.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==uT.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===uT.OPAREN_CODE?e={type:uT.CALL_EXP,arguments:this.gobbleArguments(uT.CPAREN_CODE),callee:e}:(t===uT.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:uT.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,r;for(;uT.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===uT.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);uT.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++));uT.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);uT.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return r=this.code,uT.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(r===uT.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===uT.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:uT.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,r=this.expr.charAt(this.index++),n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){n=!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 n||this.throwError('Unclosed quote after "'+e+'"'),{type:uT.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(uT.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,uT.isIdentifierPart(e))this.index++;else break;return{type:uT.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],r=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===e){r=!0,this.index++,e===uT.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(i===uT.COMMA_CODE){if(this.index++,++n!==t.length){if(e===uT.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===uT.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==uT.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(uT.CPAREN_CODE);if(this.code===uT.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:uT.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:uT.ARRAY_EXP,elements:this.gobbleArguments(uT.CBRACK_CODE)}}}Object.assign(uT,{hooks:new class{add(e,t,r){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][r?"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)})}}(uT),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"}),uT.max_unop_len=uT.getMaxKeyLen(uT.unary_ops),uT.max_binop_len=uT.getMaxKeyLen(uT.binary_ops);let uj=e=>new uT(e).parse(),uR=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(uT).filter(e=>!uR.includes(e)&&void 0===uj[e]).forEach(e=>{uj[e]=uT[e]}),uj.Jsep=uT,uj.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}});let uA="ArrowFunctionExpression",uM={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)}},uN={...uM,Promise};function uI(e,t={}){return uU(e,t,uH)}async function u$(e,t={}){return uW(e,t,uH)}function uL(e,t={}){return uU(e,t,uz)}function uF(e,t={}){return uW(e,t,uz)}function uB(e,t={}){return uU(e,t,uq)}function uV(e,t={}){return uW(e,t,uq)}function uU(e,t={},r){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 n=uY(t,uM),i=uG("string"==typeof e?uj(e):e,n);if(r(i))return i;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 uW(e,t={},r){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 n=uY(t,uN);return Promise.resolve(uG("string"==typeof e?uj(e):e,n)).then(t=>{if(r(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 uK(e){return uj(e)}function uH(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function uz(e){return"boolean"==typeof e}function uq(e){return"number"==typeof e}function uG(e,t){switch(e.type){case"UnaryExpression":var r,n,i,o,a,s,l,u,c,d,f,p,h=e,m=t;let y=uG(h.argument,m);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 g=e,b=t;let v=uG(g.left,b),w=uG(g.right,b);switch(g.operator){case"+":return v+w;case"-":return v-w;case"*":return v*w;case"/":return v/w;case"%":return v%w;case"**":return v**w;case"==":return v==w;case"===":return v===w;case"!=":return v!=w;case"!==":return v!==w;case">":return v>w;case">=":return v>=w;case"<":return v<w;case"<=":return v<=w;case"in":return v in w;case"&&":return v&&w;case"||":return v||w;case"??":return v??w;default:throw`Expression evaluator does not support operator '${g.operator}' operator`}case"ConditionalExpression":return r=e,n=t,uG(r.test,n)?uG(r.consequent,n):uG(r.alternate,n);case"CallExpression":var x=e,E=t;let S=x.arguments?.map(uJ(E)),D=uG(x.callee,E);if(D){if("function"!=typeof D)throw`${uX(x.callee)} is not a function`}else throw`No function named ${uX(x.callee)} is defined in this context`;return D(...S);case"ArrowFunctionExpression":let O;return i=e,o=t,O=i.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<O.length)throw`Required argument(s) ${O.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(O.reduce((t,r,n)=>{let i=e[n];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 r of Object.keys(t))if(!e(t[r]))return!1;return!0}if(Array.isArray(t)){for(let r of t)if(!e(r))break}return!1}(i)&&t.push([r,i]),t},[]));return uG(i.body,o.addVariables(t))}).bind(o.thisObj??null);case"MemberExpression":return function(e,t){let r,n=uG(e.object,t);if(void 0===n)switch(e.object.type){case"Identifier":{let r=uZ(e.object,t);throw ReferenceError(`ReferenceError: ${r} is not defined`)}case"MemberExpression":{let r=uZ(e.property,t);throw TypeError(`TypeError: cannot read properties of undefined (reading '${r}')`)}default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}let i=n;if("string"==typeof n)i=String.prototype;else if("number"==typeof n)i=Number.prototype;else if("function"==typeof n);else if("object"!=typeof n)throw`VisitMemberExpression does not support member access on type ${typeof n}`;switch(t.thisObj=i,e.property.type){case"Identifier":case"MemberExpression":r=uG(e.property,t);break;default:{let i=uG(e.property,t);if(void 0===i)throw{type:"Illegal property access",message:"No property was supplied to the property access"};uQ(i),r=n[i]}}return"function"==typeof r?r.bind(n):r}(e,t);case"ArrayExpression":return a=e,s=t,a.elements?.map(uJ(s));case"SequenceExpression":let P;return l=e,u=t,(P=l.expressions.map(uJ(u)))[P.length-1];case"NewExpression":var C=e,k=t;if(C.callee&&"Identifier"===C.callee.type){let e=C.arguments?.map(uJ(k));switch(C.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${C.callee.name}`}}if(C.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return uQ((c=e).value),c.value;case"Identifier":var T=e,j=t;uQ(T.name);let R=j.thisObj;if(R&&("object"==typeof R||"function"==typeof R)&&T.name in R){let e=R[T.name];return uQ(e),e}if(j.variables&&T.name in j.variables){let e=j.variables[T.name];return uQ(e),e}return T.name in j.globals?j.globals[T.name]:void 0;case"TemplateLiteral":let A,M;return d=e,f=t,A=d.expressions?.map(uJ(f))??[],(M=d.quasis?.map(uJ(f))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+A.join("")+M.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(p=e).cooked,tail:p.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function uZ(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return uZ(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function uY(e,t){let r={thisObj:void 0,variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return r.addVariables.bind(r),r}function uJ(e){return function(t){return null===t?null:uG(t,e)}}function uQ(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}function uX(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}function u0(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:{...uN},isLocalExpression:!1,variables:new Set};return u1("string"==typeof e?uj(e):e,t),[...t.variables]}function u1(e,t){switch(e.type){case"UnaryExpression":return n=e,i=t,u1(n.argument,i);case"BinaryExpression":return o=e,a=t,[u1(o.left,a),u1(o.right,a)].filter(Boolean);case"ConditionalExpression":return s=e,l=t,[u1(s.consequent,l),u1(s.test,l),u1(s.alternate,l)].filter(Boolean);case"CallExpression":let r;return u=e,c=t,r=u1(u.callee,c),u.arguments?.map(u3(c)),r;case"ArrowFunctionExpression":var n,i,o,a,s,l,u,c,d,f,p,h,m,y,g,b,v,w,x=e,E=t;let S={...E};S.isLocalExpression=!0;let D=x.params?.map(u3(S))??[],O=u1(x.body,S)??[];if(O&&Array.isArray(O))for(let e of O)D.includes(e)||E.variables.add(e);return;case"MemberExpression":let P;return d=e,f=t,u1(d.object,f),void((P={...f}).isLocalExpression=!0,u1(d.property,P));case"ArrayExpression":return p=e,h=t,void p.elements?.map(u3(h));case"SequenceExpression":return m=e,y=t,void m.expressions?.map(u3(y));case"NewExpression":return g=e,b=t,void g.arguments?.map(u3(b));case"Literal":case"TemplateElement":return;case"Identifier":var C=e,k=t;if(!(C.name in k.globals))if(k.isLocalExpression)return C.name;else k.variables.add(C.name);return;case"TemplateLiteral":return v=e,w=t,void(v.expressions?.map(u3(w)),v.quasis?.map(u3(w)));default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function u3(e){return function(t){return null===t?null:u1(t,e)}}uj.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 r=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let r=this.gobbleBinaryExpression();r||this.throwError("Expected expression after "+e),t.node={type:uA,params:null,body:r};return}}this.index=r}}),e.hooks.add("after-expression",function(t){!function t(r){r&&(Object.values(r).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===r.operator&&(r.type=uA,r.params=r.left?[r.left]:null,r.body=r.right,r.params&&r.params[0].type===e.SEQUENCE_EXP&&(r.params=r.params[0].expressions),delete r.left,delete r.right,delete r.operator))}(t.node)})}}),uj.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let r=t.node;if(r&&"new"===r.operator){r.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(r.argument.type)||this.throwError("Expected new function()"),t.node=r.argument;let n=t.node;for(;n.type===e.MEMBER_EXP||n.type===e.CALL_EXP&&n.callee.type===e.MEMBER_EXP;)n=n.type===e.MEMBER_EXP?n.object:n.callee.object;n.type="NewExpression"}})}}),uj.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 r(t){let r=this.index,n="",i=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:n+=this.expr.charAt(this.index++)};i(),this.code===e.PERIOD_CODE&&(n+=this.expr.charAt(this.index++),i());let o=this.char;("e"===o||"E"===o)&&(n+=this.expr.charAt(this.index++),("+"===(o=this.char)||"-"===o)&&(n+=this.expr.charAt(this.index++)),i(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")"));let a=this.code;if(e.isIdentifierStart(a))this.throwError("Variable names cannot start with a number ("+n+this.char+")");else if(a===e.PERIOD_CODE){n.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:a,number:n},null,2)}`),this.index=r;return}t.node={type:e.LITERAL,value:parseFloat(n),raw:this.expr.substring(r,this.index)}}e.hooks.add("gobble-token",function(n){if(48===this.code){var i,o,a;let s=this.index,l=this.expr.charAt(this.index+1),u=t.call(this,l);if(!u)return;let c="";for(;i=this.code,o=u,95===i||o.some(([e,t])=>i>=e&&i<=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,r.call(this,n);return}this.throwError("unexpected char within number")}n.node={type:e.LITERAL,value:parseInt(c,"x"===(a=l)||"X"===a?16:"b"===a||"B"===a?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&r.call(this,n)})}}),uj.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let r=++this.index,n=!1;for(;this.index<this.expr.length;){if(47===this.code&&!n){let n,i=this.expr.slice(r,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{n=new RegExp(i,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:n,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),uj.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}}),uj.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,r=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},n="",i="",o=!1,a=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:i,cooked:n},tail:o});for(;this.index<a;){let a=this.expr.charAt(++this.index);if("`"===a)return this.index+=1,o=!0,s(),e.node=t,r&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===a&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),i="",n="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===a)switch(i+=a,a=this.expr.charAt(++this.index),i+=a,a){case"n":n+="\n";break;case"r":n+="\r";break;case"t":n+=" ";break;case"b":n+="\b";break;case"f":n+="\f";break;case"v":n+="\v";break;default:n+=a}else n+=a,i+=a}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(r){if((r.node.type===e.IDENTIFIER||r.node.type===e.MEMBER_EXP)&&96===this.code)return r.node={type:"TaggedTemplateExpression",tag:r.node,quasi:t.bind(this)(r,!1)},r.node=this.gobbleTokenProperty(r.node),r.node})}}),uj.addBinaryOp("in",7),uj.addBinaryOp("??",1);let u4=z("feature-flags",{flags:function(){let e={};for(let t of Object.keys(localStorage))if(t.startsWith("openmrs:feature-flag:")){let r=t.replace("openmrs:feature-flag:",""),n=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${r}`)||"{}");e[r]={enabled:"true"===localStorage.getItem(t),...n}}return e}()});function u2(e,t,r){u4.setState(n=>({flags:{...n.flags,[e]:{enabled:n.flags[e]?.enabled??!1,label:t,description:r}}}))}function u6(e){return u4.getState().flags[e].enabled}function u5(e){return!window.offlineEnabled||(e??navigator.onLine)}u4.subscribe(e=>{for(let[t,r]of Object.entries(e.flags))localStorage.setItem(`openmrs:feature-flag:${t}`,r.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${t}`,JSON.stringify({label:r.label,description:r.description}))});var u8=ez(function(e,t,r){eN(e,t,r)});function u9(e,t=!0,r=!1){return!!(e?t:r)}let u7=K("extensionsInternal",{slots:{},extensions:{}}),ce=K("extensionRenderings",{renderings:new Map}),ct=()=>z("extensionsInternal",{slots:{},extensions:{}});function cr(e){let t=u7.getState(),r=e(t);r!==t&&u7.setState(r)}let cn=null,ci=null;function co(){let e=ce.getState();return cn&&e===ci||(cn=new Map(e.renderings),ci=e,function(e){for(let t of(cu.clear(),e.values()))cd(t,1);cc=!0}(cn)),cn}function ca(e){ci={renderings:e},ce.setState(ci,!0)}let cs=()=>z("extensions",{slots:{}});function cl(e){try{e()}catch(t){console.error(`The extension system's '${e.name}' recomputation failed`,t)}}let cu=new Map,cc=!1;function cd(e,t){let r=JSON.stringify([e.slotName,e.extensionId,e.slotModuleName,e.extensionModuleName]),n=cu.get(r);if(!n){if(t<0)return;cu.set(r,{count:1,record:{slotModuleName:e.slotModuleName,extensionModuleName:e.extensionModuleName,slotName:e.slotName,extensionId:e.extensionId}}),cc=!0;return}n.count+=t,n.count<1&&(cu.delete(r),cc=!0)}function cf(){var e,t;if(co(),!cc)return;cc=!1;let r=Array.from(cu.values(),({record:e})=>e);r.sort(cp),e=tL.getState().mountedExtensions,t=r,e.length===t.length&&e.every((e,r)=>0===cp(e,t[r]))||tL.setState({mountedExtensions:r})}function cp(e,t){return ch(e.slotName,t.slotName)||ch(e.extensionId,t.extensionId)||ch(e.slotModuleName,t.slotModuleName)||ch(e.extensionModuleName,t.extensionModuleName)}function ch(e,t){return e===t?0:e<t?-1:1}cf(),ce.subscribe(()=>cl(cf));let cm=ct(),cy=cs(),cg=tB(),cb=tV(),cv=new Set,c_=!1;function cw(e){if(null===e)cv=null;else if(null!==cv)for(let t of e)cv.add(t);cl(cx)}function cx(){if(!c_){c_=!0;try{for(let e=1;;e++){let t=cv;if(null!==t&&0===t.size)return;cv=new Set;try{!function(e,t,r,n,i,o=null){let a=cy.getState().slots,s={},l=!1,u=u5(),c=Object.entries(n.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[n,f]of Object.entries(e.slots)){var d;let p=a[n];if(p&&o&&!o.has(n)){s[n]=p;continue}let{config:h}=(d=f.name,t.slots[d]??{loaded:!1,config:{}}),m=function(e,t,r,n,i,o,a){let s=function(e,t){let r=e.add||[],n=e.remove||[],i=e.order||[],{extensions:o}=cm.getState();return[...t,...r].filter(e=>!n.includes(e)).sort((e,r)=>cR(e,i,o[cO(e)]?.order,t)-cR(r,i,o[cO(r)]?.order,t))}(r,t.slots[e].attachedIds),l=[];for(let u of s){let{config:s}=tU(n,e,u),c=r.configure?.[u]??null,d=c?u8({},s,c):s,f=cO(u),p=t.extensions[f];if(p){let e=d?.["Display conditions"]?.privileges??p.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!a?.user||!iu(e,a.user))||p.featureFlag&&!i.includes(p.featureFlag)||window.offlineEnabled&&!u9(o,p.online,p.offline))continue;l.push({id:u,name:f,moduleName:p.moduleName,config:d,featureFlag:p.featureFlag,meta:p.meta,online:d?.["Display conditions"]?.online??p.online??!0,offline:d?.["Display conditions"]?.offline??p.offline??!1,displayConditionExpression:d?.["Display conditions"]?.expression||p.displayExpression})}}return l}(n,e,h,r,c,u,i.session);p&&p.moduleName===f.moduleName&&ti(p.candidateExtensions,m)?s[n]=p:(s[n]={moduleName:f.moduleName,candidateExtensions:m},l=!0)}(l||Object.keys(a).length!==Object.keys(s).length)&&cy.setState({slots:s})}(cm.getState(),cg.getState(),cb.getState(),u4.getState(),it.getState(),t)}catch(e){throw cv=null===t||null===cv?null:new Set([...t,...cv]),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{c_=!1}}}function cE(e,t){let r=new Set;for(let n of Object.keys(e))e[n]!==t[n]&&r.add(n);for(let n of Object.keys(t))n in e||r.add(n);return r}function cS(){cw(null)}function cD(e,t){return{moduleName:t,name:e,attachedIds:[]}}function cO(e){let[t]=e.split("#");return t}function cP(e){var t;let r;return t=cm.getState(),r=cO(e),t.extensions[r]}cm.subscribe((e,t)=>{cw(e.extensions!==t.extensions?null:cE(e.slots,t.slots))}),cg.subscribe((e,t)=>{cw(cE(e.slots,t.slots))}),cb.subscribe((e,t)=>{cw(cE(e.configs,t.configs))}),u4.subscribe(()=>cw(null)),it.subscribe(()=>cw(null)),cS(),g(cS);let cC=e=>cr(t=>({...t,extensions:{...t.extensions,[e.name]:{...e}}}));function ck(e,t){cr(r=>{let n=r.slots[e];return n?{...r,slots:{...r.slots,[e]:{...n,attachedIds:[...n.attachedIds,t]}}}:{...r,slots:{...r.slots,[e]:{...cD(e),attachedIds:[t]}}}})}function cT(e,t){cr(r=>{let n=r.slots[e];return n&&n.attachedIds.includes(t)?{...r,slots:{...r.slots,[e]:{...n,attachedIds:n.attachedIds.filter(e=>e!==t)}}}:r})}function cj(e){cr(t=>{let r=t.slots[e];return r?{...t,slots:{...t.slots,[e]:{...r,attachedIds:[]}}}:t})}function cR(e,t,r,n){let i=t.indexOf(e);if(-1!==i)return i;{if(void 0!==r)return 1e3+r;let t=n.indexOf(e);return -1!==t?2e3+t:3e3}}function cA(e,t){var r;return function(e,t,r=null,n){let i;return e.filter(e=>{let o=e.displayConditionExpression;if("string"!=typeof o||0===o.trim().length)return!0;i??(i=t&&"object"==typeof t?{session:r,...t}:{session:r});try{return!!uL(o,i)}catch(t){return console.error(`Error while evaluating expression '${o}' for ${e.id}`+(n?` in ${n}`:""),t),!1}})}((r=e,cy.getState().slots[r]?.candidateExtensions??[]),t,it.getState().session,e)}let cM=(e,t)=>cm.setState(r=>{let n=r.slots[t]?.moduleName;if(n&&n!=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 ${n}.`),r;if(n&&n==e)return r;if(r.slots[t])return{...r,slots:{...r.slots,[t]:{...r.slots[t],moduleName:e}}};let i=cD(t,e);return{...r,slots:{...r.slots,[t]:{...i}}}}),cN=K("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function cI({name:e,basePath:t,mode:r,componentContext:n,state:i}){cN.setState({slotName:e,basePath:t,mode:r??"normal",componentContext:n,state:i})}function c$(e){cN.getState().slotName===e&&cN.setState(cN.getInitialState(),!0)}let cL=0,cF=null,cB={bootstrap:{millis:15e3,dieOnTimeout:!0},mount:{millis:15e3,dieOnTimeout:!0},unmount:{millis:15e3,dieOnTimeout:!0}};async function cV(e,t){return(await (cF??(cF=new Promise((e,t)=>{nt({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),nt))),cF))("function"==typeof e?()=>e().then(e=>({timeouts:cB,...e})):{timeouts:cB,...e},t)}function cU(e,t){let r,n=cV(e,t).then(e=>r=e);return{mount:()=>n.then(e=>e.mount()),unmount:()=>n.then(e=>e.unmount()),update:e=>n.then(t=>t.update?.(e)),getStatus:()=>r?.getStatus()??"LOADING_SOURCE_CODE",get loadPromise(){return n.then(e=>e.loadPromise)},get bootstrapPromise(){return n.then(e=>e.bootstrapPromise)},get mountPromise(){return n.then(e=>e.mountPromise)},get unmountPromise(){return n.then(e=>e.unmountPromise)}}}async function cW(e,t,r,n,i=e=>e,o={}){let a=cO(n),s=cP(n),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${a}' to attach to '${t}'`);let{meta:c,moduleName:d,online:f,offline:p,load:h}=s;if(function(e=!0,t=!1){return u9(u5(),e,t)}(f,p)){let s,f=cL++,p=`${t}/${n}-${f}`;e.dataset.extensionRenderingId=p;let m=e=>{try{let e,t;(t=(e=co()).get(p))&&(e.delete(p),cd(t,-1),ca(e))}catch(t){console.error(e,t)}};try{var u;let e;u={renderingId:p,extensionName:a,extensionModuleName:d,extensionId:n,slotName:t,slotModuleName:r},(e=co()).has(u.renderingId)||(e.set(u.renderingId,u),cd(u,1),ca(e))}catch(e){throw m(`Recomputing configuration after registering '${n}' failed also failed`),e}try{s=await h()}catch(e){throw m(`Recomputing configuration after '${n}' failed to load also failed`),e}try{l=await cV(i({...s,name:`${t}/${a}-${f}`}),{...o,_meta:c,_extensionContext:{extensionId:n,extensionSlotName:t,extensionSlotModuleName:r,extensionModuleName:d},domElement:e})}catch(e){throw m(`Recomputing configuration after '${n}' failed to mount also failed`),e}l.mountPromise.then(void 0,e=>{console.error(`Extension '${n}' in slot '${t}' failed to mount`,e),m(`Recomputing configuration after '${n}' failed to mount also failed`)}),l.unmountPromise.then(()=>m(`Recomputing configuration after unmounting '${n}' failed`),e=>{console.error(`Extension '${n}' in slot '${t}' failed to unmount`,e),m(`Recomputing configuration after '${n}' failed to unmount also failed`)})}}else console.warn(`Tried to render ${n} into ${t} but no DOM element was available.`);return l}function cK(){return{current:"unavailable",notAvailable:!0,active:!1}}let cH="x-omrs-offline-response-body",cz="x-omrs-offline-response-status",cq="x-omrs-offline-caching-strategy",cG="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cZ=new Uint8Array(16),cY=[];for(let e=0;e<256;++e)cY.push((e+256).toString(16).slice(1));let cJ=function(e,t,r){if(cG&&!t&&!e)return cG();let n=(e=e||{}).random||(e.rng||function(){if(!a&&!(a="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(cZ)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return cY[e[t+0]]+cY[e[t+1]]+cY[e[t+2]]+cY[e[t+3]]+"-"+cY[e[t+4]]+cY[e[t+5]]+"-"+cY[e[t+6]]+cY[e[t+7]]+"-"+cY[e[t+8]]+cY[e[t+9]]+"-"+cY[e[t+10]]+cY[e[t+11]]+cY[e[t+12]]+cY[e[t+13]]+cY[e[t+14]]+cY[e[t+15]]}(n)},cQ="OFFLINE+";function cX(){return cQ+cJ()}function c0(e){return e.startsWith(cQ)}var c1=r(47499),c3=r.n(c1);function c4({to:e,templateParams:t,onBeforeNavigate:r,children:n,...i}){return(0,c1.useEffect)(()=>{i.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${i.href}'`),i.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),c3().createElement("a",{onClick:n=>{0===n.button&&!n.ctrlKey&&!n.shiftKey&&!n.altKey&&!n.metaKey&&(n.preventDefault(),r?.(n),nX({to:e,templateParams:t})),0===n.button&&(n.ctrlKey||n.metaKey)&&r?.(n),0===n.button&&n.shiftKey&&r?.(n),1===n.button&&r?.(n)},href:nJ(e,t),...i},n)}let c2=K("modalRegistry",{modals:{}}),c6=K("workspaceRegistrations",{workspaces:{}}),c5=K("workspaceGroups",{workspaceGroups:{}}),c8=new Set;function c9(e){let t=c6.getState().workspaces;if(t[e])return t[e];{let t=cP(e);if(t){var r;let n;return c8.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.`),c8.add(e)),{name:t.name,title:(r=t,"string"==typeof(n=r?.meta?.title)?n:n&&"object"==typeof n?oa(r.moduleName,n.key,n.default):r.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.`)}}let c7=K("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function de(e){let{openedWindows:t}=c7.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}let dt=(0,c1.createContext)({moduleName:"",featureName:""});function dr(e,t){"function"==typeof t&&(t=t(e));let r={};for(let[n,i]of Object.entries(t)){let t=function(...t){e.setState(e=>i(e,...t))};r[n]=t}return r}let dn=e=>e;function di(e,t=dn,r){let n=(0,c1.useCallback)(t=>e.subscribe(t),[e]),i=(0,c1.useCallback)(()=>t(e.getState()),[e,t]),o=(0,c1.useSyncExternalStore)(n,i,i),a=(0,c1.useMemo)(()=>r?dr(e,r):null,[e,r]);return(0,c1.useMemo)(()=>a?{...o,...a}:o,[o,a])}function da(e,t){return di(e,dn,t)}function ds(e){return function(t){let r=(0,c1.useCallback)(t=>e.subscribe(t),[]),n=(0,c1.useCallback)(()=>e.getState(),[]),i=(0,c1.useSyncExternalStore)(r,n,n),o=(0,c1.useMemo)(()=>t?dr(e,t):null,[t]);return(0,c1.useMemo)(()=>o?{...i,...o}:i,[i,o])}}let dl=[];Object.freeze(dl);let du={candidateExtensions:dl};Object.freeze(du);let dc=e=>{let t=(0,c1.useCallback)(t=>t.slots?.[e]??du,[e]);return di(cs(),t)},dd=e=>e.session;function df(e,t){let r,{candidateExtensions:n}=dc(e),i=di(it,dd),o=(M((r=(0,c1.useRef)(t)).current,t)||(r.current=t),r.current);return(0,c1.useMemo)(()=>cA(e,o),[e,o,i,n])}function dp(e,t){let{moduleName:r}=(0,c1.useContext)(dt);if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,c1.useEffect)(()=>{cM(r,e)},[r,e]),{extensions:df(e,t),extensionSlotName:e,extensionSlotModuleName:r}}function dh(e){return e}function dm({name:e,extensionSlotName:t,select:r=dh,children:n,state:i,style:o,...a}){if(n&&i)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,c1.useRef)(null),{extensions:u,extensionSlotModuleName:c}=dp(s,i),d=(0,c1.useMemo)(()=>r(u),[r,u]),f=(0,c1.useMemo)(()=>{if("function"==typeof n&&!c3().isValidElement(n))return d.map(e=>n(e,i))},[n,d]);return c3().createElement("div",{ref:l,"data-extension-slot-name":s,"data-extension-slot-module-name":c,style:{...o,position:"relative"},...a},s&&d?.map((e,t)=>c3().createElement(dt.Provider,{key:e.id,value:{moduleName:c,featureName:"",extension:{extensionId:e.id,extensionSlotName:s,extensionSlotModuleName:c}}},f?.[t]??("function"!=typeof n?n:null)??c3().createElement(fU,{state:i}))))}var dy=r(5338);function dg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function db(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dg(Object(r),!0).forEach(function(t){var n,i,o;n=e,i=t,o=r[t],i in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dg(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function dv(e){return(dv="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 d_(e){return(d_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dw(e,t){var r;if("function"!=typeof(r=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 r="single-spa-application:".concat(t);return function(){var e=document.getElementById(r);return e||((e=document.createElement("div")).id=r,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(d_(r)));return function(){var e=r(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(d_(e)));return e}}var dx=null;try{dx=require("react").createContext()}catch(e){}var dE={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 dS(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function dD(e,t){return new Promise(function(r,n){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 i,o=dk(e,t,function(){r(this)}),a=dw(e,t)(),s=function(e){var t=e.reactDom,r=e.renderType,n=e.elementToRender,i=e.domElement,o=t[r];if("function"!=typeof o)throw Error('renderType "'.concat(r,'" did not return a function.'));switch(r){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var a=o(i);return a.render(n),a;case"hydrateRoot":return o(i,n);default:return o(n,i),null}}({elementToRender:o,domElement:a,reactDom:dC(e),renderType:"function"==typeof(i=e).renderType?i.renderType():i.renderType});e.domElements[t.name]=a,e.renderResults[t.name]=s})}function dO(e,t){return new Promise(function(r){e.unmountResolves[t.name]=r;var n=e.renderResults[t.name];n&&n.unmount?n.unmount():dC(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function dP(e,t){return new Promise(function(r){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(r);var n=dk(e,t,null),i=e.renderResults[t.name];if(i&&i.render)i.render(n);else{var o=dw(e,t)();dC(e).render(n,o)}})}function dC(e){return e.ReactDOMClient||e.ReactDOM}function dk(e,t,r){var n=e.React.createElement(e.rootComponent,t),i=dx?e.React.createElement(dx.Provider,{value:t},n):n;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function r(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},r.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return r.prototype=Object.create(e.React.Component.prototype),r.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},r.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},r}(e,t),i=e.React.createElement(e.errorBoundaryClass,t,i)),i=e.React.createElement(e.SingleSpaRoot,db(db({},t),{},{mountFinished:r,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])}}),i)}var dT=r(58779),dj=r(59324),dR=r(14993);let dA={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},dM=new Map;(0,dR.r2)(dM);let dN={errorRetryCount:3,fetcher:n9,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof ie){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>dM};function dI(e,t){return function(e){if("object"!==dv(e))throw Error("single-spa-react requires a configuration object");var t,r=db(db({},dE),e);if(!r.React)throw Error("single-spa-react must be passed opts.React");if(!r.ReactDOM&&!r.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(r.renderType||(null!=(t=r.ReactDOMClient)&&t.createRoot?r.renderType="createRoot":r.renderType="render"),!r.rootComponent&&!r.loadRootComponent)throw Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(r.errorBoundary&&"function"!=typeof r.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!dx&&r.React.createContext&&(dx=r.React.createContext()),r.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}(r);var n={bootstrap:dS.bind(null,r),mount:dD.bind(null,r),unmount:dO.bind(null,r)};return r.parcelCanUpdate&&(n.update=dP.bind(null,r)),n}({React:c3(),ReactDOMClient:dy,rootComponent:(function(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},dA,e),r={...dN,...t.swrConfig};return function(e){var n,i,o,a,s;return o=i=class extends(n=c3().Component){componentDidCatch(e,r){r&&r.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:r.componentStack})),t.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:r})}render(){if(this.state.caughtError)return c3().createElement("div",null,"An error has occurred. Please try reloading the page.");{let n=c3().createElement(c1.Suspense,{fallback:null},c3().createElement(dj.BE,{value:r},c3().createElement(dt.Provider,{value:this.state.config},t.disableTranslations?c3().createElement(e,this.props):c3().createElement(dT.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},c3().createElement(e,this.props)))));return t.strictMode&&c3().StrictMode?c3().createElement(c3().StrictMode,null,n):n}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},a="displayName",s=`OpenmrsReactComponent(${t.featureName})`,a in o?Object.defineProperty(o,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[a]=s,i}})(t)(e)})}function d$(e,t){return()=>e().then(({default:e})=>dI(e,t))}function dL(e,t){return()=>Promise.resolve(dI(e,t))}let dF=d$,dB=new Map;function dV(e,t){let r=(0,c1.useRef)(t??{}),n=(0,c1.useRef)(t=>iE(e,t)),i=(0,c1.useRef)(Symbol());return(0,c1.useEffect)(()=>{let r=t??{},n=i.current;return null===ix(e)?i_(e,r):(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.`),iE(e,()=>r)),dB.set(e,n),()=>{dB.get(e)===n&&(iw(e),dB.delete(e))}},[e]),(0,c1.useEffect)(()=>{let n=t??{};M(r.current,n)||(iE(e,()=>n),r.current=n)},[t]),n.current}function dU({namespace:e,value:t}){return dV(e,t),null}let dW=({children:e,value:t,fallback:r})=>t?c3().createElement(c3().Fragment,null,e):r?c3().createElement(c3().Fragment,null,r):null;function dK(){let e=(0,c1.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,c1.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function dH(e,t=e=>e??{}){let[r,n]=(0,c1.useState)(()=>{if(dz(e))return;let r=ix(e);if(null!==r)return t?t(r):r});return(0,c1.useEffect)(()=>{if(dz(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,c1.useEffect)(()=>iS(e,e=>{if(null==e)return void n(void 0);let r=t?t(e):e;n(e=>M(e,r)?e:r)}),[e,t]),r}function dz(e){return"string"!=typeof e||0===e.trim().length}function dq(e){let t=df(e);return(0,c1.useMemo)(()=>t.map(e=>e.id),[t])}function dG(e,t){let{data:r,error:n,mutate:i,isLoading:o,isValidating:a}=(0,dj.Ay)(`${og}?patient=${e}&includeEncounterless=${t}`,n9);return(0,c1.useMemo)(()=>({isLoading:o,data:r?.data.results??[],error:n,mutate:i,isValidating:a}),[r,n,o,a,i])}function dZ(e){(0,c1.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}let dY={},dJ=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
16
- Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function dQ(e){let{moduleName:t,extension:r}=(0,c1.useContext)(dt),n=e?.externalModuleName??t;if(!n&&!r)throw Error(dJ);let i=function(e){let t=(0,c1.useMemo)(()=>tF(e),[e]),r=function(e){let[t,r]=(0,c1.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,c1.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&r(e.config)}),[e]),t}(t);if(!r)throw dY[e]||(dY[e]=new Promise(e=>{let r=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),r())})})),dY[e];return r}(n),o=function(e){let t=(0,c1.useMemo)(tV,[]),r=function(e,t){let[r,n]=(0,c1.useState)(t?()=>{let r=tU(e.getState(),t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null);return(0,c1.useEffect)(()=>{if(t)return e.subscribe(e=>{let i=tU(e,t.extensionSlotName,t.extensionId);i.loaded&&i.config&&!ti(i.config,r)&&n(i.config)})},[e,t,r]),r}(t,e);if(!r&&e){let r=`${e.extensionSlotName}-${e.extensionId}`;throw!dY[r]&&t&&(dY[r]=new Promise(r=>{let n=t.subscribe(t=>{let i=tU(t,e.extensionSlotName,e.extensionId);i.loaded&&i.config&&(r(i.config),n())})})),dY[r]}return r||{}}(r);return(0,c1.useMemo)(()=>e?.externalModuleName&&n===e.externalModuleName?{...i}:{...i,...o},[n,e?.externalModuleName,i,o])}let dX=df;function d0(){let[e,t]=(0,c1.useState)(u5());return(0,c1.useEffect)(()=>g(({online:e})=>t(e)),[]),e}function d1(e,t=300){let[r,n]=(0,c1.useState)(e);return(0,c1.useEffect)(()=>{let r=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(r)}},[e,t]),r}var d3=r(54225);let d4=`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 d2(){let e=`${n2}/emrapi/configuration?v=${d4}`,t=(0,d3.A)(e,n9);return(0,c1.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}function d6(e){let t=df(e);return(0,c1.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}ds(ct());let d5=ds(cs());function d8(e){let{flags:t}=di(u4);return t[e]?.enabled??!1}function d9(){let[,e]=(0,c1.useState)(0);return(0,c1.useCallback)(()=>{e(e=>e+1)},[])}function d7(e,t,r={}){return ft(e,t,fe,r)}let fe={getPaginatedUrl:(e,t,r)=>{if(!e)return null;{let n=new URL(n8(e.toString()),window.location.toString());return n.searchParams.set("limit",""+t),n.searchParams.set("startIndex",""+r),n.searchParams.set("totalCount","true"),n.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 ft(e,t,r,n={}){let{getPaginatedUrl:i,getTotalCount:o,getCurrentPageSize:a,getData:s}=r,{immutable:l,swrConfig:u}=n,c=n.fetcher??n9,[d,f]=(0,c1.useState)(1),p=(0,c1.useRef)(NaN),h=(0,c1.useRef)(NaN),m=(0,c1.useRef)(d),y=(0,c1.useRef)(!1),g=(0,c1.useRef)(!1),b=e?.toString()??"",[v,w]=(0,c1.useState)(b);b!==v&&(w(b),f(1),m.current=1,p.current=NaN,h.current=NaN,y.current=!1,g.current=!1);let x=(d-1)*t,E=(0,c1.useMemo)(()=>i(e,t,x),[e,t,x]),{data:S,...D}=(l?d3.A:dj.Ay)(E,c,u);S?.data&&(p.current=o(S?.data),h.current=a(S?.data),y.current=!0);let O=Math.ceil(p.current/t),P=(0,c1.useCallback)(e=>{if(!Number.isInteger(e)||e<1)return void console.warn(`useServerPagination: ignoring goTo(${e}); page must be a positive integer.`);let r=Math.ceil(p.current/t);!y.current||Number.isNaN(r)||e<=r?(m.current=e,f(e)):console.warn("Invalid attempt to go to out of bounds page: "+e)},[t]);(0,c1.useEffect)(()=>{if(!y.current)return;if(Number.isNaN(p.current)){g.current||(g.current=!0,console.warn(`useServerPagination: ${b} 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}.`),m.current=e,f(e))},[d,t,b,S]);let C=(0,c1.useCallback)(()=>{P(m.current+1)},[P]),k=(0,c1.useCallback)(()=>{P(m.current-1)},[P]);return{data:s(S?.data),totalPages:O,totalCount:p.current,currentPage:d,currentPageSize:h.current,paginated:O>1,showNextButton:d<O,showPreviousButton:d>1,goTo:P,goToNext:C,goToPrevious:k,...D}}function fr(e,t,r={}){return ft(e,t,fn(),r)}function fn(){return{getPaginatedUrl:(e,t,r)=>{if(!e)return null;{let n=new URL(n8(e.toString()),window.location.toString());return n.searchParams.set("_count",""+t),n.searchParams.set("_getpagesoffset",""+r),n.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 fi=r(19888);let fo=c3().use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}),fa={dedupe:!0};dR.qv.defineProperty(dR.BE,"defaultValue",{value:dR.sb});let fs=(0,dR.qm)((e,t,r)=>{let{cache:n,compare:i,suspense:o,fallbackData:a,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f}=r,[p,h,m,y]=dR.bZ.get(n),[g,b]=(0,dR.lK)(e),v=(0,c1.useRef)(!1),w=(0,c1.useRef)(!1),x=(0,c1.useRef)(g),E=(0,c1.useRef)(t),S=(0,c1.useRef)(r),D=()=>S.current.isVisible()&&S.current.isOnline(),[O,P,C,k]=(0,dR.r9)(n,g),T=(0,c1.useRef)({}).current,j=(0,dR.b0)(a)?r.fallback[g]:a,R=(e,t)=>{for(let r in T)if("data"===r){if(!i(e[r],t[r])&&(!(0,dR.b0)(e[r])||!i(V,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},A=(0,c1.useMemo)(()=>{let e=!!g&&!!t&&((0,dR.b0)(s)?!S.current.isPaused()&&!o&&(!!(0,dR.b0)(l)||l):s),r=t=>{let r=(0,dR.rL)(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=O(),i=k(),a=r(n),u=n===i?a:r(i),c=a;return[()=>{let e=r(O());return R(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>u]},[n,g]),M=(0,fi.useSyncExternalStore)((0,c1.useCallback)(e=>C(g,(t,r)=>{R(r,t)||e()}),[n,g]),A[0],A[1]),N=!v.current,I=p[g]&&p[g].length>0,$=M.data,L=(0,dR.b0)($)?j:$,F=M.error,B=(0,c1.useRef)(L),V=f?(0,dR.b0)($)?B.current:$:L,U=(!I||!!(0,dR.b0)(F))&&(N&&!(0,dR.b0)(s)?s:!S.current.isPaused()&&(o?!(0,dR.b0)(L)&&l:(0,dR.b0)(L)||l)),W=!!(g&&t&&N&&U),K=(0,dR.b0)(M.isValidating)?W:M.isValidating,H=(0,dR.b0)(M.isLoading)?W:M.isLoading,z=(0,c1.useCallback)(async e=>{let t,n,o=E.current;if(!g||!o||w.current||S.current.isPaused())return!1;let a=!0,s=e||{},l=!m[g]||!s.dedupe,u=()=>dR.dO?!w.current&&g===x.current&&v.current:g===x.current,c={isValidating:!1,isLoading:!1},d=()=>{P(c)},f=()=>{let e=m[g];e&&e[1]===n&&delete m[g]},y={isValidating:!0};(0,dR.b0)(O().data)&&(y.isLoading=!0);try{if(l&&(P(y),r.loadingTimeout&&(0,dR.b0)(O().data)&&setTimeout(()=>{a&&u()&&S.current.onLoadingSlow(g,r)},r.loadingTimeout),m[g]=[o(b),(0,dR.lg)()]),[t,n]=m[g],t=await t,l&&setTimeout(f,r.dedupingInterval),!m[g]||m[g][1]!==n)return l&&u()&&S.current.onDiscarded(g),!1;c.error=dR.ZH;let e=h[g];if(!(0,dR.b0)(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return d(),l&&u()&&S.current.onDiscarded(g),!1;let s=O().data;c.data=i(s,t)?s:t,l&&u()&&S.current.onSuccess(t,g,r)}catch(r){f();let e=S.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=r,l&&u()&&(e.onError(r,g,e),(!0===t||(0,dR.Tn)(t)&&t(r))&&(!S.current.revalidateOnFocus||!S.current.revalidateOnReconnect||D())&&e.onErrorRetry(r,g,e,e=>{let t=p[g];t&&t[0]&&t[0](dR.bu.ERROR_REVALIDATE_EVENT,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return a=!1,d(),!0},[g,n]),q=(0,c1.useCallback)((...e)=>(0,dR.mF)(n,x.current,...e),[]);if((0,dR.Es)(()=>{E.current=t,S.current=r,(0,dR.b0)($)||(B.current=$)}),(0,dR.Es)(()=>{if(!g)return;let e=z.bind(dR.ZH,fa),t=0,r=(0,dR.aw)(g,p,(r,n={})=>{if(r==dR.bu.FOCUS_EVENT){let r=Date.now();S.current.revalidateOnFocus&&r>t&&D()&&(t=r+S.current.focusThrottleInterval,e())}else if(r==dR.bu.RECONNECT_EVENT)S.current.revalidateOnReconnect&&D()&&e();else if(r==dR.bu.MUTATE_EVENT)return z();else if(r==dR.bu.ERROR_REVALIDATE_EVENT)return z(n)});return w.current=!1,x.current=g,v.current=!0,P({_k:b}),U&&((0,dR.b0)(L)||dR.X3?e():(0,dR.mf)(e)),()=>{w.current=!0,r()}},[g]),(0,dR.Es)(()=>{let e;function t(){let t=(0,dR.Tn)(u)?u(O().data):u;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!O().error&&(c||S.current.isVisible())&&(d||S.current.isOnline())?z(fa).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[u,c,d,g]),(0,c1.useDebugValue)(V),o&&(0,dR.b0)(L)&&g){if(!dR.dO&&dR.X3)throw Error("Fallback data is required when using suspense in SSR.");E.current=t,S.current=r,w.current=!1;let e=y[g];if((0,dR.b0)(e)||fo(q(e)),(0,dR.b0)(F)){let e=z(fa);(0,dR.b0)(V)||(e.status="fulfilled",e.value=!0),fo(e)}else throw F}return{mutate:q,get data(){return T.data=!0,V},get error(){return T.error=!0,F},get isValidating(){return T.isValidating=!0,K},get isLoading(){return T.isLoading=!0,H}}}),fl=Promise.resolve(),fu=(0,dR.Ht)(fs,e=>(t,r,n)=>{let i,o=(0,c1.useRef)(!1),{cache:a,initialSize:s=1,revalidateAll:l=!1,persistSize:u=!1,revalidateFirstPage:c=!0,revalidateOnMount:d=!1,parallel:f=!1}=n,[,,,p]=dR.bZ.get(dR.PP);try{(i=(0,dR.lK)(t?t(0,null):null)[0])&&(i=dR.q9+i)}catch(e){}let[h,m,y]=(0,dR.r9)(a,i),g=(0,c1.useCallback)(()=>(0,dR.b0)(h()._l)?s:h()._l,[a,i,s]);(0,fi.useSyncExternalStore)((0,c1.useCallback)(e=>i?y(i,()=>{e()}):()=>{},[a,i]),g,g);let b=(0,c1.useCallback)(()=>{let e=h()._l;return(0,dR.b0)(e)?s:e},[i,s]),v=(0,c1.useRef)(b());(0,dR.Es)(()=>{if(!o.current){o.current=!0;return}i&&m({_l:u?v.current:b()})},[i,a]);let w=d&&!o.current,x=e(i,async e=>{let i=h()._i,o=h()._r;m({_r:dR.ZH});let s=[],u=b(),[d]=(0,dR.r9)(a,e),y=d().data,g=[],v=null;for(let e=0;e<u;++e){let[u,d]=(0,dR.lK)(t(e,f?null:v));if(!u)break;let[h,m]=(0,dR.r9)(a,u),b=h().data,x=l||i||(0,dR.b0)(b)||c&&!e&&!(0,dR.b0)(y)||w||y&&!(0,dR.b0)(y[e])&&!n.compare(y[e],b);if(r&&("function"==typeof o?o(b,d):x)){let t=async()=>{if(u in p){let e=p[u];delete p[u],b=await e}else b=await r(d);m({data:b,_k:d}),s[e]=b};f?g.push(t):await t()}else s[e]=b;f||(v=b)}return f&&await Promise.all(g.map(e=>e())),m({_i:dR.ZH}),s},n),E=(0,c1.useCallback)(function(e,t){let r="boolean"==typeof t?{revalidate:t}:t||{},n=!1!==r.revalidate;return i?(n&&((0,dR.b0)(e)?m({_i:!0,_r:r.revalidate}):m({_i:!1,_r:r.revalidate})),arguments.length?x.mutate(e,{...r,revalidate:n}):x.mutate()):fl},[i,a]),S=(0,c1.useCallback)(e=>{let r;if(!i)return fl;let[,n]=(0,dR.r9)(a,i);if((0,dR.Tn)(e)?r=e(b()):"number"==typeof e&&(r=e),"number"!=typeof r)return fl;n({_l:r}),v.current=r;let o=[],[s]=(0,dR.r9)(a,i),l=null;for(let e=0;e<r;++e){let[r]=(0,dR.lK)(t(e,l)),[n]=(0,dR.r9)(a,r),i=r?n().data:dR.ZH;if((0,dR.b0)(i))return E(s().data);o.push(i),l=i}return E(o)},[i,a,E,b]);return{size:b(),setSize:S,mutate:E,get data(){return x.data},get error(){return x.error},get isValidating(){return x.isValidating},get isLoading(){return x.isLoading}}});function fc(e,t={}){return fd(e,fe,t)}function fd(e,t,r={}){let{swrInfiniteConfig:n,immutable:i}=r,{getNextUrl:o,getTotalCount:a,getData:s}=t,l=r.fetcher??n9,{data:u,size:c,setSize:d,...f}=fu((0,c1.useCallback)((r,n)=>0==r?e?.toString()??null:t.getNextUrl(n.data),[e]),l,{...n,...i?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),p=o(u?.[u.length-1].data),h=a(u?.[0]?.data);return{data:u?.flatMap(e=>s(e.data)),totalCount:h,hasMore:null!=p,loadMore:()=>{d((u?.length??0)+1)},nextUri:p,...f}}function ff(e,t={}){return fp(e,fe,t)}function fp(e,t,r={}){let n=fd(e,t,r),{hasMore:i,error:o,data:a,loadMore:s,isLoading:l,nextUri:u}=n;return((0,c1.useEffect)(()=>{i&&!o&&s()},[i,u]),r.partialData)?n:{...n,data:i||o?void 0:a,isLoading:l||i}}function fh(e,t={}){return fp(e,fn(),t)}function fm(e,t={}){return fd(e,fn(),t)}function fy(){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 fg(){let[e,t]=(0,c1.useState)(fy);return(0,c1.useEffect)(()=>{let e=()=>{t(fy())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let fb=e=>"small-desktop"===e||"large-desktop"===e;function fv(e){let t=(0,c1.useContext)(dt);(0,c1.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),cI(e),()=>{c$(e.name)}),[t,e])}function f_(){return di(cN)}function fw(e=null,t=null){let[r,n]=(0,c1.useState)([]);return(0,c1.useEffect)(()=>{let r=uk(e,t).subscribe(e=>{n(e)},e=>{console.error(e)});return()=>r.unsubscribe()},[e,t]),r}function fx(e,t=!0){let r=(0,c1.useRef)(null);return(0,c1.useEffect)(()=>{let n=n=>{t&&r.current&&n.target&&n.target instanceof Node&&(r.current.contains(n.target)||e(n))};return window.addEventListener("mousedown",n),window.addEventListener("touchstart",n),()=>{window.removeEventListener("mousedown",n),window.removeEventListener("touchstart",n)}},[e,t]),r}function fE(e){let t=(0,c1.useRef)();return(0,c1.useEffect)(()=>{let r=new IntersectionObserver(t=>{for(let r of t)if(r.isIntersecting)return void e()},{threshold:1});return t.current&&r.observe(t.current),()=>{t.current&&r.unobserve(t.current)}},[t.current,e]),t}function fS(e,t={}){let{abortController:r,fetchInit:n,url:i,swrConfig:o}=t,a=dK(),s=(0,c1.useMemo)(()=>n?.signal??r?.signal??a.signal,[r?.signal,n?.signal,a.signal]),l=(0,c1.useCallback)(e=>n9(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,i),{...n,signal:s}),[s,n,i]);return(0,dj.Ay)(e,l,o)}function fD(e=[],t=10){let[r,n]=(0,c1.useState)(1),i=(0,c1.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]);r>i&&n(i);let o=Math.min(Math.max(1,r),i),a=(0,c1.useMemo)(()=>{let r=(o-1)*t,n=(o+0)*t;return e.slice(r,n)},[e,o,t]),s=(0,c1.useCallback)(e=>{!Number.isInteger(e)||e<1?console.warn(`usePagination: ignoring goTo(${e}); page must be a positive integer.`):n(e)},[]),l=(0,c1.useCallback)(()=>{n(e=>e+1)},[]),u=(0,c1.useCallback)(()=>{n(e=>Math.max(1,e-1))},[]);return(0,c1.useMemo)(()=>({results:a,totalPages:i,currentPage:o,paginated:e.length>t,showNextButton:o<i,showPreviousButton:o>1,goTo:s,goToNext:l,goToPrevious:u}),[a,i,e.length,t,o,s,l,u])}function fO(e,t,r,n){return{pageSizes:(0,c1.useMemo)(()=>{let r=Math.ceil(t/e);return isNaN(r)&&(r=0),[...Array(r).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,c1.useMemo)(()=>e>t?t:e*r>t?e*(r-1)+n:e*r,[e,t,r,n])}}function fP(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function fC(e){let[t,r]=(0,c1.useState)(e??fP()),{data:n,error:i,isValidating:o}=(0,dj.Ay)(t?["patient",t]:null,()=>uf(t,{}));return(0,c1.useEffect)(()=>{let e=()=>{let e=fP();e!==t&&r(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,c1.useMemo)(()=>({isLoading:o&&!i&&!n,patient:n,patientUuid:t,error:i}),[o,i,n,t])}function fk(){let e=`${n2}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:r,isLoading:n}=(0,dj.Ay)(e,n9);return(0,c1.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:n,error:r}),[t,r,n])}function fT(e){let{extensions:t,extensionSlotModuleName:r}=dp(e);return e?t.map(t=>({state:n})=>c3().createElement(dt.Provider,{value:{moduleName:r,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:r}}},c3().createElement(fU,{state:n}))):[]}function fj(){let e=(0,c1.useRef)(),[t,r]=(0,c1.useState)(null),n=null;if(!t){if(s){let e=io().getState();e.loaded&&(n=e.session)}else s=new Promise(t=>{let r=({loaded:r,session:i})=>{r&&(t(i),n=i,e.current&&(e.current(),e.current=void 0))};r(io().getState()),n||(e.current=io().subscribe(r))});if(n)r(n);else throw s}(0,c1.useEffect)(()=>(e.current||(e.current=io().subscribe(({loaded:e,session:t})=>{e&&(n=t,r(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let i=t||n;if(!i)if(s)throw console.warn("useSession is in an unexpected state. Attempting to recover."),s;else throw Error("useSession is in an invalid state.");return i}let fR=({privilege:e,fallback:t,children:r})=>{let[n,i]=(0,c1.useState)(null);return((0,c1.useEffect)(()=>{let e=ii({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()},[]),n&&iu(e,n))?c3().createElement(c3().Fragment,null,r):t?c3().createElement(c3().Fragment,null,t):null};var fA=r(74353),fM=r.n(fA),fN=r(47581);let fI=new Map;function f$(){for(let e of Array.from(fI.values()))e()}let fL={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid}};function fF(e){let t=(0,c1.useId)();return(0,c1.useEffect)(()=>{if(e)return fI.set(t,e),()=>{fI.delete(t)}},[t,e]),{...da(uv(),fL),mutateVisit:f$}}function fB(e,t=ug){let r=(0,c1.useRef)(void 0),{patientUuid:n,manuallySetVisitUuid:i,setVisitContext:o}=fF((0,c1.useCallback)(()=>r.current?.(),[])),a=e&&n==e?i:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${a}?v=${t}`,{data:u,error:c,mutate:d,isValidating:f}=(0,dj.Ay)(e?`${n2}/visit${s}`:null,n9),{data:p,error:h,mutate:m,isValidating:y}=(0,dj.Ay)(e&&a?`${n2}/visit${l}`:null,n9),g=(0,c1.useMemo)(()=>u?.data.results.find(e=>null===e.stopDatetime)??null,[u]),b=(0,c1.useMemo)(()=>a&&p?p.data:null,[p,a]),v=(0,c1.useRef)(null);(0,c1.useEffect)(()=>{!f&&g&&n===e&&null===i&&o(g),y||(v.current&&b&&v.current.uuid===b.uuid&&!v.current.stopDatetime&&b.stopDatetime&&o(null),v.current=b)},[b,i,g,f,y,n]);let w=(0,c1.useCallback)(()=>{d(),m()},[d,m]);(0,c1.useEffect)(()=>{r.current=w},[w]);let x=!!(!u||a&&!p),E=!!(a?h:c);return{error:c||h,mutate:w,isValidating:f||y,activeVisit:g,currentVisit:b,currentVisitIsRetrospective:!!a,isLoading:x&&!E}}function fV(){let[e,t]=(0,c1.useState)([]);return(0,c1.useEffect)(()=>{let e=uP().subscribe(e=>{t(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}fA.extend(fN);let fU=({state:e,children:t,...r})=>{let{extension:n}=(0,c1.useContext)(dt),i=(0,c1.useRef)(null),o=(0,c1.useRef)(Promise.resolve()),a=(0,c1.useRef)(!1),s=(0,c1.useRef)(!1),l=(0,c1.useRef)(e),u=(0,c1.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,c1.useCallback)((e,t)=>{e.update&&"UNMOUNTING"!==e.getStatus()&&(o.current=Promise.all([e.mountPromise,o.current]).then(()=>{if(i.current?.getStatus()==="MOUNTED"&&i.current.update)return i.current.update({...t})}).catch(e=>{let t=i.current?.getStatus();"UNMOUNTING"!==t&&"NOT_MOUNTED"!==t&&"UNLOADING"!==t&&console.error(`The extension '${n?.extensionId}' failed to update`,e)}))},[]),d=(0,c1.useCallback)(t=>{t&&!i.current&&!s.current&&n?.extensionSlotName&&n.extensionSlotModuleName&&(s.current=!0,cW(t,n.extensionSlotName,n.extensionSlotModuleName,n.extensionId,void 0,e).then(t=>{(s.current=!1,i.current=t,a.current)?u(t):t&&l.current!==e&&c(t,l.current)},()=>{s.current=!1}))},[]);return(0,c1.useEffect)(()=>(a.current=!1,()=>{a.current=!0,u(i.current)}),[]),(0,c1.useEffect)(()=>{l.current=e,i.current&&c(i.current,e)},[e]),n?c3().createElement("div",{ref:d,"data-extension-id":n?.extensionId,style:{position:"relative"},...r}):null};var fW=r(74848),fK=r(46942),fH=r.n(fK);function fz({title:e,children:t}){let r="tablet"===fg();return(0,fW.jsxs)("div",{className:fH()({"-esm-form-builder__card-header-module__tabletHeader___rUYi0":r,"-esm-form-builder__card-header-module__desktopHeader___CDa37":!r}),children:[(0,fW.jsx)("h4",{children:e}),t]})}var fq=r(68108);let fG="-esm-form-builder__custom-overflow-menu-module__container___lY3iq",fZ="-esm-form-builder__custom-overflow-menu-module__menu___dReHr",fY="-esm-form-builder__custom-overflow-menu-module__show___48R0e",fJ="-esm-form-builder__custom-overflow-menu-module__overflowMenuButton___tsY8r",fQ=(0,c1.createContext)(null);function fX(){let e=(0,c1.useContext)(fQ);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function f0({menuTitle:e,children:t}){let[r,n]=c3().useState(!1),i=fx(()=>n(!1),r),o="tablet"===fg(),a=(0,c1.useCallback)(()=>n(e=>!e),[]),s=(0,c1.useRef)(null),l=(0,c1.useRef)(null),u=(0,c1.useId)(),c=`custom-overflow-menu-trigger-${u}`,d=`custom-overflow-menu-${u}`,f=(0,c1.useCallback)(()=>{n(!1),s.current?.focus()},[]),p=(0,c1.useMemo)(()=>({closeMenu:f}),[f]),h=(0,c1.useCallback)(e=>{"Escape"===e.key&&r&&(e.stopPropagation(),f())},[f,r]),m=c1.Children.toArray(t);(0,c1.useEffect)(()=>{if(r&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[r]);let y=(0,c1.useCallback)(({currentIndex:e,direction:t})=>{let r=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!r?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,i=Array.from(r).indexOf(n);if(-1===i)return void r[t>0?0:r.length-1]?.focus();let o=i+t,a=o<0?r.length-1:o>=r.length?0:o;r[a]?.focus()},[]),g=m.map((e,t)=>(0,c1.isValidElement)(e)?(0,c1.cloneElement)(e,{closeMenu:f,handleOverflowMenuItemFocus:y,index:t}):e);return(0,fW.jsxs)("div",{"data-overflow-menu":!0,className:fH()("cds--overflow-menu",fG),ref:i,children:[(0,fW.jsx)("button",{className:fH()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":r},fJ),"aria-controls":d,"aria-expanded":r,"aria-haspopup":"true",id:c,onClick:a,onKeyDown:h,ref:s,children:e}),(0,fW.jsxs)("div",{className:fH()("cds--overflow-menu-options","cds--overflow-menu--flip",fZ,{[fY]:r}),"aria-labelledby":c,"data-floating-menu-direction":"bottom",id:d,onKeyDown:h,ref:l,role:"menu",tabIndex:-1,children:[(0,fW.jsx)("ul",{className:fH()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":o}),children:(0,fW.jsx)(fQ.Provider,{value:p,children:g})}),(0,fW.jsx)("span",{})]})]})}function f1(e){let t=(0,c1.useContext)(fQ);return(0,fW.jsx)(fq.XSD,{...e,closeMenu:t?.closeMenu})}let f3={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},f4=e=>(0,fW.jsx)(fq.GGC,{translateWithId:(e,t)=>{let r=f3[e];return r?os(r,e,t):e},...e});var f2=r(47767),f6=r(84976);let f5=["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"],f8=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),f9=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-add",iconProps:e})})),f7=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),pe=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),pt=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),pr=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),pn=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),pi=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),po=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),pa=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),ps=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),pl=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),pu=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),pc=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),pd=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),pf=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),pp=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),ph=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),pm=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),py=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),pg=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),pb=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),pv=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-close",iconProps:e})})),p_=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),pw=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),px=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-document",iconProps:e})})),pE=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),pS=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-download",iconProps:e})})),pD=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),pO=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),pP=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),pC=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-events",iconProps:e})})),pk=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),pT=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),pj=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),pR=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),pA=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),pM=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-group",iconProps:e})})),pN=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),pI=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),p$=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),pL=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-information",iconProps:e})})),pF=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),pB=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),pV=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),pU=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),pW=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),pK=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-location",iconProps:e})})),pH=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),pz=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),pq=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),pG=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),pZ=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),pY=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),pJ=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-money",iconProps:e})})),pQ=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),pX=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),p0=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),p1=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),p3=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-password",iconProps:e})})),p4=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),p2=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),p6=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),p5=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),p8=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),p9=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),p7=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),he=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-report",iconProps:e})})),ht=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),hr=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-save",iconProps:e})})),hn=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-search",iconProps:e})})),hi=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),ho=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),ha=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),hs=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),hl=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),hu=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),hc=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),hd=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-table",iconProps:e})})),hf=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-time",iconProps:e})})),hp=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),hh=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),hm=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),hy=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),hg=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),hb=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),hv=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),h_=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),hw=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-user",iconProps:e})})),hx=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),hE=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-view",iconProps:e})})),hS=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(hj,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),hD=hS,hO=pE,hP=pW,hC=p$,hk=hs,hT=(0,c1.memo)((0,c1.forwardRef)(function({icon:e,fallback:t,...r},n){let i=(0,c1.useRef)(e?document.getElementById(e):void 0);return(0,c1.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),r=new MutationObserver(t=>{for(let r of t)"childList"===r.type&&(i.current=e?document.getElementById(e):void 0)});return t&&r.observe(t,{childList:!0}),()=>r.disconnect()},[e]),(0,fW.jsx)(dW,{value:i.current,fallback:t,children:(0,fW.jsx)(hj,{ref:n,icon:e,iconProps:r})})})),hj=(0,c1.memo)((0,c1.forwardRef)(function({icon:e,iconProps:t},r){let{className:n,fill:i,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 a=(0,c1.useRef)(null);return(0,c1.useImperativeHandle)(r,()=>a.current),(0,c1.useEffect)(()=>{a.current&&"currentColor"!==i&&a.current.style.setProperty("--omrs-icon-fill",i)},[]),(0,fW.jsx)("svg",{ref:a,className:fH()("omrs-icon","-esm-form-builder__icons-module__icon___sq7Qp",n),height:o,width:o,viewBox:"0 0 16 16",children:(0,fW.jsx)("use",{href:`#${e}`})})})),hR=({path:e,title:t,basePath:r,icon:n})=>{let{t:i}=(0,dT.useTranslation)(),o=(0,f2.zy)(),a=(0,c1.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let r=t.split("/").map(e=>decodeURIComponent(e)),n=(o.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return n.some((e,t)=>r.every((e,r)=>n[t+r]===e))},[o.pathname,e]);return(0,fW.jsx)("div",{children:(0,fW.jsx)(c4,{className:fH()("cds--side-nav__link",{"active-left-nav-link":a}),to:`${r}/${encodeURIComponent(e)}`,children:(0,fW.jsxs)("span",{className:"-esm-form-builder__dashboard-module__menu___Lg1M+",children:[(0,fW.jsx)(hT,{icon:n,className:"-esm-form-builder__dashboard-module__icon___Y2DxK",size:16}),(0,fW.jsx)("span",{children:i(t)})]})})},e)};function hA(e){return function({basePath:t}){return(0,fW.jsx)(f6.Kd,{children:(0,fW.jsx)(hR,{basePath:t,...e})})}}function hM(e){let t=(0,c1.useRef)(null),r=(0,c1.useRef)(void 0),n=(0,c1.useCallback)(t=>{if("function"==typeof e){let r=e(t);return()=>{"function"==typeof r?r():e(null)}}if(e)return e.current=t,()=>{e.current=null}},[e]);return(0,c1.useMemo)(()=>({get current(){return t.current},set current(value){t.current=value,r.current&&(r.current(),r.current=void 0),null!=value&&(r.current=n(value))}}),[n])}function hN(...e){return 1===e.length&&e[0]?e[0]:t=>{let r=!1,n=e.map(e=>{let n=hI(e,t);return r||="function"==typeof n,n});if(r)return()=>{n.forEach((t,r)=>{"function"==typeof t?t():hI(e[r],null)})}}}function hI(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function h$(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}let hL="u">typeof document?c3().useLayoutEffect:()=>{},hF={prefix:String(Math.round(1e10*Math.random())),current:0},hB=c3().createContext(hF),hV=c3().createContext(!1),hU=("u">typeof window&&window.document&&window.document.createElement,new WeakMap),hW="function"==typeof c3().useId?function(e){let t=c3().useId(),[r]=(0,c1.useState)(hq()),n=r?"react-aria":`react-aria${hF.prefix}`;return e||`${n}-${t}`}:function(e){let t=(0,c1.useContext)(hB),r=function(e=!1){let t=(0,c1.useContext)(hB),r=(0,c1.useRef)(null);if(null===r.current&&!e){let e=c3().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let r=hU.get(e);null==r?hU.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==r.state&&(t.current=r.id,hU.delete(e))}r.current=++t.current}return r.current}(!!e),n=`react-aria${t.prefix}`;return e||`${n}-${r}`};function hK(){return!1}function hH(){return!0}function hz(e){return()=>{}}function hq(){return"function"==typeof c3().useSyncExternalStore?c3().useSyncExternalStore(hz,hK,hH):(0,c1.useContext)(hV)}let hG=!!("u">typeof window&&window.document&&window.document.createElement),hZ=new Map;function hY(e){let[t,r]=(0,c1.useState)(e),n=(0,c1.useRef)(null),i=hW(t),o=(0,c1.useRef)(null);if(l&&l.register(o,i),hG){let e=hZ.get(i);e&&!e.includes(n)?e.push(n):hZ.set(i,[n])}return hL(()=>()=>{l&&l.unregister(o),hZ.delete(i)},[i]),(0,c1.useEffect)(()=>{let e=n.current;return e&&r(e),()=>{e&&(n.current=null)}}),i}function hJ(e=[]){let t=hY(),[r,n]=function(e){let[t,r]=(0,c1.useState)(e),n=(0,c1.useRef)(t),i=(0,c1.useRef)(null),o=(0,c1.useRef)(()=>{if(!i.current)return;let e=i.current.next();if(e.done){i.current=null;return}n.current===e.value?o.current():r(e.value)});return hL(()=>{n.current=t,i.current&&o.current()}),[t,(0,c1.useCallback)(e=>{i.current=e(n.current),o.current()},[o])]}(t),i=(0,c1.useCallback)(()=>{n(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,n]);return hL(i,[t,i,...e]),r}"u">typeof FinalizationRegistry&&(l=new FinalizationRegistry(e=>{hZ.delete(e)}));let hQ=function(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(r=0;r<o;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n};function hX(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let e in n){let r=t[e],i=n[e];"function"==typeof r&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&90>=e.charCodeAt(2)?t[e]=h$(r,i):("className"===e||"UNSAFE_className"===e)&&"string"==typeof r&&"string"==typeof i?t[e]=hQ(r,i):"id"===e&&r&&i?t.id=function(e,t){if(e===t)return e;let r=hZ.get(e);if(r)return r.forEach(e=>e.current=t),t;let n=hZ.get(t);return n?(n.forEach(t=>t.current=e),e):t}(r,i):"ref"===e&&r&&i?t.ref=hN(r,i):t[e]=void 0!==i?i:r}}return t}let h0=Symbol("default");function h1({values:e,children:t}){for(let[r,n]of e)t=c3().createElement(r.Provider,{value:n},t);return t}function h3(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=e;return(0,c1.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:i}):t,l="function"==typeof r?r({...s,defaultStyle:a||{}}):r,u="function"==typeof n?n({...s,defaultChildren:o}):null==n?o:n,{className:null!=e?e:i,style:l||a?{...a,...l}:void 0,children:null!=u?u:o,"data-rac":""}},[t,r,n,i,o,a,s])}function h4(e,t){let r=(0,c1.useContext)(e);if(null===t)return null;if(r&&"object"==typeof r&&"slots"in r&&r.slots){let e=t||h0;if(!r.slots[e]){let e=new Intl.ListFormat().format(Object.keys(r.slots).map(e=>`"${e}"`)),n=t?`Invalid slot "${t}".`:"A slot prop is required.";throw Error(`${n} Valid slot names are ${e}.`)}return r.slots[e]}return r}function h2(e,t,r){let{ref:n,...i}=h4(r,e.slot)||{},o=hM((0,c1.useMemo)(()=>hN(t,n),[t,n])),a=hX(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&("function"==typeof i.style||"function"==typeof e.style?a.style=t=>{let r="function"==typeof i.style?i.style(t):i.style,n={...t.defaultStyle,...r},o="function"==typeof e.style?e.style({...t,defaultStyle:n}):e.style;return{...n,...o}}:a.style={...i.style,...e.style}),[a,o]}function h6(e=!0){let[t,r]=(0,c1.useState)(e),n=(0,c1.useRef)(!1),i=(0,c1.useCallback)(e=>{n.current=!0,r(!!e)},[]);return hL(()=>{n.current||r(!1)},[]),[i,t]}function h5(e){let t=/^(data-.*)$/,r={};for(let n in e)t.test(n)||(r[n]=e[n]);return r}let h8=(0,c1.createContext)(null),h9=null;function h7(e,t="assertive",r=7e3){h9?h9.announce(e,t,r):(h9=new me,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?h9.announce(e,t,r):setTimeout(()=>{(null==h9?void 0:h9.isAttached())&&(null==h9||h9.announce(e,t,r))},100))}class me{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",r=7e3){var n,i;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==(n=this.assertiveLog)||n.appendChild(o):null==(i=this.politeLog)||i.appendChild(o),""!==e&&setTimeout(()=>{o.remove()},r)}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 mt=new Set(["id"]),mr=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),mn=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),mi=new Set(["dir","lang","hidden","inert","translate"]),mo=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),ma=/^(data-.*)$/;function ms(e,t={}){let{labelable:r,isLink:n,global:i,events:o=i,propNames:a}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(mt.has(t)||r&&mr.has(t)||n&&mn.has(t)||i&&mi.has(t)||o&&(mo.has(t)||t.endsWith("Capture")&&mo.has(t.slice(0,-7)))||a?.has(t)||ma.test(t))&&(s[t]=e[t]);return s}function ml(e){if(function(){if(null==mu){mu=!1;try{document.createElement("div").focus({get preventScroll(){return mu=!0,!0}})}catch{}}return mu}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let mu=null,mc=e=>e?.ownerDocument??document,md=e=>e&&"window"in e&&e.window===e?e:mc(e).defaultView||window;function mf(e,t){return!!t&&!!e&&e.contains(t)}function mp(e){return e.target}function mh(e){if(!e)return!1;let t=e.getRootNode(),r=md(e);if(!(t instanceof r.Document||t instanceof r.ShadowRoot))return!1;let n=t.activeElement;return null!=n&&e.contains(n)}let mm="u">typeof Element&&"checkVisibility"in Element.prototype;function my(e,t){return mm?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):"#comment"!==e.nodeName&&function(e){let t=md(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,i="none"!==r&&"hidden"!==n&&"collapse"!==n;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:r,visibility:n}=t(e);i="none"!==r&&"hidden"!==n&&"collapse"!==n}return i}(e)&&!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))&&(!e.parentElement||my(e.parentElement,e))}let mg=["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"])',"permission"],mb=mg.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";mg.push('[tabindex]:not([tabindex="-1"]):not([disabled])');let mv=mg.join(':not([hidden]):not([tabindex="-1"]),');function m_(e,t){return e.matches(mb)&&!mx(e)&&(t?.skipVisibilityCheck||my(e))}function mw(e){return e.matches(mv)&&my(e)&&!mx(e)}function mx(e){let t=e;for(;null!=t;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function mE(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function mS(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function mD(e){let t=(0,c1.useRef)({isFocused:!1,observer:null});return hL(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]),(0,c1.useCallback)(r=>{let n=mp(r);(n instanceof HTMLButtonElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&(t.current.isFocused=!0,n.addEventListener("focusout",r=>{if(t.current.isFocused=!1,n.disabled){let t=mE(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===((e=document)=>e.activeElement)()?null:((e=document)=>e.activeElement)();n.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),n.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:["disabled"]}))},[e])}let mO=!1;function mP(e){if("u"<typeof window||null==window.navigator)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function mC(e){return"u">typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function mk(e){let t=null;return()=>(null==t&&(t=e()),t)}let mT=mk(function(){return mC(/^Mac/i)}),mj=mk(function(){return mC(/^iPhone/i)}),mR=mk(function(){return mC(/^iPad/i)||mT()&&navigator.maxTouchPoints>1}),mA=mk(function(){return mj()||mR()});mk(function(){return mT()||mA()});let mM=mk(function(){return mP(/AppleWebKit/i)&&!mN()}),mN=mk(function(){return mP(/Chrome/i)}),mI=mk(function(){return mP(/Android/i)}),m$=mk(function(){return mP(/Firefox/i)});function mL(e){return""===e.pointerType&&!!e.isTrusted||(mI()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function mF(e,t,r=!0){let{metaKey:n,ctrlKey:i,altKey:o,shiftKey:a}=t;m$()&&window.event?.type?.startsWith("key")&&"_blank"===e.target&&(mT()?n=!0:i=!0);let s=mM()&&mT()&&!mR()&&1?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:n,ctrlKey:i,altKey:o,shiftKey:a}):new MouseEvent("click",{metaKey:n,ctrlKey:i,altKey:o,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});mF.isOpening=r,ml(e),e.dispatchEvent(s),mF.isOpening=!1}mF.isOpening=!1;let mB=null,mV=new Set,mU=new Map,mW=!1,mK=!1,mH={Tab:!0,Escape:!0};function mz(e,t){for(let r of mV)r(e,t)}function mq(e){mW=!0,mF.isOpening||e.metaKey||!mT()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(mB="keyboard",mz("keyboard",e))}function mG(e){mB="pointer","pointerType"in e&&e.pointerType,("mousedown"===e.type||"pointerdown"===e.type)&&(mW=!0,mz("pointer",e))}function mZ(e){!mF.isOpening&&mL(e)&&(mW=!0,mB="virtual")}function mY(e){let t=md(mp(e)),r=mc(mp(e));mp(e)!==t&&mp(e)!==r&&!mO&&e.isTrusted&&(mW||mK||(mB="virtual",mz("virtual",e)),mW=!1,mK=!1)}function mJ(){mO||(mW=!1,mK=!0)}function mQ(e){if("u"<typeof window||"u"<typeof document)return;let t=md(e),r=mc(e);if(mU.get(t))return;let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){mW=!0,n.apply(this,arguments)},r.addEventListener("keydown",mq,!0),r.addEventListener("keyup",mq,!0),r.addEventListener("click",mZ,!0),t.addEventListener("focus",mY,!0),t.addEventListener("blur",mJ,!1),"u">typeof PointerEvent&&(r.addEventListener("pointerdown",mG,!0),r.addEventListener("pointermove",mG,!0),r.addEventListener("pointerup",mG,!0)),t.addEventListener("beforeunload",()=>{mX(e)},{once:!0}),mU.set(t,{focus:n})}let mX=(e,t)=>{let r=md(e),n=mc(e);t&&n.removeEventListener("DOMContentLoaded",t),mU.has(r)&&(r.HTMLElement.prototype.focus=mU.get(r).focus,n.removeEventListener("keydown",mq,!0),n.removeEventListener("keyup",mq,!0),n.removeEventListener("click",mZ,!0),r.removeEventListener("focus",mY,!0),r.removeEventListener("blur",mJ,!1),"u">typeof PointerEvent&&(n.removeEventListener("pointerdown",mG,!0),n.removeEventListener("pointermove",mG,!0),n.removeEventListener("pointerup",mG,!0)),mU.delete(r))};function m0(){return"pointer"!==mB}"u">typeof document&&("loading"!==(p=mc(void 0)).readyState?mQ(void 0):p.addEventListener("DOMContentLoaded",()=>{mQ(void 0)}));let m1=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),m3=new Map,m4=new Set;function m2(){if("u"<typeof window)return;function e(e){return"propertyName"in e}let t=r=>{let n=mp(r);if(!e(r)||!n)return;let i=m3.get(n);if(i&&(i.delete(r.propertyName),0===i.size&&(n.removeEventListener("transitioncancel",t),m3.delete(n)),0===m3.size)){for(let e of m4)e();m4.clear()}};document.body.addEventListener("transitionrun",r=>{let n=mp(r);if(!e(r)||!n)return;let i=m3.get(n);i||(i=new Set,m3.set(n,i),n.addEventListener("transitioncancel",t,{once:!0})),i.add(r.propertyName)}),document.body.addEventListener("transitionend",t)}function m6(e){requestAnimationFrame(()=>{for(let[e]of m3)"isConnected"in e&&!e.isConnected&&m3.delete(e);0===m3.size?e():m4.add(e)})}function m5(e){if(!e.isConnected)return;let t=mc(e);if("virtual"===mB){let r=((e=document)=>e.activeElement)(t);m6(()=>{let n=((e=document)=>e.activeElement)(t);(n===r||n===t.body)&&e.isConnected&&ml(e)})}else ml(e)}function m8(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:i}=e,o=(0,c1.useCallback)(e=>{if(mp(e)===e.currentTarget)return n&&n(e),i&&i(!1),!0},[n,i]),a=mD(o),s=(0,c1.useCallback)(e=>{let t=mp(e),n=mc(t),o=n?((e=document)=>e.activeElement)(n):((e=document)=>e.activeElement)();t===e.currentTarget&&t===o&&(r&&r(e),i&&i(!0),a(e))},[i,r,a]);return{focusProps:{onFocus:!t&&(r||i||n)?s:void 0,onBlur:!t&&(n||i)?o:void 0}}}function m9(e){if(!e)return;let t=!0;return r=>{e({...r,preventDefault(){r.preventDefault()},isDefaultPrevented:()=>r.isDefaultPrevented(),stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped:()=>t}),t&&r.stopPropagation()}}function m7(e,t){hL(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}"u">typeof document&&("loading"!==document.readyState?m2():document.addEventListener("DOMContentLoaded",m2));let ye=c3().createContext(null);function yt(e,t){let{focusProps:r}=m8(e),{keyboardProps:n}={keyboardProps:e.isDisabled?{}:{onKeyDown:m9(e.onKeyDown),onKeyUp:m9(e.onKeyUp)}},i=hX(r,n),o=function(e){let t=(0,c1.useContext)(ye)||{};m7(t,e);let{ref:r,...n}=t;return n}(t),a=e.isDisabled?{}:o,s=(0,c1.useRef)(e.autoFocus);(0,c1.useEffect)(()=>{s.current&&t.current&&m5(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:hX({...i,tabIndex:l},a)}}c3().forwardRef(function(e,t){let{children:r,...n}=e,i=hM(t),o={...n,ref:i};return c3().createElement(ye.Provider,{value:o},r)});let yr="default",yn="",yi=new WeakMap;function yo(e){if(mA())"disabled"===yr&&(yr="restoring",setTimeout(()=>{m6(()=>{if("restoring"===yr){let t=mc(e);"none"===t.documentElement.style.webkitUserSelect&&(t.documentElement.style.webkitUserSelect=yn||""),yn="",yr="default"}})},300));else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&yi.has(e)){let t=yi.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";"none"===e.style[r]&&(e.style[r]=t),""===e.getAttribute("style")&&e.removeAttribute("style"),yi.delete(e)}}function ya(e){let t=e?.defaultView;return t?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let ys=new WeakMap;function yl(e){let t=e??("u">typeof document?document:void 0);if(!t)return ya(t);if(ys.has(t))return ys.get(t);let r=t.querySelector('meta[property="csp-nonce"]'),n=r&&r instanceof md(r).HTMLMetaElement&&(r.nonce||r.content)||ya(t)||void 0;return void 0!==n&&ys.set(t,n),n}let yu=c3().createContext({register:()=>{}});yu.displayName="PressResponderContext";let yc=c3().useInsertionEffect??hL;function yd(e){let t=(0,c1.useRef)(null);return yc(()=>{t.current=e},[e]),(0,c1.useCallback)((...e)=>{let r=t.current;return r?.(...e)},[])}function yf(){let e=(0,c1.useRef)(new Map),t=(0,c1.useCallback)((t,r,n,i)=>{let o=i?.once?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:o,options:i}),t.addEventListener(r,o,i)},[]),r=(0,c1.useCallback)((t,r,n,i)=>{let o=e.current.get(n)?.fn||n;t.removeEventListener(r,o,i),e.current.delete(n)},[]),n=(0,c1.useCallback)(()=>{e.current.forEach((e,t)=>{r(e.eventTarget,e.type,t,e.options)})},[r]);return(0,c1.useEffect)(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}var yp=r(54575),yh=r.n(yp);class ym{#e;constructor(e,t,r,n){this.#e=!0;let i=n?.target??r.currentTarget;const o=i?.getBoundingClientRect();let a,s=0,l,u=null;null!=r.clientX&&null!=r.clientY&&(l=r.clientX,u=r.clientY),o&&(null!=l&&null!=u?(a=l-o.left,s=u-o.top):(a=o.width/2,s=o.height/2)),this.type=e,this.pointerType=t,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=a,this.y=s,this.key=r.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}let yy=Symbol("linkClicked"),yg="react-aria-pressable-style",yb="data-react-aria-pressable";function yv(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:o,onClick:a,isDisabled:s,isPressed:l,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:f,...p}=function(e){let t=(0,c1.useContext)(yu);if(t){let{register:r,ref:n,...i}=t;e=hX(i,e),r()}return m7(t,e.ref),e}(e),[h,m]=(0,c1.useState)(!1),y=(0,c1.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:b}=yf(),v=(0,c1.useCallback)((e,t)=>{let i=y.current;if(s||i.didFirePressStart)return!1;let o=!0;if(i.isTriggeringEvent=!0,n){let r=new ym("pressstart",t,e);n(r),o=r.shouldStopPropagation}return r&&r(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,m(!0),o},[s,n,r]),w=(0,c1.useCallback)((e,n,o=!0)=>{let a=y.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let l=!0;if(i){let t=new ym("pressend",n,e);i(t),l=t.shouldStopPropagation}if(r&&r(!1),m(!1),t&&o&&!s){let r=new ym("press",n,e);t(r),l&&=r.shouldStopPropagation}return a.isTriggeringEvent=!1,l},[s,i,r,t]),x=yd(w),E=yd((0,c1.useCallback)((e,t)=>{let r=y.current;if(s)return!1;if(o){r.isTriggeringEvent=!0;let n=new ym("pressup",t,e);return o(n),r.isTriggeringEvent=!1,n.shouldStopPropagation}return!0},[s,o])),S=(0,c1.useCallback)(e=>{let t=y.current;if(t.isPressed&&t.target){for(let r of(t.didFirePressStart&&null!=t.pointerType&&w(yx(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,b(),d||yo(t.target),t.disposables))r();t.disposables=[]}},[d,b,w]),D=yd(S),O=(0,c1.useCallback)(e=>{c&&S(e)},[c,S]),P=(0,c1.useCallback)(e=>{s||a?.(e)},[s,a]),C=(0,c1.useCallback)((e,t)=>{if(!s&&a){let r=new MouseEvent("click",e);mS(r,t),a(mE(r))}},[s,a]),k=(0,c1.useMemo)(()=>{let e=y.current,t={onKeyDown(t){if(yw(t.nativeEvent,t.currentTarget)&&mf(t.currentTarget,mp(t))){yE(mp(t),t.key)&&t.preventDefault();let n=!0;e.isPressed||t.repeat||(e.target=t.currentTarget,e.isPressed=!0,e.pointerType="keyboard",n=v(t,"keyboard"));let i=t.currentTarget;g(mc(t.currentTarget),"keyup",h$(t=>{yw(t,i)&&!t.repeat&&mf(i,mp(t))&&e.target&&E(yx(e.target,t),"keyboard")},r),!0),n&&t.stopPropagation(),t.metaKey&&mT()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else"Meta"===t.key&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||mf(t.currentTarget,mp(t)))&&t&&0===t.button&&!e.isTriggeringEvent&&!mF.isOpening){let r=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&("virtual"===e.pointerType||mL(t.nativeEvent))){let e=v(t,"virtual"),n=E(t,"virtual"),i=x(t,"virtual");P(t),r=e&&n&&i}else if(e.isPressed&&"keyboard"!==e.pointerType){let n=e.pointerType||t.nativeEvent.pointerType||"virtual",i=E(yx(t.currentTarget,t),n),o=x(yx(t.currentTarget,t),n,!0);r=i&&o,e.isOverTarget=!1,P(t),D(t)}e.ignoreEmulatedMouseEvents=!1,r&&t.stopPropagation()}}},r=t=>{if(e.isPressed&&e.target&&yw(t,e.target)){yE(mp(t),t.key)&&t.preventDefault();let r=mp(t),n=mf(e.target,r);x(yx(e.target,t),"keyboard",n),n&&C(t,e.target),b(),"Enter"!==t.key&&y_(e.target)&&mf(e.target,r)&&!t[yy]&&(t[yy]=!0,mF(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if("Meta"===t.key&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;for(let r of(e.metaKeyEvents=void 0,t.values()))e.target?.dispatchEvent(new KeyboardEvent("keyup",r))}};if("u">typeof PointerEvent){t.onPointerDown=t=>{var i;if(0!==t.button||!mf(t.currentTarget,mp(t)))return;if(i=t.nativeEvent,!mI()&&0===i.width&&0===i.height||1===i.width&&1===i.height&&0===i.pressure&&0===i.detail&&"mouse"===i.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(mA()){if("default"===yr){let t=mc(e);yn=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}yr="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";yi.set(e,e.style[t]),e.style[t]="none"}}(e.target),o=v(t,e.pointerType);let i=mp(t);"releasePointerCapture"in i&&("hasPointerCapture"in i?i.hasPointerCapture(t.pointerId)&&i.releasePointerCapture(t.pointerId):i.releasePointerCapture(t.pointerId)),g(mc(t.currentTarget),"pointerup",r,!1),g(mc(t.currentTarget),"pointercancel",n,!1)}o&&t.stopPropagation()},t.onMouseDown=t=>{if(mf(t.currentTarget,mp(t))&&0===t.button){if(u){let r=function(e){for(;e&&!m_(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=md(e),r=t.document.activeElement;if(!r||r===e)return;mO=!0;let n=!1,i=e=>{(mp(e)===r||n)&&e.stopImmediatePropagation()},o=t=>{(mp(t)===r||n)&&(t.stopImmediatePropagation(),e||n||(n=!0,ml(r),l()))},a=t=>{(mp(t)===e||n)&&t.stopImmediatePropagation()},s=t=>{(mp(t)===e||n)&&(t.stopImmediatePropagation(),n||(n=!0,ml(r),l()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",o,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",a,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",o,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",a,!0),mO=!1,n=!1},u=requestAnimationFrame(l);return l}(t.target);r&&e.disposables.push(r)}t.stopPropagation()}},t.onPointerUp=t=>{mf(t.currentTarget,mp(t))&&"virtual"!==e.pointerType&&(0!==t.button||e.isPressed||E(t,e.pointerType||t.pointerType))},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!0,v(yx(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!1,x(yx(e.target,t),e.pointerType,!1),O(t))};let r=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&e.target){if(mf(e.target,mp(t))&&null!=e.pointerType){let r=!1,n=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(r?D(t):(ml(e.target),e.target.click()))},80);g(t.currentTarget,"click",()=>r=!0,!0),e.disposables.push(()=>clearTimeout(n))}else D(t);e.isOverTarget=!1}},n=e=>{D(e)};t.onDragStart=e=>{mf(e.currentTarget,mp(e))&&D(e)}}return t},[g,s,u,b,d,O,v,P,C]);return(0,c1.useEffect)(()=>{if(!f)return;let e=mc(f.current);if(!e||!e.head||e.getElementById(yg))return;let t=e.createElement("style");t.id=yg;let r=yl(e);r&&(t.nonce=r),t.textContent=`
15
+ ${this.stack}`}}let it=K("session",{loaded:!1,session:null}),ir=0;function ii(e={includeAuthStatus:!0}){return(ir<Date.now()-6e4||!it.getState().loaded)&&is(),new ea.Observable(t=>{let r=r=>{r.loaded&&(e.includeAuthStatus?t.next(r.session):t.next(r.session?.user))};return r(it.getState()),it.subscribe(r)})}function io(){return(ir<Date.now()-6e4||!it.getState().loaded)&&is(),it}function ia(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 is(e,t){ir=Date.now();let r={};return e&&t&&(r.Authorization=`Basic ${window.btoa(`${e}:${t}`)}`),im(n9(n5,{headers:r}))}function il(){it.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function iu(e,t){var r,n;if(void 0===t)return!e;if(!e)return!0;return r=e,n=t,("string"==typeof r?!Z(n.privileges.find(e=>r===e.display)):Array.isArray(r)?r.every(e=>!Z(n.privileges.find(t=>e===t.display))):(Z(r)||console.error(`Could not understand privileges "${r}"`),!0))||!Z(t.roles.find(e=>"System Developer"===e.display))}function ic(){let e,t;return new Promise(r=>{let n=n=>{n.loaded&&n.session.user&&(e=n.session.user,r(n.session.user),t&&t())};n(it.getState()),e||(t=it.subscribe(n))})}function id(){return new Promise((e,t)=>{ii().subscribe(t=>{e(t.sessionLocation)},t).unsubscribe()})}async function ip(e,t){return im(n9(n5,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}))}async function ih(e,t,r){return r||(r=new AbortController),await n9(`${n2}/user/${e}`,{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:r.signal}),is()}function im(e){return new Promise((t,r)=>{e.then(e=>{let n;"object"==typeof e?.data?(n={loaded:!0,session:e.data},it.setState(n),t(n)):(n={loaded:!1,session:null},it.setState(n),r(n))}).catch(e=>{T(`Failed to fetch new session information: ${e}`);let t={loaded:!1,session:null};it.setState(t),r(t)})})}function iy(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}it.subscribe(e=>{e.loaded&&e.session&&ia(e.session)});let ig={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"},ib=L()(()=>({}));H("openmrs-app-context",ib);let iv={};function i_(e,t=iv){ib.setState(r=>{if(e in r)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({},r,{[e]:t===iv?{}:t})})}function iw(e){ib.setState(t=>(e in t&&delete t[e],t))}function ix(e,t=e=>e){let r=ib.getState();return e in r?Object.freeze(Object.assign({},t?t(r[e]):r[e])):null}function iE(e,t){ib.setState(r=>(e in r||(r[e]={}),r[e]=t(r[e]),Object.assign({},r)))}function iS(e,t){let r=ix(e);return t(iD(r)),ib.subscribe(n=>{let i=e in n?n[e]:null;i!==r&&(r=i,t(iD(i)))})}function iD(e){return null===e?null:Object.freeze(Object.assign({},e))}let iO={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",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"},iP=e=>"string"==typeof e,iC=()=>{let e,t,r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},ik=e=>null==e?"":""+e,ij=/###/g,iT=e=>e&&e.indexOf("###")>-1?e.replace(ij,"."):e,iR=e=>!e||iP(e),iA=(e,t,r)=>{let n=iP(t)?t.split("."):t,i=0;for(;i<n.length-1;){if(iR(e))return{};let t=iT(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return iR(e)?{}:{obj:e,k:iT(n[i])}},iM=(e,t,r)=>{let{obj:n,k:i}=iA(e,t,Object);if(void 0!==n||1===t.length){n[i]=r;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=iA(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,s=iA(e,a=a.slice(0,a.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=r},iN=(e,t)=>{let{obj:r,k:n}=iA(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},iI=(e,t,r)=>{for(let n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?iP(e[n])||e[n]instanceof String||iP(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):iI(e[n],t[n],r):e[n]=t[n]);return e};var i$={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let iL=e=>iP(e)?e.replace(/[&<>"'\/]/g,e=>i$[e]):e,iF=[" ",",","?","!",";"],iB=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 r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),iV=(e,t,r=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let n=t.split(r),i=e;for(let e=0;e<n.length;){let t;if(!i||"object"!=typeof i)return;let o="";for(let a=e;a<n.length;++a)if(a!==e&&(o+=r),o+=n[a],void 0!==(t=i[o])){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<n.length-1)continue;e+=a-e+1;break}i=t}return i},iU=e=>e?.replace("_","-"),iW={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 iK{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||iW,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,r,n){return n&&!this.debug?null:(iP(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new iK(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new iK(this.logger,e)}}var iH=new iK;class iz{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let r=this.observers[e].get(t)||0;this.observers[e].set(t,r+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,r])=>{for(let n=0;n<r;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r.apply(r,[e,...t])})}}class iq extends iz{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,r,n={}){let i,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],r&&(Array.isArray(r)?i.push(...r):iP(r)&&o?i.push(...r.split(o)):i.push(r)));let s=iN(this.data,i);return(!s&&!t&&!r&&e.indexOf(".")>-1&&(e=i[0],t=i[1],r=i.slice(2).join(".")),!s&&a&&iP(r))?iV(this.data?.[e]?.[t],r,o):s}addResource(e,t,r,n,i={silent:!1}){let o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),iM(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(let n in r)(iP(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=r,r=t,t=a[1]),this.addNamespaces(t);let s=iN(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?iI(s,r,i):s={...s,...r},iM(this.data,a,s),o.silent||this.emit("added",e,t,r)}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 iG={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(e=>{t=this.processors[e]?.process(t,r,n,i)??t}),t}};let iZ=Symbol("i18next/PATH_KEY");function iY(e,t){let r,n,i,{[iZ]:o}=e((n=[],(i=Object.create(null)).get=(e,t)=>(r?.revoke?.(),t===iZ)?n:(n.push(t),(r=Proxy.revocable(e,i)).proxy),Proxy.revocable(Object.create(null),i).proxy));return o.join(t?.keySeparator??".")}let iJ={},iQ=e=>!iP(e)&&"boolean"!=typeof e&&"number"!=typeof e;class iX extends iz{constructor(e,t={}){super(),((e,t,r)=>{e.forEach(e=>{t[e]&&(r[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=iH.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let r={...t};if(null==e)return!1;let n=this.resolve(e,r);if(n?.res===void 0)return!1;let i=iQ(n.res);return!1!==r.returnObjects||!i}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,r)=>{t=t||"",r=r||"";let n=iF.filter(e=>0>t.indexOf(e)&&0>r.indexOf(e));if(0===n.length)return!0;let i=iB.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`),o=!i.test(e);if(!o){let t=e.indexOf(r);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,r,n);if(o&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:iP(i)?[i]:i};let o=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(n)}return{key:e,namespaces:iP(i)?[i]:i}}translate(e,t,r){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=iY(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);let i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1],u=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?i?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a;let f=this.resolve(e,n),p=f?.res,h=f?.usedKey||a,m=f?.exactUsedKey||a,y=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==n.count&&!iP(n.count),v=iX.hasDefaultValue(n),w=b?this.pluralResolver.getSuffix(c,n.count,n):"",x=n.ordinal&&b?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",E=b&&!n.ordinal&&0===n.count,S=E&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${w}`]||n[`defaultValue${x}`]||n.defaultValue,D=p;g&&!p&&v&&(D=S);let O=iQ(D),P=Object.prototype.toString.apply(D);if(g&&D&&O&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(P)&&!(iP(y)&&Array.isArray(D))){if(!n.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(h,D,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(f.res=e,f.usedParams=this.getUsedParamsDetails(n),f):e}if(o){let e=Array.isArray(D),t=e?[]:{},r=e?m:h;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let i=`${r}${o}${e}`;v&&!p?t[e]=this.translate(i,{...n,defaultValue:iQ(S)?S[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(i,{...n,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=D[e])}p=t}}else if(g&&iP(y)&&Array.isArray(p))(p=p.join(y))&&(p=this.extendTranslation(p,e,n,r));else{let t=!1,i=!1;!this.isValidLookup(p)&&v&&(t=!0,p=S),this.isValidLookup(p)||(i=!0,p=a);let s=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:p,d=v&&S!==p&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,a,d?S:p),o){let e=this.resolve(a,{...n,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,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=v&&r!==p?r:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,n),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);E&&n[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],a+t,n[`defaultValue${t}`]||S)})}):r(e,a,S))}p=this.extendTranslation(p,e,n,f,r),i&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}${u}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,t?p:void 0,n))}return i?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(e,t,r,n,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let o;r.interpolation&&this.interpolator.init({...r,...{interpolation:{...this.options.interpolation,...r.interpolation}}});let a=iP(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=r.replace&&!iP(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,r.lng||this.language||n.usedLng,r),a){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||r.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}let o=r.postProcess||this.options.postProcess,a=iP(o)?[o]:o;return null!=e&&a?.length&&!1!==r.applyPostProcessor&&(e=iG.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,n,i,o,a;return iP(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(r))return;let s=this.extractFromKey(e,t),l=s.key;n=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==t.count&&!iP(t.count),d=c&&!t.ordinal&&0===t.count,f=void 0!==t.context&&(iP(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(r)||(a=e,!iJ[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(iJ[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" 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(n=>{let a;if(this.isValidLookup(r))return;o=n;let s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,n,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(n,t.count,t));let r=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(i)&&s.push(l+e.replace(i,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+r)),f){let n=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(n),c&&(t.ordinal&&0===e.indexOf(i)&&s.push(n+e.replace(i,this.options.pluralSeparator)),s.push(n+e),d&&s.push(n+r))}}for(;a=s.pop();)this.isValidLookup(r)||(i=a,r=this.getResource(n,e,a,t))}))})}),{res:r,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(e={}){let t=e.replace&&!iP(e.replace),r=t?e.replace:e;if(t&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!t)for(let e of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[e];return r}static hasDefaultValue(e){let t="defaultValue";for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}class i0{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=iH.create("languageUtils")}getScriptPartFromCode(e){if(!(e=iU(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=iU(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(iP(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 r=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(r))&&(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let r=this.getScriptPartFromCode(e);if(this.isSupportedCode(r))return t=r;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&(e.indexOf("-")>0&&0>n.indexOf("-")&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.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)),iP(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){let r=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],i=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return iP(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):iP(e)&&i(this.formatLanguageCode(e)),r.forEach(e=>{0>n.indexOf(e)&&i(this.formatLanguageCode(e))}),n}}let i1={zero:0,one:1,two:2,few:3,many:4,other:5},i3={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class i4{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=iH.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let r,n=iU("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{r=new Intl.PluralRules(n,{type:i})}catch(i){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),i3;if(!e.match(/-|_/))return i3;let n=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(n,t)}return this.pluralRulesCache[o]=r,r}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return(r||(r=this.getRule("dev",t)),r)?r.resolvedOptions().pluralCategories.sort((e,t)=>i1[e]-i1[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,r={}){let n=this.getRule(e,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}let i2=(e,t,r,n=".",i=!0)=>{let o,a=void 0!==(o=iN(e,r))?o:iN(t,r);return!a&&i&&iP(r)&&void 0===(a=iV(e,r,n))&&(a=iV(t,r,n)),a};class i6{constructor(e={}){this.logger=iH.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:r,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:g}=e.interpolation;this.escape=void 0!==t?t:iL,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):o||"{{",this.suffix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):f||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=p?p.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==g&&g,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,r,n){let i,o,a,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(0>e.indexOf(this.formatSeparator)){let i=i2(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,r,{...n,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(i2(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,r,{...n,...t,interpolationkey:o})};this.resetRegExp();let u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.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(a=0;i=t.regex.exec(e);){let r=i[1].trim();if(void 0===(o=l(r)))if("function"==typeof u){let t=u(e,i,n);o=iP(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))o="";else if(c){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),o="";else iP(o)||this.useRawValueToEscape||(o=ik(o));let s=t.safeValue(o);if(e=e.replace(i[0],s),c?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t,r={}){let n,i,o,a=(e,t)=>{let r=this.nestingOptionsSeparator;if(0>e.indexOf(r))return e;let n=e.split(RegExp(`${r}[ ]*{`)),i=`{${n[1]}`;e=n[0];let a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);((a?.length??0)%2!=0||s)&&s.length%2==0||(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];(o=(o={...r}).replace&&!iP(o.replace)?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let l=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==l&&(s=n[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,l)),(i=t(a.call(this,n[1].trim(),o),o))&&n[0]===e&&!iP(i))return i;iP(i)||(i=ik(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}let i5=e=>{let t={};return(r,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});let a=n+JSON.stringify(o),s=t[a];return s||(s=e(iU(n),i),t[a]=s),s(r)}},i8=e=>(t,r,n)=>e(iU(r),n)(t);class i9{constructor(e={}){this.logger=iH.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let r=t.cacheInBuiltFormats?i5:i8;this.formats={number:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:r((e,t)=>{let r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:r((e,t)=>{let r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:r((e,t)=>{let r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=i5(t)}format(e,t,r,n={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&0>i[0].indexOf(")")&&i.find(e=>e.indexOf(")")>-1)){let e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){let n=e.split("(");t=n[0].toLowerCase().trim();let i=n[1].substring(0,n[1].length-1);"currency"===t&&0>i.indexOf(":")?r.currency||(r.currency=i.trim()):"relativetime"===t&&0>i.indexOf(":")?r.range||(r.range=i.trim()):i.split(";").forEach(e=>{if(e){let[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();r[o]||(r[o]=i),"false"===i&&(r[o]=!1),"true"===i&&(r[o]=!0),isNaN(i)||(r[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:r}})(t);if(this.formats[i]){let t=e;try{let a=n?.formatParams?.[n.interpolationkey]||{},s=a.locale||a.lng||n.locale||n.lng||r;t=this.formats[i](e,s,{...o,...n,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}}class i7 extends iz{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=iH.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(e,t,r,n){let i={},o={},a={},s={};return e.forEach(e=>{let n=!0;t.forEach(t=>{let a=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,n=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,r){let n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);let a={};this.queue.forEach(r=>{((e,t,r,n)=>{let{obj:i,k:o}=iA(e,t,Object);i[o]=i[o]||[],i[o].push(r)})(r.loaded,[i],o),void 0!==r.pending[e]&&(delete r.pending[e],r.pendingCount--),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{a[e]||(a[e]={});let t=r.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:i,callback:o});this.readingCalls++;let a=(a,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)}a&&s&&n<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,r,n+1,2*i,o)},i):o(a,s)},s=this.backend[r].bind(this.backend);if(2===s.length){try{let r=s(e,t);r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}return}return s(e,t,a)}prepareLoading(e,t,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();iP(e)&&(e=this.languageUtils.toResolveHierarchy(e)),iP(t)&&(t=[t]);let i=this.queueLoad(e,t,r,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e,t=""){let r=e.split("|"),n=r[0],i=r[1];this.read(n,i,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,r),!r&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,r,o)})}saveMissing(e,t,r,n,i,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${r}" 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!=r&&""!==r){if(this.backend?.create){let s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;(i=5===l.length?l(e,t,r,n,s):l(e,t,r,n))&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,r,n,a,s)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}let oe=()=>({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]),iP(e[1])&&(t.defaultValue=e[1]),iP(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ot=e=>(iP(e.ns)&&(e.ns=[e.ns]),iP(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),iP(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),or=()=>{};class on extends iz{constructor(e={},t){if(super(),this.options=ot(e),this.services={},this.logger=iH,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&&(iP(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let r=oe();this.options={...r,...this.options,...ot(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?iH.init(n(this.modules.logger),this.options):iH.init(null,this.options),e=this.modules.formatter?this.modules.formatter:i9;let t=new i0(this.options);this.store=new iq(this.options.resources,this.options);let i=this.services;i.logger=iH,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new i4(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.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===r.interpolation.format)&&(i.formatter=n(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new i6(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new i7(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new iX(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=or),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 i=iC(),o=()=>{let e=(e,r)=>{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),i.resolve(r),t(e,r)};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),i}loadResources(e,t=or){let r=t,n=iP(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return r();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};n?t(n):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),r(e)})}else r(null)}reloadResources(e,t,r){let n=iC();return"function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=or),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}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&&iG.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 r=iC();this.emit("languageChanging",e);let n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,r.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);let r=iP(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(iP(t)?[t]:t);o&&(this.language||n(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(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()),r}getFixedT(e,t,r){let n=(e,t,...i)=>{let o,a;(o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t}).lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||r||n.keyPrefix);let s=this.options.keySeparator||".";return o.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=iY(e,{...this.options,...t})),`${o.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=iY(e,{...this.options,...t})),a=o.keyPrefix?`${o.keyPrefix}${s}${e}`:e),this.t(a,o)};return iP(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=r,n}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 r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let o=(e,t)=>{let r=this.services.backendConnector.state[`${e}|${t}`];return -1===r||0===r||2===r};if(t.precheck){let e=t.precheck(this,o);if(void 0!==e)return e}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!n||o(i,e)))}loadNamespaces(e,t){let r=iC();return this.options.ns?(iP(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){let r=iC();iP(e)&&(e=[e]);let n=this.options.preload||[],i=e.filter(e=>0>n.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=n.concat(i),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(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 i0(oe());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 on(e,t)}cloneInstance(e={},t=or){let r=e.forkResourceStore;r&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},i=new on(n);return(void 0!==e.debug||void 0!==e.prefix)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new iq(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((r,n)=>(r[n]={...e[t][n]},r),e[t]),e),{}),n),i.services.resourceStore=i.store),i.translator=new iX(i.services,n),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let oi=on.createInstance();oi.createInstance=on.createInstance,oi.createInstance,oi.dir,oi.init,oi.loadResources,oi.reloadResources,oi.use,oi.changeLanguage,oi.getFixedT,oi.t,oi.exists,oi.setDefaultNamespace,oi.hasLoadedNamespace,oi.loadNamespaces,oi.loadLanguages;let oo=oi.default||oi;function oa(e,t,r,n){return oo.t(t,{ns:e,defaultValue:r,...n})}function os(e,t,r){return iO[e]?oa("core",e,t??iO[e],r):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}oo.on("initialized",function(){window.i18next.loadNamespaces(["core"])});let ol=null;async function ou(){return ol??(ol=oc().then(({map:e,complete:t})=>(t||(ol=null),e))),ol}async function oc(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[],r=!0;for(let n=0;n<e.length;n++){let i=e[n];try{if(i.src){let e=await fetch(i.src);if(!e.ok)throw Error(`Request for ${i.src} returned ${e.status} ${e.statusText}`);t.push(await e.json())}else i.textContent&&t.push(JSON.parse(i.textContent))}catch(e){r=!1,console.warn(`[import-maps] Failed to parse import map from script tag at index ${n}`,e)}}return{map:function(e){let t={imports:{}};for(let r of e)r?.imports&&Object.assign(t.imports,r.imports);return t}(t),complete:r}}async function od(){return await ou()}function of(e){return e.replace(/[\/\-@]/g,"_")}async function op(e,t="./start",n){var i;let o,a=!n?.maxLoadingTime||n.maxLoadingTime<=0?6e5:n.maxLoadingTime;await Promise.race([oh(e,n?.importMap),new Promise((t,r)=>{o=setTimeout(()=>{var t;r(Error(`Could not resolve requested script, ${e}, within ${(t=a)<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`}.`))},a)})]),o&&clearTimeout(o);let s=of(e),l=window[s];if(!("object"==typeof(i=l)&&null!==i&&"init"in i&&"function"==typeof i.init&&"get"in i&&"function"==typeof i.get)){let e=`The global variable ${s} does not refer to a federated module`;throw console.error(e),Error(e)}l.init(r.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 oh(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 r=of(e);if(!window[r]){let r=t??await om();if(!r.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let n=r.imports[e];n.startsWith("./")&&(n=window.spaBase+n.substring(1));let i=e in{};try{return await function(e){var t;let r=(t=window)[oy]??(t[oy]=new Map),n=r.get(e);if(n)return n;if(document.head.querySelector(`script[src="${e}"]`))return console.warn(`Script at ${e} already loaded. Not loading it again.`),Promise.resolve();let i=document.createElement("script");i.src=e,i.type="text/javascript",i.async=!0;let o=new Promise((t,n)=>{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 a(){clearTimeout(o),i.removeEventListener("load",s),i.removeEventListener("error",l)}function s(){a(),t()}function l(t){a(),r.delete(e),i.remove();let o=`Failed to load script from ${e}`;console.error(o,t),n(t.message??o)}i.addEventListener("load",s),i.addEventListener("error",l),document.head.appendChild(i)});return r.set(e,o),o}(n)}catch(e){return i&&O({kind:"error",title:os("scriptLoadingFailed","Error: Script failed to load"),description:os("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:n}),actionButtonLabel:os("resetOverrides","Reset overrides"),onActionButtonClick(){console.warn("[Security] Import map overrides are disabled in production mode."),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function om(){return od()}let oy=Symbol.for("__openmrs_script_loading"),og=`${n2}/attachment`;function ob(e,t){return n9(`${og}/${e}`,{signal:t.signal})}function ov(e,t,r){return n9(`${og}?patient=${e}&includeEncounterless=${t}`,{signal:r.signal})}async function o_(e,t){let r=new FormData;return r.append("fileCaption",t.fileDescription),r.append("patient",e),t.file?r.append("file",t.file,t.fileName):(r.append("file",new File([""],t.fileName),t.fileName),r.append("base64Content",t.base64Content)),n9(`${og}`,{method:"POST",body:r})}function ow(e,t){return n9(`${og}/${e}`,{method:"DELETE",signal:t.signal})}try{self["workbox:window:6.5.4"]&&_()}catch(e){}function ox(e,t){return new Promise(function(r){var n=new MessageChannel;n.port1.onmessage=function(e){r(e.data)},e.postMessage(t,[n.port2])})}function oE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function oS(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var oD=function(){var e=this;this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r})};function oO(e,t){var r=location.href;return new URL(e,r).href===new URL(t,r).href}var oP=function(e,t){this.type=e,Object.assign(this,t)};function oC(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ok(){}var oj={type:"SKIP_WAITING"};function oT(e,t){if(!t)return e&&e.then?e.then(ok):Promise.resolve()}async function oR(e){let t=await (f??Promise.resolve(void 0));return t?await t.messageSW(e):{success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."}}!function(e){function t(t,r){var n,i;return void 0===r&&(r={}),(n=e.call(this)||this).nn={},n.tn=0,n.rn=new oD,n.en=new oD,n.on=new oD,n.un=0,n.an=new Set,n.cn=function(){var e=n.fn,t=e.installing;n.tn>0||!oO(t.scriptURL,n.sn.toString())||performance.now()>n.un+6e4?(n.vn=t,e.removeEventListener("updatefound",n.cn)):(n.hn=t,n.an.add(t),n.rn.resolve(t)),++n.tn,t.addEventListener("statechange",n.ln)},n.ln=function(e){var t=n.fn,r=e.target,i=r.state,o=r===n.vn,a={sw:r,isExternal:o,originalEvent:e};!o&&n.mn&&(a.isUpdate=!0),n.dispatchEvent(new oP(i,a)),"installed"===i?n.wn=self.setTimeout(function(){"installed"===i&&t.waiting===r&&n.dispatchEvent(new oP("waiting",a))},200):"activating"===i&&(clearTimeout(n.wn),o||n.en.resolve(r))},n.dn=function(e){var t=n.hn,r=t!==navigator.serviceWorker.controller;n.dispatchEvent(new oP("controlling",{isExternal:r,originalEvent:e,sw:t,isUpdate:n.mn})),r||n.on.resolve(t)},i=function(e){var t=e.data,r=e.ports,i=e.source;return oC(n.getSW(),function(){n.an.has(i)&&n.dispatchEvent(new oP("message",{data:t,originalEvent:e,ports:r,sw:i}))})},n.gn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}},n.sn=t,n.nn=r,navigator.serviceWorker.addEventListener("message",n.gn),n}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var r,n=t.prototype;n.register=function(e){var t=(void 0===e?{}:e).immediate,r=void 0!==t&&t;try{var n,i,o,a=this;return n=function(){if(!r&&"complete"!==document.readyState)return oT(new Promise(function(e){return window.addEventListener("load",e)}))},i=function(){return a.mn=!!navigator.serviceWorker.controller,a.yn=a.pn(),oC(a.bn(),function(e){a.fn=e,a.yn&&(a.hn=a.yn,a.en.resolve(a.yn),a.on.resolve(a.yn),a.yn.addEventListener("statechange",a.ln,{once:!0}));var t=a.fn.waiting;return t&&oO(t.scriptURL,a.sn.toString())&&(a.hn=t,Promise.resolve().then(function(){a.dispatchEvent(new oP("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),a.hn&&(a.rn.resolve(a.hn),a.an.add(a.hn)),a.fn.addEventListener("updatefound",a.cn),navigator.serviceWorker.addEventListener("controllerchange",a.dn),a.fn})},(o=n())&&o.then?o.then(i):i(o)}catch(e){return Promise.reject(e)}},n.update=function(){try{return this.fn?oT(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},n.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},n.messageSW=function(e){try{return oC(this.getSW(),function(t){return ox(t,e)})}catch(e){return Promise.reject(e)}},n.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&ox(this.fn.waiting,oj)},n.pn=function(){var e=navigator.serviceWorker.controller;return e&&oO(e.scriptURL,this.sn.toString())?e:void 0},n.bn=function(){try{var e=this;return function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){return oC(navigator.serviceWorker.register(e.sn,e.nn),function(t){return e.un=performance.now(),t})},function(e){throw e})}catch(e){return Promise.reject(e)}},oE(t.prototype,[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}]),r&&oE(t,r)}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,r=function(e){var t;if("u"<typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return oS(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?oS(e,void 0):void 0}}(e))){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(this.Sn(e.type));!(t=r()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());let oA="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,oM=Object.keys,oN=Array.isArray;function oI(e,t){return"object"!=typeof t||oM(t).forEach(function(r){e[r]=t[r]}),e}"u"<typeof Promise||oA.Promise||(oA.Promise=Promise);let o$=Object.getPrototypeOf,oL={}.hasOwnProperty;function oF(e,t){return oL.call(e,t)}function oB(e,t){"function"==typeof t&&(t=t(o$(e))),("u"<typeof Reflect?oM:Reflect.ownKeys)(t).forEach(r=>{oU(e,r,t[r])})}let oV=Object.defineProperty;function oU(e,t,r,n){oV(e,t,oI(r&&oF(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function oW(e){return{from:function(t){return e.prototype=Object.create(t.prototype),oU(e.prototype,"constructor",e),{extend:oB.bind(null,e.prototype)}}}}let oK=Object.getOwnPropertyDescriptor;function oH(e,t){let r;return oK(e,t)||(r=o$(e))&&oH(r,t)}let oz=[].slice;function oq(e,t,r){return oz.call(e,t,r)}function oG(e,t){return t(e)}function oZ(e){if(!e)throw Error("Assertion Failed")}function oY(e){oA.setImmediate?setImmediate(e):setTimeout(e,0)}function oJ(e,t){return e.reduce((e,r,n)=>{var i=t(r,n);return i&&(e[i[0]]=i[1]),e},{})}function oQ(e,t){if("string"==typeof t&&oF(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=oQ(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return null==s?void 0:oQ(s,t.substr(a+1))}}function oX(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){oZ("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)oX(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?oN(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=r;else{var l=e[a];l&&oF(e,a)||(l=e[a]={}),oX(l,s,r)}}else void 0===r?oN(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function o0(e){var t={};for(var r in e)oF(e,r)&&(t[r]=e[r]);return t}let o1=[].concat;function o3(e){return o1.apply([],e)}let o4="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(o3([8,16,32,64].map(e=>["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>oA[e]),o2=o4.map(e=>oA[e]);oJ(o4,e=>[e,!0]);let o6=null;function o5(e){o6="u">typeof WeakMap&&new WeakMap;let t=function e(t){if(!t||"object"!=typeof t)return t;let r=o6&&o6.get(t);if(r)return r;if(oN(t)){r=[],o6&&o6.set(t,r);for(var n=0,i=t.length;n<i;++n)r.push(e(t[n]))}else if(o2.indexOf(t.constructor)>=0)r=t;else{let n=o$(t);for(var o in r=n===Object.prototype?{}:Object.create(n),o6&&o6.set(t,r),t)oF(t,o)&&(r[o]=e(t[o]))}return r}(e);return o6=null,t}let{toString:o8}={};function o9(e){return o8.call(e).slice(8,-1)}let o7="u">typeof Symbol?Symbol.iterator:"@@iterator",ae="symbol"==typeof o7?function(e){var t;return null!=e&&(t=e[o7])&&t.apply(e)}:function(){return null},at={};function ar(e){var t,r,n,i;if(1==arguments.length){if(oN(e))return e.slice();if(this===at&&"string"==typeof e)return[e];if(i=ae(e)){for(r=[];!(n=i.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=Array(t);t--;)r[t]=arguments[t];return r}let an="u">typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var ai="u">typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),ao=()=>!0;let aa=!Error("").stack;function as(){if(aa)try{throw as.arguments,Error()}catch(e){return e}return Error()}function al(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(ao).map(e=>"\n"+e).join("")):""}var au=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ac=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(au),ad={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function af(e,t){this._e=as(),this.name=e,this.message=t}function ap(e,t){return e+". Errors: "+Object.keys(t).map(e=>t[e].toString()).filter((e,t,r)=>r.indexOf(e)===t).join("\n")}function ah(e,t,r,n){this._e=as(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=ap(e,t)}function am(e,t){this._e=as(),this.name="BulkError",this.failures=Object.keys(t).map(e=>t[e]),this.failuresByPos=t,this.message=ap(e,t)}oW(af).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+al(this._e,2))}},toString:function(){return this.name+": "+this.message}}),oW(ah).from(af),oW(am).from(af);var ay=ac.reduce((e,t)=>(e[t]=t+"Error",e),{}),ag=ac.reduce((e,t)=>{var r=t+"Error";function n(e,n){this._e=as(),this.name=r,e?"string"==typeof e?(this.message=`${e}${n?"\n "+n:""}`,this.inner=n||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=ad[t]||r,this.inner=null)}return oW(n).from(af),e[t]=n,e},{});ag.Syntax=SyntaxError,ag.Type=TypeError,ag.Range=RangeError;var ab=au.reduce((e,t)=>(e[t+"Error"]=ag[t],e),{}),av=ac.reduce((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=ag[t]),e),{});function a_(){}function aw(e){return e}function ax(e,t){return null==e||e===aw?t:function(r){return t(e(r))}}function aE(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function aS(e,t){return e===a_?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?aE(n,this.onsuccess):n),i&&(this.onerror=this.onerror?aE(i,this.onerror):i),void 0!==o?o:r}}function aD(e,t){return e===a_?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?aE(r,this.onsuccess):r),n&&(this.onerror=this.onerror?aE(n,this.onerror):n)}}function aO(e,t){return e===a_?t:function(r){var n=e.apply(this,arguments);oI(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?aE(i,this.onsuccess):i),o&&(this.onerror=this.onerror?aE(o,this.onerror):o),void 0===n?void 0===a?void 0:a:oI(n,a)}}function aP(e,t){return e===a_?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function aC(e,t){return e===a_?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return r.then(function(){return t.apply(n,o)})}return t.apply(this,arguments)}}av.ModifyError=ah,av.DexieError=af,av.BulkError=am;var ak={};let[aj,aT,aR]="u"<typeof Promise?[]:(()=>{let e=Promise.resolve();if("u"<typeof crypto||!crypto.subtle)return[e,o$(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,o$(t),e]})(),aA=aT&&aT.then,aM=aj&&aj.constructor,aN=!!aR;var aI=!1,a$=aR?()=>{aR.then(a2)}:oA.setImmediate?setImmediate.bind(null,a2):oA.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{a2(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(a2,0)},aL=function(e,t){aq.push([e,t]),aB&&(a$(),aB=!1)},aF=!0,aB=!0,aV=[],aU=[],aW=null,aK=aw,aH={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:sb,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{sb(e[0],e[1])}catch(e){}})}},az=aH,aq=[],aG=0,aZ=[];function aY(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=a_,this._lib=!1;var t=this._PSD=az;if(ai&&(this._stackHolder=as(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==ak)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&aX(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,r){try{r(r=>{if(null===t._state){if(r===t)throw TypeError("A promise cannot be resolved with itself.");var n=t._lib&&a6();r&&"function"==typeof r.then?e(t,(e,t)=>{r instanceof aY?r._then(e,t):r.then(e,t)}):(t._state=!0,t._value=r,a0(t)),n&&a5()}},aX.bind(null,t))}catch(e){aX(t,e)}}(this,e)}let aJ={get:function(){var e=az,t=si;function r(r,n){var i=!e.global&&(e!==az||t!==si);let o=i&&!sl();var a=new aY((t,a)=>{a1(this,new aQ(sm(r,e,i,o),sm(n,e,i,o),t,a,e))});return ai&&a4(a,this),a}return r.prototype=ak,r},set:function(e){oU(this,"then",e&&e.prototype===ak?aJ:{get:function(){return e},set:aJ.set})}};function aQ(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function aX(e,t){if(aU.push(t),null===e._state){var r=e._lib&&a6();t=aK(t),e._state=!1,e._value=t,ai&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}(()=>{var r=oH(t,"stack");t._promise=e,oU(t,"stack",{get:()=>aI?r&&(r.get?r.get.apply(t):r.value):e.stack})}),aV.some(t=>t._value===e._value)||aV.push(e),a0(e),r&&a5()}}function a0(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)a1(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===aG&&(++aG,aL(()=>{0==--aG&&a8()},[]))}function a1(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++aG,aL(a3,[r,e,t])}else e._listeners.push(t)}function a3(e,t,r){try{aW=t;var n,i=t._value;t._state?n=e(i):(aU.length&&(aU=[]),n=e(i),-1===aU.indexOf(i)&&function(e){for(var t=aV.length;t;)if(aV[--t]._value===e._value)return void aV.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{aW=null,0==--aG&&a8(),--r.psd.ref||r.psd.finalize()}}function a4(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function a2(){a6()&&a5()}function a6(){var e=aF;return aF=!1,aB=!1,e}function a5(){var e,t,r;do for(;aq.length>0;)for(e=aq,aq=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}while(aq.length>0);aF=!0,aB=!0}function a8(){var e=aV;aV=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var t=aZ.slice(0),r=t.length;r;)t[--r]()}function a9(e){return new aY(ak,!1,e)}function a7(e,t){var r=az;return function(){var n=a6(),i=az;try{return sf(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{sf(i,!1),n&&a5()}}}oB(aY.prototype,{then:aJ,_then:function(e,t){a1(this,new aQ(null,null,e,t,az))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,e=>e instanceof t?r(e):a9(e)):this.then(null,e=>e&&e.name===t?r(e):a9(e))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),a9(t)))},stack:{get:function(){if(this._stack)return this._stack;try{aI=!0;var e=(function e(t,r,n){if(r.length===n)return r;var i="";if(!1===t._state){var o,a,s=t._value;null!=s?(o=s.name||"Error",a=s.message||s,i=al(s,0)):(o=s,a=""),r.push(o+(a?": "+a:"")+i)}return ai&&((i=al(t._stackHolder,2))&&-1===r.indexOf(i)&&r.push(i),t._prev&&e(t._prev,r,n)),r})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{aI=!1}}},timeout:function(e,t){return e<1/0?new aY((r,n)=>{var i=setTimeout(()=>n(new ag.Timeout(t)),e);this.then(r,n).finally(clearTimeout.bind(null,i))}):this}}),"u">typeof Symbol&&Symbol.toStringTag&&oU(aY.prototype,Symbol.toStringTag,"Dexie.Promise"),aH.env=sp(),oB(aY,{all:function(){var e=ar.apply(null,arguments).map(su);return new aY(function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((i,o)=>aY.resolve(i).then(r=>{e[o]=r,--n||t(e)},r))})},resolve:e=>{if(e instanceof aY)return e;if(e&&"function"==typeof e.then)return new aY((t,r)=>{e.then(t,r)});var t=new aY(ak,!0,e);return a4(t,aW),t},reject:a9,race:function(){var e=ar.apply(null,arguments).map(su);return new aY((t,r)=>{e.map(e=>aY.resolve(e).then(t,r))})},PSD:{get:()=>az,set:e=>az=e},totalEchoes:{get:()=>si},newPSD:sa,usePSD:sh,scheduler:{get:()=>aL,set:e=>{aL=e}},rejectionMapper:{get:()=>aK,set:e=>{aK=e}},follow:(e,t)=>new aY((r,n)=>sa((t,r)=>{var n=az;n.unhandleds=[],n.onunhandled=r,n.finalize=aE(function(){var e;e=()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])},aZ.push(function t(){e(),aZ.splice(aZ.indexOf(t),1)}),++aG,aL(()=>{0==--aG&&a8()},[])},n.finalize),e()},t,r,n))}),aM&&(aM.allSettled&&oU(aY,"allSettled",function(){let e=ar.apply(null,arguments).map(su);return new aY(t=>{0===e.length&&t([]);let r=e.length,n=Array(r);e.forEach((e,i)=>aY.resolve(e).then(e=>n[i]={status:"fulfilled",value:e},e=>n[i]={status:"rejected",reason:e}).then(()=>--r||t(n)))})}),aM.any&&"u">typeof AggregateError&&oU(aY,"any",function(){let e=ar.apply(null,arguments).map(su);return new aY((t,r)=>{0===e.length&&r(AggregateError([]));let n=e.length,i=Array(n);e.forEach((e,o)=>aY.resolve(e).then(e=>t(e),e=>{i[o]=e,--n||r(AggregateError(i))}))})}));let se={awaits:0,echoes:0,id:0};var st=0,sr=[],sn=0,si=0,so=0;function sa(e,t,r,n){var i=az,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++so;var a=aH.env;o.env=aN?{Promise:aY,PromiseProp:{value:aY,configurable:!0,writable:!0},all:aY.all,race:aY.race,allSettled:aY.allSettled,any:aY.any,resolve:aY.resolve,reject:aY.reject,nthen:sy(a.nthen,o),gthen:sy(a.gthen,o)}:{},t&&oI(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=sh(o,e,r,n);return 0===o.ref&&o.finalize(),s}function ss(){return se.id||(se.id=++st),++se.awaits,se.echoes+=100,se.id}function sl(){return!!se.awaits&&(0==--se.awaits&&(se.id=0),se.echoes=100*se.awaits,!0)}function su(e){return se.echoes&&e&&e.constructor===aM?(ss(),e.then(e=>(sl(),e),e=>(sl(),sv(e)))):e}function sc(e){++si,se.echoes&&0!=--se.echoes||(se.echoes=se.id=0),sr.push(az),sf(e,!0)}function sd(){var e=sr[sr.length-1];sr.pop(),sf(e,!1)}function sf(e,t){var r,n=az;if((t?!se.echoes||sn++&&e===az:!sn||--sn&&e===az)||(r=t?sc.bind(null,e):sd,aA.call(aj,r)),e!==az&&(az=e,n===aH&&(aH.env=sp()),aN)){var i=aH.env.Promise,o=e.env;aT.then=o.nthen,i.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(oA,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject,o.allSettled&&(i.allSettled=o.allSettled),o.any&&(i.any=o.any))}}function sp(){var e=oA.Promise;return aN?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(oA,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:aT.then,gthen:e.prototype.then}:{}}function sh(e,t,r,n,i){var o=az;try{return sf(e,!0),t(r,n,i)}finally{sf(o,!1)}}function sm(e,t,r,n){return"function"!=typeof e?e:function(){var i,o=az;r&&ss(),sf(t,!0);try{return e.apply(this,arguments)}finally{sf(o,!1),n&&(i=sl,aA.call(aj,i))}}}function sy(e,t){return function(r,n){return e.call(this,sm(r,t),sm(n,t))}}-1===(""+aA).indexOf("[native code]")&&(ss=sl=a_);let sg="unhandledrejection";function sb(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(oA.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(sg,!0,!0),oI(n,i)):oA.CustomEvent&&oI(n=new CustomEvent(sg,{detail:i}),i),n&&oA.dispatchEvent&&(dispatchEvent(n),!oA.PromiseRejectionEvent&&oA.onunhandledrejection))try{oA.onunhandledrejection(n)}catch(e){}ai&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}var sv=aY.reject;let s_="3.2.7",sw=String.fromCharCode(65535),sx=-1/0,sE="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",sS="String expected.",sD=[],sO="u">typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),sP=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),sC="__dbnames",sk="readonly",sj="readwrite";function sT(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}let sR={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function sA(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=o5(t))[e],t)}class sM{_trans(e,t,r){let n=this._tx||az.trans,i=this.name;function o(e,r,n){if(!n.schema[i])throw new ag.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}let a=a6();try{return n&&n.db===this.db?n===az.trans?n._promise(e,o,r):sa(()=>n._promise(e,o,r),{trans:n,transless:az.transless||az}):function e(t,r,n,i){if(t.idbdb&&(t._state.openComplete||az.letThrough||t._vip)){var o=t._createTransaction(r,n,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===ay.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,r,n,i))):sv(o)}return o._promise(r,(e,t)=>sa(()=>(az.trans=o,i(e,t,o)))).then(e=>o._completion.then(()=>e))}if(t._state.openComplete)return sv(new ag.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return sv(new ag.DatabaseClosed);t.open().catch(a_)}return t._state.dbReadyPromise.then(()=>e(t,r,n,i))}(this.db,e,[this.name],o)}finally{a&&a5()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",t=>this.core.get({trans:t,key:e}).then(e=>this.hook.reading.fire(e))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(oN(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let t=oM(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);let r=this.schema.indexes.concat(this.schema.primKey).filter(e=>{if(e.compound&&t.every(t=>e.keyPath.indexOf(t)>=0)){for(let r=0;r<t.length;++r)if(-1===t.indexOf(e.keyPath[r]))return!1;return!0}return!1}).sort((e,t)=>e.keyPath.length-t.keyPath.length)[0];if(r&&this.db._maxKey!==sw){let n=r.keyPath.slice(0,t.length);return this.where(n).equals(n.map(t=>e[t]))}!r&&ai&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);let{idxByName:n}=this.schema,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}let[a,s]=t.reduce(([t,r],i)=>{let a=n[i],s=e[i];return[t||a,t||!a?sT(r,a&&a.multi?e=>{let t=oQ(e,i);return oN(t)&&t.some(e=>o(s,e))}:e=>o(s,oQ(e,i))):r]},[null,null]);return a?this.where(a.name).equals(e[a.keyPath]).filter(s):r?this.filter(s):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,oN(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let t=t=>{if(!t)return t;let r=Object.create(e.prototype);for(var n in t)if(oF(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass(function(e){oI(this,e)})}add(e,t){let{auto:r,keyPath:n}=this.schema.primKey,i=e;return n&&r&&(i=sA(n)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]})).then(e=>e.numFailures?aY.reject(e.failures[0]):e.lastResult).then(t=>{if(n)try{oX(e,n,t)}catch(e){}return t})}update(e,t){if("object"!=typeof e||oN(e))return this.where(":id").equals(e).modify(t);{let r=oQ(e,this.schema.primKey.keyPath);if(void 0===r)return sv(new ag.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?oM(t).forEach(r=>{oX(e,r,t[r])}):t(e,{value:e,primKey:r})}catch(e){}return this.where(":id").equals(r).modify(t)}}put(e,t){let{auto:r,keyPath:n}=this.schema.primKey,i=e;return n&&r&&(i=sA(n)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null})).then(e=>e.numFailures?aY.reject(e.failures[0]):e.lastResult).then(t=>{if(n)try{oX(e,n,t)}catch(e){}return t})}delete(e){return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:[e]})).then(e=>e.numFailures?aY.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:sR})).then(e=>e.numFailures?aY.reject(e.failures[0]):void 0)}bulkGet(e){return this._trans("readonly",t=>this.core.getMany({keys:e,trans:t}).then(e=>e.map(e=>this.hook.reading.fire(e))))}bulkAdd(e,t,r){let n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:r,keyPath:o}=this.schema.primKey;if(o&&n)throw new ag.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new ag.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=o&&r?e.map(sA(o)):e;return this.core.mutate({trans:t,type:"add",keys:n,values:s,wantResults:i}).then(({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new am(`${this.name}.bulkAdd(): ${e} of ${a} operations failed`,n)})})}bulkPut(e,t,r){let n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:r,keyPath:o}=this.schema.primKey;if(o&&n)throw new ag.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new ag.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=o&&r?e.map(sA(o)):e;return this.core.mutate({trans:t,type:"put",keys:n,values:s,wantResults:i}).then(({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new am(`${this.name}.bulkPut(): ${e} of ${a} operations failed`,n)})})}bulkDelete(e){let t=e.length;return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:e})).then(({numFailures:e,lastResult:r,failures:n})=>{if(0===e)return r;throw new am(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)})}}function sN(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"!=typeof e){n||(n=aP),i||(i=a_);var a={subscribers:[],fire:i,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=n(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter(function(t){return t!==e}),a.fire=a.subscribers.reduce(n,i)}};return t[e]=r[e]=a,a}oM(e).forEach(function(t){var r=e[t];if(oN(r))o(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new ag.InvalidArgument("Invalid event config");var n=o(t,aw,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){oY(function(){e.apply(null,t)})})})}})}}function sI(e,t){return oW(t).from({prototype:e}),t}function s$(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function sL(e,t){e.filter=sT(e.filter,t)}function sF(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>sT(n(),t()):t,e.justLimit=r&&!n}function sB(e,t){if(e.isPrimKey)return t.primaryKey;let r=t.getIndexByKeyPath(e.index);if(!r)throw new ag.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function sV(e,t,r){let n=sB(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function sU(e,t,r,n){let i=e.replayFilter?sT(e.filter,e.replayFilter()):e.filter;if(e.or){let o={},a=(e,r,n)=>{if(!i||i(r,n,e=>r.stop(e),e=>r.fail(e))){var a=r.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),oF(o,s)||(o[s]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(a,r),sW(sV(e,n,r),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return sW(sV(e,n,r),sT(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function sW(e,t,r,n){var i=a7(n?(e,t,i)=>r(n(e),t,i):r);return e.then(e=>{if(e)return e.start(()=>{var r=()=>e.continue();t&&!t(e,e=>r=e,t=>{e.stop(t),r=a_},t=>{e.fail(t),r=a_})||i(e.value,e,e=>r=e),r()})})}function sK(e,t){try{let r=sH(e),n=sH(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){let r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return r===n?0:r<n?-1:1}(sz(e),sz(t));case"Array":return function(e,t){let r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r){let n=sK(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function sH(e){let t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";let r=o9(e);return"ArrayBuffer"===r?"binary":r}function sz(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class sq{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,sv.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,sv.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=sT(t.algorithm,e)}_iterate(e,t){return sU(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&oI(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read(r=>sU(t,e,r,t.table.core))}count(e){return this._read(e=>{let t=this._ctx,r=t.table.core;if(s$(t,!0))return r.count({trans:e,query:{index:sB(t,r.schema),range:t.range}}).then(e=>Math.min(e,t.limit));var n=0;return sU(t,()=>(++n,!1),e,r).then(()=>n)}).then(e)}sortBy(e,t){let r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a:0}return this.toArray(function(e){return e.sort(s)}).then(t)}toArray(e){return this._read(e=>{var t=this._ctx;if("next"===t.dir&&s$(t,!0)&&t.limit>0){let{valueMapper:r}=t,n=sB(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:n,range:t.range}}).then(({result:e})=>r?e.map(r):e)}{let r=[];return sU(t,e=>r.push(e),e,t.table.core).then(()=>r)}},e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,s$(t)?sF(t,()=>{var t=e;return(e,r)=>0===t||(1===t?--t:r(()=>{e.advance(t),t=0}),!1)}):sF(t,()=>{var t=e;return()=>--t<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),sF(this._ctx,()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}},!0),this}until(e,t){return sL(this._ctx,function(r,n,i){return!e(r.value)||(n(i),t)}),this}first(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)}last(e){return this.reverse().first(e)}filter(e){var t;return sL(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=sT(t.isMatch,e),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,r){e(r.key,r)})}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,r){e(r.primaryKey,r)})}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each(function(e,t){r.push(t.key)}).then(function(){return r}).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&s$(t,!0)&&t.limit>0)return this._read(e=>{var r=sB(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})}).then(({result:e})=>e).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each(function(e,t){r.push(t.primaryKey)}).then(function(){return r}).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys(function(e){return e[0]}).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var r={};return sL(this._ctx,function(e){var t=e.primaryKey.toString(),n=oF(r,t);return r[t]=!0,!n}),this}modify(e){var t=this._ctx;return this._write(r=>{var n;if("function"==typeof e)n=e;else{var i=oM(e),o=i.length;n=function(t){for(var r=!1,n=0;n<o;++n){var a=i[n],s=e[a];oQ(t,a)!==s&&(oX(t,a,s),r=!0)}return r}}let a=t.table.core,{outbound:s,extractKey:l}=a.schema.primaryKey,u=this.db._options.modifyChunkSize||200,c=[],d=0,f=[],p=(e,t)=>{let{failures:r,numFailures:n}=t;for(let t of(d+=e-n,oM(r)))c.push(r[t])};return this.clone().primaryKeys().then(i=>{let o=c=>{let d=Math.min(u,i.length-c);return a.getMany({trans:r,keys:i.slice(c,c+d),cache:"immutable"}).then(f=>{let h=[],m=[],y=s?[]:null,g=[];for(let e=0;e<d;++e){let t=f[e],r={value:o5(t),primKey:i[c+e]};!1!==n.call(r,r.value,r)&&(null==r.value?g.push(i[c+e]):s||0===sK(l(t),l(r.value))?(m.push(r.value),s&&y.push(i[c+e])):(g.push(i[c+e]),h.push(r.value)))}let b=s$(t)&&t.limit===1/0&&("function"!=typeof e||e===sG)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&a.mutate({trans:r,type:"add",values:h}).then(e=>{for(let t in e.failures)g.splice(parseInt(t),1);p(h.length,e)})).then(()=>(m.length>0||b&&"object"==typeof e)&&a.mutate({trans:r,type:"put",keys:y,values:m,criteria:b,changeSpec:"function"!=typeof e&&e}).then(e=>p(m.length,e))).then(()=>(g.length>0||b&&e===sG)&&a.mutate({trans:r,type:"delete",keys:g,criteria:b}).then(e=>p(g.length,e))).then(()=>i.length>c+d&&o(c+u))})};return o(0).then(()=>{if(c.length>0)throw new ah("Error modifying one or more objects",c,d,f);return i.length})})})}delete(){var e=this._ctx,t=e.range;return s$(e)&&(e.isPrimKey&&!sO||3===t.type)?this._write(r=>{let{primaryKey:n}=e.table.core.schema;return e.table.core.count({trans:r,query:{index:n,range:t}}).then(n=>e.table.core.mutate({trans:r,type:"deleteRange",range:t}).then(({failures:e,lastResult:t,results:r,numFailures:i})=>{if(i)throw new ah("Could not delete some values",Object.keys(e).map(t=>e[t]),n-i);return n-i}))}):this.modify(sG)}}let sG=(e,t)=>t.value=null;function sZ(e,t){return e<t?-1:+(e!==t)}function sY(e,t){return e>t?-1:+(e!==t)}function sJ(e,t,r){var n=e instanceof s3?new e.Collection(e):e;return n._ctx.error=r?new r(t):TypeError(t),n}function sQ(e){return new e.Collection(e,()=>s1("")).limit(0)}function sX(e,t,r,n){var i,o,a,s,l,u,c,d=r.length;if(!r.every(e=>"string"==typeof e))return sJ(e,sS);function f(e){i="next"===e?e=>e.toUpperCase():e=>e.toLowerCase(),o="next"===e?e=>e.toLowerCase():e=>e.toUpperCase(),a="next"===e?sZ:sY;var t=r.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return a(e.lower,t.lower)});s=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),u=e,c="next"===e?"":n}f("next");var p=new e.Collection(e,()=>s0(s[0],l[d-1]+n));p._ondirectionchange=function(e){f(e)};var h=0;return p._addAlgorithm(function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,l,h))return!0;for(var p=null,m=h;m<d;++m){var y=function(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,l=0;l<a;++l){var u=t[l];if(u!==n[l])return 0>i(e[l],r[l])?e.substr(0,l)+r[l]+r.substr(l+1):0>i(e[l],n[l])?e.substr(0,l)+n[l]+r.substr(l+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;0>i(e[l],u)&&(s=l)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}(i,f,s[m],l[m],a,u);null===y&&null===p?h=m+1:(null===p||a(p,y)>0)&&(p=y)}return r(null!==p?function(){e.continue(p+c)}:n),!1}),p}function s0(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function s1(e){return{type:1,lower:e,upper:e}}class s3{get Collection(){return this._ctx.table.db.Collection}between(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?sQ(this):new this.Collection(this,()=>s0(e,t,!r,!n))}catch(e){return sJ(this,sE)}}equals(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s1(e))}above(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s0(e,void 0,!0))}aboveOrEqual(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s0(e,void 0,!1))}below(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s0(void 0,e,!1,!0))}belowOrEqual(e){return null==e?sJ(this,sE):new this.Collection(this,()=>s0(void 0,e))}startsWith(e){return"string"!=typeof e?sJ(this,sS):this.between(e,e+sw,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):sX(this,(e,t)=>0===e.indexOf(t[0]),[e],sw)}equalsIgnoreCase(e){return sX(this,(e,t)=>e===t[0],[e],"")}anyOfIgnoreCase(){var e=ar.apply(at,arguments);return 0===e.length?sQ(this):sX(this,(e,t)=>-1!==t.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=ar.apply(at,arguments);return 0===e.length?sQ(this):sX(this,(e,t)=>t.some(t=>0===e.indexOf(t)),e,sw)}anyOf(){let e=ar.apply(at,arguments),t=this._cmp;try{e.sort(t)}catch(e){return sJ(this,sE)}if(0===e.length)return sQ(this);let r=new this.Collection(this,()=>s0(e[0],e[e.length-1]));r._ondirectionchange=r=>{t="next"===r?this._ascending:this._descending,e.sort(t)};let n=0;return r._addAlgorithm((r,i,o)=>{let a=r.key;for(;t(a,e[n])>0;)if(++n===e.length)return i(o),!1;return 0===t(a,e[n])||(i(()=>{r.continue(e[n])}),!1)}),r}notEqual(e){return this.inAnyRange([[sx,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=ar.apply(at,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return sJ(this,sE)}let t=e.reduce((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[sx,t]],null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){let r=this._cmp,n=this._ascending,i=this._descending,o=this._min,a=this._max;if(0===e.length)return sQ(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=n(e[0],e[1])))return sJ(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ag.InvalidArgument);let s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,u,c=n;function d(e,t){return c(e[0],t[0])}try{(u=e.reduce(function(e,t){let n=0,i=e.length;for(;n<i;++n){let i=e[n];if(0>r(t[0],i[1])&&r(t[1],i[0])>0){i[0]=o(i[0],t[0]),i[1]=a(i[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(d)}catch(e){return sJ(this,sE)}let f=0,p=l?e=>n(e,u[f][1])>0:e=>n(e,u[f][1])>=0,h=s?e=>i(e,u[f][0])>0:e=>i(e,u[f][0])>=0,m=p,y=new this.Collection(this,()=>s0(u[0][0],u[u.length-1][1],!s,!l));return y._ondirectionchange=e=>{"next"===e?(m=p,c=n):(m=h,c=i),u.sort(d)},y._addAlgorithm((e,t,r)=>{for(var i=e.key;m(i);)if(++f===u.length)return t(r),!1;return!!(!p(i)&&!h(i))||(0===this._cmp(i,u[f][1])||0===this._cmp(i,u[f][0])||t(()=>{c===n?e.continue(u[f][0]):e.continue(u[f][1])}),!1)}),y}startsWithAnyOf(){let e=ar.apply(at,arguments);return e.every(e=>"string"==typeof e)?0===e.length?sQ(this):this.inAnyRange(e.map(e=>[e,e+sw])):sJ(this,"startsWithAnyOf() only works with strings")}}function s4(e){return a7(function(t){return s2(t),e(t.target.error),!1})}function s2(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let s6="storagemutated",s5="x-storagemutated-1",s8=sN(null,s6);class s9{_lock(){return oZ(!az.global),++this._reculock,1!==this._reculock||az.global||(az.lockOwnerFor=this),this}_unlock(){if(oZ(!az.global),0==--this._reculock)for(az.global||(az.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{sh(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&az.lockOwnerFor!==this}create(e){if(!this.mode)return this;let t=this.db.idbdb,r=this.db._state.dbOpenError;if(oZ(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new ag.DatabaseClosed(r);case"MissingAPIError":throw new ag.MissingAPI(r.message,r);default:throw new ag.OpenFailed(r)}if(!this.active)throw new ag.TransactionInactive;return oZ(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=a7(t=>{s2(t),this._reject(e.error)}),e.onabort=a7(t=>{s2(t),this.active&&this._reject(new ag.Abort(e.error)),this.active=!1,this.on("abort").fire(t)}),e.oncomplete=a7(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&s8.storagemutated.fire(e.mutatedParts)}),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return sv(new ag.ReadOnly("Transaction is readonly"));if(!this.active)return sv(new ag.TransactionInactive);if(this._locked())return new aY((n,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,i)},az])});if(r)return sa(()=>{var e=new aY((e,r)=>{this._lock();let n=t(e,r,this);n&&n.then&&n.then(e,r)});return e.finally(()=>this._unlock()),e._lib=!0,e});var n=new aY((e,r)=>{var n=t(e,r,this);n&&n.then&&n.then(e,r)});return n._lib=!0,n}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();let r=aY.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(()=>r);else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new aY((e,n)=>{r.then(r=>t._waitingQueue.push(a7(e.bind(null,r))),e=>t._waitingQueue.push(a7(n.bind(null,e)))).finally(()=>{t._waitingFor===i&&(t._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ag.Abort))}table(e){let t=this._memoizedTables||(this._memoizedTables={});if(oF(t,e))return t[e];let r=this.schema[e];if(!r)throw new ag.NotFound("Table "+e+" not part of transaction");let n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n}}function s7(e,t,r,n,i,o,a){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:o,src:(r&&!a?"&":"")+(n?"*":"")+(i?"++":"")+le(t)}}function le(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function lt(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:oJ(r,e=>[e.name,e])}}let lr=e=>{try{return e.only([[]]),lr=()=>[[]],[[]]}catch(e){return lr=()=>sw,sw}};function ln(e){return null==e?()=>{}:"string"==typeof e?1===e.split(".").length?t=>t[e]:t=>oQ(t,e):t=>oQ(t,e)}function li(e){return[].slice.call(e)}let lo=0;function la(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function ls({_novip:e},t){let r=t.db,n=function(e,t,{IDBKeyRange:r,indexedDB:n},i){var o;return{dbcore:(o=function(e,t,r){let n;function i(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:r,upper:n,lowerOpen:i,upperOpen:o}=e;return void 0===r?void 0===n?null:t.upperBound(n,!!o):void 0===n?t.lowerBound(r,!!i):t.bound(r,n,!!i,!!o)}let{schema:o,hasGetAll:a}=(n=li(e.objectStoreNames),{schema:{name:e.name,tables:n.map(e=>r.objectStore(e)).map(e=>{let{keyPath:t,autoIncrement:r}=e,n=oN(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:ln(t)},indexes:li(e.indexNames).map(t=>e.index(t)).map(e=>{let{name:t,unique:r,multiEntry:n,keyPath:i}=e,a={name:t,compound:oN(i),keyPath:i,unique:r,multiEntry:n,extractKey:ln(i)};return o[la(i)]=a,a}),getIndexByKeyPath:e=>o[la(e)]};return o[":id"]=a.primaryKey,null!=t&&(o[la(t)]=a.primaryKey),a})},hasGetAll:n.length>0&&"getAll"in r.objectStore(n[0])&&!("u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),s=o.tables.map(e=>{let t;return{name:t=e.name,schema:e,mutate:function({trans:e,type:r,keys:n,values:o,range:a}){return new Promise((s,l)=>{let u;s=a7(s);let c=e.objectStore(t),d=null==c.keyPath,f="put"===r||"add"===r;if(!f&&"delete"!==r&&"deleteRange"!==r)throw Error("Invalid operation type: "+r);let{length:p}=n||o||{length:1};if(n&&o&&n.length!==o.length)throw Error("Given keys array must have same length as given values array.");if(0===p)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let h=[],m=[],y=0,g=e=>{++y,s2(e)};if("deleteRange"===r){if(4===a.type)return s({numFailures:y,failures:m,results:[],lastResult:void 0});3===a.type?h.push(u=c.clear()):h.push(u=c.delete(i(a)))}else{let[e,t]=f?d?[o,n]:[o,null]:[n,null];if(f)for(let n=0;n<p;++n)h.push(u=t&&void 0!==t[n]?c[r](e[n],t[n]):c[r](e[n])),u.onerror=g;else for(let t=0;t<p;++t)h.push(u=c[r](e[t])),u.onerror=g}let b=e=>{let t=e.target.result;h.forEach((e,t)=>null!=e.error&&(m[t]=e.error)),s({numFailures:y,failures:m,results:"delete"===r?n:h.map(e=>e.result),lastResult:t})};u.onerror=e=>{g(e),b(e)},u.onsuccess=b})},getMany:({trans:e,keys:r})=>new Promise((n,i)=>{n=a7(n);let o=e.objectStore(t),a=r.length,s=Array(a),l,u=0,c=0,d=e=>{let t=e.target;s[t._pos]=t.result,++c===u&&n(s)},f=s4(i);for(let e=0;e<a;++e)null!=r[e]&&((l=o.get(r[e]))._pos=e,l.onsuccess=d,l.onerror=f,++u);0===u&&n(s)}),get:({trans:e,key:r})=>new Promise((n,i)=>{n=a7(n);let o=e.objectStore(t).get(r);o.onsuccess=e=>n(e.target.result),o.onerror=s4(i)}),query:e=>new Promise((r,n)=>{r=a7(r);let{trans:o,values:s,limit:l,query:u}=e,c=l===1/0?void 0:l,{index:d,range:f}=u,p=o.objectStore(t),h=d.isPrimaryKey?p:p.index(d.name),m=i(f);if(0===l)return r({result:[]});if(a){let e=s?h.getAll(m,c):h.getAllKeys(m,c);e.onsuccess=e=>r({result:e.target.result}),e.onerror=s4(n)}else{let e=0,t=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),i=[];t.onsuccess=n=>{let o=t.result;return o?(i.push(s?o.value:o.primaryKey),++e===l?r({result:i}):void o.continue()):r({result:i})},t.onerror=s4(n)}}),openCursor:function({trans:e,values:r,query:n,reverse:o,unique:a}){return new Promise((s,l)=>{s=a7(s);let{index:u,range:c}=n,d=e.objectStore(t),f=u.isPrimaryKey?d:d.index(u.name),p=o?a?"prevunique":"prev":a?"nextunique":"next",h=!r&&"openKeyCursor"in f?f.openKeyCursor(i(c),p):f.openCursor(i(c),p);h.onerror=s4(l),h.onsuccess=a7(t=>{let r=h.result;if(!r)return void s(null);r.___id=++lo,r.done=!1;let n=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));let o=r.advance.bind(r),a=()=>{throw Error("Cursor not stopped")};r.trans=e,r.stop=r.continue=r.continuePrimaryKey=r.advance=()=>{throw Error("Cursor not started")},r.fail=a7(l),r.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},r.start=e=>{let t=new Promise((e,t)=>{e=a7(e),h.onerror=s4(t),r.fail=t,r.stop=t=>{r.stop=r.continue=r.continuePrimaryKey=r.advance=a,e(t)}}),s=()=>{if(h.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=()=>{throw Error("Cursor behind last entry")},r.stop()};return h.onsuccess=a7(e=>{h.onsuccess=s,s()}),r.continue=n,r.continuePrimaryKey=i,r.advance=o,s(),t},s(r)},l)})},count({query:e,trans:r}){let{index:n,range:o}=e;return new Promise((e,a)=>{let s=r.objectStore(t),l=n.isPrimaryKey?s:s.index(n.name),u=i(o),c=u?l.count(u):l.count();c.onsuccess=a7(t=>e(t.target.result)),c.onerror=s4(a)})}}}),l={};return s.forEach(e=>l[e.name]=e),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!l[e])throw Error(`Table '${e}' not found`);return l[e]},MIN_KEY:-1/0,MAX_KEY:lr(t),schema:o}}(t,r,i),e.dbcore.reduce((e,{create:t})=>({...e,...t(e)}),o))}}(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach(t=>{let r=t.name;e.core.schema.tables.some(e=>e.name===r)&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))})}function ll({_novip:e},t,r,n){r.forEach(r=>{let i=n[r];t.forEach(t=>{let n=oH(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?oU(t,r,{get(){return this.table(r)},set(e){oV(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))})})}function lu({_novip:e},t){t.forEach(t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]})}function lc(e,t){return e._cfg.version-t._cfg.version}function ld(e,t){let r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){let i=e[r],o=t[r];if(i){let e={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")==""+(o.primKey.keyPath||"")&&(i.primKey.auto===o.primKey.auto||sO)){let t,r=i.idxByName,a=o.idxByName;for(t in r)a[t]||e.del.push(t);for(t in a){let n=r[t],i=a[t];n?n.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}else e.recreate=!0,n.change.push(e)}else n.add.push([r,o])}return n}function lf(e,t,r,n){let i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach(e=>lp(i,e)),i}function lp(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function lh(e,t,r){let n={};return oq(t.objectStoreNames,0).forEach(e=>{let t=r.objectStore(e),i=t.keyPath,o=s7(le(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[];for(let e=0;e<t.indexNames.length;++e){let r=t.index(t.indexNames[e]);i=r.keyPath;var s=s7(r.name,i,!!r.unique,!!r.multiEntry,!1,i&&"string"!=typeof i,!1);a.push(s)}n[e]=lt(e,o,a)}),n}function lm({_novip:e},t,r){let n=r.db.objectStoreNames;for(let i=0;i<n.length;++i){let o=n[i],a=r.objectStore(o);e._hasGetAll="getAll"in a;for(let e=0;e<a.indexNames.length;++e){let r=a.indexNames[e],n=a.index(r).keyPath,i="string"==typeof n?n:"["+oq(n).join("+")+"]";if(t[o]){let e=t[o].idxByName[i];e&&(e.name=r,delete t[o].idxByName[i],t[o].idxByName[r]=e)}}}"u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&oA.WorkerGlobalScope&&oA instanceof oA.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class ly{_parseStoresSpec(e,t){oM(e).forEach(r=>{if(null!==e[r]){var n=e[r].split(",").map((e,t)=>{let r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return s7(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),oN(n),0===t)}),i=n.shift();if(i.multi)throw new ag.Schema("Primary key cannot be multi-valued");n.forEach(e=>{if(e.auto)throw new ag.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new ag.Schema("Index must have a name and cannot be an empty string")}),t[r]=lt(r,i,n)}})}stores(e){let t=this.db;this._cfg.storesSource=this._cfg.storesSource?oI(this._cfg.storesSource,e):e;let r=t._versions,n={},i={};return r.forEach(e=>{oI(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)}),t._dbSchema=i,lu(t,[t._allTables,t,t.Transaction.prototype]),ll(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],oM(i),i),t._storeNames=oM(i),this}upgrade(e){return this._cfg.contentUpgrade=aC(this._cfg.contentUpgrade||a_,e),this}}function lg(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new lI(sC,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),r.table("dbnames")}function lb(e){return e&&"function"==typeof e.databases}function lv(e){return sa(function(){return az.letThrough=!0,e()})}function l_(e){var t=t=>e.next(t),r=i(t),n=i(t=>e.throw(t));function i(e){return t=>{var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):oN(o)?Promise.all(o).then(r,n):r(o)}}return i(t)()}function lw(e,t,r){var n=arguments.length;if(n<2)throw new ag.InvalidArgument("Too few arguments");for(var i=Array(n-1);--n;)i[n-1]=arguments[n];return r=i.pop(),[e,o3(i),r]}function lx(e,t,r){let n=oN(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}let lE={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){let r=e.table(t),{schema:n}=r,i={},o=[];function a(e,t,r){let n=la(e),s=i[n]=i[n]||[],l=null==e?0:"string"==typeof e?1:e.length,u=t>0,c={...r,isVirtual:u,keyTail:t,keyLength:l,extractKey:ln(e),unique:!u&&r.unique};return s.push(c),c.isPrimaryKey||o.push(c),l>1&&a(2===l?e[0]:e.slice(0,l-1),t+1,r),s.sort((e,t)=>e.keyTail-t.keyTail),c}let s=a(n.primaryKey.keyPath,0,n.primaryKey);for(let e of(i[":id"]=[s],n.indexes))a(e.keyPath,0,e);function l(t){var r,n;let i=t.query.index;return i.isVirtual?{...t,query:{index:i,range:(r=t.query.range,n=i.keyTail,{type:1===r.type?2:r.type,lower:lx(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:lx(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}:t}return{...r,schema:{...n,primaryKey:s,indexes:o,getIndexByKeyPath:function(e){let t=i[la(e)];return t&&t[0]}},count:e=>r.count(l(e)),query:e=>r.query(l(e)),openCursor(t){let{keyTail:n,isVirtual:i,keyLength:o}=t.query.index;return i?r.openCursor(l(t)).then(r=>r&&Object.create(r,{continue:{value:function(i){null!=i?r.continue(lx(i,t.reverse?e.MAX_KEY:e.MIN_KEY,n)):t.unique?r.continue(r.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,n)):r.continue()}},continuePrimaryKey:{value(t,i){r.continuePrimaryKey(lx(t,e.MAX_KEY,n),i)}},primaryKey:{get:()=>r.primaryKey},key:{get(){let e=r.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>r.value}})):r.openCursor(t)}}}}}};function lS(e,t,r,n){return r=r||{},n=n||"",oM(e).forEach(i=>{if(oF(t,i)){var o=e[i],a=t[i];if("object"==typeof o&&"object"==typeof a&&o&&a){let e=o9(o);e!==o9(a)?r[n+i]=t[i]:"Object"===e?lS(o,a,r,n+i+"."):o!==a&&(r[n+i]=t[i])}else o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0}),oM(t).forEach(i=>{oF(e,i)||(r[n+i]=t[i])}),r}let lD={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){let r=e.table(t),{primaryKey:n}=r.schema;return{...r,mutate(e){let i=az.trans,{deleting:o,creating:a,updating:s}=i.table(t).hook;switch(e.type){case"add":if(a.fire===a_)break;return i._promise("readwrite",()=>l(e),!0);case"put":if(a.fire===a_&&s.fire===a_)break;return i._promise("readwrite",()=>l(e),!0);case"delete":if(o.fire===a_)break;return i._promise("readwrite",()=>l(e),!0);case"deleteRange":if(o.fire===a_)break;return i._promise("readwrite",()=>(function e(t,i,o){return r.query({trans:t,values:!1,query:{index:n,range:i},limit:o}).then(({result:r})=>l({type:"delete",keys:r,trans:t}).then(n=>n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:e(t,{...i,lower:r[r.length-1],lowerOpen:!0},o)))})(e.trans,e.range,1e4),!0)}return r.mutate(e);function l(e){var t,i;let l=az.trans,u=e.keys||("delete"===(t=e).type?t.keys:t.keys||t.values.map(n.extractKey));if(!u)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:u}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),("add"===(i=e).type?Promise.resolve([]):r.getMany({trans:i.trans,keys:u,cache:"immutable"})).then(t=>{let i=u.map((r,i)=>{let u=t[i],c={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(c,r,u,l);else if("add"===e.type||void 0===u){let t=a.fire.call(c,r,e.values[i],l);null==r&&null!=t&&(r=t,e.keys[i]=r,n.outbound||oX(e.values[i],n.keyPath,r))}else{let t=lS(u,e.values[i]),n=s.fire.call(c,t,r,u,l);if(n){let t=e.values[i];Object.keys(n).forEach(e=>{oF(t,e)?t[e]=n[e]:oX(t,e,n[e])})}}return c});return r.mutate(e).then(({failures:r,results:n,numFailures:o,lastResult:a})=>{for(let o=0;o<u.length;++o){let a=n?n[o]:u[o],s=i[o];null==a?s.onerror&&s.onerror(r[o]):s.onsuccess&&s.onsuccess("put"===e.type&&t[o]?e.values[o]:a)}return{failures:r,results:n,numFailures:o,lastResult:a}}).catch(e=>(i.forEach(t=>t.onerror&&t.onerror(e)),Promise.reject(e)))})}}}}})};function lO(e,t,r){try{if(!t||t.keys.length<e.length)return null;let n=[];for(let i=0,o=0;i<t.keys.length&&o<e.length;++i)0===sK(t.keys[i],e[o])&&(n.push(r?o5(t.values[i]):t.values[i]),++o);return n.length===e.length?n:null}catch(e){return null}}let lP={stack:"dbcore",level:-1,create:e=>({table:t=>{let r=e.table(t);return{...r,getMany:e=>{if(!e.cache)return r.getMany(e);let t=lO(e.keys,e.trans._cache,"clone"===e.cache);return t?aY.resolve(t):r.getMany(e).then(t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?o5(t):t},t))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function lC(e){return!("from"in e)}let lk=function(e,t){if(!this){let t=new lk;return e&&"d"in e&&oI(t,e),t}oI(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function lj(e,t,r){let n=sK(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(lC(e))return oI(e,{from:t,to:r,d:1});let i=e.l,o=e.r;if(0>sK(r,e.from))return i?lj(i,t,r):e.l={from:t,to:r,d:1,l:null,r:null},lA(e);if(sK(t,e.to)>0)return o?lj(o,t,r):e.r={from:t,to:r,d:1,l:null,r:null},lA(e);0>sK(t,e.from)&&(e.from=t,e.l=null,e.d=o?o.d+1:1),sK(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);let a=!e.r;i&&!e.l&&lT(e,i),o&&a&&lT(e,o)}function lT(e,t){lC(t)||function e(t,{from:r,to:n,l:i,r:o}){lj(t,r,n),i&&e(t,i),o&&e(t,o)}(e,t)}function lR(e){let t=lC(e)?null:{s:0,n:e};return{next(e){let r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&0>sK(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!r||0>=sK(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function lA(e){var t,r;let n=((null==(t=e.r)?void 0:t.d)||0)-((null==(r=e.l)?void 0:r.d)||0),i=n>1?"r":n<-1?"l":"";if(i){let t="r"===i?"l":"r",r={...e},n=e[i];e.from=n.from,e.to=n.to,e[i]=n[i],r[i]=n[t],e[t]=r,r.d=lM(r)}e.d=lM(e)}function lM({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}oB(lk.prototype,{add(e){return lT(this,e),this},addKey(e){return lj(this,e,e),this},addKeys(e){return e.forEach(e=>lj(this,e,e)),this},[o7](){return lR(this)}});let lN={stack:"dbcore",level:0,create:e=>{let t=e.schema.name,r=new lk(e.MIN_KEY,e.MAX_KEY);return{...e,table:n=>{let i=e.table(n),{schema:o}=i,{primaryKey:a}=o,{extractKey:s,outbound:l}=a,u={...i,mutate:e=>{let a=e.trans,s=a.mutatedParts||(a.mutatedParts={}),l=e=>{let r=`idb://${t}/${n}/${e}`;return s[r]||(s[r]=new lk)},u=l(""),c=l(":dels"),{type:d}=e,[f,p]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return i.mutate(e).then(e=>{if(oN(f)){"delete"!==d&&(f=e.results),u.addKeys(f);let t=lO(f,h);t||"add"===d||c.addKeys(f),(t||p)&&o.indexes.forEach(function(e){let r=l(e.name||"");function n(t){return null!=t?e.extractKey(t):null}let i=t=>e.multiEntry&&oN(t)?t.forEach(e=>r.addKey(e)):r.addKey(t);(t||p).forEach((e,r)=>{let o=t&&n(t[r]),a=p&&n(p[r]);0!==sK(o,a)&&(null!=o&&i(o),null!=a&&i(a))})})}else if(f){let e={from:f.lower,to:f.upper};c.add(e),u.add(e)}else u.add(r),c.add(r),o.indexes.forEach(e=>l(e.name).add(r));return e})}},c=({query:{index:t,range:r}})=>{var n,i;return[t,new lk(null!=(n=r.lower)?n:e.MIN_KEY,null!=(i=r.upper)?i:e.MAX_KEY)]},d={get:e=>[a,new lk(e.key)],getMany:e=>[a,(new lk).addKeys(e.keys)],count:c,query:c,openCursor:c};return oM(d).forEach(e=>{u[e]=function(o){let{subscr:a}=az;if(a){let u=e=>{let r=`idb://${t}/${n}/${e}`;return a[r]||(a[r]=new lk)},c=u(""),f=u(":dels"),[p,h]=d[e](o);if(u(p.name||"").add(h),!p.isPrimaryKey){if("count"!==e){let t="query"===e&&l&&o.values&&i.query({...o,values:!1});return i[e].apply(this,arguments).then(r=>{if("query"===e){if(l&&o.values)return t.then(({result:e})=>(c.addKeys(e),r));let e=o.values?r.result.map(s):r.result;o.values?c.addKeys(e):f.addKeys(e)}else if("openCursor"===e){let e=o.values;return r&&Object.create(r,{key:{get:()=>(f.addKey(r.primaryKey),r.key)},primaryKey:{get(){let e=r.primaryKey;return f.addKey(e),e}},value:{get:()=>(e&&c.addKey(r.primaryKey),r.value)}})}return r})}f.add(r)}}return i[e].apply(this,arguments)}}),u}}}};class lI{constructor(e,t){var r;this._middlewares={},this.verno=0;const n=lI.dependencies;this._options=t={addons:lI.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:i}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:a_,dbReadyPromise:null,cancelOpen:a_,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};o.dbReadyPromise=new aY(e=>{o.dbReadyResolve=e}),o.openCanceller=new aY((e,t)=>{o.cancelOpen=t}),this._state=o,this.name=e,this.on=sN(this,"populate","blocked","versionchange","close",{ready:[aC,a_]}),this.on.ready.subscribe=oG(this.on.ready.subscribe,e=>(t,r)=>{lI.vip(()=>{let n=this._state;if(n.openComplete)n.dbOpenError||aY.resolve().then(t),r&&e(t);else if(n.onReadyBeingFired)n.onReadyBeingFired.push(t),r&&e(t);else{e(t);let n=this;r||e(function e(){n.on.ready.unsubscribe(t),n.on.ready.unsubscribe(e)})}})}),this.Collection=(r=this,sI(sq.prototype,function(e,t){this.db=r;let n=sR,i=null;if(t)try{n=t()}catch(e){i=e}let o=e._ctx,a=o.table,s=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:s!==aw?s:null}})),this.Table=function(e){return sI(sM.prototype,function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:sN(null,{creating:[aS,a_],reading:[ax,aw],updating:[aO,a_],deleting:[aD,a_]})})}(this),this.Transaction=function(e){return sI(s9.prototype,function(t,r,n,i,o){this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=sN(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new aY((e,t)=>{this._resolve=e,this._reject=t}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),sv(e)})})}(this),this.Version=function(e){return sI(ly.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return sI(s3.prototype,function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};let i=e._deps.indexedDB;if(!i)throw new ag.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>0>i.cmp(e,t)?e:t,this._IDBKeyRange=e._deps.IDBKeyRange})}(this),this.on("versionchange",e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)}),this._maxKey=lr(t.IDBKeyRange),this._createTransaction=(e,t,r,n)=>new this.Transaction(e,t,r,this._options.chromeTransactionDurability,n),this._fireOnBlocked=e=>{this.on("blocked").fire(e),sD.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(t=>t.on("versionchange").fire(e))},this.use(lE),this.use(lD),this.use(lN),this.use(lP),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new ag.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new ag.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let t=this._versions;var r=t.filter(t=>t._cfg.version===e)[0];return r||(r=new this.Version(e),t.push(r),t.sort(lc),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||az.letThrough||this._vip)?e():new aY((e,t)=>{if(this._state.openComplete)return t(new ag.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new ag.DatabaseClosed);this.open().catch(a_)}this._state.dbReadyPromise.then(e,t)}).then(e)}use({stack:e,create:t,level:r,name:n}){n&&this.unuse({stack:e,name:n});let i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==r?10:r,name:n}),i.sort((e,t)=>e.level-t.level),this}unuse({stack:e,name:t,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter(e=>r?e.create!==r:!!t&&e.name!==t)),this}open(){return function(e){var t;let r=e._state,{indexedDB:n}=e._deps;if(r.isBeingOpened||e.idbdb)return r.dbReadyPromise.then(()=>r.dbOpenError?sv(r.dbOpenError):e);ai&&(r.openCanceller._stackHolder=as()),r.isBeingOpened=!0,r.dbOpenError=null,r.openComplete=!1;let i=r.openCanceller;function o(){if(r.openCanceller!==i)throw new ag.DatabaseClosed("db.open() was cancelled")}let a=r.dbReadyResolve,s=null,l=!1,u=()=>new aY((t,i)=>{if(o(),!n)throw new ag.MissingAPI;let a=e.name,u=r.autoSchema?n.open(a):n.open(a,Math.round(10*e.verno));if(!u)throw new ag.MissingAPI;u.onerror=s4(i),u.onblocked=a7(e._fireOnBlocked),u.onupgradeneeded=a7(t=>{if(s=u.transaction,r.autoSchema&&!e._options.allowEmptyDB){u.onerror=s2,s.abort(),u.result.close();let e=n.deleteDatabase(a);e.onsuccess=e.onerror=a7(()=>{i(new ag.NoSuchDatabase(`Database ${a} doesnt exist`))})}else{let r,n,a,f;s.onerror=s4(i);var o,c,d=t.oldVersion>0x4000000000000000?0:t.oldVersion;l=d<1,e._novip.idbdb=u.result,o=d/10,c=s,r=e._dbSchema,(n=e._createTransaction("readwrite",e._storeNames,r)).create(c),n._completion.catch(i),a=n._reject.bind(n),f=az.transless||az,sa(()=>{az.trans=n,az.transless=f,0===o?(oM(r).forEach(e=>{lf(c,e,r[e].primKey,r[e].indexes)}),ls(e,c),aY.follow(()=>e.on.populate.fire(n)).catch(a)):(function({_novip:e},t,r,n){let i=[],o=e._versions,a=e._dbSchema=lh(e,e.idbdb,n),s=!1;return o.filter(e=>e._cfg.version>=t).forEach(o=>{i.push(()=>{let i=a,l=o._cfg.dbschema;lm(e,i,n),lm(e,l,n),a=e._dbSchema=l;let u=ld(i,l);u.add.forEach(e=>{lf(n,e[0],e[1].primKey,e[1].indexes)}),u.change.forEach(e=>{if(e.recreate)throw new ag.Upgrade("Not yet support for changing primary key");{let t=n.objectStore(e.name);e.add.forEach(e=>lp(t,e)),e.change.forEach(e=>{t.deleteIndex(e.name),lp(t,e)}),e.del.forEach(e=>t.deleteIndex(e))}});let c=o._cfg.contentUpgrade;if(c&&o._cfg.version>t){let t;ls(e,n),r._memoizedTables={},s=!0;let o=o0(l);u.del.forEach(e=>{o[e]=i[e]}),lu(e,[e.Transaction.prototype]),ll(e,[e.Transaction.prototype],oM(o),o),r.schema=o;let a=an(c);a&&ss();let d=aY.follow(()=>{if((t=c(r))&&a){var e=sl.bind(null,null);t.then(e,e)}});return t&&"function"==typeof t.then?aY.resolve(t):d.then(()=>t)}}),i.push(t=>{var n;s&&sO||(n=o._cfg.dbschema,[].slice.call(t.db.objectStoreNames).forEach(e=>null==n[e]&&t.db.deleteObjectStore(e))),lu(e,[e.Transaction.prototype]),ll(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema})}),(function e(){return i.length?aY.resolve(i.shift()(r.idbtrans)).then(e):aY.resolve()})().then(()=>{var e;oM(e=a).forEach(t=>{n.db.objectStoreNames.contains(t)||lf(n,t,e[t].primKey,e[t].indexes)})})})(e,o,n,c).catch(a)})}},i),u.onsuccess=a7(()=>{s=null;let n=e._novip.idbdb=u.result,i=oq(n.objectStoreNames);if(i.length>0)try{let t,o=n.transaction(1===i.length?i[0]:i,"readonly");r.autoSchema?function({_novip:e},t,r){e.verno=t.version/10;let n=e._dbSchema=lh(0,t,r);e._storeNames=oq(t.objectStoreNames,0),ll(e,[e._allTables],oM(n),n)}(e,n,o):(lm(e,e._dbSchema,o),((t=ld(lh(0,e.idbdb,o),e._dbSchema)).add.length||t.change.some(e=>e.add.length||e.change.length))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),ls(e,o)}catch(e){}sD.push(e),n.onversionchange=a7(t=>{r.vcFired=!0,e.on("versionchange").fire(t)}),n.onclose=a7(t=>{e.on("close").fire(t)}),l&&function({indexedDB:e,IDBKeyRange:t},r){lb(e)||r===sC||lg(e,t).put({name:r}).catch(a_)}(e._deps,a),t()},i)}).catch(e=>e&&"UnknownError"===e.name&&r.PR1398_maxLoop>0?(r.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),u()):aY.reject(e));return aY.race([i,("u"<typeof navigator?aY.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var r=function(){return indexedDB.databases().finally(e)};t=setInterval(r,100),r()}).finally(function(){return clearInterval(t)}):Promise.resolve()).then(u)]).then(()=>(o(),r.onReadyBeingFired=[],aY.resolve(lv(()=>e.on.ready.fire(e.vip))).then(function t(){if(r.onReadyBeingFired.length>0){let n=r.onReadyBeingFired.reduce(aC,a_);return r.onReadyBeingFired=[],aY.resolve(lv(()=>n(e.vip))).then(t)}}))).finally(()=>{r.onReadyBeingFired=null,r.isBeingOpened=!1}).then(()=>e).catch(t=>{r.dbOpenError=t;try{s&&s.abort()}catch(e){}return i===r.openCanceller&&e._close(),sv(t)}).finally(()=>{r.openComplete=!0,a()})}(this)}_close(){let e=this._state,t=sD.indexOf(this);if(t>=0&&sD.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new aY(t=>{e.dbReadyResolve=t}),e.openCanceller=new aY((t,r)=>{e.cancelOpen=r})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new ag.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,t=this._state;return new aY((r,n)=>{let i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=a7(()=>{!function({indexedDB:e,IDBKeyRange:t},r){lb(e)||r===sC||lg(e,t).delete(r).catch(a_)}(this._deps,this.name),r()}),e.onerror=s4(n),e.onblocked=this._fireOnBlocked};if(e)throw new ag.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()})}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){let e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return oM(this._allTables).map(e=>this._allTables[e])}transaction(){let e=lw.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n,i,o=az.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);let a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(i=t.map(e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||e===sk)n=sk;else{if("rw"!=e&&e!=sj)throw new ag.InvalidArgument("Invalid transaction mode: "+e);n=sj}if(o){if(o.mode===sk&&n===sj){if(!a)throw new ag.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&i.forEach(e=>{if(o&&-1===o.storeNames.indexOf(e)){if(!a)throw new ag.SubTransaction("Table "+e+" not included in parent transaction.");o=null}}),a&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(t,r)=>{r(e)}):sv(e)}let s=(function e(t,r,n,i,o){return aY.resolve().then(()=>{let a,s=az.transless||az,l=t._createTransaction(r,n,t._dbSchema,i);if(i)l.idbtrans=i.idbtrans;else try{l.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===ay.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,r,n,null,o))):sv(i)}let u=an(o);u&&ss();let c=aY.follow(()=>{if(a=o.call(l,l))if(u){var e=sl.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=l_(a))},{trans:l,transless:s});return(a&&"function"==typeof a.then?aY.resolve(a).then(e=>l.active?e:sv(new ag.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>a)).then(e=>(i&&l._resolve(),l._completion.then(()=>e))).catch(e=>(l._reject(e),sv(e)))})}).bind(null,this,n,i,o,r);return o?o._promise(n,s,"lock"):az.trans?sh(az.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!oF(this._allTables,e))throw new ag.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let l$="u">typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class lL{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[l$](){return this}}function lF(e,t){return oM(t).forEach(r=>{lT(e[r]||(e[r]=new lk),t[r])}),e}try{o={indexedDB:oA.indexedDB||oA.mozIndexedDB||oA.webkitIndexedDB||oA.msIndexedDB,IDBKeyRange:oA.IDBKeyRange||oA.webkitIDBKeyRange}}catch(e){o={indexedDB:null,IDBKeyRange:null}}function lB(e){let t=lV;try{lV=!0,s8.storagemutated.fire(e)}finally{lV=t}}oB(lI,{...av,delete:e=>new lI(e,{addons:[]}).delete(),exists:e=>new lI(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:t}){return lb(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>e!==sC)):lg(e,t).toCollection().primaryKeys()})(lI.dependencies).then(e)}catch(e){return sv(new ag.MissingAPI)}},defineClass:()=>function(e){oI(this,e)},ignoreTransaction:e=>az.trans?sh(az.transless,e):e(),vip:lv,async:function(e){return function(){try{var t=l_(e.apply(this,arguments));return t&&"function"==typeof t.then?t:aY.resolve(t)}catch(e){return sv(e)}}},spawn:function(e,t,r){try{var n=l_(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:aY.resolve(n)}catch(e){return sv(e)}},currentTransaction:{get:()=>az.trans||null},waitFor:function(e,t){let r=aY.resolve("function"==typeof e?lI.ignoreTransaction(e):e).timeout(t||6e4);return az.trans?az.trans.waitFor(r):r},Promise:aY,debug:{get:()=>ai,set:e=>{ai=e,ao="dexie"===e?()=>!0:sP}},derive:oW,extend:oI,props:oB,override:oG,Events:sN,on:s8,liveQuery:function(e){let t,r=!1,n=new lL(n=>{let i=an(e),o=!1,a={},s={},l={get closed(){return o},unsubscribe:()=>{o=!0,s8.storagemutated.unsubscribe(f)}};n.start&&n.start(l);let u=!1,c=!1;function d(){return oM(s).some(e=>a[e]&&function(e,t){let r=lR(t),n=r.next();if(n.done)return!1;let i=n.value,o=lR(e),a=o.next(i.from),s=a.value;for(;!n.done&&!a.done;){if(0>=sK(s.from,i.to)&&sK(s.to,i.from)>=0)return!0;0>sK(i.from,s.from)?i=(n=r.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}(a[e],s[e]))}let f=e=>{lF(a,e),d()&&p()},p=()=>{let h,m;if(u||o)return;a={};let y={},g=(i&&ss(),h=()=>sa(e,{subscr:y,trans:null}),m=az.trans?sh(az.transless,h):h(),i&&m.then(sl,sl),m);c||(s8(s6,f),c=!0),u=!0,Promise.resolve(g).then(e=>{r=!0,t=e,u=!1,o||(d()?p():(a={},s=y,n.next&&n.next(e)))},e=>{u=!1,r=!1,n.error&&n.error(e),l.unsubscribe()})};return p(),l});return n.hasValue=()=>r,n.getValue=()=>t,n},extendObservabilitySet:lF,getByKeyPath:oQ,setByKeyPath:oX,delByKeyPath:function(e,t){"string"==typeof t?oX(e,t,void 0):"length"in t&&[].map.call(t,function(t){oX(e,t,void 0)})},shallowClone:o0,deepClone:o5,getObjectDiff:lS,cmp:sK,asap:oY,minKey:sx,addons:[],connections:sD,errnames:ay,dependencies:o,semVer:s_,version:s_.split(".").map(e=>parseInt(e)).reduce((e,t,r)=>e+t/Math.pow(10,2*r))}),lI.maxKey=lr(lI.dependencies.IDBKeyRange),"u">typeof dispatchEvent&&"u">typeof addEventListener&&(s8(s6,e=>{if(!lV){let t;sO?(t=document.createEvent("CustomEvent")).initCustomEvent(s5,!0,!0,e):t=new CustomEvent(s5,{detail:e}),lV=!0,dispatchEvent(t),lV=!1}}),addEventListener(s5,({detail:e})=>{lV||lB(e)}));let lV=!1;if("u">typeof BroadcastChannel){let e=new BroadcastChannel(s5);"function"==typeof e.unref&&e.unref(),s8(s6,t=>{lV||e.postMessage(t)}),e.onmessage=e=>{e.data&&lB(e.data)}}else if("u">typeof self&&"u">typeof navigator){s8(s6,e=>{try{lV||("u">typeof localStorage&&localStorage.setItem(s5,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(t=>t.postMessage({type:s5,changedParts:e})))}catch(e){}}),"u">typeof addEventListener&&addEventListener("storage",e=>{if(e.key===s5){let t=JSON.parse(e.newValue);t&&lB(t.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&e.type===s5&&lB(e.changedParts)})}function lU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}aY.rejectionMapper=function(e,t){if(!e||e instanceof af||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ab[e.name])return e;var r=new ab[e.name](t||e.message,e);return"stack"in e&&oU(r,"stack",{get:function(){return this.inner.stack}}),r},ao=sP;class lW extends lI{constructor(){super("EsmOffline"),lU(this,"syncQueue",void 0),lU(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}}function lK(){return new lW}let lH=new lW,lz={};async function lq(){let e=await ic();return e?.uuid||"*"}async function lG(e,t,r,n){let i=n&&n.id;return void 0!==i&&await lH.syncQueue.where({type:t,userId:e}).filter(e=>e?.descriptor.id===i).delete().catch(lI.errnames.DatabaseClosed),await lH.syncQueue.add({type:t,content:r,userId:e,descriptor:n||{},createdOn:new Date}).catch(lI.errnames.DatabaseClosed,()=>-1)}async function lZ(e,t,r){let n=await lq();return await lG(n,e,t,r)}async function lY(e,t){return(await lJ(e,t)).map(e=>e.content)}async function lJ(e,t){return await lH.syncQueue.where(t?{type:t,userId:e}:{userId:e}).toArray().catch(lI.errnames.DatabaseClosed,()=>[])}async function lQ(e){let t=await lq();return await lY(t,e)}async function lX(e){let t=await lq();return await lJ(t,e)}async function l0(e){return await lH.syncQueue.get(e).catch(lI.errnames.DatabaseClosed,()=>void 0)}function l1(e){return!!lz[e]?.options.onBeginEditSyncItem}async function l3(e){let t=await l0(e);if(!t)throw Error(`No sync item with the ID ${e} exists.`);let r=lz[t.type]?.options.onBeginEditSyncItem;if(!r)throw Error(`A sync item with the ID ${e} exists, but the associated handler (if one exists) doesn't support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "${t.type}" supports editing items.`);r(t)}async function l4(e){await lH.syncQueue.delete(e).catch(lI.errnames.DatabaseClosed)}function l2(e,t,r,n={}){lz[e]={type:e,dependsOn:t,process:r,options:n}}K("offline-synchronization",{});let l6={};function l5(){return Object.values(l6)}function l8(e){l6[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${e.id}" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.`),l6[e.id]=e}async function l9(e){let t=await ua();return await l7(t,e)}async function l7(e,t){let r=new lW;return await r.dynamicOfflineData.where(t?{type:t,users:e}:{users:e}).toArray().catch(lI.errnames.DatabaseClosed,()=>[])}async function ue(e,t){let r=await ua();return await ut(r,e,t)}async function ut(e,t,r){let n=new lW,i=await n.dynamicOfflineData.get({type:t,identifier:r}).catch(lI.errnames.DatabaseClosed,()=>void 0);i?i.users.includes(e)||await n.dynamicOfflineData.update(i.id,{users:[...i.users,e]}).catch(lI.errnames.DatabaseClosed):await n.dynamicOfflineData.add({users:[e],type:t,identifier:r}).catch(lI.errnames.DatabaseClosed)}async function ur(e,t){let r=await ua();return await un(r,e,t)}async function un(e,t,r){let n=new lW,i=await n.dynamicOfflineData.get({type:t,identifier:r,users:e}).catch(lI.errnames.DatabaseClosed,()=>void 0);i&&(i.users.length>1?await n.dynamicOfflineData.update(i.id,{users:i.users.filter(t=>t!==e)}).catch(lI.errnames.DatabaseClosed):await n.dynamicOfflineData.delete(i.id).catch(lI.errnames.DatabaseClosed))}async function ui(e,t){let r=await l9(e);await Promise.all(r.map(async e=>uo(e.type,e.identifier,t)))}async function uo(e,t,r){await ue(e,t);let n=new lW,i=await ua(),o=await n.dynamicOfflineData.get({type:e,identifier:t}).catch(lI.errnames.DatabaseClosed,()=>void 0),a=l5().filter(t=>t.type===e);if(!o)return;let s=await Promise.all(a.map(async e=>{try{return e.sync(t,r),{id:e.id,error:void 0}}catch(r){let t=r.message?.toString()??r.toString();return{id:e.id,error:t}}})),l=s.filter(e=>!e.error).map(e=>e.id),u=s.filter(e=>e.error).map(e=>e.id),c=s.filter(e=>e.error).map(e=>({handlerId:e.id,message:e.error})),d={syncedOn:new Date,syncedBy:i,succeededHandlers:l,erroredHandlers:u,errors:c};o.id&&await n.dynamicOfflineData.update(o.id,{syncState:d}).catch(lI.errnames.DatabaseClosed)}async function ua(){let e=(await ic()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let us=K("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function ul(){return ud(),us}function uu(e,t){ud(),l8({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,r)=>t.onOfflinePatientAdded({patientUuid:e,signal:r??new AbortController().signal})})}async function uc(e){ud(),await uo("patient",e)}function ud(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")}async function uf(e,t,r=!0){if(e){let n=null,[i,o]=await Promise.all([n9(`${n6}/Patient/${e}`,t).catch(e=>n=e),r?up(e):Promise.resolve(null)]);if(i.ok)return i.data;if(o)return o;if(n)throw n}return null}async function up(e){let t=(await lQ("patient-registration")).find(t=>t.fhirPatient.id===e);return t?.fhirPatient??null}function uh(e,t){let r=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,r),()=>{window.removeEventListener(`openmrs:${e}`,r)}}var um=((er={}).NEWVISIT="startVisit",er.EDITVISIT="editVisit",er.LOADING="loadingVisit",er),uy=((en={}).NOTSTARTED="notStarted",en.ONGOING="ongoing",en);let ug="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))",ub=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};function uv(){return z("visit",ub)}function u_(e,t){uv().setState({patientUuid:e,manuallySetVisitUuid:t})}function uw(e,t){return n9(`${n2}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function ux(e,t,r){return n9(`${n2}/visit/${e}`,{signal:r.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function uE(e,t,r){return n9(`${n2}/visit?patient=${e}&v=${r??ug}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}uv().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});let uS=new ea.BehaviorSubject(null);var uD=r(56170);function uO(e){return{uuid:e.uuid,display:e.display,name:e.name}}function uP(){return n7(`${n2}/visittype`).pipe((0,uD.map)(e=>e.data.results.map(uO))).pipe((0,uD.take)(1))}function uC(e){return{uuid:e.uuid,display:e.display}}function uk(e=null,t=null){let r=new URLSearchParams;e&&r.set("tag",e),t&&r.set("q",t);let n=r.toString();return n7(`${n2}/location${n?"?"+n:""}`).pipe((0,uD.map)(e=>e.data.results.map(uC))).pipe((0,uD.take)(1))}class uj{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+uj.version}static addUnaryOp(e){return uj.max_unop_len=Math.max(e.length,uj.max_unop_len),uj.unary_ops[e]=1,uj}static addBinaryOp(e,t,r){return uj.max_binop_len=Math.max(e.length,uj.max_binop_len),uj.binary_ops[e]=t,r?uj.right_associative.add(e):uj.right_associative.delete(e),uj}static addIdentifierChar(e){return uj.additional_identifier_chars.add(e),uj}static addLiteral(e,t){return uj.literals[e]=t,uj}static removeUnaryOp(e){return delete uj.unary_ops[e],e.length===uj.max_unop_len&&(uj.max_unop_len=uj.getMaxKeyLen(uj.unary_ops)),uj}static removeAllUnaryOps(){return uj.unary_ops={},uj.max_unop_len=0,uj}static removeIdentifierChar(e){return uj.additional_identifier_chars.delete(e),uj}static removeBinaryOp(e){return delete uj.binary_ops[e],e.length===uj.max_binop_len&&(uj.max_binop_len=uj.getMaxKeyLen(uj.binary_ops)),uj.right_associative.delete(e),uj}static removeAllBinaryOps(){return uj.binary_ops={},uj.max_binop_len=0,uj}static removeLiteral(e){return delete uj.literals[e],uj}static removeAllLiterals(){return uj.literals={},uj}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 uj(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 uj.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!uj.binary_ops[String.fromCharCode(e)]||uj.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return uj.isIdentifierStart(e)||uj.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(uj.hooks[e]){let r={context:this,node:t};return uj.hooks.run(e,r),r.node}return t}searchHook(e){if(uj.hooks[e]){let t={context:this};return uj.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===uj.SPACE_CODE||e===uj.TAB_CODE||e===uj.LF_CODE||e===uj.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:uj.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],r,n;for(;this.index<this.expr.length;)if((r=this.code)===uj.SEMCOL_CODE||r===uj.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())t.push(n);else if(this.index<this.expr.length){if(r===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,uj.max_binop_len),t=e.length;for(;t>0;){if(uj.binary_ops.hasOwnProperty(e)&&(!uj.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!uj.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,n,i,o,a,s,l;if(!(o=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return o;for(i={value:t,prec:uj.binaryPrecedence(t),right_a:uj.right_associative.has(t)},(a=this.gobbleToken())||this.throwError("Expected expression after "+t),n=[o,i,a];t=this.gobbleBinaryOp();){if(0===(r=uj.binaryPrecedence(t))){this.index-=t.length;break}i={value:t,prec:r,right_a:uj.right_associative.has(t)},l=t;let s=e=>i.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;n.length>2&&s(n[n.length-2]);)a=n.pop(),t=n.pop().value,o=n.pop(),e={type:uj.BINARY_EXP,operator:t,left:o,right:a},n.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),n.push(i,e)}for(s=n.length-1,e=n[s];s>1;)e={type:uj.BINARY_EXP,operator:n[s-1].value,left:n[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,r,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"))return this.runHook("after-token",n);if(e=this.code,uj.isDecimalDigit(e)||e===uj.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===uj.SQUOTE_CODE||e===uj.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===uj.OBRACK_CODE)n=this.gobbleArray();else{for(r=(t=this.expr.substr(this.index,uj.max_unop_len)).length;r>0;){if(uj.unary_ops.hasOwnProperty(t)&&(!uj.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!uj.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:uj.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}uj.isIdentifierStart(e)?(n=this.gobbleIdentifier(),uj.literals.hasOwnProperty(n.name)?n={type:uj.LITERAL,value:uj.literals[n.name],raw:n.name}:n.name===uj.this_str&&(n={type:uj.THIS_EXP})):e===uj.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===uj.PERIOD_CODE||t===uj.OBRACK_CODE||t===uj.OPAREN_CODE||t===uj.QUMARK_CODE;){let r;if(t===uj.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==uj.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===uj.OBRACK_CODE?((e={type:uj.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==uj.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===uj.OPAREN_CODE?e={type:uj.CALL_EXP,arguments:this.gobbleArguments(uj.CPAREN_CODE),callee:e}:(t===uj.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:uj.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,r;for(;uj.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===uj.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);uj.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++));uj.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);uj.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return r=this.code,uj.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(r===uj.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===uj.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:uj.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,r=this.expr.charAt(this.index++),n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){n=!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 n||this.throwError('Unclosed quote after "'+e+'"'),{type:uj.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(uj.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,uj.isIdentifierPart(e))this.index++;else break;return{type:uj.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],r=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===e){r=!0,this.index++,e===uj.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(i===uj.COMMA_CODE){if(this.index++,++n!==t.length){if(e===uj.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===uj.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==uj.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(uj.CPAREN_CODE);if(this.code===uj.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:uj.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:uj.ARRAY_EXP,elements:this.gobbleArguments(uj.CBRACK_CODE)}}}Object.assign(uj,{hooks:new class{add(e,t,r){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][r?"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)})}}(uj),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"}),uj.max_unop_len=uj.getMaxKeyLen(uj.unary_ops),uj.max_binop_len=uj.getMaxKeyLen(uj.binary_ops);let uT=e=>new uj(e).parse(),uR=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(uj).filter(e=>!uR.includes(e)&&void 0===uT[e]).forEach(e=>{uT[e]=uj[e]}),uT.Jsep=uj,uT.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}});let uA="ArrowFunctionExpression",uM={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)}},uN={...uM,Promise};function uI(e,t={}){return uU(e,t,uH)}async function u$(e,t={}){return uW(e,t,uH)}function uL(e,t={}){return uU(e,t,uz)}function uF(e,t={}){return uW(e,t,uz)}function uB(e,t={}){return uU(e,t,uq)}function uV(e,t={}){return uW(e,t,uq)}function uU(e,t={},r){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 n=uY(t,uM),i=uG("string"==typeof e?uT(e):e,n);if(r(i))return i;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 uW(e,t={},r){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 n=uY(t,uN);return Promise.resolve(uG("string"==typeof e?uT(e):e,n)).then(t=>{if(r(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 uK(e){return uT(e)}function uH(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function uz(e){return"boolean"==typeof e}function uq(e){return"number"==typeof e}function uG(e,t){switch(e.type){case"UnaryExpression":var r,n,i,o,a,s,l,u,c,d,f,p,h=e,m=t;let y=uG(h.argument,m);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 g=e,b=t;let v=uG(g.left,b),w=uG(g.right,b);switch(g.operator){case"+":return v+w;case"-":return v-w;case"*":return v*w;case"/":return v/w;case"%":return v%w;case"**":return v**w;case"==":return v==w;case"===":return v===w;case"!=":return v!=w;case"!==":return v!==w;case">":return v>w;case">=":return v>=w;case"<":return v<w;case"<=":return v<=w;case"in":return v in w;case"&&":return v&&w;case"||":return v||w;case"??":return v??w;default:throw`Expression evaluator does not support operator '${g.operator}' operator`}case"ConditionalExpression":return r=e,n=t,uG(r.test,n)?uG(r.consequent,n):uG(r.alternate,n);case"CallExpression":var x=e,E=t;let S=x.arguments?.map(uJ(E)),D=uG(x.callee,E);if(D){if("function"!=typeof D)throw`${uX(x.callee)} is not a function`}else throw`No function named ${uX(x.callee)} is defined in this context`;return D(...S);case"ArrowFunctionExpression":let O;return i=e,o=t,O=i.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<O.length)throw`Required argument(s) ${O.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(O.reduce((t,r,n)=>{let i=e[n];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 r of Object.keys(t))if(!e(t[r]))return!1;return!0}if(Array.isArray(t)){for(let r of t)if(!e(r))break}return!1}(i)&&t.push([r,i]),t},[]));return uG(i.body,o.addVariables(t))}).bind(o.thisObj??null);case"MemberExpression":return function(e,t){let r,n=uG(e.object,t);if(void 0===n)switch(e.object.type){case"Identifier":{let r=uZ(e.object,t);throw ReferenceError(`ReferenceError: ${r} is not defined`)}case"MemberExpression":{let r=uZ(e.property,t);throw TypeError(`TypeError: cannot read properties of undefined (reading '${r}')`)}default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}let i=n;if("string"==typeof n)i=String.prototype;else if("number"==typeof n)i=Number.prototype;else if("function"==typeof n);else if("object"!=typeof n)throw`VisitMemberExpression does not support member access on type ${typeof n}`;switch(t.thisObj=i,e.property.type){case"Identifier":case"MemberExpression":r=uG(e.property,t);break;default:{let i=uG(e.property,t);if(void 0===i)throw{type:"Illegal property access",message:"No property was supplied to the property access"};uQ(i),r=n[i]}}return"function"==typeof r?r.bind(n):r}(e,t);case"ArrayExpression":return a=e,s=t,a.elements?.map(uJ(s));case"SequenceExpression":let P;return l=e,u=t,(P=l.expressions.map(uJ(u)))[P.length-1];case"NewExpression":var C=e,k=t;if(C.callee&&"Identifier"===C.callee.type){let e=C.arguments?.map(uJ(k));switch(C.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${C.callee.name}`}}if(C.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return uQ((c=e).value),c.value;case"Identifier":var j=e,T=t;uQ(j.name);let R=T.thisObj;if(R&&("object"==typeof R||"function"==typeof R)&&j.name in R){let e=R[j.name];return uQ(e),e}if(T.variables&&j.name in T.variables){let e=T.variables[j.name];return uQ(e),e}return j.name in T.globals?T.globals[j.name]:void 0;case"TemplateLiteral":let A,M;return d=e,f=t,A=d.expressions?.map(uJ(f))??[],(M=d.quasis?.map(uJ(f))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+A.join("")+M.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(p=e).cooked,tail:p.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function uZ(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return uZ(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function uY(e,t){let r={thisObj:void 0,variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return r.addVariables.bind(r),r}function uJ(e){return function(t){return null===t?null:uG(t,e)}}function uQ(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}function uX(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}function u0(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:{...uN},isLocalExpression:!1,variables:new Set};return u1("string"==typeof e?uT(e):e,t),[...t.variables]}function u1(e,t){switch(e.type){case"UnaryExpression":return n=e,i=t,u1(n.argument,i);case"BinaryExpression":return o=e,a=t,[u1(o.left,a),u1(o.right,a)].filter(Boolean);case"ConditionalExpression":return s=e,l=t,[u1(s.consequent,l),u1(s.test,l),u1(s.alternate,l)].filter(Boolean);case"CallExpression":let r;return u=e,c=t,r=u1(u.callee,c),u.arguments?.map(u3(c)),r;case"ArrowFunctionExpression":var n,i,o,a,s,l,u,c,d,f,p,h,m,y,g,b,v,w,x=e,E=t;let S={...E};S.isLocalExpression=!0;let D=x.params?.map(u3(S))??[],O=u1(x.body,S)??[];if(O&&Array.isArray(O))for(let e of O)D.includes(e)||E.variables.add(e);return;case"MemberExpression":let P;return d=e,f=t,u1(d.object,f),void((P={...f}).isLocalExpression=!0,u1(d.property,P));case"ArrayExpression":return p=e,h=t,void p.elements?.map(u3(h));case"SequenceExpression":return m=e,y=t,void m.expressions?.map(u3(y));case"NewExpression":return g=e,b=t,void g.arguments?.map(u3(b));case"Literal":case"TemplateElement":return;case"Identifier":var C=e,k=t;if(!(C.name in k.globals))if(k.isLocalExpression)return C.name;else k.variables.add(C.name);return;case"TemplateLiteral":return v=e,w=t,void(v.expressions?.map(u3(w)),v.quasis?.map(u3(w)));default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function u3(e){return function(t){return null===t?null:u1(t,e)}}uT.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 r=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let r=this.gobbleBinaryExpression();r||this.throwError("Expected expression after "+e),t.node={type:uA,params:null,body:r};return}}this.index=r}}),e.hooks.add("after-expression",function(t){!function t(r){r&&(Object.values(r).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===r.operator&&(r.type=uA,r.params=r.left?[r.left]:null,r.body=r.right,r.params&&r.params[0].type===e.SEQUENCE_EXP&&(r.params=r.params[0].expressions),delete r.left,delete r.right,delete r.operator))}(t.node)})}}),uT.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let r=t.node;if(r&&"new"===r.operator){r.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(r.argument.type)||this.throwError("Expected new function()"),t.node=r.argument;let n=t.node;for(;n.type===e.MEMBER_EXP||n.type===e.CALL_EXP&&n.callee.type===e.MEMBER_EXP;)n=n.type===e.MEMBER_EXP?n.object:n.callee.object;n.type="NewExpression"}})}}),uT.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 r(t){let r=this.index,n="",i=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:n+=this.expr.charAt(this.index++)};i(),this.code===e.PERIOD_CODE&&(n+=this.expr.charAt(this.index++),i());let o=this.char;("e"===o||"E"===o)&&(n+=this.expr.charAt(this.index++),("+"===(o=this.char)||"-"===o)&&(n+=this.expr.charAt(this.index++)),i(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")"));let a=this.code;if(e.isIdentifierStart(a))this.throwError("Variable names cannot start with a number ("+n+this.char+")");else if(a===e.PERIOD_CODE){n.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:a,number:n},null,2)}`),this.index=r;return}t.node={type:e.LITERAL,value:parseFloat(n),raw:this.expr.substring(r,this.index)}}e.hooks.add("gobble-token",function(n){if(48===this.code){var i,o,a;let s=this.index,l=this.expr.charAt(this.index+1),u=t.call(this,l);if(!u)return;let c="";for(;i=this.code,o=u,95===i||o.some(([e,t])=>i>=e&&i<=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,r.call(this,n);return}this.throwError("unexpected char within number")}n.node={type:e.LITERAL,value:parseInt(c,"x"===(a=l)||"X"===a?16:"b"===a||"B"===a?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&r.call(this,n)})}}),uT.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let r=++this.index,n=!1;for(;this.index<this.expr.length;){if(47===this.code&&!n){let n,i=this.expr.slice(r,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{n=new RegExp(i,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:n,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),uT.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}}),uT.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,r=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},n="",i="",o=!1,a=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:i,cooked:n},tail:o});for(;this.index<a;){let a=this.expr.charAt(++this.index);if("`"===a)return this.index+=1,o=!0,s(),e.node=t,r&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===a&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),i="",n="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===a)switch(i+=a,a=this.expr.charAt(++this.index),i+=a,a){case"n":n+="\n";break;case"r":n+="\r";break;case"t":n+=" ";break;case"b":n+="\b";break;case"f":n+="\f";break;case"v":n+="\v";break;default:n+=a}else n+=a,i+=a}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(r){if((r.node.type===e.IDENTIFIER||r.node.type===e.MEMBER_EXP)&&96===this.code)return r.node={type:"TaggedTemplateExpression",tag:r.node,quasi:t.bind(this)(r,!1)},r.node=this.gobbleTokenProperty(r.node),r.node})}}),uT.addBinaryOp("in",7),uT.addBinaryOp("??",1);let u4=z("feature-flags",{flags:function(){let e={};for(let t of Object.keys(localStorage))if(t.startsWith("openmrs:feature-flag:")){let r=t.replace("openmrs:feature-flag:",""),n=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${r}`)||"{}");e[r]={enabled:"true"===localStorage.getItem(t),...n}}return e}()});function u2(e,t,r){u4.setState(n=>({flags:{...n.flags,[e]:{enabled:n.flags[e]?.enabled??!1,label:t,description:r}}}))}function u6(e){return u4.getState().flags[e].enabled}function u5(e){return!window.offlineEnabled||(e??navigator.onLine)}u4.subscribe(e=>{for(let[t,r]of Object.entries(e.flags))localStorage.setItem(`openmrs:feature-flag:${t}`,r.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${t}`,JSON.stringify({label:r.label,description:r.description}))});var u8=ez(function(e,t,r){eN(e,t,r)});function u9(e,t=!0,r=!1){return!!(e?t:r)}let u7=K("extensionsInternal",{slots:{},extensions:{}}),ce=K("extensionRenderings",{renderings:new Map}),ct=()=>z("extensionsInternal",{slots:{},extensions:{}});function cr(e){let t=u7.getState(),r=e(t);r!==t&&u7.setState(r)}let cn=null,ci=null;function co(){let e=ce.getState();return cn&&e===ci||(cn=new Map(e.renderings),ci=e,function(e){for(let t of(cu.clear(),e.values()))cd(t,1);cc=!0}(cn)),cn}function ca(e){ci={renderings:e},ce.setState(ci,!0)}let cs=()=>z("extensions",{slots:{}});function cl(e){try{e()}catch(t){console.error(`The extension system's '${e.name}' recomputation failed`,t)}}let cu=new Map,cc=!1;function cd(e,t){let r=JSON.stringify([e.slotName,e.extensionId,e.slotModuleName,e.extensionModuleName]),n=cu.get(r);if(!n){if(t<0)return;cu.set(r,{count:1,record:{slotModuleName:e.slotModuleName,extensionModuleName:e.extensionModuleName,slotName:e.slotName,extensionId:e.extensionId}}),cc=!0;return}n.count+=t,n.count<1&&(cu.delete(r),cc=!0)}function cf(){var e,t;if(co(),!cc)return;cc=!1;let r=Array.from(cu.values(),({record:e})=>e);r.sort(cp),e=tL.getState().mountedExtensions,t=r,e.length===t.length&&e.every((e,r)=>0===cp(e,t[r]))||tL.setState({mountedExtensions:r})}function cp(e,t){return ch(e.slotName,t.slotName)||ch(e.extensionId,t.extensionId)||ch(e.slotModuleName,t.slotModuleName)||ch(e.extensionModuleName,t.extensionModuleName)}function ch(e,t){return e===t?0:e<t?-1:1}cf(),ce.subscribe(()=>cl(cf));let cm=ct(),cy=cs(),cg=tB(),cb=tV(),cv=new Set,c_=!1;function cw(e){if(null===e)cv=null;else if(null!==cv)for(let t of e)cv.add(t);cl(cx)}function cx(){if(!c_){c_=!0;try{for(let e=1;;e++){let t=cv;if(null!==t&&0===t.size)return;cv=new Set;try{!function(e,t,r,n,i,o=null){let a=cy.getState().slots,s={},l=!1,u=u5(),c=Object.entries(n.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[n,f]of Object.entries(e.slots)){var d;let p=a[n];if(p&&o&&!o.has(n)){s[n]=p;continue}let{config:h}=(d=f.name,t.slots[d]??{loaded:!1,config:{}}),m=function(e,t,r,n,i,o,a){let s=function(e,t){let r=e.add||[],n=e.remove||[],i=e.order||[],{extensions:o}=cm.getState();return[...t,...r].filter(e=>!n.includes(e)).sort((e,r)=>cR(e,i,o[cO(e)]?.order,t)-cR(r,i,o[cO(r)]?.order,t))}(r,t.slots[e].attachedIds),l=[];for(let u of s){let{config:s}=tU(n,e,u),c=r.configure?.[u]??null,d=c?u8({},s,c):s,f=cO(u),p=t.extensions[f];if(p){let e=d?.["Display conditions"]?.privileges??p.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!a?.user||!iu(e,a.user))||p.featureFlag&&!i.includes(p.featureFlag)||window.offlineEnabled&&!u9(o,p.online,p.offline))continue;l.push({id:u,name:f,moduleName:p.moduleName,config:d,featureFlag:p.featureFlag,meta:p.meta,online:d?.["Display conditions"]?.online??p.online??!0,offline:d?.["Display conditions"]?.offline??p.offline??!1,displayConditionExpression:d?.["Display conditions"]?.expression||p.displayExpression})}}return l}(n,e,h,r,c,u,i.session);p&&p.moduleName===f.moduleName&&ti(p.candidateExtensions,m)?s[n]=p:(s[n]={moduleName:f.moduleName,candidateExtensions:m},l=!0)}(l||Object.keys(a).length!==Object.keys(s).length)&&cy.setState({slots:s})}(cm.getState(),cg.getState(),cb.getState(),u4.getState(),it.getState(),t)}catch(e){throw cv=null===t||null===cv?null:new Set([...t,...cv]),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{c_=!1}}}function cE(e,t){let r=new Set;for(let n of Object.keys(e))e[n]!==t[n]&&r.add(n);for(let n of Object.keys(t))n in e||r.add(n);return r}function cS(){cw(null)}function cD(e,t){return{moduleName:t,name:e,attachedIds:[]}}function cO(e){let[t]=e.split("#");return t}function cP(e){var t;let r;return t=cm.getState(),r=cO(e),t.extensions[r]}cm.subscribe((e,t)=>{cw(e.extensions!==t.extensions?null:cE(e.slots,t.slots))}),cg.subscribe((e,t)=>{cw(cE(e.slots,t.slots))}),cb.subscribe((e,t)=>{cw(cE(e.configs,t.configs))}),u4.subscribe(()=>cw(null)),it.subscribe(()=>cw(null)),cS(),g(cS);let cC=e=>cr(t=>({...t,extensions:{...t.extensions,[e.name]:{...e}}}));function ck(e,t){cr(r=>{let n=r.slots[e];return n?{...r,slots:{...r.slots,[e]:{...n,attachedIds:[...n.attachedIds,t]}}}:{...r,slots:{...r.slots,[e]:{...cD(e),attachedIds:[t]}}}})}function cj(e,t){cr(r=>{let n=r.slots[e];return n&&n.attachedIds.includes(t)?{...r,slots:{...r.slots,[e]:{...n,attachedIds:n.attachedIds.filter(e=>e!==t)}}}:r})}function cT(e){cr(t=>{let r=t.slots[e];return r?{...t,slots:{...t.slots,[e]:{...r,attachedIds:[]}}}:t})}function cR(e,t,r,n){let i=t.indexOf(e);if(-1!==i)return i;{if(void 0!==r)return 1e3+r;let t=n.indexOf(e);return -1!==t?2e3+t:3e3}}function cA(e,t){var r;return function(e,t,r=null,n){let i;return e.filter(e=>{let o=e.displayConditionExpression;if("string"!=typeof o||0===o.trim().length)return!0;i??(i=t&&"object"==typeof t?{session:r,...t}:{session:r});try{return!!uL(o,i)}catch(t){return console.error(`Error while evaluating expression '${o}' for ${e.id}`+(n?` in ${n}`:""),t),!1}})}((r=e,cy.getState().slots[r]?.candidateExtensions??[]),t,it.getState().session,e)}let cM=(e,t)=>cm.setState(r=>{let n=r.slots[t]?.moduleName;if(n&&n!=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 ${n}.`),r;if(n&&n==e)return r;if(r.slots[t])return{...r,slots:{...r.slots,[t]:{...r.slots[t],moduleName:e}}};let i=cD(t,e);return{...r,slots:{...r.slots,[t]:{...i}}}}),cN=K("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function cI({name:e,basePath:t,mode:r,componentContext:n,state:i}){cN.setState({slotName:e,basePath:t,mode:r??"normal",componentContext:n,state:i})}function c$(e){cN.getState().slotName===e&&cN.setState(cN.getInitialState(),!0)}let cL=0,cF=null,cB={bootstrap:15e3,mount:15e3,unmount:15e3};function cV(e){if(e.timeouts)return e;let t=e.name??"parcel",r=Object.fromEntries(Object.keys(cB).filter(t=>e[t]).map(r=>{var n,i;let o,a;return[r,(n=e[r],i=cB[r],o=Array.isArray(n)?n:[n],a=e=>o.reduce((n,i,o)=>n.then(()=>{let n=i(e);return"function"==typeof n?.then&&"function"==typeof n?.catch?n:Promise.reject(Error(`Lifecycle function ${r} at array index ${o} for parcel ${t} did not return a promise`))}),Promise.resolve(void 0)),e=>{let n,o=new Promise((e,o)=>{n=setTimeout(()=>o(Error(`Lifecycle function ${r} for parcel ${t} did not settle within ${i}ms`)),i)});return Promise.race([a(e),o]).finally(()=>clearTimeout(n))})]}));return{...e,...r}}async function cU(e,t){return(await (cF??(cF=new Promise((e,t)=>{nt({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),nt))),cF))("function"==typeof e?()=>e().then(cV):cV(e),t)}function cW(e,t){let r,n=cU(e,t).then(e=>r=e);return{mount:()=>n.then(e=>e.mount()),unmount:()=>n.then(e=>e.unmount()),update:e=>n.then(t=>t.update?.(e)),getStatus:()=>r?.getStatus()??"LOADING_SOURCE_CODE",get loadPromise(){return n.then(e=>e.loadPromise)},get bootstrapPromise(){return n.then(e=>e.bootstrapPromise)},get mountPromise(){return n.then(e=>e.mountPromise)},get unmountPromise(){return n.then(e=>e.unmountPromise)}}}async function cK(e,t,r,n,i=e=>e,o={}){let a=cO(n),s=cP(n),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${a}' to attach to '${t}'`);let{meta:c,moduleName:d,online:f,offline:p,load:h}=s;if(function(e=!0,t=!1){return u9(u5(),e,t)}(f,p)){let s,f=cL++,p=`${t}/${n}-${f}`;e.dataset.extensionRenderingId=p;let m=e=>{try{let e,t;(t=(e=co()).get(p))&&(e.delete(p),cd(t,-1),ca(e))}catch(t){console.error(e,t)}};try{var u;let e;u={renderingId:p,extensionName:a,extensionModuleName:d,extensionId:n,slotName:t,slotModuleName:r},(e=co()).has(u.renderingId)||(e.set(u.renderingId,u),cd(u,1),ca(e))}catch(e){throw m(`Recomputing configuration after registering '${n}' failed also failed`),e}try{s=await h()}catch(e){throw m(`Recomputing configuration after '${n}' failed to load also failed`),e}try{l=await cU(i({...s,name:`${t}/${a}-${f}`}),{...o,_meta:c,_extensionContext:{extensionId:n,extensionSlotName:t,extensionSlotModuleName:r,extensionModuleName:d},domElement:e})}catch(e){throw m(`Recomputing configuration after '${n}' failed to mount also failed`),e}l.mountPromise.then(void 0,e=>{console.error(`Extension '${n}' in slot '${t}' failed to mount`,e),m(`Recomputing configuration after '${n}' failed to mount also failed`)}),l.unmountPromise.then(()=>m(`Recomputing configuration after unmounting '${n}' failed`),e=>{console.error(`Extension '${n}' in slot '${t}' failed to unmount`,e),m(`Recomputing configuration after '${n}' failed to unmount also failed`)})}}else console.warn(`Tried to render ${n} into ${t} but no DOM element was available.`);return l}function cH(){return{current:"unavailable",notAvailable:!0,active:!1}}let cz="x-omrs-offline-response-body",cq="x-omrs-offline-response-status",cG="x-omrs-offline-caching-strategy",cZ="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cY=new Uint8Array(16),cJ=[];for(let e=0;e<256;++e)cJ.push((e+256).toString(16).slice(1));let cQ=function(e,t,r){if(cZ&&!t&&!e)return cZ();let n=(e=e||{}).random||(e.rng||function(){if(!a&&!(a="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(cY)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return cJ[e[t+0]]+cJ[e[t+1]]+cJ[e[t+2]]+cJ[e[t+3]]+"-"+cJ[e[t+4]]+cJ[e[t+5]]+"-"+cJ[e[t+6]]+cJ[e[t+7]]+"-"+cJ[e[t+8]]+cJ[e[t+9]]+"-"+cJ[e[t+10]]+cJ[e[t+11]]+cJ[e[t+12]]+cJ[e[t+13]]+cJ[e[t+14]]+cJ[e[t+15]]}(n)},cX="OFFLINE+";function c0(){return cX+cQ()}function c1(e){return e.startsWith(cX)}var c3=r(47499),c4=r.n(c3);function c2({to:e,templateParams:t,onBeforeNavigate:r,children:n,...i}){return(0,c3.useEffect)(()=>{i.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${i.href}'`),i.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),c4().createElement("a",{onClick:n=>{0===n.button&&!n.ctrlKey&&!n.shiftKey&&!n.altKey&&!n.metaKey&&(n.preventDefault(),r?.(n),nX({to:e,templateParams:t})),0===n.button&&(n.ctrlKey||n.metaKey)&&r?.(n),0===n.button&&n.shiftKey&&r?.(n),1===n.button&&r?.(n)},href:nJ(e,t),...i},n)}let c6=K("modalRegistry",{modals:{}}),c5=K("workspaceRegistrations",{workspaces:{}}),c8=K("workspaceGroups",{workspaceGroups:{}}),c9=new Set;function c7(e){let t=c5.getState().workspaces;if(t[e])return t[e];{let t=cP(e);if(t){var r;let n;return c9.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.`),c9.add(e)),{name:t.name,title:(r=t,"string"==typeof(n=r?.meta?.title)?n:n&&"object"==typeof n?oa(r.moduleName,n.key,n.default):r.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.`)}}let de=K("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function dt(e){let{openedWindows:t}=de.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}let dr=(0,c3.createContext)({moduleName:"",featureName:""});function dn(e,t){"function"==typeof t&&(t=t(e));let r={};for(let[n,i]of Object.entries(t)){let t=function(...t){e.setState(e=>i(e,...t))};r[n]=t}return r}let di=e=>e;function da(e,t=di,r){let n=(0,c3.useCallback)(t=>e.subscribe(t),[e]),i=(0,c3.useCallback)(()=>t(e.getState()),[e,t]),o=(0,c3.useSyncExternalStore)(n,i,i),a=(0,c3.useMemo)(()=>r?dn(e,r):null,[e,r]);return(0,c3.useMemo)(()=>a?{...o,...a}:o,[o,a])}function ds(e,t){return da(e,di,t)}function dl(e){return function(t){let r=(0,c3.useCallback)(t=>e.subscribe(t),[]),n=(0,c3.useCallback)(()=>e.getState(),[]),i=(0,c3.useSyncExternalStore)(r,n,n),o=(0,c3.useMemo)(()=>t?dn(e,t):null,[t]);return(0,c3.useMemo)(()=>o?{...i,...o}:i,[i,o])}}let du=[];Object.freeze(du);let dc={candidateExtensions:du};Object.freeze(dc);let dd=e=>{let t=(0,c3.useCallback)(t=>t.slots?.[e]??dc,[e]);return da(cs(),t)},df=e=>e.session;function dp(e,t){let r,{candidateExtensions:n}=dd(e),i=da(it,df),o=(M((r=(0,c3.useRef)(t)).current,t)||(r.current=t),r.current);return(0,c3.useMemo)(()=>cA(e,o),[e,o,i,n])}function dh(e,t){let{moduleName:r}=(0,c3.useContext)(dr);if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,c3.useEffect)(()=>{cM(r,e)},[r,e]),{extensions:dp(e,t),extensionSlotName:e,extensionSlotModuleName:r}}function dm(e){return e}function dy({name:e,extensionSlotName:t,select:r=dm,children:n,state:i,style:o,...a}){if(n&&i)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,c3.useRef)(null),{extensions:u,extensionSlotModuleName:c}=dh(s,i),d=(0,c3.useMemo)(()=>r(u),[r,u]),f=(0,c3.useMemo)(()=>{if("function"==typeof n&&!c4().isValidElement(n))return d.map(e=>n(e,i))},[n,d]);return c4().createElement("div",{ref:l,"data-extension-slot-name":s,"data-extension-slot-module-name":c,style:{...o,position:"relative"},...a},s&&d?.map((e,t)=>c4().createElement(dr.Provider,{key:e.id,value:{moduleName:c,featureName:"",extension:{extensionId:e.id,extensionSlotName:s,extensionSlotModuleName:c}}},f?.[t]??("function"!=typeof n?n:null)??c4().createElement(fW,{state:i}))))}var dg=r(5338);function db(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function dv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?db(Object(r),!0).forEach(function(t){var n,i,o;n=e,i=t,o=r[t],i in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):db(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function d_(e){return(d_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dw(e){return(dw="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 dx(e,t){var r;if("function"!=typeof(r=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 r="single-spa-application:".concat(t);return function(){var e=document.getElementById(r);return e||((e=document.createElement("div")).id=r,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(dw(r)));return function(){var e=r(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(dw(e)));return e}}var dE=null;try{dE=require("react").createContext()}catch(e){}var dS={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 dD(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function dO(e,t){return new Promise(function(r,n){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 i,o=dj(e,t,function(){r(this)}),a=dx(e,t)(),s=function(e){var t=e.reactDom,r=e.renderType,n=e.elementToRender,i=e.domElement,o=t[r];if("function"!=typeof o)throw Error('renderType "'.concat(r,'" did not return a function.'));switch(r){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var a=o(i);return a.render(n),a;case"hydrateRoot":return o(i,n);default:return o(n,i),null}}({elementToRender:o,domElement:a,reactDom:dk(e),renderType:"function"==typeof(i=e).renderType?i.renderType():i.renderType});e.domElements[t.name]=a,e.renderResults[t.name]=s})}function dP(e,t){return new Promise(function(r){e.unmountResolves[t.name]=r;var n=e.renderResults[t.name];n&&n.unmount?n.unmount():dk(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function dC(e,t){return new Promise(function(r){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(r);var n=dj(e,t,null),i=e.renderResults[t.name];if(i&&i.render)i.render(n);else{var o=dx(e,t)();dk(e).render(n,o)}})}function dk(e){return e.ReactDOMClient||e.ReactDOM}function dj(e,t,r){var n=e.React.createElement(e.rootComponent,t),i=dE?e.React.createElement(dE.Provider,{value:t},n):n;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function r(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},r.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return r.prototype=Object.create(e.React.Component.prototype),r.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},r.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},r}(e,t),i=e.React.createElement(e.errorBoundaryClass,t,i)),i=e.React.createElement(e.SingleSpaRoot,dv(dv({},t),{},{mountFinished:r,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])}}),i)}var dT=r(58779),dR=r(59324),dA=r(14993);let dM={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},dN=new Map;(0,dA.r2)(dN);let dI={errorRetryCount:3,fetcher:n9,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof ie){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>dN};function d$(e,t){return function(e){if("object"!==d_(e))throw Error("single-spa-react requires a configuration object");var t,r=dv(dv({},dS),e);if(!r.React)throw Error("single-spa-react must be passed opts.React");if(!r.ReactDOM&&!r.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(r.renderType||(null!=(t=r.ReactDOMClient)&&t.createRoot?r.renderType="createRoot":r.renderType="render"),!r.rootComponent&&!r.loadRootComponent)throw Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(r.errorBoundary&&"function"!=typeof r.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!dE&&r.React.createContext&&(dE=r.React.createContext()),r.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}(r);var n={bootstrap:dD.bind(null,r),mount:dO.bind(null,r),unmount:dP.bind(null,r)};return r.parcelCanUpdate&&(n.update=dC.bind(null,r)),n}({React:c4(),ReactDOMClient:dg,rootComponent:(function(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},dM,e),r={...dI,...t.swrConfig};return function(e){var n,i,o,a,s;return o=i=class extends(n=c4().Component){componentDidCatch(e,r){r&&r.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:r.componentStack})),t.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:r})}render(){if(this.state.caughtError)return c4().createElement("div",null,"An error has occurred. Please try reloading the page.");{let n=c4().createElement(c3.Suspense,{fallback:null},c4().createElement(dR.BE,{value:r},c4().createElement(dr.Provider,{value:this.state.config},t.disableTranslations?c4().createElement(e,this.props):c4().createElement(dT.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},c4().createElement(e,this.props)))));return t.strictMode&&c4().StrictMode?c4().createElement(c4().StrictMode,null,n):n}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},a="displayName",s=`OpenmrsReactComponent(${t.featureName})`,a in o?Object.defineProperty(o,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[a]=s,i}})(t)(e)})}function dL(e,t){return()=>e().then(({default:e})=>d$(e,t))}function dF(e,t){return()=>Promise.resolve(d$(e,t))}let dB=dL,dV=new Map;function dU(e,t){let r=(0,c3.useRef)(t??{}),n=(0,c3.useRef)(t=>iE(e,t)),i=(0,c3.useRef)(Symbol());return(0,c3.useEffect)(()=>{let r=t??{},n=i.current;return null===ix(e)?i_(e,r):(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.`),iE(e,()=>r)),dV.set(e,n),()=>{dV.get(e)===n&&(iw(e),dV.delete(e))}},[e]),(0,c3.useEffect)(()=>{let n=t??{};M(r.current,n)||(iE(e,()=>n),r.current=n)},[t]),n.current}function dW({namespace:e,value:t}){return dU(e,t),null}let dK=({children:e,value:t,fallback:r})=>t?c4().createElement(c4().Fragment,null,e):r?c4().createElement(c4().Fragment,null,r):null;function dH(){let e=(0,c3.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,c3.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function dz(e,t=e=>e??{}){let[r,n]=(0,c3.useState)(()=>{if(dq(e))return;let r=ix(e);if(null!==r)return t?t(r):r});return(0,c3.useEffect)(()=>{if(dq(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,c3.useEffect)(()=>iS(e,e=>{if(null==e)return void n(void 0);let r=t?t(e):e;n(e=>M(e,r)?e:r)}),[e,t]),r}function dq(e){return"string"!=typeof e||0===e.trim().length}function dG(e){let t=dp(e);return(0,c3.useMemo)(()=>t.map(e=>e.id),[t])}function dZ(e,t){let{data:r,error:n,mutate:i,isLoading:o,isValidating:a}=(0,dR.Ay)(`${og}?patient=${e}&includeEncounterless=${t}`,n9);return(0,c3.useMemo)(()=>({isLoading:o,data:r?.data.results??[],error:n,mutate:i,isValidating:a}),[r,n,o,a,i])}function dY(e){(0,c3.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}let dJ={},dQ=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
16
+ Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function dX(e){let{moduleName:t,extension:r}=(0,c3.useContext)(dr),n=e?.externalModuleName??t;if(!n&&!r)throw Error(dQ);let i=function(e){let t=(0,c3.useMemo)(()=>tF(e),[e]),r=function(e){let[t,r]=(0,c3.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,c3.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&r(e.config)}),[e]),t}(t);if(!r)throw dJ[e]||(dJ[e]=new Promise(e=>{let r=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),r())})})),dJ[e];return r}(n),o=function(e){let t=(0,c3.useMemo)(tV,[]),r=function(e,t){let[r,n]=(0,c3.useState)(t?()=>{let r=tU(e.getState(),t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null);return(0,c3.useEffect)(()=>{if(t)return e.subscribe(e=>{let i=tU(e,t.extensionSlotName,t.extensionId);i.loaded&&i.config&&!ti(i.config,r)&&n(i.config)})},[e,t,r]),r}(t,e);if(!r&&e){let r=`${e.extensionSlotName}-${e.extensionId}`;throw!dJ[r]&&t&&(dJ[r]=new Promise(r=>{let n=t.subscribe(t=>{let i=tU(t,e.extensionSlotName,e.extensionId);i.loaded&&i.config&&(r(i.config),n())})})),dJ[r]}return r||{}}(r);return(0,c3.useMemo)(()=>e?.externalModuleName&&n===e.externalModuleName?{...i}:{...i,...o},[n,e?.externalModuleName,i,o])}let d0=dp;function d1(){let[e,t]=(0,c3.useState)(u5());return(0,c3.useEffect)(()=>g(({online:e})=>t(e)),[]),e}function d3(e,t=300){let[r,n]=(0,c3.useState)(e);return(0,c3.useEffect)(()=>{let r=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(r)}},[e,t]),r}var d4=r(54225);let d2=`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 d6(){let e=`${n2}/emrapi/configuration?v=${d2}`,t=(0,d4.A)(e,n9);return(0,c3.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}function d5(e){let t=dp(e);return(0,c3.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}dl(ct());let d8=dl(cs());function d9(e){let{flags:t}=da(u4);return t[e]?.enabled??!1}function d7(){let[,e]=(0,c3.useState)(0);return(0,c3.useCallback)(()=>{e(e=>e+1)},[])}function fe(e,t,r={}){return fr(e,t,ft,r)}let ft={getPaginatedUrl:(e,t,r)=>{if(!e)return null;{let n=new URL(n8(e.toString()),window.location.toString());return n.searchParams.set("limit",""+t),n.searchParams.set("startIndex",""+r),n.searchParams.set("totalCount","true"),n.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 fr(e,t,r,n={}){let{getPaginatedUrl:i,getTotalCount:o,getCurrentPageSize:a,getData:s}=r,{immutable:l,swrConfig:u}=n,c=n.fetcher??n9,[d,f]=(0,c3.useState)(1),p=(0,c3.useRef)(NaN),h=(0,c3.useRef)(NaN),m=(0,c3.useRef)(d),y=(0,c3.useRef)(!1),g=(0,c3.useRef)(!1),b=e?.toString()??"",[v,w]=(0,c3.useState)(b);b!==v&&(w(b),f(1),m.current=1,p.current=NaN,h.current=NaN,y.current=!1,g.current=!1);let x=(d-1)*t,E=(0,c3.useMemo)(()=>i(e,t,x),[e,t,x]),{data:S,...D}=(l?d4.A:dR.Ay)(E,c,u);S?.data&&(p.current=o(S?.data),h.current=a(S?.data),y.current=!0);let O=Math.ceil(p.current/t),P=(0,c3.useCallback)(e=>{if(!Number.isInteger(e)||e<1)return void console.warn(`useServerPagination: ignoring goTo(${e}); page must be a positive integer.`);let r=Math.ceil(p.current/t);!y.current||Number.isNaN(r)||e<=r?(m.current=e,f(e)):console.warn("Invalid attempt to go to out of bounds page: "+e)},[t]);(0,c3.useEffect)(()=>{if(!y.current)return;if(Number.isNaN(p.current)){g.current||(g.current=!0,console.warn(`useServerPagination: ${b} 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}.`),m.current=e,f(e))},[d,t,b,S]);let C=(0,c3.useCallback)(()=>{P(m.current+1)},[P]),k=(0,c3.useCallback)(()=>{P(m.current-1)},[P]);return{data:s(S?.data),totalPages:O,totalCount:p.current,currentPage:d,currentPageSize:h.current,paginated:O>1,showNextButton:d<O,showPreviousButton:d>1,goTo:P,goToNext:C,goToPrevious:k,...D}}function fn(e,t,r={}){return fr(e,t,fi(),r)}function fi(){return{getPaginatedUrl:(e,t,r)=>{if(!e)return null;{let n=new URL(n8(e.toString()),window.location.toString());return n.searchParams.set("_count",""+t),n.searchParams.set("_getpagesoffset",""+r),n.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 fo=r(19888);let fa=c4().use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}),fs={dedupe:!0};dA.qv.defineProperty(dA.BE,"defaultValue",{value:dA.sb});let fl=(0,dA.qm)((e,t,r)=>{let{cache:n,compare:i,suspense:o,fallbackData:a,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:f}=r,[p,h,m,y]=dA.bZ.get(n),[g,b]=(0,dA.lK)(e),v=(0,c3.useRef)(!1),w=(0,c3.useRef)(!1),x=(0,c3.useRef)(g),E=(0,c3.useRef)(t),S=(0,c3.useRef)(r),D=()=>S.current.isVisible()&&S.current.isOnline(),[O,P,C,k]=(0,dA.r9)(n,g),j=(0,c3.useRef)({}).current,T=(0,dA.b0)(a)?r.fallback[g]:a,R=(e,t)=>{for(let r in j)if("data"===r){if(!i(e[r],t[r])&&(!(0,dA.b0)(e[r])||!i(V,t[r])))return!1}else if(t[r]!==e[r])return!1;return!0},A=(0,c3.useMemo)(()=>{let e=!!g&&!!t&&((0,dA.b0)(s)?!S.current.isPaused()&&!o&&(!!(0,dA.b0)(l)||l):s),r=t=>{let r=(0,dA.rL)(t);return(delete r._k,e)?{isValidating:!0,isLoading:!0,...r}:r},n=O(),i=k(),a=r(n),u=n===i?a:r(i),c=a;return[()=>{let e=r(O());return R(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>u]},[n,g]),M=(0,fo.useSyncExternalStore)((0,c3.useCallback)(e=>C(g,(t,r)=>{R(r,t)||e()}),[n,g]),A[0],A[1]),N=!v.current,I=p[g]&&p[g].length>0,$=M.data,L=(0,dA.b0)($)?T:$,F=M.error,B=(0,c3.useRef)(L),V=f?(0,dA.b0)($)?B.current:$:L,U=(!I||!!(0,dA.b0)(F))&&(N&&!(0,dA.b0)(s)?s:!S.current.isPaused()&&(o?!(0,dA.b0)(L)&&l:(0,dA.b0)(L)||l)),W=!!(g&&t&&N&&U),K=(0,dA.b0)(M.isValidating)?W:M.isValidating,H=(0,dA.b0)(M.isLoading)?W:M.isLoading,z=(0,c3.useCallback)(async e=>{let t,n,o=E.current;if(!g||!o||w.current||S.current.isPaused())return!1;let a=!0,s=e||{},l=!m[g]||!s.dedupe,u=()=>dA.dO?!w.current&&g===x.current&&v.current:g===x.current,c={isValidating:!1,isLoading:!1},d=()=>{P(c)},f=()=>{let e=m[g];e&&e[1]===n&&delete m[g]},y={isValidating:!0};(0,dA.b0)(O().data)&&(y.isLoading=!0);try{if(l&&(P(y),r.loadingTimeout&&(0,dA.b0)(O().data)&&setTimeout(()=>{a&&u()&&S.current.onLoadingSlow(g,r)},r.loadingTimeout),m[g]=[o(b),(0,dA.lg)()]),[t,n]=m[g],t=await t,l&&setTimeout(f,r.dedupingInterval),!m[g]||m[g][1]!==n)return l&&u()&&S.current.onDiscarded(g),!1;c.error=dA.ZH;let e=h[g];if(!(0,dA.b0)(e)&&(n<=e[0]||n<=e[1]||0===e[1]))return d(),l&&u()&&S.current.onDiscarded(g),!1;let s=O().data;c.data=i(s,t)?s:t,l&&u()&&S.current.onSuccess(t,g,r)}catch(r){f();let e=S.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=r,l&&u()&&(e.onError(r,g,e),(!0===t||(0,dA.Tn)(t)&&t(r))&&(!S.current.revalidateOnFocus||!S.current.revalidateOnReconnect||D())&&e.onErrorRetry(r,g,e,e=>{let t=p[g];t&&t[0]&&t[0](dA.bu.ERROR_REVALIDATE_EVENT,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return a=!1,d(),!0},[g,n]),q=(0,c3.useCallback)((...e)=>(0,dA.mF)(n,x.current,...e),[]);if((0,dA.Es)(()=>{E.current=t,S.current=r,(0,dA.b0)($)||(B.current=$)}),(0,dA.Es)(()=>{if(!g)return;let e=z.bind(dA.ZH,fs),t=0,r=(0,dA.aw)(g,p,(r,n={})=>{if(r==dA.bu.FOCUS_EVENT){let r=Date.now();S.current.revalidateOnFocus&&r>t&&D()&&(t=r+S.current.focusThrottleInterval,e())}else if(r==dA.bu.RECONNECT_EVENT)S.current.revalidateOnReconnect&&D()&&e();else if(r==dA.bu.MUTATE_EVENT)return z();else if(r==dA.bu.ERROR_REVALIDATE_EVENT)return z(n)});return w.current=!1,x.current=g,v.current=!0,P({_k:b}),U&&((0,dA.b0)(L)||dA.X3?e():(0,dA.mf)(e)),()=>{w.current=!0,r()}},[g]),(0,dA.Es)(()=>{let e;function t(){let t=(0,dA.Tn)(u)?u(O().data):u;t&&-1!==e&&(e=setTimeout(r,t))}function r(){!O().error&&(c||S.current.isVisible())&&(d||S.current.isOnline())?z(fs).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[u,c,d,g]),(0,c3.useDebugValue)(V),o&&(0,dA.b0)(L)&&g){if(!dA.dO&&dA.X3)throw Error("Fallback data is required when using suspense in SSR.");E.current=t,S.current=r,w.current=!1;let e=y[g];if((0,dA.b0)(e)||fa(q(e)),(0,dA.b0)(F)){let e=z(fs);(0,dA.b0)(V)||(e.status="fulfilled",e.value=!0),fa(e)}else throw F}return{mutate:q,get data(){return j.data=!0,V},get error(){return j.error=!0,F},get isValidating(){return j.isValidating=!0,K},get isLoading(){return j.isLoading=!0,H}}}),fu=Promise.resolve(),fc=(0,dA.Ht)(fl,e=>(t,r,n)=>{let i,o=(0,c3.useRef)(!1),{cache:a,initialSize:s=1,revalidateAll:l=!1,persistSize:u=!1,revalidateFirstPage:c=!0,revalidateOnMount:d=!1,parallel:f=!1}=n,[,,,p]=dA.bZ.get(dA.PP);try{(i=(0,dA.lK)(t?t(0,null):null)[0])&&(i=dA.q9+i)}catch(e){}let[h,m,y]=(0,dA.r9)(a,i),g=(0,c3.useCallback)(()=>(0,dA.b0)(h()._l)?s:h()._l,[a,i,s]);(0,fo.useSyncExternalStore)((0,c3.useCallback)(e=>i?y(i,()=>{e()}):()=>{},[a,i]),g,g);let b=(0,c3.useCallback)(()=>{let e=h()._l;return(0,dA.b0)(e)?s:e},[i,s]),v=(0,c3.useRef)(b());(0,dA.Es)(()=>{if(!o.current){o.current=!0;return}i&&m({_l:u?v.current:b()})},[i,a]);let w=d&&!o.current,x=e(i,async e=>{let i=h()._i,o=h()._r;m({_r:dA.ZH});let s=[],u=b(),[d]=(0,dA.r9)(a,e),y=d().data,g=[],v=null;for(let e=0;e<u;++e){let[u,d]=(0,dA.lK)(t(e,f?null:v));if(!u)break;let[h,m]=(0,dA.r9)(a,u),b=h().data,x=l||i||(0,dA.b0)(b)||c&&!e&&!(0,dA.b0)(y)||w||y&&!(0,dA.b0)(y[e])&&!n.compare(y[e],b);if(r&&("function"==typeof o?o(b,d):x)){let t=async()=>{if(u in p){let e=p[u];delete p[u],b=await e}else b=await r(d);m({data:b,_k:d}),s[e]=b};f?g.push(t):await t()}else s[e]=b;f||(v=b)}return f&&await Promise.all(g.map(e=>e())),m({_i:dA.ZH}),s},n),E=(0,c3.useCallback)(function(e,t){let r="boolean"==typeof t?{revalidate:t}:t||{},n=!1!==r.revalidate;return i?(n&&((0,dA.b0)(e)?m({_i:!0,_r:r.revalidate}):m({_i:!1,_r:r.revalidate})),arguments.length?x.mutate(e,{...r,revalidate:n}):x.mutate()):fu},[i,a]),S=(0,c3.useCallback)(e=>{let r;if(!i)return fu;let[,n]=(0,dA.r9)(a,i);if((0,dA.Tn)(e)?r=e(b()):"number"==typeof e&&(r=e),"number"!=typeof r)return fu;n({_l:r}),v.current=r;let o=[],[s]=(0,dA.r9)(a,i),l=null;for(let e=0;e<r;++e){let[r]=(0,dA.lK)(t(e,l)),[n]=(0,dA.r9)(a,r),i=r?n().data:dA.ZH;if((0,dA.b0)(i))return E(s().data);o.push(i),l=i}return E(o)},[i,a,E,b]);return{size:b(),setSize:S,mutate:E,get data(){return x.data},get error(){return x.error},get isValidating(){return x.isValidating},get isLoading(){return x.isLoading}}});function fd(e,t={}){return ff(e,ft,t)}function ff(e,t,r={}){let{swrInfiniteConfig:n,immutable:i}=r,{getNextUrl:o,getTotalCount:a,getData:s}=t,l=r.fetcher??n9,{data:u,size:c,setSize:d,...f}=fc((0,c3.useCallback)((r,n)=>0==r?e?.toString()??null:t.getNextUrl(n.data),[e]),l,{...n,...i?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),p=o(u?.[u.length-1].data),h=a(u?.[0]?.data);return{data:u?.flatMap(e=>s(e.data)),totalCount:h,hasMore:null!=p,loadMore:()=>{d((u?.length??0)+1)},nextUri:p,...f}}function fp(e,t={}){return fh(e,ft,t)}function fh(e,t,r={}){let n=ff(e,t,r),{hasMore:i,error:o,data:a,loadMore:s,isLoading:l,nextUri:u}=n;return((0,c3.useEffect)(()=>{i&&!o&&s()},[i,u]),r.partialData)?n:{...n,data:i||o?void 0:a,isLoading:l||i}}function fm(e,t={}){return fh(e,fi(),t)}function fy(e,t={}){return ff(e,fi(),t)}function fg(){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 fb(){let[e,t]=(0,c3.useState)(fg);return(0,c3.useEffect)(()=>{let e=()=>{t(fg())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let fv=e=>"small-desktop"===e||"large-desktop"===e;function f_(e){let t=(0,c3.useContext)(dr);(0,c3.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),cI(e),()=>{c$(e.name)}),[t,e])}function fw(){return da(cN)}function fx(e=null,t=null){let[r,n]=(0,c3.useState)([]);return(0,c3.useEffect)(()=>{let r=uk(e,t).subscribe(e=>{n(e)},e=>{console.error(e)});return()=>r.unsubscribe()},[e,t]),r}function fE(e,t=!0){let r=(0,c3.useRef)(null);return(0,c3.useEffect)(()=>{let n=n=>{t&&r.current&&n.target&&n.target instanceof Node&&(r.current.contains(n.target)||e(n))};return window.addEventListener("mousedown",n),window.addEventListener("touchstart",n),()=>{window.removeEventListener("mousedown",n),window.removeEventListener("touchstart",n)}},[e,t]),r}function fS(e){let t=(0,c3.useRef)();return(0,c3.useEffect)(()=>{let r=new IntersectionObserver(t=>{for(let r of t)if(r.isIntersecting)return void e()},{threshold:1});return t.current&&r.observe(t.current),()=>{t.current&&r.unobserve(t.current)}},[t.current,e]),t}function fD(e,t={}){let{abortController:r,fetchInit:n,url:i,swrConfig:o}=t,a=dH(),s=(0,c3.useMemo)(()=>n?.signal??r?.signal??a.signal,[r?.signal,n?.signal,a.signal]),l=(0,c3.useCallback)(e=>n9(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,i),{...n,signal:s}),[s,n,i]);return(0,dR.Ay)(e,l,o)}function fO(e=[],t=10){let[r,n]=(0,c3.useState)(1),i=(0,c3.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]);r>i&&n(i);let o=Math.min(Math.max(1,r),i),a=(0,c3.useMemo)(()=>{let r=(o-1)*t,n=(o+0)*t;return e.slice(r,n)},[e,o,t]),s=(0,c3.useCallback)(e=>{!Number.isInteger(e)||e<1?console.warn(`usePagination: ignoring goTo(${e}); page must be a positive integer.`):n(e)},[]),l=(0,c3.useCallback)(()=>{n(e=>e+1)},[]),u=(0,c3.useCallback)(()=>{n(e=>Math.max(1,e-1))},[]);return(0,c3.useMemo)(()=>({results:a,totalPages:i,currentPage:o,paginated:e.length>t,showNextButton:o<i,showPreviousButton:o>1,goTo:s,goToNext:l,goToPrevious:u}),[a,i,e.length,t,o,s,l,u])}function fP(e,t,r,n){return{pageSizes:(0,c3.useMemo)(()=>{let r=Math.ceil(t/e);return isNaN(r)&&(r=0),[...Array(r).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,c3.useMemo)(()=>e>t?t:e*r>t?e*(r-1)+n:e*r,[e,t,r,n])}}function fC(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function fk(e){let[t,r]=(0,c3.useState)(e??fC()),{data:n,error:i,isValidating:o}=(0,dR.Ay)(t?["patient",t]:null,()=>uf(t,{}));return(0,c3.useEffect)(()=>{let e=()=>{let e=fC();e!==t&&r(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,c3.useMemo)(()=>({isLoading:o&&!i&&!n,patient:n,patientUuid:t,error:i}),[o,i,n,t])}function fj(){let e=`${n2}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:r,isLoading:n}=(0,dR.Ay)(e,n9);return(0,c3.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:n,error:r}),[t,r,n])}function fT(e){let{extensions:t,extensionSlotModuleName:r}=dh(e);return e?t.map(t=>({state:n})=>c4().createElement(dr.Provider,{value:{moduleName:r,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:r}}},c4().createElement(fW,{state:n}))):[]}function fR(){let e=(0,c3.useRef)(),[t,r]=(0,c3.useState)(null),n=null;if(!t){if(s){let e=io().getState();e.loaded&&(n=e.session)}else s=new Promise(t=>{let r=({loaded:r,session:i})=>{r&&(t(i),n=i,e.current&&(e.current(),e.current=void 0))};r(io().getState()),n||(e.current=io().subscribe(r))});if(n)r(n);else throw s}(0,c3.useEffect)(()=>(e.current||(e.current=io().subscribe(({loaded:e,session:t})=>{e&&(n=t,r(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let i=t||n;if(!i)if(s)throw console.warn("useSession is in an unexpected state. Attempting to recover."),s;else throw Error("useSession is in an invalid state.");return i}let fA=({privilege:e,fallback:t,children:r})=>{let[n,i]=(0,c3.useState)(null);return((0,c3.useEffect)(()=>{let e=ii({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()},[]),n&&iu(e,n))?c4().createElement(c4().Fragment,null,r):t?c4().createElement(c4().Fragment,null,t):null};var fM=r(74353),fN=r.n(fM),fI=r(47581);let f$=new Map;function fL(){for(let e of Array.from(f$.values()))e()}let fF={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid}};function fB(e){let t=(0,c3.useId)();return(0,c3.useEffect)(()=>{if(e)return f$.set(t,e),()=>{f$.delete(t)}},[t,e]),{...ds(uv(),fF),mutateVisit:fL}}function fV(e,t=ug){let r=(0,c3.useRef)(void 0),{patientUuid:n,manuallySetVisitUuid:i,setVisitContext:o}=fB((0,c3.useCallback)(()=>r.current?.(),[])),a=e&&n==e?i:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${a}?v=${t}`,{data:u,error:c,mutate:d,isValidating:f}=(0,dR.Ay)(e?`${n2}/visit${s}`:null,n9),{data:p,error:h,mutate:m,isValidating:y}=(0,dR.Ay)(e&&a?`${n2}/visit${l}`:null,n9),g=(0,c3.useMemo)(()=>u?.data.results.find(e=>null===e.stopDatetime)??null,[u]),b=(0,c3.useMemo)(()=>a&&p?p.data:null,[p,a]),v=(0,c3.useRef)(null);(0,c3.useEffect)(()=>{!f&&g&&n===e&&null===i&&o(g),y||(v.current&&b&&v.current.uuid===b.uuid&&!v.current.stopDatetime&&b.stopDatetime&&o(null),v.current=b)},[b,i,g,f,y,n]);let w=(0,c3.useCallback)(()=>{d(),m()},[d,m]);(0,c3.useEffect)(()=>{r.current=w},[w]);let x=!!(!u||a&&!p),E=!!(a?h:c);return{error:c||h,mutate:w,isValidating:f||y,activeVisit:g,currentVisit:b,currentVisitIsRetrospective:!!a,isLoading:x&&!E}}function fU(){let[e,t]=(0,c3.useState)([]);return(0,c3.useEffect)(()=>{let e=uP().subscribe(e=>{t(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}fM.extend(fI);let fW=({state:e,children:t,...r})=>{let{extension:n}=(0,c3.useContext)(dr),i=(0,c3.useRef)(null),o=(0,c3.useRef)(Promise.resolve()),a=(0,c3.useRef)(!1),s=(0,c3.useRef)(!1),l=(0,c3.useRef)(e),u=(0,c3.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,c3.useCallback)((e,t)=>{e.update&&"UNMOUNTING"!==e.getStatus()&&(o.current=Promise.all([e.mountPromise,o.current]).then(()=>{if(i.current?.getStatus()==="MOUNTED"&&i.current.update)return i.current.update({...t})}).catch(e=>{let t=i.current?.getStatus();"UNMOUNTING"!==t&&"NOT_MOUNTED"!==t&&"UNLOADING"!==t&&console.error(`The extension '${n?.extensionId}' failed to update`,e)}))},[]),d=(0,c3.useCallback)(t=>{t&&!i.current&&!s.current&&n?.extensionSlotName&&n.extensionSlotModuleName&&(s.current=!0,cK(t,n.extensionSlotName,n.extensionSlotModuleName,n.extensionId,void 0,e).then(t=>{(s.current=!1,i.current=t,a.current)?u(t):t&&l.current!==e&&c(t,l.current)},()=>{s.current=!1}))},[]);return(0,c3.useEffect)(()=>(a.current=!1,()=>{a.current=!0,u(i.current)}),[]),(0,c3.useEffect)(()=>{l.current=e,i.current&&c(i.current,e)},[e]),n?c4().createElement("div",{ref:d,"data-extension-id":n?.extensionId,style:{position:"relative"},...r}):null};var fK=r(74848),fH=r(46942),fz=r.n(fH);function fq({title:e,children:t}){let r="tablet"===fb();return(0,fK.jsxs)("div",{className:fz()({"-esm-form-builder__card-header-module__tabletHeader___rUYi0":r,"-esm-form-builder__card-header-module__desktopHeader___CDa37":!r}),children:[(0,fK.jsx)("h4",{children:e}),t]})}var fG=r(68108);let fZ="-esm-form-builder__custom-overflow-menu-module__container___lY3iq",fY="-esm-form-builder__custom-overflow-menu-module__menu___dReHr",fJ="-esm-form-builder__custom-overflow-menu-module__show___48R0e",fQ="-esm-form-builder__custom-overflow-menu-module__overflowMenuButton___tsY8r",fX=(0,c3.createContext)(null);function f0(){let e=(0,c3.useContext)(fX);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function f1({menuTitle:e,children:t}){let[r,n]=c4().useState(!1),i=fE(()=>n(!1),r),o="tablet"===fb(),a=(0,c3.useCallback)(()=>n(e=>!e),[]),s=(0,c3.useRef)(null),l=(0,c3.useRef)(null),u=(0,c3.useId)(),c=`custom-overflow-menu-trigger-${u}`,d=`custom-overflow-menu-${u}`,f=(0,c3.useCallback)(()=>{n(!1),s.current?.focus()},[]),p=(0,c3.useMemo)(()=>({closeMenu:f}),[f]),h=(0,c3.useCallback)(e=>{"Escape"===e.key&&r&&(e.stopPropagation(),f())},[f,r]),m=c3.Children.toArray(t);(0,c3.useEffect)(()=>{if(r&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[r]);let y=(0,c3.useCallback)(({currentIndex:e,direction:t})=>{let r=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!r?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,i=Array.from(r).indexOf(n);if(-1===i)return void r[t>0?0:r.length-1]?.focus();let o=i+t,a=o<0?r.length-1:o>=r.length?0:o;r[a]?.focus()},[]),g=m.map((e,t)=>(0,c3.isValidElement)(e)?(0,c3.cloneElement)(e,{closeMenu:f,handleOverflowMenuItemFocus:y,index:t}):e);return(0,fK.jsxs)("div",{"data-overflow-menu":!0,className:fz()("cds--overflow-menu",fZ),ref:i,children:[(0,fK.jsx)("button",{className:fz()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":r},fQ),"aria-controls":d,"aria-expanded":r,"aria-haspopup":"true",id:c,onClick:a,onKeyDown:h,ref:s,children:e}),(0,fK.jsxs)("div",{className:fz()("cds--overflow-menu-options","cds--overflow-menu--flip",fY,{[fJ]:r}),"aria-labelledby":c,"data-floating-menu-direction":"bottom",id:d,onKeyDown:h,ref:l,role:"menu",tabIndex:-1,children:[(0,fK.jsx)("ul",{className:fz()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":o}),children:(0,fK.jsx)(fX.Provider,{value:p,children:g})}),(0,fK.jsx)("span",{})]})]})}function f3(e){let t=(0,c3.useContext)(fX);return(0,fK.jsx)(fG.XSD,{...e,closeMenu:t?.closeMenu})}let f4={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},f2=e=>(0,fK.jsx)(fG.GGC,{translateWithId:(e,t)=>{let r=f4[e];return r?os(r,e,t):e},...e});var f6=r(47767),f5=r(84976);let f8=["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"],f9=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),f7=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-add",iconProps:e})})),pe=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),pt=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),pr=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),pn=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),pi=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),po=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),pa=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),ps=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),pl=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),pu=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),pc=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),pd=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),pf=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),pp=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),ph=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),pm=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),py=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),pg=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),pb=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),pv=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),p_=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-close",iconProps:e})})),pw=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),px=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),pE=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-document",iconProps:e})})),pS=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),pD=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-download",iconProps:e})})),pO=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),pP=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),pC=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),pk=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-events",iconProps:e})})),pj=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),pT=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),pR=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),pA=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),pM=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),pN=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-group",iconProps:e})})),pI=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),p$=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),pL=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),pF=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-information",iconProps:e})})),pB=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),pV=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),pU=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),pW=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),pK=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),pH=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-location",iconProps:e})})),pz=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),pq=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),pG=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),pZ=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),pY=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),pJ=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),pQ=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-money",iconProps:e})})),pX=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),p0=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),p1=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),p3=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),p4=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-password",iconProps:e})})),p2=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),p6=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),p5=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),p8=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),p9=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),p7=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),he=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),ht=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-report",iconProps:e})})),hr=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),hn=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-save",iconProps:e})})),hi=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-search",iconProps:e})})),ho=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),ha=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),hs=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),hl=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),hu=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),hc=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),hd=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),hf=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-table",iconProps:e})})),hp=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-time",iconProps:e})})),hh=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),hm=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),hy=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),hg=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),hb=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),hv=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),h_=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),hw=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),hx=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-user",iconProps:e})})),hE=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),hS=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-view",iconProps:e})})),hD=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(hR,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),hO=hD,hP=pS,hC=pK,hk=pL,hj=hl,hT=(0,c3.memo)((0,c3.forwardRef)(function({icon:e,fallback:t,...r},n){let i=(0,c3.useRef)(e?document.getElementById(e):void 0);return(0,c3.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),r=new MutationObserver(t=>{for(let r of t)"childList"===r.type&&(i.current=e?document.getElementById(e):void 0)});return t&&r.observe(t,{childList:!0}),()=>r.disconnect()},[e]),(0,fK.jsx)(dK,{value:i.current,fallback:t,children:(0,fK.jsx)(hR,{ref:n,icon:e,iconProps:r})})})),hR=(0,c3.memo)((0,c3.forwardRef)(function({icon:e,iconProps:t},r){let{className:n,fill:i,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 a=(0,c3.useRef)(null);return(0,c3.useImperativeHandle)(r,()=>a.current),(0,c3.useEffect)(()=>{a.current&&"currentColor"!==i&&a.current.style.setProperty("--omrs-icon-fill",i)},[]),(0,fK.jsx)("svg",{ref:a,className:fz()("omrs-icon","-esm-form-builder__icons-module__icon___sq7Qp",n),height:o,width:o,viewBox:"0 0 16 16",children:(0,fK.jsx)("use",{href:`#${e}`})})})),hA=({path:e,title:t,basePath:r,icon:n})=>{let{t:i}=(0,dT.useTranslation)(),o=(0,f6.zy)(),a=(0,c3.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let r=t.split("/").map(e=>decodeURIComponent(e)),n=(o.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return n.some((e,t)=>r.every((e,r)=>n[t+r]===e))},[o.pathname,e]);return(0,fK.jsx)("div",{children:(0,fK.jsx)(c2,{className:fz()("cds--side-nav__link",{"active-left-nav-link":a}),to:`${r}/${encodeURIComponent(e)}`,children:(0,fK.jsxs)("span",{className:"-esm-form-builder__dashboard-module__menu___Lg1M+",children:[(0,fK.jsx)(hT,{icon:n,className:"-esm-form-builder__dashboard-module__icon___Y2DxK",size:16}),(0,fK.jsx)("span",{children:i(t)})]})})},e)};function hM(e){return function({basePath:t}){return(0,fK.jsx)(f5.Kd,{children:(0,fK.jsx)(hA,{basePath:t,...e})})}}function hN(e){let t=(0,c3.useRef)(null),r=(0,c3.useRef)(void 0),n=(0,c3.useCallback)(t=>{if("function"==typeof e){let r=e(t);return()=>{"function"==typeof r?r():e(null)}}if(e)return e.current=t,()=>{e.current=null}},[e]);return(0,c3.useMemo)(()=>({get current(){return t.current},set current(value){t.current=value,r.current&&(r.current(),r.current=void 0),null!=value&&(r.current=n(value))}}),[n])}function hI(...e){return 1===e.length&&e[0]?e[0]:t=>{let r=!1,n=e.map(e=>{let n=h$(e,t);return r||="function"==typeof n,n});if(r)return()=>{n.forEach((t,r)=>{"function"==typeof t?t():h$(e[r],null)})}}}function h$(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function hL(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}let hF="u">typeof document?c4().useLayoutEffect:()=>{},hB={prefix:String(Math.round(1e10*Math.random())),current:0},hV=c4().createContext(hB),hU=c4().createContext(!1),hW=("u">typeof window&&window.document&&window.document.createElement,new WeakMap),hK="function"==typeof c4().useId?function(e){let t=c4().useId(),[r]=(0,c3.useState)(hG()),n=r?"react-aria":`react-aria${hB.prefix}`;return e||`${n}-${t}`}:function(e){let t=(0,c3.useContext)(hV),r=function(e=!1){let t=(0,c3.useContext)(hV),r=(0,c3.useRef)(null);if(null===r.current&&!e){let e=c4().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let r=hW.get(e);null==r?hW.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==r.state&&(t.current=r.id,hW.delete(e))}r.current=++t.current}return r.current}(!!e),n=`react-aria${t.prefix}`;return e||`${n}-${r}`};function hH(){return!1}function hz(){return!0}function hq(e){return()=>{}}function hG(){return"function"==typeof c4().useSyncExternalStore?c4().useSyncExternalStore(hq,hH,hz):(0,c3.useContext)(hU)}let hZ=!!("u">typeof window&&window.document&&window.document.createElement),hY=new Map;function hJ(e){let[t,r]=(0,c3.useState)(e),n=(0,c3.useRef)(null),i=hK(t),o=(0,c3.useRef)(null);if(l&&l.register(o,i),hZ){let e=hY.get(i);e&&!e.includes(n)?e.push(n):hY.set(i,[n])}return hF(()=>()=>{l&&l.unregister(o),hY.delete(i)},[i]),(0,c3.useEffect)(()=>{let e=n.current;return e&&r(e),()=>{e&&(n.current=null)}}),i}function hQ(e=[]){let t=hJ(),[r,n]=function(e){let[t,r]=(0,c3.useState)(e),n=(0,c3.useRef)(t),i=(0,c3.useRef)(null),o=(0,c3.useRef)(()=>{if(!i.current)return;let e=i.current.next();if(e.done){i.current=null;return}n.current===e.value?o.current():r(e.value)});return hF(()=>{n.current=t,i.current&&o.current()}),[t,(0,c3.useCallback)(e=>{i.current=e(n.current),o.current()},[o])]}(t),i=(0,c3.useCallback)(()=>{n(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,n]);return hF(i,[t,i,...e]),r}"u">typeof FinalizationRegistry&&(l=new FinalizationRegistry(e=>{hY.delete(e)}));let hX=function(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(r=0;r<o;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n};function h0(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let e in n){let r=t[e],i=n[e];"function"==typeof r&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&90>=e.charCodeAt(2)?t[e]=hL(r,i):("className"===e||"UNSAFE_className"===e)&&"string"==typeof r&&"string"==typeof i?t[e]=hX(r,i):"id"===e&&r&&i?t.id=function(e,t){if(e===t)return e;let r=hY.get(e);if(r)return r.forEach(e=>e.current=t),t;let n=hY.get(t);return n?(n.forEach(t=>t.current=e),e):t}(r,i):"ref"===e&&r&&i?t.ref=hI(r,i):t[e]=void 0!==i?i:r}}return t}let h1=Symbol("default");function h3({values:e,children:t}){for(let[r,n]of e)t=c4().createElement(r.Provider,{value:n},t);return t}function h4(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=e;return(0,c3.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:i}):t,l="function"==typeof r?r({...s,defaultStyle:a||{}}):r,u="function"==typeof n?n({...s,defaultChildren:o}):null==n?o:n,{className:null!=e?e:i,style:l||a?{...a,...l}:void 0,children:null!=u?u:o,"data-rac":""}},[t,r,n,i,o,a,s])}function h2(e,t){let r=(0,c3.useContext)(e);if(null===t)return null;if(r&&"object"==typeof r&&"slots"in r&&r.slots){let e=t||h1;if(!r.slots[e]){let e=new Intl.ListFormat().format(Object.keys(r.slots).map(e=>`"${e}"`)),n=t?`Invalid slot "${t}".`:"A slot prop is required.";throw Error(`${n} Valid slot names are ${e}.`)}return r.slots[e]}return r}function h6(e,t,r){let{ref:n,...i}=h2(r,e.slot)||{},o=hN((0,c3.useMemo)(()=>hI(t,n),[t,n])),a=h0(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&("function"==typeof i.style||"function"==typeof e.style?a.style=t=>{let r="function"==typeof i.style?i.style(t):i.style,n={...t.defaultStyle,...r},o="function"==typeof e.style?e.style({...t,defaultStyle:n}):e.style;return{...n,...o}}:a.style={...i.style,...e.style}),[a,o]}function h5(e=!0){let[t,r]=(0,c3.useState)(e),n=(0,c3.useRef)(!1),i=(0,c3.useCallback)(e=>{n.current=!0,r(!!e)},[]);return hF(()=>{n.current||r(!1)},[]),[i,t]}function h8(e){let t=/^(data-.*)$/,r={};for(let n in e)t.test(n)||(r[n]=e[n]);return r}let h9=(0,c3.createContext)(null),h7=null;function me(e,t="assertive",r=7e3){h7?h7.announce(e,t,r):(h7=new mt,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?h7.announce(e,t,r):setTimeout(()=>{(null==h7?void 0:h7.isAttached())&&(null==h7||h7.announce(e,t,r))},100))}class mt{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",r=7e3){var n,i;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==(n=this.assertiveLog)||n.appendChild(o):null==(i=this.politeLog)||i.appendChild(o),""!==e&&setTimeout(()=>{o.remove()},r)}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 mr=new Set(["id"]),mn=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),mi=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),mo=new Set(["dir","lang","hidden","inert","translate"]),ma=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),ms=/^(data-.*)$/;function ml(e,t={}){let{labelable:r,isLink:n,global:i,events:o=i,propNames:a}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(mr.has(t)||r&&mn.has(t)||n&&mi.has(t)||i&&mo.has(t)||o&&(ma.has(t)||t.endsWith("Capture")&&ma.has(t.slice(0,-7)))||a?.has(t)||ms.test(t))&&(s[t]=e[t]);return s}function mu(e){if(function(){if(null==mc){mc=!1;try{document.createElement("div").focus({get preventScroll(){return mc=!0,!0}})}catch{}}return mc}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let mc=null,md=e=>e?.ownerDocument??document,mf=e=>e&&"window"in e&&e.window===e?e:md(e).defaultView||window;function mp(e,t){return!!t&&!!e&&e.contains(t)}function mh(e){return e.target}function mm(e){if(!e)return!1;let t=e.getRootNode(),r=mf(e);if(!(t instanceof r.Document||t instanceof r.ShadowRoot))return!1;let n=t.activeElement;return null!=n&&e.contains(n)}let my="u">typeof Element&&"checkVisibility"in Element.prototype;function mg(e,t){return my?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):"#comment"!==e.nodeName&&function(e){let t=mf(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,i="none"!==r&&"hidden"!==n&&"collapse"!==n;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:r,visibility:n}=t(e);i="none"!==r&&"hidden"!==n&&"collapse"!==n}return i}(e)&&!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))&&(!e.parentElement||mg(e.parentElement,e))}let mb=["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"])',"permission"],mv=mb.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";mb.push('[tabindex]:not([tabindex="-1"]):not([disabled])');let m_=mb.join(':not([hidden]):not([tabindex="-1"]),');function mw(e,t){return e.matches(mv)&&!mE(e)&&(t?.skipVisibilityCheck||mg(e))}function mx(e){return e.matches(m_)&&mg(e)&&!mE(e)}function mE(e){let t=e;for(;null!=t;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function mS(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function mD(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function mO(e){let t=(0,c3.useRef)({isFocused:!1,observer:null});return hF(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]),(0,c3.useCallback)(r=>{let n=mh(r);(n instanceof HTMLButtonElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&(t.current.isFocused=!0,n.addEventListener("focusout",r=>{if(t.current.isFocused=!1,n.disabled){let t=mS(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===((e=document)=>e.activeElement)()?null:((e=document)=>e.activeElement)();n.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),n.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:["disabled"]}))},[e])}let mP=!1;function mC(e){if("u"<typeof window||null==window.navigator)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function mk(e){return"u">typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function mj(e){let t=null;return()=>(null==t&&(t=e()),t)}let mT=mj(function(){return mk(/^Mac/i)}),mR=mj(function(){return mk(/^iPhone/i)}),mA=mj(function(){return mk(/^iPad/i)||mT()&&navigator.maxTouchPoints>1}),mM=mj(function(){return mR()||mA()});mj(function(){return mT()||mM()});let mN=mj(function(){return mC(/AppleWebKit/i)&&!mI()}),mI=mj(function(){return mC(/Chrome/i)}),m$=mj(function(){return mC(/Android/i)}),mL=mj(function(){return mC(/Firefox/i)});function mF(e){return""===e.pointerType&&!!e.isTrusted||(m$()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function mB(e,t,r=!0){let{metaKey:n,ctrlKey:i,altKey:o,shiftKey:a}=t;mL()&&window.event?.type?.startsWith("key")&&"_blank"===e.target&&(mT()?n=!0:i=!0);let s=mN()&&mT()&&!mA()&&1?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:n,ctrlKey:i,altKey:o,shiftKey:a}):new MouseEvent("click",{metaKey:n,ctrlKey:i,altKey:o,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});mB.isOpening=r,mu(e),e.dispatchEvent(s),mB.isOpening=!1}mB.isOpening=!1;let mV=null,mU=new Set,mW=new Map,mK=!1,mH=!1,mz={Tab:!0,Escape:!0};function mq(e,t){for(let r of mU)r(e,t)}function mG(e){mK=!0,mB.isOpening||e.metaKey||!mT()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(mV="keyboard",mq("keyboard",e))}function mZ(e){mV="pointer","pointerType"in e&&e.pointerType,("mousedown"===e.type||"pointerdown"===e.type)&&(mK=!0,mq("pointer",e))}function mY(e){!mB.isOpening&&mF(e)&&(mK=!0,mV="virtual")}function mJ(e){let t=mf(mh(e)),r=md(mh(e));mh(e)!==t&&mh(e)!==r&&!mP&&e.isTrusted&&(mK||mH||(mV="virtual",mq("virtual",e)),mK=!1,mH=!1)}function mQ(){mP||(mK=!1,mH=!0)}function mX(e){if("u"<typeof window||"u"<typeof document)return;let t=mf(e),r=md(e);if(mW.get(t))return;let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){mK=!0,n.apply(this,arguments)},r.addEventListener("keydown",mG,!0),r.addEventListener("keyup",mG,!0),r.addEventListener("click",mY,!0),t.addEventListener("focus",mJ,!0),t.addEventListener("blur",mQ,!1),"u">typeof PointerEvent&&(r.addEventListener("pointerdown",mZ,!0),r.addEventListener("pointermove",mZ,!0),r.addEventListener("pointerup",mZ,!0)),t.addEventListener("beforeunload",()=>{m0(e)},{once:!0}),mW.set(t,{focus:n})}let m0=(e,t)=>{let r=mf(e),n=md(e);t&&n.removeEventListener("DOMContentLoaded",t),mW.has(r)&&(r.HTMLElement.prototype.focus=mW.get(r).focus,n.removeEventListener("keydown",mG,!0),n.removeEventListener("keyup",mG,!0),n.removeEventListener("click",mY,!0),r.removeEventListener("focus",mJ,!0),r.removeEventListener("blur",mQ,!1),"u">typeof PointerEvent&&(n.removeEventListener("pointerdown",mZ,!0),n.removeEventListener("pointermove",mZ,!0),n.removeEventListener("pointerup",mZ,!0)),mW.delete(r))};function m1(){return"pointer"!==mV}"u">typeof document&&("loading"!==(p=md(void 0)).readyState?mX(void 0):p.addEventListener("DOMContentLoaded",()=>{mX(void 0)}));let m3=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),m4=new Map,m2=new Set;function m6(){if("u"<typeof window)return;function e(e){return"propertyName"in e}let t=r=>{let n=mh(r);if(!e(r)||!n)return;let i=m4.get(n);if(i&&(i.delete(r.propertyName),0===i.size&&(n.removeEventListener("transitioncancel",t),m4.delete(n)),0===m4.size)){for(let e of m2)e();m2.clear()}};document.body.addEventListener("transitionrun",r=>{let n=mh(r);if(!e(r)||!n)return;let i=m4.get(n);i||(i=new Set,m4.set(n,i),n.addEventListener("transitioncancel",t,{once:!0})),i.add(r.propertyName)}),document.body.addEventListener("transitionend",t)}function m5(e){requestAnimationFrame(()=>{for(let[e]of m4)"isConnected"in e&&!e.isConnected&&m4.delete(e);0===m4.size?e():m2.add(e)})}function m8(e){if(!e.isConnected)return;let t=md(e);if("virtual"===mV){let r=((e=document)=>e.activeElement)(t);m5(()=>{let n=((e=document)=>e.activeElement)(t);(n===r||n===t.body)&&e.isConnected&&mu(e)})}else mu(e)}function m9(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:i}=e,o=(0,c3.useCallback)(e=>{if(mh(e)===e.currentTarget)return n&&n(e),i&&i(!1),!0},[n,i]),a=mO(o),s=(0,c3.useCallback)(e=>{let t=mh(e),n=md(t),o=n?((e=document)=>e.activeElement)(n):((e=document)=>e.activeElement)();t===e.currentTarget&&t===o&&(r&&r(e),i&&i(!0),a(e))},[i,r,a]);return{focusProps:{onFocus:!t&&(r||i||n)?s:void 0,onBlur:!t&&(n||i)?o:void 0}}}function m7(e){if(!e)return;let t=!0;return r=>{e({...r,preventDefault(){r.preventDefault()},isDefaultPrevented:()=>r.isDefaultPrevented(),stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped:()=>t}),t&&r.stopPropagation()}}function ye(e,t){hF(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}"u">typeof document&&("loading"!==document.readyState?m6():document.addEventListener("DOMContentLoaded",m6));let yt=c4().createContext(null);function yr(e,t){let{focusProps:r}=m9(e),{keyboardProps:n}={keyboardProps:e.isDisabled?{}:{onKeyDown:m7(e.onKeyDown),onKeyUp:m7(e.onKeyUp)}},i=h0(r,n),o=function(e){let t=(0,c3.useContext)(yt)||{};ye(t,e);let{ref:r,...n}=t;return n}(t),a=e.isDisabled?{}:o,s=(0,c3.useRef)(e.autoFocus);(0,c3.useEffect)(()=>{s.current&&t.current&&m8(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:h0({...i,tabIndex:l},a)}}c4().forwardRef(function(e,t){let{children:r,...n}=e,i=hN(t),o={...n,ref:i};return c4().createElement(yt.Provider,{value:o},r)});let yn="default",yi="",yo=new WeakMap;function ya(e){if(mM())"disabled"===yn&&(yn="restoring",setTimeout(()=>{m5(()=>{if("restoring"===yn){let t=md(e);"none"===t.documentElement.style.webkitUserSelect&&(t.documentElement.style.webkitUserSelect=yi||""),yi="",yn="default"}})},300));else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&yo.has(e)){let t=yo.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";"none"===e.style[r]&&(e.style[r]=t),""===e.getAttribute("style")&&e.removeAttribute("style"),yo.delete(e)}}function ys(e){let t=e?.defaultView;return t?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let yl=new WeakMap;function yu(e){let t=e??("u">typeof document?document:void 0);if(!t)return ys(t);if(yl.has(t))return yl.get(t);let r=t.querySelector('meta[property="csp-nonce"]'),n=r&&r instanceof mf(r).HTMLMetaElement&&(r.nonce||r.content)||ys(t)||void 0;return void 0!==n&&yl.set(t,n),n}let yc=c4().createContext({register:()=>{}});yc.displayName="PressResponderContext";let yd=c4().useInsertionEffect??hF;function yf(e){let t=(0,c3.useRef)(null);return yd(()=>{t.current=e},[e]),(0,c3.useCallback)((...e)=>{let r=t.current;return r?.(...e)},[])}function yp(){let e=(0,c3.useRef)(new Map),t=(0,c3.useCallback)((t,r,n,i)=>{let o=i?.once?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:o,options:i}),t.addEventListener(r,o,i)},[]),r=(0,c3.useCallback)((t,r,n,i)=>{let o=e.current.get(n)?.fn||n;t.removeEventListener(r,o,i),e.current.delete(n)},[]),n=(0,c3.useCallback)(()=>{e.current.forEach((e,t)=>{r(e.eventTarget,e.type,t,e.options)})},[r]);return(0,c3.useEffect)(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}var yh=r(54575),ym=r.n(yh);class yy{#e;constructor(e,t,r,n){this.#e=!0;let i=n?.target??r.currentTarget;const o=i?.getBoundingClientRect();let a,s=0,l,u=null;null!=r.clientX&&null!=r.clientY&&(l=r.clientX,u=r.clientY),o&&(null!=l&&null!=u?(a=l-o.left,s=u-o.top):(a=o.width/2,s=o.height/2)),this.type=e,this.pointerType=t,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=a,this.y=s,this.key=r.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}let yg=Symbol("linkClicked"),yb="react-aria-pressable-style",yv="data-react-aria-pressable";function y_(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:o,onClick:a,isDisabled:s,isPressed:l,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:f,...p}=function(e){let t=(0,c3.useContext)(yc);if(t){let{register:r,ref:n,...i}=t;e=h0(i,e),r()}return ye(t,e.ref),e}(e),[h,m]=(0,c3.useState)(!1),y=(0,c3.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:b}=yp(),v=(0,c3.useCallback)((e,t)=>{let i=y.current;if(s||i.didFirePressStart)return!1;let o=!0;if(i.isTriggeringEvent=!0,n){let r=new yy("pressstart",t,e);n(r),o=r.shouldStopPropagation}return r&&r(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,m(!0),o},[s,n,r]),w=(0,c3.useCallback)((e,n,o=!0)=>{let a=y.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let l=!0;if(i){let t=new yy("pressend",n,e);i(t),l=t.shouldStopPropagation}if(r&&r(!1),m(!1),t&&o&&!s){let r=new yy("press",n,e);t(r),l&&=r.shouldStopPropagation}return a.isTriggeringEvent=!1,l},[s,i,r,t]),x=yf(w),E=yf((0,c3.useCallback)((e,t)=>{let r=y.current;if(s)return!1;if(o){r.isTriggeringEvent=!0;let n=new yy("pressup",t,e);return o(n),r.isTriggeringEvent=!1,n.shouldStopPropagation}return!0},[s,o])),S=(0,c3.useCallback)(e=>{let t=y.current;if(t.isPressed&&t.target){for(let r of(t.didFirePressStart&&null!=t.pointerType&&w(yE(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,b(),d||ya(t.target),t.disposables))r();t.disposables=[]}},[d,b,w]),D=yf(S),O=(0,c3.useCallback)(e=>{c&&S(e)},[c,S]),P=(0,c3.useCallback)(e=>{s||a?.(e)},[s,a]),C=(0,c3.useCallback)((e,t)=>{if(!s&&a){let r=new MouseEvent("click",e);mD(r,t),a(mS(r))}},[s,a]),k=(0,c3.useMemo)(()=>{let e=y.current,t={onKeyDown(t){if(yx(t.nativeEvent,t.currentTarget)&&mp(t.currentTarget,mh(t))){yS(mh(t),t.key)&&t.preventDefault();let n=!0;e.isPressed||t.repeat||(e.target=t.currentTarget,e.isPressed=!0,e.pointerType="keyboard",n=v(t,"keyboard"));let i=t.currentTarget;g(md(t.currentTarget),"keyup",hL(t=>{yx(t,i)&&!t.repeat&&mp(i,mh(t))&&e.target&&E(yE(e.target,t),"keyboard")},r),!0),n&&t.stopPropagation(),t.metaKey&&mT()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else"Meta"===t.key&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||mp(t.currentTarget,mh(t)))&&t&&0===t.button&&!e.isTriggeringEvent&&!mB.isOpening){let r=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&("virtual"===e.pointerType||mF(t.nativeEvent))){let e=v(t,"virtual"),n=E(t,"virtual"),i=x(t,"virtual");P(t),r=e&&n&&i}else if(e.isPressed&&"keyboard"!==e.pointerType){let n=e.pointerType||t.nativeEvent.pointerType||"virtual",i=E(yE(t.currentTarget,t),n),o=x(yE(t.currentTarget,t),n,!0);r=i&&o,e.isOverTarget=!1,P(t),D(t)}e.ignoreEmulatedMouseEvents=!1,r&&t.stopPropagation()}}},r=t=>{if(e.isPressed&&e.target&&yx(t,e.target)){yS(mh(t),t.key)&&t.preventDefault();let r=mh(t),n=mp(e.target,r);x(yE(e.target,t),"keyboard",n),n&&C(t,e.target),b(),"Enter"!==t.key&&yw(e.target)&&mp(e.target,r)&&!t[yg]&&(t[yg]=!0,mB(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if("Meta"===t.key&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;for(let r of(e.metaKeyEvents=void 0,t.values()))e.target?.dispatchEvent(new KeyboardEvent("keyup",r))}};if("u">typeof PointerEvent){t.onPointerDown=t=>{var i;if(0!==t.button||!mp(t.currentTarget,mh(t)))return;if(i=t.nativeEvent,!m$()&&0===i.width&&0===i.height||1===i.width&&1===i.height&&0===i.pressure&&0===i.detail&&"mouse"===i.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(mM()){if("default"===yn){let t=md(e);yi=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}yn="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";yo.set(e,e.style[t]),e.style[t]="none"}}(e.target),o=v(t,e.pointerType);let i=mh(t);"releasePointerCapture"in i&&("hasPointerCapture"in i?i.hasPointerCapture(t.pointerId)&&i.releasePointerCapture(t.pointerId):i.releasePointerCapture(t.pointerId)),g(md(t.currentTarget),"pointerup",r,!1),g(md(t.currentTarget),"pointercancel",n,!1)}o&&t.stopPropagation()},t.onMouseDown=t=>{if(mp(t.currentTarget,mh(t))&&0===t.button){if(u){let r=function(e){for(;e&&!mw(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=mf(e),r=t.document.activeElement;if(!r||r===e)return;mP=!0;let n=!1,i=e=>{(mh(e)===r||n)&&e.stopImmediatePropagation()},o=t=>{(mh(t)===r||n)&&(t.stopImmediatePropagation(),e||n||(n=!0,mu(r),l()))},a=t=>{(mh(t)===e||n)&&t.stopImmediatePropagation()},s=t=>{(mh(t)===e||n)&&(t.stopImmediatePropagation(),n||(n=!0,mu(r),l()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",o,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",a,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",o,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",a,!0),mP=!1,n=!1},u=requestAnimationFrame(l);return l}(t.target);r&&e.disposables.push(r)}t.stopPropagation()}},t.onPointerUp=t=>{mp(t.currentTarget,mh(t))&&"virtual"!==e.pointerType&&(0!==t.button||e.isPressed||E(t,e.pointerType||t.pointerType))},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!0,v(yE(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!1,x(yE(e.target,t),e.pointerType,!1),O(t))};let r=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&e.target){if(mp(e.target,mh(t))&&null!=e.pointerType){let r=!1,n=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(r?D(t):(mu(e.target),e.target.click()))},80);g(t.currentTarget,"click",()=>r=!0,!0),e.disposables.push(()=>clearTimeout(n))}else D(t);e.isOverTarget=!1}},n=e=>{D(e)};t.onDragStart=e=>{mp(e.currentTarget,mh(e))&&D(e)}}return t},[g,s,u,b,d,O,v,P,C]);return(0,c3.useEffect)(()=>{if(!f)return;let e=md(f.current);if(!e||!e.head||e.getElementById(yb))return;let t=e.createElement("style");t.id=yb;let r=yu(e);r&&(t.nonce=r),t.textContent=`
17
17
  @layer {
18
- [${yb}] {
18
+ [${yv}] {
19
19
  touch-action: pan-x pan-y pinch-zoom;
20
20
  }
21
21
  }
22
- `.trim(),e.head.prepend(t)},[f]),(0,c1.useEffect)(()=>{let e=y.current;return()=>{for(let t of(d||yo(e.target??void 0),e.disposables))t();e.disposables=[]}},[d]),{isPressed:l||h,pressProps:hX(p,k,{[yb]:!0})}}function y_(e){return"A"===e.tagName&&e.hasAttribute("href")}function yw(e,t){let{key:r,code:n}=e,i=t.getAttribute("role");return("Enter"===r||" "===r||"Spacebar"===r||"Space"===n)&&!(t instanceof md(t).HTMLInputElement&&!yD(t,r)||t instanceof md(t).HTMLTextAreaElement||t.isContentEditable)&&!(("link"===i||!i&&y_(t))&&"Enter"!==r)}function yx(e,t){let r=t.clientX,n=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:n,key:t.key}}function yE(e,t){return e instanceof HTMLInputElement?!yD(e,t):!(e instanceof HTMLInputElement)&&(e instanceof HTMLButtonElement?"submit"!==e.type&&"reset"!==e.type:!y_(e))}let yS=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function yD(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:yS.has(e.type)}function yO(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=e,o=(0,c1.useRef)({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:s}=yf(),l=(0,c1.useCallback)(e=>{mf(e.currentTarget,mp(e))&&o.current.isFocusWithin&&!mf(e.currentTarget,e.relatedTarget)&&(o.current.isFocusWithin=!1,s(),r&&r(e),i&&i(!1))},[r,i,o,s]),u=mD(l),c=(0,c1.useCallback)(e=>{if(!mf(e.currentTarget,mp(e)))return;let t=mp(e),r=mc(t),s=((e=document)=>e.activeElement)(r);if(!o.current.isFocusWithin&&s===t){n&&n(e),i&&i(!0),o.current.isFocusWithin=!0,u(e);let t=e.currentTarget;a(r,"focus",e=>{let n=mp(e);if(o.current.isFocusWithin&&!mf(t,n)){let e=new r.defaultView.FocusEvent("blur",{relatedTarget:n});mS(e,t),l(mE(e))}},{capture:!0})}},[n,i,u,a,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}function yP(e={}){var t;let{autoFocus:r=!1,isTextInput:n,within:i}=e,o=(0,c1.useRef)({isFocused:!1,isFocusVisible:r||m0()}),[a,s]=(0,c1.useState)(!1),[l,u]=(0,c1.useState)(()=>o.current.isFocused&&o.current.isFocusVisible),c=(0,c1.useCallback)(()=>u(o.current.isFocused&&o.current.isFocusVisible),[]),d=(0,c1.useCallback)(e=>{o.current.isFocused=e,o.current.isFocusVisible=m0(),s(e),c()},[c]);t={enabled:a,isTextInput:n},mQ(),(0,c1.useEffect)(()=>{if(t?.enabled===!1)return;let e=(e,r)=>{var n;let i,a,s,l,u,d,f,p;n=!!t?.isTextInput,a=mc(i=r?mp(r):void 0),l=void 0!==(s=md(i))?s.HTMLInputElement:HTMLInputElement,u=void 0!==s?s.HTMLTextAreaElement:HTMLTextAreaElement,d=void 0!==s?s.HTMLElement:HTMLElement,f=void 0!==s?s.KeyboardEvent:KeyboardEvent,p=((e=document)=>e.activeElement)(a),(n=n||p instanceof l&&!m1.has(p.type)||p instanceof u||p instanceof d&&p.isContentEditable)&&"keyboard"===e&&r instanceof f&&!mH[r.key]||(e=>{o.current.isFocusVisible=e,c()})(m0())};return mV.add(e),()=>{mV.delete(e)}},[n,a]);let{focusProps:f}=m8({isDisabled:i,onFocusChange:d}),{focusWithinProps:p}=yO({isDisabled:!i,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:i?p:f}}let yC=!1,yk=0;function yT(e){"touch"===e.pointerType&&(yC=!0,setTimeout(()=>{yC=!1},500))}function yj(){let e=mc(null);if(void 0!==e)return 0===yk&&"u">typeof PointerEvent&&e.addEventListener("pointerup",yT),yk++,()=>{!(--yk>0)&&"u">typeof PointerEvent&&e.removeEventListener("pointerup",yT)}}function yR(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:i}=e,[o,a]=(0,c1.useState)(!1),s=(0,c1.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,c1.useEffect)(yj,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=yf(),{hoverProps:c,triggerHoverEnd:d}=(0,c1.useMemo)(()=>{let e=(e,t)=>{let i=s.target;s.pointerType="",s.target=null,"touch"!==t&&s.isHovered&&i&&(s.isHovered=!1,u(),n&&n({type:"hoverend",target:i,pointerType:t}),r&&r(!1),a(!1))},o={};return"u">typeof PointerEvent&&(o.onPointerEnter=n=>{yC&&"mouse"===n.pointerType||((n,o)=>{if(s.pointerType=o,i||"touch"===o||s.isHovered||!mf(n.currentTarget,mp(n)))return;s.isHovered=!0;let u=n.currentTarget;s.target=u,l(mc(mp(n)),"pointerover",t=>{s.isHovered&&s.target&&!mf(s.target,mp(t))&&e(t,t.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:u,pointerType:o}),r&&r(!0),a(!0)})(n,n.pointerType)},o.onPointerLeave=t=>{!i&&mf(t.currentTarget,mp(t))&&e(t,t.pointerType)}),{hoverProps:o,triggerHoverEnd:e}},[t,r,n,i,s,l,u]);return(0,c1.useEffect)(()=>{i&&d({currentTarget:s.target},s.pointerType)},[i]),{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 yA=(0,c1.createContext)(!1);function yM(e){let t=(t,r)=>(0,c1.useContext)(yA)?null:e(t,r);return t.displayName=e.displayName||e.name,(0,c1.forwardRef)(t)}let yN=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),yI=(0,c1.createContext)({}),y$=yM(function(e,t){var r;[e,t]=h2(e,t,yI);let n=((r=e).isPending&&(r.onPress=void 0,r.onPressStart=void 0,r.onPressEnd=void 0,r.onPressChange=void 0,r.onPressUp=void 0,r.onKeyDown=void 0,r.onKeyUp=void 0,r.onClick=void 0,r.href=void 0),e=r),{isPending:i}=n,{buttonProps:o,isPressed:a}=function(e,t){let r,{elementType:n="button",isDisabled:i,onPress:o,onPressStart:a,onPressEnd:s,onPressUp:l,onPressChange:u,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:f,href:p,target:h,rel:m,type:y="button"}=e;r="button"===n?{type:y,disabled:i,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:"button",href:"a"!==n||i?void 0:p,target:"a"===n?h:void 0,type:"input"===n?y:void 0,disabled:"input"===n?i:void 0,"aria-disabled":i&&"input"!==n?i:void 0,rel:"a"===n?m:void 0};let{pressProps:g,isPressed:b}=yv({onPressStart:a,onPressEnd:s,onPressChange:u,onPress:o,onPressUp:l,onClick:f,isDisabled:i,preventFocusOnPress:c,ref:t}),{focusableProps:v}=yt(e,t);d&&(v.tabIndex=i?-1:v.tabIndex);let w=hX(v,g,ms(e,{labelable:!0}));return{isPressed:b,buttonProps:hX(r,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"],"aria-disabled":e["aria-disabled"]})}}(e,t),{focusProps:s,isFocused:l,isFocusVisible:u}=yP(e),{hoverProps:c,isHovered:d}=yR({...e,isDisabled:e.isDisabled||i}),f={isHovered:d,isPressed:(n.isPressed||a)&&!i,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:null!=i&&i},p=h3({...e,values:f,defaultClassName:"react-aria-Button"}),h=hY(o.id),m=hY(),y=o["aria-labelledby"];i&&(y?y=`${y} ${m}`:o["aria-label"]&&(y=`${h} ${m}`));let g=(0,c1.useRef)(i);return(0,c1.useEffect)(()=>{let e={"aria-labelledby":y||h};!g.current&&l&&i?h7(e,"assertive"):g.current&&l&&!i&&h7(e,"assertive"),g.current=i},[i,l,y,h]),c3().createElement("button",{...ms(e,{propNames:yN}),...hX(o,s,c),...p,type:"submit"===o.type&&i?"button":o.type,id:h,ref:t,"aria-labelledby":y,slot:e.slot||void 0,"aria-disabled":i?"true":o["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":l||void 0,"data-pending":i||void 0,"data-focus-visible":u||void 0},c3().createElement(h8.Provider,{value:{id:m}},p.children))});(0,c1.createContext)(null),(0,c1.createContext)(null),(0,c1.createContext)(null),(0,c1.createContext)(null),(0,c1.createContext)(null);let yL=(0,c1.createContext)({}),yF=(0,c1.createContext)({}),yB=(0,c1.forwardRef)(function(e,t){[e,t]=h2(e,t,yF);let{elementType:r="span",...n}=e;return c3().createElement(r,{className:"react-aria-Text",...n,ref:t})}),yV=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),yU=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function yW(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),r="function"==typeof t.getTextInfo?t.getTextInfo():t.textInfo;if(r)return"rtl"===r.direction;if(t.script)return yV.has(t.script)}let t=e.split("-")[0];return yU.has(t)}let yK=Symbol.for("react-aria.i18n.locale");function yH(){let e="u">typeof window&&window[yK]||"u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:yW(e)?"rtl":"ltr"}}let yz=yH(),yq=new Set;function yG(){for(let e of(yz=yH(),yq))e(yz)}function yZ(){let e=hq(),[t,r]=(0,c1.useState)(yz);return((0,c1.useEffect)(()=>(0===yq.size&&window.addEventListener("languagechange",yG),yq.add(r),()=>{yq.delete(r),0===yq.size&&window.removeEventListener("languagechange",yG)}),[]),e)?{locale:"u">typeof window&&window[yK]||"en-US",direction:"ltr"}:t}let yY=c3().createContext(null);function yJ(e){let{locale:t,children:r}=e,n=c3().useMemo(()=>({locale:t,direction:yW(t)?"rtl":"ltr"}),[t]);return c3().createElement(yY.Provider,{value:n},r)}function yQ(e){let{children:t}=e,r=yZ();return c3().createElement(yY.Provider,{value:r},t)}function yX(e){let{locale:t,children:r}=e;return t?c3().createElement(yJ,{locale:t,children:r}):c3().createElement(yQ,{children:r})}function y0(){let e=yZ();return(0,c1.useContext)(yY)||e}let y1=null;function y3(e,t="assertive",r=7e3){y1?y1.announce(e,t,r):(y1=new y4,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?y1.announce(e,t,r):setTimeout(()=>{y1?.isAttached()&&y1?.announce(e,t,r)},100))}class y4{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))}isAttached(){return this.node?.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",r=7e3){if(!this.node)return;let n=document.createElement("div");"object"==typeof e?(n.setAttribute("role","img"),n.setAttribute("aria-labelledby",e["aria-labelledby"])):n.textContent=e,"assertive"===t?this.assertiveLog?.appendChild(n):this.politeLog?.appendChild(n),""!==e&&setTimeout(()=>{n.remove()},r)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}}var y2={};function y6(e,t){let r=(0,c1.useRef)(null);return e&&r.current&&t(e,r.current)&&(e=r.current),r.current=e,e}y2={"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 y5=new Map;class y8{constructor(e,t={}){this.formatter=y7(e,t),this.options=t}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 r=this.formatter.formatToParts(e),n=this.formatter.formatToParts(t);return[...r.map(e=>({...e,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...n.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return null==gt&&(gt="h12"===new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle),gt&&(this.resolvedHourCycle||(this.resolvedHourCycle=function(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,"");let r=y7(e+=(e.includes("-u-")?"":"-u")+"-nu-latn",{...t,timeZone:void 0}),n=parseInt(r.formatToParts(new Date(2020,2,3,0)).find(e=>"hour"===e.type).value,10),i=parseInt(r.formatToParts(new Date(2020,2,3,23)).find(e=>"hour"===e.type).value,10);if(0===n&&23===i)return"h23";if(24===n&&23===i)return"h24";if(0===n&&11===i)return"h11";if(12===n&&11===i)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}}let y9={true:{ja:"h11"},false:{}};function y7(e,t={}){if("boolean"==typeof t.hour12&&(null==ge&&(ge="24"===new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))),ge)){let r=y9[String((t={...t}).hour12)][e.split("-")[0]],n=t.hour12?"h12":"h23";t.hourCycle=r??n,delete t.hour12}let r=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(y5.has(r))return y5.get(r);let n=new Intl.DateTimeFormat(e,t);return y5.set(r,n),n}let ge=null,gt=null;function gr(e){e=y6(e??{},gn);let{locale:t}=y0();return(0,c1.useMemo)(()=>new y8(t,e),[t,e])}function gn(e,t){if(e===t)return!0;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(t[n]!==e[n])return!1;return!0}let gi=Symbol.for("react-aria.i18n.locale"),go=Symbol.for("react-aria.i18n.strings");class ga{constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let r=this.getStringsForLocale(t)[e];if(!r)throw Error(`Could not find intl message ${e} in ${t} locale`);return r}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,r="en-US"){var n;if(t[e])return t[e];let i=(n=e,Intl.Locale?new Intl.Locale(n).language:n.split("-")[0]);if(t[i])return t[i];for(let e in t)if(e.startsWith(i+"-"))return t[e];return t[r]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if("u"<typeof window)return null;let t=window[gi];if(void 0===h){let e=window[go];if(!e)return null;for(let r in h={},e)h[r]=new ga({[t]:e[r]},t)}let r=h?.[e];if(!r)throw Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}}let gs=new Map,gl=new Map;class gu{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let r=this.strings.getStringForLocale(e,this.locale);return"function"==typeof r?r(t,this):r}plural(e,t,r="cardinal"){let n=t["="+e];if(n)return"function"==typeof n?n():n;let i=this.locale+":"+r,o=gs.get(i);return o||(o=new Intl.PluralRules(this.locale,{type:r}),gs.set(i,o)),"function"==typeof(n=t[o.select(e)]||t.other)?n():n}number(e){let t=gl.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),gl.set(this.locale,t)),t.format(e)}select(e,t){let r=e[t]||e.other;return"function"==typeof r?r():r}}let gc=new WeakMap;function gd(e,t){let r;return t&&ga.getGlobalDictionaryForPackage(t)||((r=gc.get(e))||(r=new ga(e),gc.set(e,r)),r)}function gf(e,t){let{locale:r}=y0(),n=gd(e,t);return(0,c1.useMemo)(()=>new gu(r,n),[r,n])}function gp(e,t){return e-t*Math.floor(e/t)}function gh(e,t,r,n){let i=(t=gy(e,t))-1,o=-2;return r<=2?o=0:gm(t)&&(o=-1),1721425+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*r-362)/12+o+n)}function gm(e){return e%4==0&&(e%100!=0||e%400==0)}function gy(e,t){return"BC"===e?1-t:t}function gg(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}let gb={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 gv{fromJulianDay(e){let t=e-1721426,r=Math.floor(t/146097),n=gp(t,146097),i=Math.floor(n/36524),o=gp(n,36524),a=Math.floor(o/1461),s=Math.floor(gp(o,1461)/365),[l,u]=gg(400*r+100*i+4*a+s+ +(4!==i&&4!==s)),c=e-gh(l,u,1,1),d=2;e<gh(l,u,3,1)?d=0:gm(u)&&(d=1);let f=Math.floor(((c+d)*12+373)/367),p=e-gh(l,u,f,1)+1;return new gB(l,u,f,p)}toJulianDay(e){return gh(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return gb[gm(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return gm(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}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 g_(e,t){let r=e.copy(),n="hour"in r?gT(r,t):0;gw(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,gx(r),gE(r),r.day+=7*(t.weeks||0),r.day+=t.days||0,r.day+=n,function(e){for(;e.day<1;)e.month--,gx(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,gx(e)}(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let i=r.calendar.getYearsInEra(r);if(r.year>i){let e=r.calendar.isInverseEra?.(r);r.year=i,r.month=e?1:r.calendar.getMonthsInYear(r),r.day=e?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let o=r.calendar.getMonthsInYear(r);return r.month>o&&(r.month=o,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function gw(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function gx(e){for(;e.month<1;)gw(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,gw(e,1)}function gE(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 gS(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),gE(e)}function gD(e){let t={};for(let r in e)"number"==typeof e[r]&&(t[r]=-e[r]);return t}function gO(e,t){let r=e.copy();return null!=t.era&&(r.era=t.era),null!=t.year&&(r.year=t.year),null!=t.month&&(r.month=t.month),null!=t.day&&(r.day=t.day),gS(r),r}function gP(e,t){let r=e.copy();return null!=t.hour&&(r.hour=t.hour),null!=t.minute&&(r.minute=t.minute),null!=t.second&&(r.second=t.second),null!=t.millisecond&&(r.millisecond=t.millisecond),gC(r),r}function gC(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 gk(e,t){let r=e%t;return r<0&&(r+=t),r}function gT(e,t){let r;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=gk(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=gk(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=gk(e.minute,60),r=Math.floor(e.hour/24),e.hour=gk(e.hour,24),r}function gj(e,t){let r=e.copy();return gT(r,t),r}function gR(e,t,r,n){let i=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=gM(o,r,0,t.length-1,n?.round),i.era=t[o],gS(i);break}case"year":i.calendar.isInverseEra?.(i)&&(r=-r),i.year=gM(e.year,r,-1/0,9999,n?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=gM(e.month,r,1,e.calendar.getMonthsInYear(e),n?.round);break;case"day":i.day=gM(e.day,r,1,e.calendar.getDaysInMonth(e),n?.round);break;default:throw Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),gS(i),i}function gA(e,t,r,n){let i=e.copy();switch(t){case"hour":{let t=e.hour,o=0,a=23;if(n?.hourCycle===12){let e=t>=12;o=12*!!e,a=e?23:11}i.hour=gM(t,r,o,a,n?.round);break}case"minute":i.minute=gM(e.minute,r,0,59,n?.round);break;case"second":i.second=gM(e.second,r,0,59,n?.round);break;case"millisecond":i.millisecond=gM(e.millisecond,r,0,999,n?.round);break;default:throw Error("Unsupported field "+t)}return i}function gM(e,t,r,n,i=!1){if(i){(e+=Math.sign(t))<r&&(e=n);let i=Math.abs(t);(e=t>0?Math.ceil(e/i)*i:Math.floor(e/i)*i)>n&&(e=r)}else(e+=t)<r?e=n-(r-e-1):e>n&&(e=r+(e-n-1));return e}function gN(e,t){let r;return r=(null!=t.years&&0!==t.years||null!=t.months&&0!==t.months||null!=t.weeks&&0!==t.weeks||null!=t.days&&0!==t.days?gZ(g_(gX(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):gK(e)-e.offset)+(t.milliseconds||0),r+=1e3*(t.seconds||0),r+=6e4*(t.minutes||0),g0(gJ(r+=36e5*(t.hours||0),e.timeZone),e.calendar)}function gI(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 g$(e){let t,r=g0(e,new gv);return t="BC"===r.era?1===r.year?"0000":"-"+String(Math.abs(1-r.year)).padStart(6,"00"):String(r.year).padStart(4,"0"),`${t}-${String(r.month).padStart(2,"0")}-${String(r.day).padStart(2,"0")}`}function gL(e){return`${g$(e)}T${gI(e)}`}function gF(e){let t,r="object"==typeof e[0]?e.shift():new gv;if("string"==typeof e[0])t=e.shift();else{let e=r.getEras();t=e[e.length-1]}return[r,t,e.shift(),e.shift(),e.shift()]}class gB{#t;constructor(...e){let[t,r,n,i,o]=gF(e);this.calendar=t,this.era=r,this.year=n,this.month=i,this.day=o,gS(this)}copy(){return this.era?new gB(this.calendar,this.era,this.year,this.month,this.day):new gB(this.calendar,this.year,this.month,this.day)}add(e){return g_(this,e)}subtract(e){return g_(this,gD(e))}set(e){return gO(this,e)}cycle(e,t,r){return gR(this,e,t,r)}toDate(e){return gY(this,e)}toString(){return g$(this)}compare(e){return g7(this,e)}}class gV{#t;constructor(e=0,t=0,r=0,n=0){this.hour=e,this.minute=t,this.second=r,this.millisecond=n,gC(this)}copy(){return new gV(this.hour,this.minute,this.second,this.millisecond)}add(e){return gj(this,e)}subtract(e){return gj(this,gD(e))}set(e){return gP(this,e)}cycle(e,t,r){return gA(this,e,t,r)}toString(){return gI(this)}compare(e){var t,r;return t=this,r=e,be(t)-be(r)}}class gU{#t;constructor(...e){let[t,r,n,i,o]=gF(e);this.calendar=t,this.era=r,this.year=n,this.month=i,this.day=o,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,gS(this)}copy(){return this.era?new gU(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new gU(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return g_(this,e)}subtract(e){return g_(this,gD(e))}set(e){return gO(gP(this,e),e)}cycle(e,t,r){switch(e){case"era":case"year":case"month":case"day":return gR(this,e,t,r);default:return gA(this,e,t,r)}}toDate(e,t){return gY(this,e,t)}toString(){return gL(this)}compare(e){var t,r;let n=g7(this,e);return 0===n?(t=this,r=gX(e),be(t)-be(r)):n}}class gW{#t;constructor(...e){let[t,r,n,i,o]=gF(e),a=e.shift(),s=e.shift();this.calendar=t,this.era=r,this.year=n,this.month=i,this.day=o,this.timeZone=a,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,gS(this)}copy(){return this.era?new gW(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new gW(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return gN(this,e)}subtract(e){return gN(this,gD(e))}set(e,t){let r,n;return 0===(n=gP(gO(r=gX(this),e),e)).compare(r)?this:g0(gJ(gZ(n,this.timeZone,t),this.timeZone),this.calendar)}cycle(e,t,r){return function(e,t,r,n){switch(t){case"hour":{let t=0,i=23;if(n?.hourCycle===12){let r=e.hour>=12;t=12*!!r,i=r?23:11}let o=gX(e),a=g0(gP(o,{hour:t}),new gv),s=[gZ(a,e.timeZone,"earlier"),gZ(a,e.timeZone,"later")].filter(t=>gJ(t,e.timeZone).day===a.day)[0],l=g0(gP(o,{hour:i}),new gv),u=[gZ(l,e.timeZone,"earlier"),gZ(l,e.timeZone,"later")].filter(t=>gJ(t,e.timeZone).day===l.day).pop(),c=gK(e)-e.offset,d=Math.floor(c/36e5),f=c%36e5;return g0(gJ(c=36e5*gM(d,r,Math.floor(s/36e5),Math.floor(u/36e5),n?.round)+f,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return gA(e,t,r,n);case"era":case"year":case"month":case"day":return g0(gJ(gZ(gR(gX(e),t,r,n),e.timeZone),e.timeZone),e.calendar);default:throw Error("Unsupported field "+t)}}(this,e,t,r)}toDate(){var e;return e=this,new Date(gK(e)-e.offset)}toString(){var e;let t,r,n,i,o;return`${gL(this)}${t=0>Math.sign(e=this.offset)?"-":"+",r=Math.floor((e=Math.abs(e))/36e5),n=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),o=`${t}${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`,0!==i&&(o+=`:${String(i).padStart(2,"0")}`),o}[${this.timeZone}]`}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-(function(e,t){if(e instanceof gW){var r,n;return e.timeZone===t?e:(r=e,n=t,g0(gJ(gK(r)-r.offset,n),r.calendar))}return gJ(gZ(e,t,void 0),t)})(e,this.timeZone).toDate().getTime()}}function gK(e){return gH(gy((e=g0(e,new gv)).era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function gH(e,t,r,n,i,o,a){let s=new Date;return s.setUTCHours(n,i,o,a),s.setUTCFullYear(e,t-1,r),s.getTime()}function gz(e,t){if("UTC"===t)return 0;if(e>0&&t===br())return -6e4*new Date(e).getTimezoneOffset();let{year:r,month:n,day:i,hour:o,minute:a,second:s}=gG(e,t);return gH(r,n,i,o,a,s,0)-1e3*Math.floor(e/1e3)}let gq=new Map;function gG(e,t){let r=gq.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),gq.set(t,r));let n=r.formatToParts(new Date(e)),i={};for(let e of n)"literal"!==e.type&&(i[e.type]=e.value);return{year:"BC"===i.era||"B"===i.era?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:"24"===i.hour?0:+i.hour,minute:+i.minute,second:+i.second}}function gZ(e,t,r="compatible"){var n,i,o;let a=gX(e);if("UTC"===t)return gK(a);if(t===br()&&"compatible"===r){a=g0(a,new gv);let e=new Date,t=gy(a.era,a.year);return e.setFullYear(t,a.month-1,a.day),e.setHours(a.hour,a.minute,a.second,a.millisecond),e.getTime()}let s=gK(a),l=gz(s-864e5,t),u=gz(s+864e5,t),c=(n=a,((i=s-l)==(o=s-u)?[i]:[i,o]).filter(e=>{var r;let i;return r=n,i=gG(e,t),r.year===i.year&&r.month===i.month&&r.day===i.day&&r.hour===i.hour&&r.minute===i.minute&&r.second===i.second}));if(1===c.length)return c[0];if(c.length>1)switch(r){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw RangeError("Multiple possible absolute times found")}switch(r){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 gY(e,t,r="compatible"){return new Date(gZ(e,t,r))}function gJ(e,t){let r=gz(e,t),n=new Date(e+r),i=n.getUTCFullYear();return new gW(i<1?"BC":"AD",i<1?-i+1:i,n.getUTCMonth()+1,n.getUTCDate(),t,r,n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds())}function gQ(e){return new gB(e.calendar,e.era,e.year,e.month,e.day)}function gX(e,t){let r=0,n=0,i=0,o=0;if("timeZone"in e)({hour:r,minute:n,second:i,millisecond:o}=e);else if("hour"in e&&!t)return e;return t&&({hour:r,minute:n,second:i,millisecond:o}=t),new gU(e.calendar,e.era,e.year,e.month,e.day,r,n,i,o)}function g0(e,t){if(g2(e.calendar,t))return e;let r=t.fromJulianDay(e.calendar.toJulianDay(e)),n=e.copy();return n.calendar=t,n.era=r.era,n.year=r.year,n.month=r.month,n.day=r.day,gS(n),n}let g1={"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 g3(e,t){return t=g0(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function g4(e,t){return g2(e.calendar,t.calendar)&&g3(e,t)}function g2(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}let g6={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function g5(e,t,r){let n=Math.ceil(e.calendar.toJulianDay(e)+1-(r?g6[r]:function(e){let t=bs.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo()))return bs.set(e,t),t.firstDay}let r=function(e){if(Intl.Locale){let t=ba.get(e);return!t&&(t=new Intl.Locale(e).maximize().region)&&ba.set(e,t),t}let t=e.split("-")[1];return"u"===t?void 0:t}(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];t="mon"===r?{firstDay:1}:"tue"===r?{firstDay:2}:"wed"===r?{firstDay:3}:"thu"===r?{firstDay:4}:"fri"===r?{firstDay:5}:"sat"===r?{firstDay:6}:{firstDay:0}}else t=e.includes("-ca-iso8601")?{firstDay:1}:{firstDay:r&&g1[r]||0};bs.set(e,t)}return t.firstDay}(t)))%7;return n<0&&(n+=7),n}function g8(e){return gJ(Date.now(),e)}function g9(e){return gQ(g8(e))}function g7(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function be(e){return 36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}let bt=null;function br(){return null==bt&&(bt=new Intl.DateTimeFormat().resolvedOptions().timeZone),bt}function bn(e){return e.subtract({days:e.day-1})}function bi(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function bo(e,t,r){let n=g5(e,t,r);return e.subtract({days:n})}let ba=new Map,bs=new Map;function bl(e,t,r){let n=e.calendar.getDaysInMonth(e);return Math.ceil((g5(bn(e),t,r)+n)/7)}function bu(e,t){return e&&t?0>=e.compare(t)?e:t:e||t}function bc(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}function bd(e){return e&&e.__esModule?e.default:e}let bf=new WeakMap;function bp(e){return e?.calendar.identifier==="gregory"&&"BC"===e.era?"short":void 0}function bh(e,t,r,n){let i=gf(bd(y2),"@react-aria/calendar"),o=bp(e)||bp(t),a=gr({month:"long",year:"numeric",era:o,calendar:e.calendar.identifier,timeZone:r}),s=gr({month:"long",year:"numeric",day:"numeric",era:o,calendar:e.calendar.identifier,timeZone:r});return(0,c1.useMemo)(()=>{if(g3(e,bn(e))){let o=e,s=t;if(e.calendar.getFormattableMonth&&(o=e.calendar.getFormattableMonth(e)),t.calendar.getFormattableMonth&&(s=t.calendar.getFormattableMonth(t)),g3(t,bi(e)))return a.format(o.toDate(r));if(g3(t,bi(t)))return n?bm(a,i,o,s,r):a.formatRange(o.toDate(r),s.toDate(r))}return n?bm(s,i,e,t,r):s.formatRange(e.toDate(r),t.toDate(r))},[e,t,a,s,i,r,n])}function bm(e,t,r,n,i){let o=e.formatRangeToParts(r.toDate(i),n.toDate(i)),a=-1;for(let e=0;e<o.length;e++){let t=o[e];if("shared"===t.source&&"literal"===t.type)a=e;else if("endRange"===t.source)break}let s="",l="";for(let e=0;e<o.length;e++)e<a?s+=o[e].value:e>a&&(l+=o[e].value);return t.format("dateRange",{startDate:s,endDate:l})}function by(e,t){let{id:r,"aria-label":n,"aria-labelledby":i}=e;return r=hY(r),i&&n?i=[...new Set([r,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),n||i||!t||(n=t),{id:r,"aria-label":n,"aria-labelledby":i}}function bg(e,t){let r=(0,c1.useRef)(!0),n=(0,c1.useRef)(null),i=yd(e);(0,c1.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[]),(0,c1.useEffect)(()=>{let e=n.current;r.current?r.current=!1:(!e||t.some((t,r)=>!Object.is(t,e[r])))&&i(),n.current=t},t)}function bb(e,t){var r;let n,i,o,a,s,l=gf((r=y2)&&r.__esModule?r.default:r,"@react-aria/calendar"),u=ms(e),c=bh(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),d=bh(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);bg(()=>{t.isFocused||y3(d)},[d]);let f=(o=gf(bd(y2),"@react-aria/calendar"),"highlightedRange"in t?{start:n,end:i}=t.highlightedRange||{}:n=i=t.value??void 0,a=gr({weekday:"long",month:"long",year:"numeric",day:"numeric",era:bp(n)||bp(i),timeZone:t.timeZone}),s="anchorDate"in t?t.anchorDate:null,(0,c1.useMemo)(()=>{if(!s&&n&&i)if(g3(n,i)){let e=a.format(n.toDate(t.timeZone));return o.format("selectedDateDescription",{date:e})}else{let e=bm(a,o,n,i,t.timeZone);return o.format("selectedRangeDescription",{dateRange:e})}return""},[n,i,s,t.timeZone,o,a]));bg(()=>{f&&y3(f,"polite",4e3)},[f]);let p=hJ([!!e.errorMessage,e.isInvalid,e.validationState]);bf.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:p,selectedDateDescription:f});let[h,m]=(0,c1.useState)(!1),y=e.isDisabled||t.isNextVisibleRangeInvalid();y&&h&&(m(!1),t.setFocused(!0));let[g,b]=(0,c1.useState)(!1),v=e.isDisabled||t.isPreviousVisibleRangeInvalid();return v&&g&&(b(!1),t.setFocused(!0)),{calendarProps:hX(u,by({id:e.id,"aria-label":[e["aria-label"],d].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]}),{role:"application","aria-details":e["aria-details"]||void 0,"aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":l.format("next"),isDisabled:y,onFocusChange:m},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":l.format("previous"),isDisabled:v,onFocusChange:b},errorMessageProps:{id:p},title:c}}let bv={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 b_(e){let{children:t,elementType:r="div",isFocusable:n,style:i,...o}=e,{visuallyHiddenProps:a}=function(e={}){let{style:t,isFocusable:r}=e,[n,i]=(0,c1.useState)(!1),{focusWithinProps:o}=yO({isDisabled:!r,onFocusWithinChange:e=>i(e)}),a=(0,c1.useMemo)(()=>n?t:t?{...bv,...t}:bv,[n]);return{visuallyHiddenProps:{...o,style:a}}}(e);return c3().createElement(r,hX(o,a),t)}function bw(e,t,r,n){let i=yd(r),o=null==r;(0,c1.useEffect)(()=>{if(o||!e.current)return;let r=e.current;return r.addEventListener(t,i,n),()=>{r.removeEventListener(t,i,n)}},[e,t,n,o])}function bx(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&"hidden"!==r.overflow&&(i=!0),i&&t&&(i=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),i}function bE(e,t){let r=e;for(bx(r,t)&&(r=r.parentElement);r&&!bx(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function bS(e,t){let r=[],n=document.scrollingElement||document.documentElement;do bx(e,t)&&r.push(e),e=e.parentElement;while(e&&e!==n);return r}function bD(e,t,r={}){let{block:n="nearest",inline:i="nearest"}=r;if(e===t)return;let o=e.scrollTop,a=e.scrollLeft,s=t.getBoundingClientRect(),l=e.getBoundingClientRect(),u=window.getComputedStyle(t),c=window.getComputedStyle(e),d=document.scrollingElement||document.documentElement,f=e===d?0:l.top,p=e===d?e.clientHeight:l.bottom,h=e===d?0:l.left,m=e===d?e.clientWidth:l.right,y=parseInt(u.scrollMarginTop,10)||0,g=parseInt(u.scrollMarginBottom,10)||0,b=parseInt(u.scrollMarginLeft,10)||0,v=parseInt(u.scrollMarginRight,10)||0,w=parseInt(c.scrollPaddingTop,10)||0,x=parseInt(c.scrollPaddingBottom,10)||0,E=parseInt(c.scrollPaddingLeft,10)||0,S=parseInt(c.scrollPaddingRight,10)||0,D=parseInt(c.borderTopWidth,10)||0,O=parseInt(c.borderBottomWidth,10)||0,P=parseInt(c.borderLeftWidth,10)||0,C=parseInt(c.borderRightWidth,10)||0,k=s.top-y,T=s.bottom+g,j=s.left-b,R=s.right+v,A=e===d?0:P+C,M=e===d?0:D+O,N=e.offsetWidth-e.clientWidth-A,I=e.offsetHeight-e.clientHeight-M,$=f+D+w,L=p-O-x-I,F=h+P+E,B=m-C-S;"rtl"!==c.direction||mA()?B-=N:F+=N;let V=k<$||T>L,U=j<F||R>B;if(V&&"start"===n)o+=k-$;else if(V&&"center"===n)o+=(k+T)/2-($+L)/2;else if(V&&"end"===n)o+=T-L;else if(V&&"nearest"===n){let e=k-$,t=T-L;o+=Math.abs(e)<=Math.abs(t)?e:t}if(U&&"start"===i)a+=j-F;else if(U&&"center"===i)a+=(j+R)/2-(F+B)/2;else if(U&&"end"===i)a+=R-B;else if(U&&"nearest"===i){let e=j-F,t=R-B;a+=Math.abs(e)<=Math.abs(t)?e:t}e.scrollTo({left:a,top:o})}function bO(e,t={}){let{containingElement:r}=t;if(e&&e.isConnected){let t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let{left:t,top:n}=e.getBoundingClientRect(),i=bS(e,!0);for(let t of i)bD(t,e);let{left:o,top:a}=e.getBoundingClientRect();if(Math.abs(t-o)>1||Math.abs(n-a)>1)for(let e of i=r?bS(r,!0):[])bD(e,r,{block:"center",inline:"center"})}else{let{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});let{left:i,top:o}=e.getBoundingClientRect();(Math.abs(t-i)>1||Math.abs(n-o)>1)&&(r?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}let bP=0,bC=new Map;function bk(e){let[t,r]=(0,c1.useState)();return hL(()=>{if(!e)return;let t=bC.get(e);if(t)r(t.element.id);else{let n=`react-aria-description-${bP++}`;r(n);let i=document.createElement("div");i.id=n,i.style.display="none",i.textContent=e,document.body.appendChild(i),t={refCount:0,element:i},bC.set(e,t)}return t.refCount++,()=>{t&&0==--t.refCount&&(t.element.remove(),bC.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}class bT extends gv{fromJulianDay(e){let t=super.fromJulianDay(e);return new gB(this,gy(t.era,t.year)- -543,t.month,t.day)}toJulianDay(e){return super.toJulianDay(bj(e))}getEras(){return["BE"]}getDaysInMonth(e){return super.getDaysInMonth(bj(e))}balanceDate(){}constructor(...e){super(...e),this.identifier="buddhist"}}function bj(e){let[t,r]=gg(e.year+-543);return new gB(t,r,e.month,e.day)}function bR(e,t,r,n){return e+365*t+Math.floor(t/4)+30*(r-1)+n-1}function bA(e,t){let r=Math.floor(4*(t-e)/1461),n=1+Math.floor((t-bR(e,r,1,1))/30),i=t+1-bR(e,r,n,1);return[r,n,i]}function bM(e){return Math.floor(e%4/3)}function bN(e,t){return t%13!=0?30:bM(e)+5}class bI{fromJulianDay(e){let[t,r,n]=bA(1723856,e),i="AM";return t<=0&&(i="AA",t+=5500),new gB(this,i,t,r,n)}toJulianDay(e){let t=e.year;return"AA"===e.era&&(t-=5500),bR(1723856,t,e.month,e.day)}getDaysInMonth(e){return bN(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+bM(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(e){return"AA"===e.era?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class b$ extends bI{fromJulianDay(e){let[t,r,n]=bA(1723856,e);return new gB(this,"AA",t+=5500,r,n)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier="ethioaa"}}class bL extends bI{fromJulianDay(e){let[t,r,n]=bA(1824665,e),i="CE";return t<=0&&(i="BCE",t=1-t),new gB(this,i,t,r,n)}toJulianDay(e){let t=e.year;return"BCE"===e.era&&(t=1-t),bR(1824665,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return"BCE"===e.era&&(t=1-t),bN(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 bF=765433;function bB(e){return 7>gp(7*e+1,19)}function bV(e){let t=Math.floor((235*e-234)/19),r=29*t+Math.floor((12084+13753*t)/25920);return 3>gp(3*(r+1),7)&&(r+=1),r}function bU(e){let t,r;return bV(e)+(t=bV(e-1),r=bV(e),bV(e+1)-r==356?2:+(r-t==382))}function bW(e){return bU(e+1)-bU(e)}function bK(e,t){if(t>=6&&!bB(e)&&t++,4===t||7===t||9===t||11===t||13===t)return 29;let r=function(e){let t=bW(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}(e);return 2===t?2===r?30:29:3===t?0===r?29:30:6===t?30*!!bB(e):30}class bH{fromJulianDay(e){let t=e-347997,r=Math.floor((25920*t/bF*19+234)/235)+1,n=bU(r),i=Math.floor(t-n);for(;i<1;)i=Math.floor(t-(n=bU(--r)));let o=1,a=0;for(;a<i;)a+=bK(r,o),o++;let s=i-(a-=bK(r,--o));return new gB(this,r,o,s)}toJulianDay(e){let t=bU(e.year);for(let r=1;r<e.month;r++)t+=bK(e.year,r);return t+e.day+347997}getDaysInMonth(e){return bK(e.year,e.month)}getMonthsInYear(e){return bB(e.year)?13:12}getDaysInYear(e){return bW(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(e,t){t.year!==e.year&&(bB(t.year)&&!bB(e.year)&&t.month>6?e.month--:!bB(t.year)&&bB(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier="hebrew"}}class bz extends gv{fromJulianDay(e){let t,r,n,i=super.fromJulianDay(e),o=i.year-78,a=e-gh(i.era,i.year,1,1);if(a<80?(o--,a+=(t=gm(i.year-1)?31:30)+155+90+10):(t=gm(i.year)?31:30,a-=80),a<t)r=1,n=a+1;else{let e=a-t;e<155?(r=Math.floor(e/31)+2,n=e%31+1):(e-=155,r=Math.floor(e/30)+7,n=e%30+1)}return new gB(this,o,r,n)}toJulianDay(e){let t,r,[n,i]=gg(e.year+78);return(gm(i)?(t=31,r=gh(n,i,3,21)):(t=30,r=gh(n,i,3,22)),1===e.month)?r+e.day-1:(r+=t+31*Math.min(e.month-2,5),e.month>=8&&(r+=(e.month-7)*30),r+=e.day-1)}getDaysInMonth(e){return 1===e.month&&gm(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 bq(e,t,r,n){return n+Math.ceil(29.5*(r-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function bG(e,t,r){let n=Math.floor((30*(r-t)+10646)/10631),i=Math.min(12,Math.ceil((r-(29+bq(t,n,1,1)))/29.5)+1),o=r-bq(t,n,i,1)+1;return new gB(e,n,i,o)}function bZ(e){return(14+11*e)%30<11}class bY{fromJulianDay(e){return bG(this,1948440,e)}toJulianDay(e){return bq(1948440,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return 12===e.month&&bZ(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return bZ(e.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class bJ extends bY{fromJulianDay(e){return bG(this,1948439,e)}toJulianDay(e){return bq(1948439,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier="islamic-tbla"}}function bQ(e){return 460322+c[e-1300]}function bX(e,t){return(u[e-1300]&1<<11-(t-1))==0?29:30}function b0(e,t){let r=bQ(e);for(let n=1;n<t;n++)r+=bX(e,n);return r}function b1(e){return c[e+1-1300]-c[e-1300]}class b3 extends bY{constructor(){if(super(),this.identifier="islamic-umalqura",u||(u=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),e=>e.charCodeAt(0)).buffer)),!c){c=new Uint32Array(301);let e=0;for(let t=1300;t<=1600;t++){c[t-1300]=e;for(let r=1;r<=12;r++)e+=bX(t,r)}}}fromJulianDay(e){let t=e-1948440,r=bQ(1300),n=bQ(1600);if(t<r||t>n)return super.fromJulianDay(e);{let e=1299,r=1,n=1;for(;n>0;){n=t-bQ(++e)+1;let i=b1(e);if(n===i){r=12;break}if(n<i){let t=bX(e,r);for(r=1;n>t;)n-=t,t=bX(e,++r);break}}return new gB(this,e,r,t-b0(e,r)+1)}}toJulianDay(e){return e.year<1300||e.year>1600?super.toJulianDay(e):1948440+b0(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<1300||e.year>1600?super.getDaysInMonth(e):bX(e.year,e.month)}getDaysInYear(e){return e.year<1300||e.year>1600?super.getDaysInYear(e):b1(e.year)}}let b4=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],b2=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],b6=[1867,1911,1925,1988,2018],b5=["meiji","taisho","showa","heisei","reiwa"];function b8(e){let t=b4.findIndex(([t,r,n])=>!!(e.year<t)||e.year===t&&!!(e.month<r)||e.year===t&&e.month===r&&!!(e.day<n));return -1===t?b4.length-1:0===t?0:t-1}function b9(e){let t=b6[b5.indexOf(e.era)];if(!t)throw Error("Unknown era: "+e.era);return new gB(e.year+t,e.month,e.day)}class b7 extends gv{fromJulianDay(e){let t=super.fromJulianDay(e),r=b8(t);return new gB(this,b5[r],t.year-b6[r],t.month,t.day)}toJulianDay(e){return super.toJulianDay(b9(e))}balanceDate(e){let t=b9(e),r=b8(t);b5[r]!==e.era&&(e.era=b5[r],e.year=t.year-b6[r]),this.constrainDate(e)}constrainDate(e){let t=b5.indexOf(e.era),r=b2[t];if(null!=r){let[n,i,o]=r,a=n-b6[t];e.year=Math.max(1,Math.min(a,e.year)),e.year===a&&(e.month=Math.min(i,e.month),e.month===i&&(e.day=Math.min(o,e.day)))}if(1===e.year&&t>=0){let[,r,n]=b4[t];e.month=Math.max(r,e.month),e.month===r&&(e.day=Math.max(n,e.day))}}getEras(){return b5}getYearsInEra(e){let t=b5.indexOf(e.era),r=b4[t],n=b4[t+1];if(null==n)return 9999-r[0]+1;let i=n[0]-r[0];return(e.month<n[1]||e.month===n[1]&&e.day<n[2])&&i++,i}getDaysInMonth(e){return super.getDaysInMonth(b9(e))}getMinimumMonthInYear(e){let t=ve(e);return t?t[1]:1}getMinimumDayInMonth(e){let t=ve(e);return t&&e.month===t[1]?t[2]:1}constructor(...e){super(...e),this.identifier="japanese"}}function ve(e){if(1===e.year)return b4[b5.indexOf(e.era)]}let vt=[0,31,62,93,124,155,186,216,246,276,306,336];class vr{fromJulianDay(e){let t=e-1948320,r=1+Math.floor((33*t+3)/12053),n=t-(365*(r-1)+Math.floor((8*r+21)/33)),i=n<216?Math.floor(n/31):Math.floor((n-6)/30),o=n-vt[i]+1;return new gB(this,r,i+1,o)}toJulianDay(e){let t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=vt[e.month-1],t+=e.day}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||8>gp(25*e.year+11,33)?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}function vn(e){return"minguo"===e.era?e.year+1911:1-e.year+1911}function vi(e){let t=e-1911;return t>0?["minguo",t]:["before_minguo",1-t]}class vo extends gv{fromJulianDay(e){let t=super.fromJulianDay(e),[r,n]=vi(gy(t.era,t.year));return new gB(this,r,n,t.month,t.day)}toJulianDay(e){return super.toJulianDay(va(e))}getEras(){return["before_minguo","minguo"]}balanceDate(e){let[t,r]=vi(vn(e));e.era=t,e.year=r}isInverseEra(e){return"before_minguo"===e.era}getDaysInMonth(e){return super.getDaysInMonth(va(e))}getYearsInEra(e){return"before_minguo"===e.era?9999:8088}constructor(...e){super(...e),this.identifier="roc"}}function va(e){let[t,r]=gg(vn(e));return new gB(t,r,e.month,e.day)}function vs(e){switch(e){case"buddhist":return new bT;case"ethiopic":return new bI;case"ethioaa":return new b$;case"coptic":return new bL;case"hebrew":return new bH;case"indian":return new bz;case"islamic-civil":return new bY;case"islamic-tbla":return new bJ;case"islamic-umalqura":return new b3;case"japanese":return new b7;case"persian":return new vr;case"roc":return new vo;default:return new gv}}function vl(e,t,r){return null!=t&&0>e.compare(t)||null!=r&&e.compare(r)>0}function vu(e,t,r,n,i){let o={};for(let e in t)o[e]=Math.floor(t[e]/2),o[e]>0&&t[e]%2==0&&o[e]--;let a=vc(e,t,r).subtract(o);return vf(e,a,t,r,n,i)}function vc(e,t,r,n,i){let o=e;if(t.years)o=bn(e.subtract({months:e.month-1}));else t.months?o=bn(e):t.weeks&&(o=bo(e,r));return vf(e,o,t,r,n,i)}function vd(e,t,r,n,i){let o={...t};o.days?o.days--:o.weeks?o.weeks--:o.months?o.months--:o.years&&o.years--;let a=vc(e,t,r).subtract(o);return vf(e,a,t,r,n,i)}function vf(e,t,r,n,i,o){if(i&&e.compare(i)>=0){let e=bc(t,vc(gQ(i),r,n));e&&(t=e)}if(o&&0>=e.compare(o)){let e=bu(t,vd(gQ(o),r,n));e&&(t=e)}return t}function vp(e,t,r){if(t){let r=bc(e,gQ(t));r&&(e=r)}if(r){let t=bu(e,gQ(r));t&&(e=t)}return e}function vh(e,t,r){if(!r)return e;for(;e.compare(t)>=0&&r(e);)e=e.subtract({days:1});return e.compare(t)>=0?e:null}let vm="u">typeof document?c3().useInsertionEffect??c3().useLayoutEffect:()=>{};function vy(e,t,r){let[n,i]=(0,c1.useState)(e||t),o=(0,c1.useRef)(n),a=(0,c1.useRef)(void 0!==e),s=void 0!==e;(0,c1.useEffect)(()=>{a.current,a.current=s},[s]);let l=s?e:n;vm(()=>{o.current=l});let[,u]=(0,c1.useReducer)(()=>({}),{});return[l,(0,c1.useCallback)((e,...t)=>{let n="function"==typeof e?e(o.current):e;Object.is(o.current,n)||(o.current=n,i(n),u(),r?.(n,...t))},[r])]}function vg(e){let t=(0,c1.useMemo)(()=>new y8(e.locale),[e.locale]),r=(0,c1.useMemo)(()=>t.resolvedOptions(),[t]),{locale:n,createCalendar:i,visibleDuration:o={months:1},minValue:a,maxValue:s,selectionAlignment:l,isDateUnavailable:u,pageBehavior:c="visible",firstDayOfWeek:d}=e,f=(0,c1.useMemo)(()=>i(r.calendar),[i,r.calendar]),[p,h]=vy(e.value,e.defaultValue??null,e.onChange),m=(0,c1.useMemo)(()=>p?g0(gQ(p),f):null,[p,f]),y=(0,c1.useMemo)(()=>p&&"timeZone"in p?p.timeZone:r.timeZone,[p,r.timeZone]),[g,b]=vy((0,c1.useMemo)(()=>e.focusedValue?vp(g0(gQ(e.focusedValue),f),a,s):void 0,[e.focusedValue,f,a,s]),(0,c1.useMemo)(()=>vp(e.defaultFocusedValue?g0(gQ(e.defaultFocusedValue),f):m||g0(g9(y),f),a,s),[e.defaultFocusedValue,m,y,f,a,s]),e.onFocusChange),[v,w]=(0,c1.useState)(()=>{switch(l){case"start":return vc(g,o,n,a,s);case"end":return vd(g,o,n,a,s);default:return vu(g,o,n,a,s)}}),[x,E]=(0,c1.useState)(e.autoFocus||!1),S=(0,c1.useMemo)(()=>{let e={...o};return e.days?e.days--:e.days=-1,v.add(e)},[v,o]),[D,O]=(0,c1.useState)(f);if(!g2(f,D)){let e=g0(g,f);w(vu(e,o,n,a,s)),b(e),O(f)}function P(e){b(e=vp(e,a,s))}function C(t){if(!e.isDisabled&&!e.isReadOnly){let e=t;if(null===e)return void h(null);(e=vh(e=vp(e,a,s),v,u))&&(e=g0(e,p?.calendar||new gv),p&&"hour"in p?h(p.set(e)):h(e))}}vl(g,a,s)?b(vp(g,a,s)):0>g.compare(v)?w(vd(g,o,n,a,s)):g.compare(S)>0&&w(vc(g,o,n,a,s));let k=(0,c1.useMemo)(()=>!!m&&(!!(u&&u(m))||vl(m,a,s)),[m,u,a,s]),T=e.isInvalid||"invalid"===e.validationState||k,j=(0,c1.useMemo)(()=>"visible"===c?o:vb(o),[c,o]);return{isDisabled:e.isDisabled??!1,isReadOnly:e.isReadOnly??!1,value:m,setValue:C,visibleRange:{start:v,end:S},minValue:a,maxValue:s,focusedDate:g,timeZone:y,validationState:T?"invalid":null,isValueInvalid:T,setFocusedDate(e){P(e)},focusNextDay(){P(g.add({days:1}))},focusPreviousDay(){P(g.subtract({days:1}))},focusNextRow(){o.days?this.focusNextPage():(o.weeks||o.months||o.years)&&P(g.add({weeks:1}))},focusPreviousRow(){o.days?this.focusPreviousPage():(o.weeks||o.months||o.years)&&P(g.subtract({weeks:1}))},focusNextPage(){let e=v.add(j);b(vp(g.add(j),a,s)),w(vc(vf(g,e,j,n,a,s),j,n))},focusPreviousPage(){let e=v.subtract(j);b(vp(g.subtract(j),a,s)),w(vc(vf(g,e,j,n,a,s),j,n))},focusSectionStart(){o.days?P(v):o.weeks?P(bo(g,n)):(o.months||o.years)&&P(bn(g))},focusSectionEnd(){o.days?P(S):o.weeks?P(bo(g,n,void 0).add({days:6})):(o.months||o.years)&&P(bi(g))},focusNextSection(e){e||o.days?o.days?this.focusNextPage():o.weeks?P(g.add({months:1})):(o.months||o.years)&&P(g.add({years:1})):P(g.add(vb(o)))},focusPreviousSection(e){e||o.days?o.days?this.focusPreviousPage():o.weeks?P(g.subtract({months:1})):(o.months||o.years)&&P(g.subtract({years:1})):P(g.subtract(vb(o)))},selectFocusedDate(){u&&u(g)||C(g)},selectDate(e){C(e)},isFocused:x,setFocused:E,isInvalid:e=>vl(e,a,s),isSelected(e){return null!=m&&g3(e,m)&&!this.isCellDisabled(e)&&!this.isCellUnavailable(e)},isCellFocused:e=>x&&g&&g3(e,g),isCellDisabled(t){return e.isDisabled||0>t.compare(v)||t.compare(S)>0||this.isInvalid(t)},isCellUnavailable:t=>!!e.isDateUnavailable&&e.isDateUnavailable(t),isPreviousVisibleRangeInvalid(){let e=v.subtract({days:1});return g3(e,v)||this.isInvalid(e)},isNextVisibleRangeInvalid(){let e=S.add({days:1});return g3(e,S)||this.isInvalid(e)},getDatesInWeek(e,t=v){let r=t.add({weeks:e}),i=[],o=g5(r=bo(r,n,d),n,d);for(let e=0;e<o;e++)i.push(null);for(;i.length<7;){i.push(r);let e=r.add({days:1});if(g3(r,e))break;r=e}for(;i.length<7;)i.push(null);return i}}}function vb(e){let t={...e};for(let r in e)t[r]=1;return t}function vv(e,t){return e&&t?(0>t.compare(e)&&([e,t]=[t,e]),{start:gQ(e),end:gQ(t)}):null}function v_(e,t){return(e=g0(e,t?.calendar||new gv),t&&"hour"in t)?t.set(e):e}function vw(e,t,r){let n=e.add({days:r});for(;(r<0?n.compare(t.visibleRange.start)>=0:0>=n.compare(t.visibleRange.end))&&!t.isCellUnavailable(n);)n=n.add({days:r});if(t.isCellUnavailable(n))return n.add({days:-r})}let vx=(0,c1.createContext)(null),vE=(0,c1.createContext)(null),vS=(0,c1.createContext)(null),vD=(0,c1.createContext)(null),vO=(0,c1.forwardRef)(function(e,t){[e,t]=h2(e,t,vx);let{locale:r}=y0(),n=vg({...e,locale:r,createCalendar:vs}),{calendarProps:i,prevButtonProps:o,nextButtonProps:a,errorMessageProps:s,title:l}=bb(e,n),u=h3({...e,values:{state:n,isDisabled:e.isDisabled||!1,isInvalid:n.isValueInvalid},defaultClassName:"react-aria-Calendar"});return c3().createElement("div",{...u,...i,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":n.isValueInvalid||void 0},c3().createElement(h1,{values:[[yI,{slots:{previous:o,next:a}}],[yL,{"aria-hidden":!0,level:2,children:l}],[vS,n],[vx,e],[yF,{slots:{errorMessage:s}}]]},c3().createElement(b_,null,c3().createElement("h2",null,i["aria-label"])),u.children,c3().createElement(b_,null,c3().createElement("button",{"aria-label":a["aria-label"],disabled:a.isDisabled,onClick:()=>n.focusNextPage(),tabIndex:-1}))))}),vP=(0,c1.forwardRef)(function(e,t){[e,t]=h2(e,t,vE);let{locale:r}=y0(),n=function(e){let{value:t,defaultValue:r,onChange:n,createCalendar:i,locale:o,visibleDuration:a={months:1},minValue:s,maxValue:l,...u}=e,[c,d]=vy(t,r||null,n),[f,p]=(0,c1.useState)(null),h="center";if(c&&c.start&&c.end){let e=vu(gQ(c.start),a,o,s,l).add(a).subtract({days:1});c.end.compare(e)>0&&(h="start")}let m=(0,c1.useRef)(null),[y,g]=(0,c1.useState)(null),b=(0,c1.useMemo)(()=>bc(s,y?.start),[s,y]),v=(0,c1.useMemo)(()=>bu(l,y?.end),[l,y]),w=vg({...u,value:c&&c.start,createCalendar:i,locale:o,visibleDuration:a,minValue:b,maxValue:v,selectionAlignment:e.selectionAlignment||h}),x=t=>{t&&e.isDateUnavailable&&!e.allowsNonContiguousRanges?(m.current={start:vw(t,w,-1),end:vw(t,w,1)},g(m.current)):(m.current=null,g(null))},[E,S]=(0,c1.useState)(w.visibleRange);g4(w.visibleRange.start,E.start)&&g4(w.visibleRange.end,E.end)||(x(f),S(w.visibleRange));let D=e=>{e?(p(e),x(e)):(p(null),x(null))},O=f?vv(f,w.focusedDate):c&&vv(c.start,c.end),P=t=>{if(e.isReadOnly)return;let r=vh(vp(t,b,v),w.visibleRange.start,e.isDateUnavailable);if(r)if(f){let e=vv(f,r);e&&d({start:v_(e.start,c?.start),end:v_(e.end,c?.end)}),D(null)}else D(r)},[C,k]=(0,c1.useState)(!1),{isDateUnavailable:T}=e,j=(0,c1.useMemo)(()=>!!c&&!f&&(!!(T&&(T(c.start)||T(c.end)))||vl(c.start,s,l)||vl(c.end,s,l)),[T,c,f,s,l]),R=e.isInvalid||"invalid"===e.validationState||j;return{...w,value:c,setValue:d,anchorDate:f,setAnchorDate:D,highlightedRange:O,validationState:R?"invalid":null,isValueInvalid:R,selectFocusedDate(){P(w.focusedDate)},selectDate:P,highlightDate(e){f&&w.setFocusedDate(e)},isSelected:e=>!!(O&&e.compare(O.start)>=0&&0>=e.compare(O.end)&&!w.isCellDisabled(e)&&!w.isCellUnavailable(e)),isInvalid:e=>w.isInvalid(e)||vl(e,m.current?.start,m.current?.end),isDragging:C,setDragging:k,clearSelection(){D(null),d(null)}}}({...e,locale:r,createCalendar:vs}),{calendarProps:i,prevButtonProps:o,nextButtonProps:a,errorMessageProps:s,title:l}=function(e,t,r){let{commitBehavior:n="select",...i}=e,o=bb(i,t),a=(0,c1.useRef)(!1),s=(0,c1.useRef)("u">typeof window?window:null);bw(s,"pointerdown",e=>{a.current=0===e.width&&0===e.height});let l={clear:()=>t.clearSelection(),reset:()=>t.setAnchorDate(null),select:()=>t.selectFocusedDate()};return bw(s,"pointerup",e=>{if(a.current){a.current=!1;return}if(t.setDragging(!1),!t.anchorDate)return;let i=e.target;r.current&&mh(r.current)&&(!mf(r.current,i)||!i.closest('button, [role="button"]'))&&l[n]()}),o.calendarProps.onBlur=e=>{r.current&&(e.relatedTarget&&mf(r.current,e.relatedTarget)||!t.anchorDate||l[n]())},bw(r,"touchmove",e=>{t.isDragging&&e.preventDefault()},{passive:!1,capture:!0}),o}(e,n,t),u=h3({...e,values:{state:n,isDisabled:e.isDisabled||!1,isInvalid:n.isValueInvalid},defaultClassName:"react-aria-RangeCalendar"});return c3().createElement("div",{...u,...i,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":n.isValueInvalid||void 0},c3().createElement(h1,{values:[[yI,{slots:{previous:o,next:a}}],[yL,{"aria-hidden":!0,level:2,children:l}],[vD,n],[vE,e],[yF,{slots:{errorMessage:s}}]]},c3().createElement(b_,null,c3().createElement("h2",null,i["aria-label"])),u.children,c3().createElement(b_,null,c3().createElement("button",{"aria-label":a["aria-label"],disabled:a.isDisabled,onClick:()=>n.focusNextPage(),tabIndex:-1}))))}),vC=(0,c1.createContext)(null),vk=(0,c1.forwardRef)(function(e,t){var r,n;let i=(0,c1.useContext)(vS),o=(0,c1.useContext)(vD),a=h4(vx),s=h4(vE),l=null!=i?i:o,u=l.visibleRange.start;e.offset&&(u=u.add(e.offset));let c=null!=(r=null==a?void 0:a.firstDayOfWeek)?r:null==s?void 0:s.firstDayOfWeek,{gridProps:d,headerProps:f,weekDays:p}=function(e,t){let{startDate:r=t.visibleRange.start,endDate:n=t.visibleRange.end,firstDayOfWeek:i}=e,{direction:o}=y0(),a=bh(r,n,t.timeZone,!0),{ariaLabel:s,ariaLabelledBy:l}=bf.get(t),u=by({"aria-label":[s,a].filter(Boolean).join(", "),"aria-labelledby":l}),c=gr({weekday:e.weekdayStyle||"narrow",timeZone:t.timeZone}),{locale:d}=y0(),f=(0,c1.useMemo)(()=>{let e=bo(g9(t.timeZone),d,i);return[...Array(7).keys()].map(r=>{let n=e.add({days:r}).toDate(t.timeZone);return c.format(n)})},[d,t.timeZone,c,i]),p=bl(r,d,i);return{gridProps:hX(u,{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"===o?t.focusNextDay():t.focusPreviousDay();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousRow();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===o?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:f,weeksInMonth:p}}({startDate:u,endDate:bi(u),weekdayStyle:e.weekdayStyle,firstDayOfWeek:c},l);return c3().createElement(vC.Provider,{value:{headerProps:f,weekDays:p,startDate:u,firstDayOfWeek:c}},c3().createElement("table",{...ms(e),...d,ref:t,style:e.style,className:null!=(n=e.className)?n:"react-aria-CalendarGrid"},"function"!=typeof e.children?e.children:c3().createElement(c3().Fragment,null,c3().createElement(vT,null,e=>c3().createElement(vj,null,e)),c3().createElement(vR,null,e.children))))}),vT=(0,c1.forwardRef)(function(e,t){let{children:r,style:n,className:i}=e,{headerProps:o,weekDays:a}=(0,c1.useContext)(vC);return c3().createElement("thead",{...ms(e),...o,ref:t,style:n,className:i||"react-aria-CalendarGridHeader"},c3().createElement("tr",null,a.map((e,t)=>c3().cloneElement(r(e),{key:t}))))}),vj=(0,c1.forwardRef)(function(e,t){let{children:r,style:n,className:i}=e;return c3().createElement("th",{...ms(e),ref:t,style:n,className:i||"react-aria-CalendarHeaderCell"},r)}),vR=(0,c1.forwardRef)(function(e,t){let{children:r,style:n,className:i}=e,o=(0,c1.useContext)(vS),a=(0,c1.useContext)(vD),s=null!=o?o:a,{startDate:l,firstDayOfWeek:u}=(0,c1.useContext)(vC),{locale:c}=y0(),d=bl(l,c,u);return c3().createElement("tbody",{...ms(e),ref:t,style:n,className:i||"react-aria-CalendarGridBody"},[...Array(d).keys()].map(e=>c3().createElement("tr",{key:e},s.getDatesInWeek(e,l).map((e,t)=>e?c3().cloneElement(r(e),{key:t}):c3().createElement("td",{key:t})))))}),vA=(0,c1.forwardRef)(function({date:e,...t},r){var n,i,o;let a=(0,c1.useContext)(vS),s=(0,c1.useContext)(vD),l=null!=a?a:s,{startDate:u}=null!=(n=(0,c1.useContext)(vC))?n:{startDate:l.visibleRange.start},c=(0,c1.useRef)(null),{cellProps:d,buttonProps:f,...p}=function(e,t,r){var n;let i,{date:o,isDisabled:a}=e,{errorMessageId:s,selectedDateDescription:l}=bf.get(t),u=gf((n=y2)&&n.__esModule?n.default:n,"@react-aria/calendar"),c=gr({weekday:"long",day:"numeric",month:"long",year:"numeric",era:bp(o),timeZone:t.timeZone}),d=t.isSelected(o),f=t.isCellFocused(o)&&!e.isOutsideMonth;a=a||t.isCellDisabled(o);let p=t.isCellUnavailable(o),h=!a&&!p,m=t.isValueInvalid&&!!("highlightedRange"in t?!t.anchorDate&&t.highlightedRange&&o.compare(t.highlightedRange.start)>=0&&0>=o.compare(t.highlightedRange.end):t.value&&g3(t.value,o));m&&(d=!0),o=y6(o,g4);let y=(0,c1.useMemo)(()=>o.toDate(t.timeZone),[o,t.timeZone]),g=g3(o,g9(t.timeZone)),b=(0,c1.useMemo)(()=>{let e="";return"highlightedRange"in t&&t.value&&!t.anchorDate&&(g3(o,t.value.start)||g3(o,t.value.end))&&(e=l+", "),e+=c.format(y),g?e=u.format(d?"todayDateSelected":"todayDate",{date:e}):d&&(e=u.format("dateSelected",{date:e})),t.minValue&&g3(o,t.minValue)?e+=", "+u.format("minimumDate"):t.maxValue&&g3(o,t.maxValue)&&(e+=", "+u.format("maximumDate")),e},[c,y,u,d,g,o,t,l]),v="";"anchorDate"in t&&f&&!t.isReadOnly&&h&&(v=t.anchorDate?u.format("finishRangeSelectionPrompt"):u.format("startRangeSelectionPrompt"));let w=bk(v),x=(0,c1.useRef)(!1),E=(0,c1.useRef)(!1),S=(0,c1.useRef)(void 0),{pressProps:D,isPressed:O}=yv({shouldCancelOnPointerExit:"anchorDate"in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!h||t.isReadOnly,onPressStart(e){if(t.isReadOnly){t.setFocusedDate(o),t.setFocused(!0);return}if("highlightedRange"in t&&!t.anchorDate&&("mouse"===e.pointerType||"touch"===e.pointerType)){if(t.highlightedRange&&!m){if(g3(o,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(o),t.setFocused(!0),t.setDragging(!0),E.current=!0;return}else if(g3(o,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(o),t.setFocused(!0),t.setDragging(!0),E.current=!0;return}}let r=()=>{t.setDragging(!0),S.current=void 0,t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0),x.current=!0};"touch"===e.pointerType?S.current=setTimeout(r,200):r()}},onPressEnd(){E.current=!1,x.current=!1,clearTimeout(S.current),S.current=void 0},onPress(){"anchorDate"in t||t.isReadOnly||(t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0))},onPressUp(e){if(!t.isReadOnly&&("anchorDate"in t&&S.current&&(t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0)),"anchorDate"in t))if(E.current)t.setAnchorDate(o);else if(t.anchorDate&&!x.current)t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0);else if("keyboard"!==e.pointerType||t.anchorDate)"virtual"===e.pointerType&&(t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0));else{t.selectDate(o);let e=o.add({days:1});t.isInvalid(e)&&(e=o.subtract({days:1})),t.isInvalid(e)||(t.setFocusedDate(e),t.setFocused(!0))}}});a||(i=g3(o,t.focusedDate)?0:-1),(0,c1.useEffect)(()=>{f&&r.current&&(ml(r.current),"pointer"!==mB&&((e=document)=>e.activeElement)()===r.current&&bO(r.current,{containingElement:bE(r.current)}))},[f,r]);let P=gr({day:"numeric",timeZone:t.timeZone,calendar:o.calendar.identifier}),C=(0,c1.useMemo)(()=>P.formatToParts(y).find(e=>"day"===e.type).value,[P,y]);return{cellProps:{role:"gridcell","aria-disabled":!h||void 0,"aria-selected":d||void 0,"aria-invalid":m||void 0},buttonProps:hX(D,{onFocus(){a||(t.setFocusedDate(o),t.setFocused(!0))},tabIndex:i,role:"button","aria-disabled":!h||void 0,"aria-label":b,"aria-invalid":m||void 0,"aria-describedby":[m?s:void 0,w["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(e){"highlightDate"in t&&("touch"!==e.pointerType||t.isDragging)&&h&&t.highlightDate(o)},onPointerDown(e){let t=mp(e);t instanceof HTMLElement&&"releasePointerCapture"in t&&("hasPointerCapture"in t?t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId):t.releasePointerCapture(e.pointerId))},onContextMenu(e){e.preventDefault()}}),isPressed:O,isFocused:f,isSelected:d,isDisabled:a,isUnavailable:p,isOutsideVisibleRange:0>o.compare(t.visibleRange.start)||o.compare(t.visibleRange.end)>0,isInvalid:m,formattedDate:C}}({date:e},l,c),{hoverProps:h,isHovered:m}=yR({...t,isDisabled:p.isDisabled}),{focusProps:y,isFocusVisible:g}=yP();g&&(g=p.isFocused);let b=(i=u,o=g0(o=e,i.calendar),i=bn(i),o=bn(o),i.era!==o.era||i.year!==o.year||i.month!==o.month),v=!1,w=!1;"highlightedRange"in l&&l.highlightedRange&&(v=g3(e,l.highlightedRange.start),w=g3(e,l.highlightedRange.end));let x=h3({...t,defaultChildren:p.formattedDate,defaultClassName:"react-aria-CalendarCell",values:{date:e,isHovered:m,isOutsideMonth:b,isFocusVisible:g,isSelectionStart:v,isSelectionEnd:w,...p}}),E={"data-focused":p.isFocused||void 0,"data-hovered":m||void 0,"data-pressed":p.isPressed||void 0,"data-unavailable":p.isUnavailable||void 0,"data-disabled":p.isDisabled||void 0,"data-focus-visible":g||void 0,"data-outside-visible-range":p.isOutsideVisibleRange||void 0,"data-outside-month":b||void 0,"data-selected":p.isSelected||void 0,"data-selection-start":v||void 0,"data-selection-end":w||void 0,"data-invalid":p.isInvalid||void 0};return c3().createElement("td",{...d,ref:r},c3().createElement("div",{...hX(ms(t),f,y,h,E,x),ref:c}))}),vM=(0,c1.createContext)({}),vN=(0,c1.forwardRef)(function(e,t){var r,n;[e,t]=h2(e,t,vM);let{isDisabled:i,isInvalid:o,onHoverStart:a,onHoverChange:s,onHoverEnd:l,...u}=e,{hoverProps:c,isHovered:d}=yR({onHoverStart:a,onHoverChange:s,onHoverEnd:l,isDisabled:i}),{isFocused:f,isFocusVisible:p,focusProps:h}=yP({within:!0});null!=i||(i=!!e["aria-disabled"]&&"false"!==e["aria-disabled"]),null!=o||(o=!!e["aria-invalid"]&&"false"!==e["aria-invalid"]);let m=h3({...e,values:{isHovered:d,isFocusWithin:f,isFocusVisible:p,isDisabled:i,isInvalid:o},defaultClassName:"react-aria-Group"});return c3().createElement("div",{...hX(u,h,c),...m,ref:t,role:null!=(r=e.role)?r:"group",slot:null!=(n=e.slot)?n:void 0,"data-focus-within":f||void 0,"data-hovered":d||void 0,"data-focus-visible":p||void 0,"data-disabled":i||void 0,"data-invalid":o||void 0},m.children)}),vI=(0,c1.createContext)({}),v$=yM(function(e,t){[e,t]=h2(e,t,vI);let{hoverProps:r,isHovered:n}=yR(e),{isFocused:i,isFocusVisible:o,focusProps:a}=yP({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e["aria-invalid"]&&"false"!==e["aria-invalid"],l=h3({...e,values:{isHovered:n,isFocused:i,isFocusVisible:o,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:"react-aria-Input"});return c3().createElement("input",{...hX((e=>{let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,...i}=e;return i})(e),a,r),...l,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":n||void 0,"data-focus-visible":o||void 0,"data-invalid":s||void 0})});function vL(e,t,r,n){return e.createTreeWalker(t,r,n)}let vF=c3().createContext(null),vB="react-aria-focus-scope-restore",vV=null;function vU(e){var t,r,n,i,o,a,s,l,u,c;let d,f,p,h,{children:m,contain:y,restoreFocus:g,autoFocus:b}=e,v=(0,c1.useRef)(null),w=(0,c1.useRef)(null),x=(0,c1.useRef)([]),{parentNode:E}=(0,c1.useContext)(vF)||{},S=(0,c1.useMemo)(()=>new v4({scopeRef:x}),[x]);hL(()=>{let e=E||v2.root;if(v2.getTreeNode(e.scopeRef)&&vV&&!vq(vV,e.scopeRef)){let t=v2.getTreeNode(vV);t&&(e=t)}e.addChild(S),v2.addNode(S)},[S,E]),hL(()=>{let e=v2.getTreeNode(x);e&&(e.contain=!!y)},[y]),hL(()=>{let e=v.current?.nextSibling,t=[],r=e=>e.stopPropagation();for(;e&&e!==w.current;)t.push(e),e.addEventListener(vB,r),e=e.nextSibling;return x.current=t,()=>{for(let e of t)e.removeEventListener(vB,r)}},[m]),hL(()=>{if(r||n)return;let e=t.current,i=mc(e?e[0]:void 0),o=e=>{let r=mp(e);vH(r,t.current)?vV=t:vz(r)||(vV=null)};return i.addEventListener("focusin",o,!1),e?.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),e?.forEach(e=>e.removeEventListener("focusin",o,!1))}},[t=x,r=g,n=y]),i=x,o=y,d=(0,c1.useRef)(void 0),f=(0,c1.useRef)(void 0),hL(()=>{let e=i.current;if(!o){f.current&&(cancelAnimationFrame(f.current),f.current=void 0);return}let t=mc(e?e[0]:void 0),r=e=>{if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey||!vK(i)||e.isComposing)return;let r=((e=document)=>e.activeElement)(t),n=i.current;if(!n||!vH(r,n))return;let o=vX(vW(n),{tabbable:!0},n);if(!r)return;o.currentNode=r;let a=e.shiftKey?o.previousNode():o.nextNode();a||(o.currentNode=e.shiftKey?n[n.length-1].nextElementSibling:n[0].previousElementSibling,a=e.shiftKey?o.previousNode():o.nextNode()),e.preventDefault(),a&&(vG(a,!0),a instanceof md(a).HTMLInputElement&&a.select())},n=e=>{(!vV||vq(vV,i))&&vH(mp(e),i.current)?(vV=i,d.current=mp(e)):vK(i)&&!vz(mp(e),i)?d.current?d.current.focus():vV&&vV.current&&vY(vV.current):vK(i)&&(d.current=mp(e))},a=e=>{f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{let r=mB,n=("virtual"===r||null===r)&&mI()&&mN(),o=((e=document)=>e.activeElement)(t);if(!n&&o&&vK(i)&&!vz(o,i)){vV=i;let t=mp(e);t&&t.isConnected?(d.current=t,d.current?.focus()):vV.current&&vY(vV.current)}})};return t.addEventListener("keydown",r,!1),t.addEventListener("focusin",n,!1),e?.forEach(e=>e.addEventListener("focusin",n,!1)),e?.forEach(e=>e.addEventListener("focusout",a,!1)),()=>{t.removeEventListener("keydown",r,!1),t.removeEventListener("focusin",n,!1),e?.forEach(e=>e.removeEventListener("focusin",n,!1)),e?.forEach(e=>e.removeEventListener("focusout",a,!1))}},[i,o]),hL(()=>()=>{f.current&&cancelAnimationFrame(f.current)},[f]),a=x,s=g,l=y,p=(0,c1.useRef)("u">typeof document?((e=document)=>e.activeElement)(mc(a.current?a.current[0]:void 0)):null),hL(()=>{let e=a.current,t=mc(e?e[0]:void 0);if(!s||l)return;let r=()=>{(!vV||vq(vV,a))&&vH(((e=document)=>e.activeElement)(t),a.current)&&(vV=a)};return t.addEventListener("focusin",r,!1),e?.forEach(e=>e.addEventListener("focusin",r,!1)),()=>{t.removeEventListener("focusin",r,!1),e?.forEach(e=>e.removeEventListener("focusin",r,!1))}},[a,l]),hL(()=>{let e=mc(a.current?a.current[0]:void 0);if(!s)return;let t=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!vK(a)||t.isComposing)return;let r=e.activeElement;if(!vz(r,a)||!vJ(a))return;let n=v2.getTreeNode(a);if(!n)return;let i=n.nodeToRestore,o=vX(e.body,{tabbable:!0});o.currentNode=r;let s=t.shiftKey?o.previousNode():o.nextNode();if(i&&i.isConnected&&i!==e.body||(i=void 0,n.nodeToRestore=void 0),(!s||!vz(s,a))&&i){o.currentNode=i;do s=t.shiftKey?o.previousNode():o.nextNode();while(vz(s,a));(t.preventDefault(),t.stopPropagation(),s)?vG(s,!0):vz(i)?vG(i,!0):r.blur()}};return l||e.addEventListener("keydown",t,!0),()=>{l||e.removeEventListener("keydown",t,!0)}},[a,s,l]),hL(()=>{let e=mc(a.current?a.current[0]:void 0);if(!s)return;let t=v2.getTreeNode(a);if(t)return t.nodeToRestore=p.current??void 0,()=>{let t=v2.getTreeNode(a);if(!t)return;let r=t.nodeToRestore,n=((e=document)=>e.activeElement)(e);if(s&&r&&(n&&vz(n,a)||n===e.body&&vJ(a))){let t=v2.clone();requestAnimationFrame(()=>{if(e.activeElement===e.body){let e=t.getTreeNode(a);for(;e;){if(e.nodeToRestore&&e.nodeToRestore.isConnected)return void vQ(e.nodeToRestore);e=e.parent}for(e=t.getTreeNode(a);e;){if(e.scopeRef&&e.scopeRef.current&&v2.getTreeNode(e.scopeRef))return void vQ(vZ(e.scopeRef.current,!0));e=e.parent}}})}}},[a,s]),u=x,c=b,h=c3().useRef(c),(0,c1.useEffect)(()=>{h.current&&(vV=u,!vH(((e=document)=>e.activeElement)(mc(u.current?u.current[0]:void 0)),vV.current)&&u.current&&vY(u.current)),h.current=!1},[u]),(0,c1.useEffect)(()=>{let e=((e=document)=>e.activeElement)(mc(x.current?x.current[0]:void 0)),t=null;if(vH(e,x.current)){for(let r of v2.traverse())r.scopeRef&&vH(e,r.scopeRef.current)&&(t=r);t===v2.getTreeNode(x)&&(vV=t.scopeRef)}},[x]),hL(()=>()=>{let e=v2.getTreeNode(x)?.parent?.scopeRef??null;(x===vV||vq(x,vV))&&(!e||v2.getTreeNode(e))&&(vV=e),v2.removeTreeNode(x)},[x]);let D=(0,c1.useMemo)(()=>{var e;return e=x,{focusNext(t={}){let r=e.current,{from:n,tabbable:i,wrap:o,accept:a}=t,s=n||((e=document)=>e.activeElement)(mc(r[0]??void 0)),l=r[0].previousElementSibling,u=vX(vW(r),{tabbable:i,accept:a},r);u.currentNode=vH(s,r)?s:l;let c=u.nextNode();return!c&&o&&(u.currentNode=l,c=u.nextNode()),c&&vG(c,!0),c},focusPrevious(t={}){let r=e.current,{from:n,tabbable:i,wrap:o,accept:a}=t,s=n||((e=document)=>e.activeElement)(mc(r[0]??void 0)),l=r[r.length-1].nextElementSibling,u=vX(vW(r),{tabbable:i,accept:a},r);u.currentNode=vH(s,r)?s:l;let c=u.previousNode();return!c&&o&&(u.currentNode=l,c=u.previousNode()),c&&vG(c,!0),c},focusFirst(t={}){let r=e.current,{tabbable:n,accept:i}=t,o=vX(vW(r),{tabbable:n,accept:i},r);o.currentNode=r[0].previousElementSibling;let a=o.nextNode();return a&&vG(a,!0),a},focusLast(t={}){let r=e.current,{tabbable:n,accept:i}=t,o=vX(vW(r),{tabbable:n,accept:i},r);o.currentNode=r[r.length-1].nextElementSibling;let a=o.previousNode();return a&&vG(a,!0),a}}},[]),O=(0,c1.useMemo)(()=>({focusManager:D,parentNode:S}),[S,D]);return c3().createElement(vF.Provider,{value:O},c3().createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:v}),m,c3().createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:w}))}function vW(e){return e[0].parentElement}function vK(e){let t=v2.getTreeNode(vV);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function vH(e,t){return!!e&&!!t&&t.some(t=>mf(t,e))}function vz(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of v2.traverse(v2.getTreeNode(t)))if(r&&vH(e,r.current))return!0;return!1}function vq(e,t){let r=v2.getTreeNode(t)?.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function vG(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{m5(e)}catch{}}function vZ(e,t=!0){let r=e[0].previousElementSibling,n=vW(e),i=vX(n,{tabbable:t},e);i.currentNode=r;let o=i.nextNode();return t&&!o&&((i=vX(n=vW(e),{tabbable:!1},e)).currentNode=r,o=i.nextNode()),o}function vY(e,t=!0){vG(vZ(e,t))}function vJ(e){let t=v2.getTreeNode(vV);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function vQ(e){e.dispatchEvent(new CustomEvent(vB,{bubbles:!0,cancelable:!0}))&&vG(e)}function vX(e,t,r){let n=t?.tabbable?mw:m_,i=mc(e?.nodeType===Node.ELEMENT_NODE?e:null),o=vL(i,e||i,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>mf(t?.from,e)||t?.tabbable&&"INPUT"===e.tagName&&"radio"===e.getAttribute("type")&&(!function(e){if(e.checked)return!0;let t=function(e){if(!e.form)return Array.from(mc(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),r=md(e);return t instanceof r.RadioNodeList?Array.from(t).filter(e=>e instanceof r.HTMLInputElement):t instanceof r.HTMLInputElement?[t]:[]}(e);return t.length>0&&!t.some(e=>e.checked)}(e)||"INPUT"===o.currentNode.tagName&&"radio"===o.currentNode.type&&o.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:n(e)&&(!r||vH(e,r))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(o.currentNode=t.from),o}function v0(e,t={}){return{focusNext(r={}){let n=e.current;if(!n)return null;let{from:i,tabbable:o=t.tabbable,wrap:a=t.wrap,accept:s=t.accept}=r,l=i||((e=document)=>e.activeElement)(mc(n)),u=vX(n,{tabbable:o,accept:s});mf(n,l)&&(u.currentNode=l);let c=u.nextNode();return!c&&a&&(u.currentNode=n,c=u.nextNode()),c&&vG(c,!0),c},focusPrevious(r=t){let n=e.current;if(!n)return null;let{from:i,tabbable:o=t.tabbable,wrap:a=t.wrap,accept:s=t.accept}=r,l=i||((e=document)=>e.activeElement)(mc(n)),u=vX(n,{tabbable:o,accept:s});if(mf(n,l))u.currentNode=l;else{let e=v1(u);return e&&vG(e,!0),e??null}let c=u.previousNode();if(!c&&a){u.currentNode=n;let e=v1(u);if(!e)return null;c=e}return c&&vG(c,!0),c??null},focusFirst(r=t){let n=e.current;if(!n)return null;let{tabbable:i=t.tabbable,accept:o=t.accept}=r,a=vX(n,{tabbable:i,accept:o}).nextNode();return a&&vG(a,!0),a},focusLast(r=t){let n=e.current;if(!n)return null;let{tabbable:i=t.tabbable,accept:o=t.accept}=r,a=v1(vX(n,{tabbable:i,accept:o}));return a&&vG(a,!0),a??null}}}function v1(e){let t,r;do(t=e.lastChild())&&(r=t);while(t);return r}class v3{constructor(){this.fastMap=new Map,this.root=new v4({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,r){let n=this.fastMap.get(t??null);if(!n)return;let i=new v4({scopeRef:e});n.addChild(i),i.parent=n,this.fastMap.set(e,i),r&&(i.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let r=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&vH(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let n=t.children;r&&(r.removeChild(t),n.size>0&&n.forEach(e=>r&&r.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(){let e=new v3;for(let t of this.traverse())e.addTreeNode(t.scopeRef,t.parent?.scopeRef??null,t.nodeToRestore);return e}}class v4{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let v2=new v3;var v6={};function v5(e,t,r){let{direction:n}=y0(),i=(0,c1.useMemo)(()=>v0(t),[t]),o=()=>{if(!t.current)return;let e=window.event?mp(window.event):null,r=vX(t.current,{tabbable:!0});if(e&&(r.currentNode=e,e=r.previousNode()),!e){let t;do(t=r.lastChild())&&(e=t);while(t)}for(;e?.hasAttribute("data-placeholder");){let t=r.previousNode();if(t&&t.hasAttribute("data-placeholder"))e=t;else break}e&&e.focus()},{pressProps:a}=yv({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(e){"mouse"===e.pointerType&&o()},onPress(e){("touch"===e.pointerType||"pen"===e.pointerType)&&o()}});return hX(a,{onKeyDown:o=>{if(mf(o.currentTarget,mp(o))&&(o.altKey&&("ArrowDown"===o.key||"ArrowUp"===o.key)&&"setOpen"in e&&(o.preventDefault(),o.stopPropagation(),e.setOpen(!0)),!r))switch(o.key){case"ArrowLeft":if(o.preventDefault(),o.stopPropagation(),"rtl"===n){if(t.current){let e=mp(o),r=v8(t.current,e.getBoundingClientRect().left,-1);r&&r.focus()}}else i.focusPrevious();break;case"ArrowRight":if(o.preventDefault(),o.stopPropagation(),"rtl"===n){if(t.current){let e=mp(o),r=v8(t.current,e.getBoundingClientRect().left,1);r&&r.focus()}}else i.focusNext()}}})}function v8(e,t,r){let n=vX(e,{tabbable:!0}),i=n.nextNode(),o=null,a=1/0;for(;i;){let e=i.getBoundingClientRect().left-t,s=Math.abs(e);Math.sign(e)===r&&s<a&&(o=i,a=s),i=n.nextNode()}return o}function v9(e){let{description:t,errorMessage:r,isInvalid:n,validationState:i}=e,{labelProps:o,fieldProps:a}=function(e){let{id:t,label:r,"aria-labelledby":n,"aria-label":i,labelElementType:o="label"}=e;t=hY(t);let a=hY(),s={};return r&&(n=n?`${a} ${n}`:a,s={id:a,htmlFor:"label"===o?t:void 0}),{labelProps:s,fieldProps:by({id:t,"aria-label":i,"aria-labelledby":n})}}(e),s=hJ([!!t,!!r,n,i]),l=hJ([!!t,!!r,n,i]);return{labelProps:o,fieldProps:a=hX(a,{"aria-describedby":[s,l,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),descriptionProps:{id:s},errorMessageProps:{id:l}}}function v7(e,t,r){let n=yd(e=>{r&&!e.defaultPrevented&&r(t)});(0,c1.useEffect)(()=>{let t=e?.current?.form;return t?.addEventListener("reset",n),()=>{t?.removeEventListener("reset",n)}},[e])}function _e(e,t,r){let{validationBehavior:n,focus:i}=e;hL(()=>{if("native"===n&&r?.current&&!r.current.disabled){var e;let n,i=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";r.current.setCustomValidity(i),r.current.hasAttribute("title")||(r.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation({isInvalid:!(e=r.current).validity.valid,validationDetails:{badInput:(n=e.validity).badInput,customError:n.customError,patternMismatch:n.patternMismatch,rangeOverflow:n.rangeOverflow,rangeUnderflow:n.rangeUnderflow,stepMismatch:n.stepMismatch,tooLong:n.tooLong,tooShort:n.tooShort,typeMismatch:n.typeMismatch,valueMissing:n.valueMissing,valid:n.valid},validationErrors:e.validationMessage?[e.validationMessage]:[]})}});let o=(0,c1.useRef)(!1),a=yd(()=>{o.current||t.resetValidation()}),s=yd(e=>{t.displayValidation.isInvalid||t.commitValidation();let n=r?.current?.form;!e.defaultPrevented&&r&&n&&function(e){for(let t=0;t<e.elements.length;t++){let r=e.elements[t];if(r.validity?.valid===!1)return r}return null}(n)===r.current&&(i?i():r.current?.focus(),mB="keyboard",mz("keyboard",null));e.preventDefault()}),l=yd(()=>{t.commitValidation()});(0,c1.useEffect)(()=>{let e=r?.current;if(!e)return;let t=e.form,n=t?.reset;return t&&(t.reset=()=>{o.current=!window.event||"message"===window.event.type&&mp(window.event)instanceof MessagePort,n?.call(t),o.current=!1}),e.addEventListener("invalid",s),e.addEventListener("change",l),t?.addEventListener("reset",a),()=>{e.removeEventListener("invalid",s),e.removeEventListener("change",l),t?.removeEventListener("reset",a),t&&(t.reset=n)}},[r,n])}v6={"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:"Startdatum",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 _t=new WeakMap,_r="__reactAriaDateFieldRole",_n="__reactAriaDateFieldFocusManager";function _i(e,t,r){var n;let i,{isInvalid:o,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=v9({...e,labelElementType:"span",isInvalid:o,errorMessage:e.errorMessage||a}),f=(0,c1.useRef)(null),{focusWithinProps:p}=yO({...e,onFocusWithin(r){f.current=t.value,e.onFocus?.(r)},onBlurWithin:r=>{t.confirmPlaceholder(),t.value!==f.current&&t.commitValidation(),e.onBlur?.(r)},onFocusWithinChange:e.onFocusChange}),h=gf((n=v6)&&n.__esModule?n.default:n,"@react-aria/datepicker"),m="hour"===t.maxGranularity?"selectedTimeDescription":"selectedDateDescription",y="hour"===t.maxGranularity?"time":"date",g=bk(t.value?h.format(m,{[y]:t.formatValue({month:"long"})}):""),b="presentation"===e[_r]?u["aria-describedby"]:[g["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,v=e[_n],w=(0,c1.useMemo)(()=>v||v0(r),[v,r]),x=v5(t,r,"presentation"===e[_r]);_t.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:[l.id,e["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:b,focusManager:w});let E=(0,c1.useRef)(e.autoFocus);i="presentation"===e[_r]?{role:"presentation"}:hX(u,{role:"group","aria-disabled":e.isDisabled||void 0,"aria-describedby":b}),(0,c1.useEffect)(()=>{E.current&&w.focusFirst(),E.current=!1},[w]),v7(e.inputRef,t.defaultValue,t.setValue),_e({...e,focus(){w.focusFirst()}},t,e.inputRef);let S={type:"hidden",name:e.name,form:e.form,value:t.value?.toString()||"",disabled:e.isDisabled};"native"===e.validationBehavior&&(S.type="text",S.hidden=!0,S.required=e.isRequired,S.onChange=()=>{});let D=ms(e);return{labelProps:{...l,onClick:()=>{w.focusFirst()}},fieldProps:hX(D,i,x,p,{onKeyDown(t){e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){e.onKeyUp&&e.onKeyUp(t)},style:{unicodeBidi:"isolate"}}),inputProps:S,descriptionProps:c,errorMessageProps:d,isInvalid:o,validationErrors:a,validationDetails:s}}var _o={};_o={"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 Startdatum 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{D6C4}\u{C5EC}\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 _a={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},_s={..._a,customError:!0,valid:!1},_l={isInvalid:!1,validationDetails:_a,validationErrors:[]},_u=(0,c1.createContext)({}),_c="__reactAriaFormValidationState";function _d(e){if(e[_c]){let{realtimeValidation:t,displayValidation:r,updateValidation:n,resetValidation:i,commitValidation:o}=e[_c];return{realtimeValidation:t,displayValidation:r,updateValidation:n,resetValidation:i,commitValidation:o}}return function(e){let{isInvalid:t,validationState:r,name:n,value:i,builtinValidation:o,validate:a,validationBehavior:s="aria"}=e;r&&(t||="invalid"===r);let l=void 0!==t?{isInvalid:t,validationErrors:[],validationDetails:_s}:null,u=(0,c1.useMemo)(()=>a&&null!=i?_p(function(e,t){if("function"==typeof e){let r=e(t);if(r&&"boolean"!=typeof r)return _f(r)}return[]}(a,i)):null,[a,i]);o?.validationDetails.valid&&(o=void 0);let c=(0,c1.useContext)(_u),d=(0,c1.useMemo)(()=>n?Array.isArray(n)?n.flatMap(e=>_f(c[e])):_f(c[n]):[],[c,n]),[f,p]=(0,c1.useState)(c),[h,m]=(0,c1.useState)(!1);c!==f&&(p(c),m(!1));let y=(0,c1.useMemo)(()=>_p(h?[]:d),[h,d]),g=(0,c1.useRef)(_l),[b,v]=(0,c1.useState)(_l),w=(0,c1.useRef)(_l),[x,E]=(0,c1.useState)(!1);return(0,c1.useEffect)(()=>{if(!x)return;E(!1);let e=u||o||g.current;_h(e,w.current)||(w.current=e,v(e))}),{realtimeValidation:l||y||u||o||_l,displayValidation:"native"===s?l||y||b:l||y||u||o||b,updateValidation(e){"aria"!==s||_h(b,e)?g.current=e:v(e)},resetValidation(){_h(_l,w.current)||(w.current=_l,v(_l)),"native"===s&&E(!1),m(!0)},commitValidation(){"native"===s&&E(!0),m(!0)}}}(e)}function _f(e){return e?Array.isArray(e)?e:[e]:[]}function _p(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:_s}:null}function _h(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,r)=>e===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([e,r])=>t.validationDetails[e]===r)}function _m(...e){let t=new Set,r=!1,n={..._a};for(let i of e){for(let e of i.validationErrors)t.add(e);for(let e in r||=i.isInvalid,n)n[e]||=i.validationDetails[e]}return n.valid=!r,{isInvalid:r,validationErrors:[...t],validationDetails:n}}let _y=new ga((ei=_o)&&ei.__esModule?ei.default:ei);function _g(){let e="u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return e}function _b(e,t,r,n,i){let o=null!=e&&null!=r&&e.compare(r)>0,a=null!=e&&null!=t&&0>e.compare(t),s=null!=e&&n?.(e)||!1,l=o||a||s,u=[];if(l){let e=_g(),n=new gu(e,ga.getGlobalDictionaryForPackage("@react-stately/datepicker")||_y),l=new y8(e,_w({},i)),c=l.resolvedOptions().timeZone;a&&null!=t&&u.push(n.format("rangeUnderflow",{minValue:l.format(t.toDate(c))})),o&&null!=r&&u.push(n.format("rangeOverflow",{maxValue:l.format(r.toDate(c))})),s&&u.push(n.format("unavailableDate"))}return{isInvalid:l,validationErrors:u,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:o,rangeUnderflow:a,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!l}}}let _v={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},__={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function _w(e,t){e={...t.shouldForceLeadingZeros?__:_v,...e};let r=t.granularity||"minute",n=Object.keys(e),i=n.indexOf(t.maxGranularity??"year");i<0&&(i=0);let o=n.indexOf(r);if(o<0&&(o=2),i>o)throw Error("maxGranularity must be greater than granularity");let a=n.slice(i,o+1).reduce((t,r)=>(t[r]=e[r],t),{});return null!=t.hourCycle&&(a.hour12=12===t.hourCycle),a.timeZone=t.timeZone||"UTC",("hour"===r||"minute"===r||"second"===r)&&t.timeZone&&!t.hideTimeZone&&(a.timeZoneName="short"),t.showEra&&0===i&&(a.era="short"),a}function _x(e){return e&&"hour"in e?e:new gV}function _E(e,t){return null===e?null:e?g0(e,t):void 0}function _S(e,t){let r=e&&"timeZone"in e?e.timeZone:void 0,n=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw Error("Invalid granularity "+t+" for value "+e.toString());let[i,o]=(0,c1.useState)([n,r]);return e&&(i[0]!==n||i[1]!==r)&&o([n,r]),t||(t=e?n:i[0]),[t,e?r:i[1]]}let _D=new ga({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"},is:{year:"\xe1\xe1\xe1\xe1",month:"mm",day:"dd"},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"},nb:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},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");class _O{constructor(e,t,r){if(this.era=r?.era??null,this.calendar=e,this.year=r?.year??null,this.month=r?.month??null,this.day=r?.day??null,this.hour=r?.hour??null,this.hourCycle=t,this.dayPeriod=null,this.minute=r?.minute??null,this.second=r?.second??null,this.millisecond=r?.millisecond??null,this.offset="offset"in(r??{})?r.offset:null,null!=this.hour){let[e,r]=_C(this.hour,t);this.dayPeriod=e,this.hour=r}}copy(){let e=new _O(this.calendar,this.hourCycle);return e.era=this.era,e.year=this.year,e.month=this.month,e.day=this.day,e.hour=this.hour,e.dayPeriod=this.dayPeriod,e.minute=this.minute,e.second=this.second,e.millisecond=this.millisecond,e.offset=this.offset,e}isComplete(e){return e.every(e=>null!=this[e])}validate(e,t){return t.every(t=>{if(("hour"===t||"dayPeriod"===t)&&"hour"in e){let[t,r]=_C(e.hour,this.hourCycle);return this.dayPeriod===t&&this.hour===r}return this[t]===e[t]})}isCleared(e){return e.every(e=>null===this[e])}set(e,t,r){let n=this.copy();return n[e]=t,"hour"===e&&null==n.dayPeriod&&"hour"in r&&(n.dayPeriod=_C(r.hour,this.hourCycle)[0]),"year"===e&&null==n.era&&(n.era=r.era),"second"!==e&&"literal"!==e&&"timeZoneName"!==e&&(n.offset=null),n}clear(e){let t=this.copy();return t[e]=null,"year"===e&&(t.era=null),t.offset=null,t}cycle(e,t,r,n){let i=this.copy();if(null==i[e]&&"dayPeriod"!==e&&"era"!==e){if("hour"===e&&"hour"in r){let[e,t]=_C(r.hour,this.hourCycle);i.dayPeriod=e,i.hour=t}else i[e]=r[e];return"year"===e&&null==i.era&&(i.era=r.era),i}switch(e){case"era":{let e=this.calendar.getEras(),r=e.indexOf(i.era);r=_P(r,t,0,e.length-1),i.era=e[r];break}case"year":{let n=new gB(this.calendar,this.era??r.era,this.year??r.year,this.month??1,this.day??1);i.era=(n=n.cycle(e,t,{round:"year"===e})).era,i.year=n.year;break}case"month":i.month=_P(i.month??1,t,1,this.calendar.getMaximumMonthsInYear());break;case"day":i.day=_P(i.day??1,t,1,this.calendar.getMaximumDaysInMonth());break;case"hour":{let e=n.some(e=>["year","month","day"].includes(e));if("timeZone"in r&&(!e||null!=i.year&&null!=i.month&&null!=i.day)){let e=this.toValue(r),[n,o]=_C((e=e.cycle("hour",t,{hourCycle:"h12"===this.hourCycle?12:24,round:!1})).hour,this.hourCycle);i.hour=o,i.dayPeriod=n,i.offset=e.offset}else{let e=i.hour??0,n=this.getSegmentLimits("hour");i.hour=_P(e,t,n.minValue,n.maxValue),null==i.dayPeriod&&"hour"in r&&(i.dayPeriod=_C(r.hour,this.hourCycle)[0])}break}case"dayPeriod":i.dayPeriod=_P(i.dayPeriod??0,t,0,1);break;case"minute":i.minute=_P(i.minute??0,t,0,59,!0);break;case"second":i.second=_P(i.second??0,t,0,59,!0)}return i}toValue(e){if(!("hour"in e))return e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day});{let t=this.hour;null!=t?t=function(e,t,r){switch(r){case"h11":1===t&&(e+=12);break;case"h12":12===e&&(e=0),1===t&&(e+=12);break;case"h24":e-=1}return e}(t,this.dayPeriod??0,this.hourCycle):("h12"===this.hourCycle||"h11"===this.hourCycle)&&(t=12*(1===this.dayPeriod));let r=e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day,hour:t??e.hour,minute:this.minute??e.minute,second:this.second??e.second,millisecond:this.millisecond??e.millisecond});return"offset"in r&&null!=this.offset&&r.offset!==this.offset&&(r=r.add({milliseconds:r.offset-this.offset})),r}}getSegmentLimits(e){switch(e){case"era":{let e=this.calendar.getEras();return{value:null!=this.era?e.indexOf(this.era):e.length-1,minValue:0,maxValue:e.length-1}}case"year":return{value:this.year,minValue:1,maxValue:9999};case"month":return{value:this.month,minValue:1,maxValue:this.calendar.getMaximumMonthsInYear()};case"day":return{value:this.day,minValue:1,maxValue:this.calendar.getMaximumDaysInMonth()};case"dayPeriod":return{value:this.dayPeriod,minValue:0,maxValue:1};case"hour":{let e=0,t=23;return"h12"===this.hourCycle?(e=1,t=12):"h11"===this.hourCycle&&(e=0,t=11),{value:this.hour,minValue:e,maxValue:t}}case"minute":return{value:this.minute,minValue:0,maxValue:59};case"second":return{value:this.second,minValue:0,maxValue:59}}}}function _P(e,t,r,n,i=!1){if(i){(e+=Math.sign(t))<r&&(e=n);let i=Math.abs(t);(e=t>0?Math.ceil(e/i)*i:Math.floor(e/i)*i)>n&&(e=r)}else(e+=t)<r?e=n-(r-e-1):e>n&&(e=r+(e-n-1));return e}function _C(e,t){let r=+(e>=12);switch(t){case"h11":e>=12&&(e-=12);break;case"h12":0===e?e=12:e>12&&(e-=12);break;case"h23":r=null;break;case"h24":e+=1,r=null}return[r,e]}var _k=r(59381);let _T={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},_j={year:5,month:2,day:7,hour:2,minute:15,second:15},_R={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function _A(e){let{locale:t,createCalendar:r,hideTimeZone:n,isDisabled:i=!1,isReadOnly:o=!1,isRequired:a=!1,minValue:s,maxValue:l,isDateUnavailable:u}=e,c=e.value||e.defaultValue||e.placeholderValue||null,[d,f]=_S(c,e.granularity),p=f||"UTC";if(c&&!(d in c))throw Error("Invalid granularity "+d+" for value "+c.toString());let[h,m]=(0,c1.useMemo)(()=>{let n=new y8(t,{dateStyle:"short",timeStyle:"short",hour12:null!=e.hourCycle?12===e.hourCycle:void 0}).resolvedOptions();return[r(n.calendar),n.hourCycle]},[t,e.hourCycle,r]),[y,g]=vy(e.value,e.defaultValue??null,e.onChange),[b]=(0,c1.useState)(y),v=(0,c1.useMemo)(()=>_E(y,h)??null,[y,h]),[w,x]=(0,c1.useState)(()=>new _O(h,m,v)),E="gregory"===h.identifier&&"BC"===w.era,S=(0,c1.useMemo)(()=>({granularity:d,maxGranularity:e.maxGranularity??"year",timeZone:f,hideTimeZone:n,hourCycle:e.hourCycle,showEra:E,shouldForceLeadingZeros:e.shouldForceLeadingZeros}),[e.maxGranularity,d,e.hourCycle,e.shouldForceLeadingZeros,f,n,E]),D=(0,c1.useMemo)(()=>_w({},S),[S]),O=(0,c1.useMemo)(()=>new y8(t,D),[t,D]),P=(0,c1.useMemo)(()=>O.resolvedOptions(),[O]),C=(0,c1.useMemo)(()=>(function(e,t,r,n){if(e)return _E(e,r);let i=g0(g8(n??br()).set({hour:0,minute:0,second:0,millisecond:0}),r);return"year"===t||"month"===t||"day"===t?gQ(i):n?i:gX(i)})(e.placeholderValue,d,h,f),[e.placeholderValue,d,h,f]),k=(0,c1.useMemo)(()=>{let t="h11"===m||"h12"===m,r=["era","year","month","day","hour",...t?["dayPeriod"]:[],"minute","second"],n=r.indexOf(e.maxGranularity||"era"),i=r.indexOf("hour"===d&&t?"dayPeriod":d);return r.slice(n,i+1)},[e.maxGranularity,d,m]),[T,j]=(0,c1.useState)(v),[R,A]=(0,c1.useState)(h),[M,N]=(0,c1.useState)(m);v===T&&m===M&&g2(h,R)||(w=new _O(h,m,v),j(v),A(h),N(m),x(w));let I=t=>{if(!e.isDisabled&&!e.isReadOnly)if(null==t||t instanceof _O&&t.isCleared(k))x(new _O(h,m,v)),g(null);else if(t instanceof _O){if(t.isComplete(k)){let e=t.toValue(v??C);if(t.validate(e,k)){let t=g0(e,c?.calendar||new gv);if(!y||0!==t.compare(y)){x(new _O(h,m,v)),g(t);return}}}x(t)}else t=g0(t,c?.calendar||new gv),x(new _O(h,m,v)),g(t)},$=(0,c1.useMemo)(()=>w.toValue(v??C).toDate(p),[w,p,v,C]),L=(0,c1.useMemo)(()=>(function(e,t,r,n,i,o,a){let s=["hour","minute","second"],l=r.formatToParts(e),u=new(0,_k.K)(o,{useGrouping:!1}),c=new(0,_k.K)(o,{useGrouping:!1,minimumIntegerDigits:2});for(let e of l)if("year"===e.type||"month"===e.type||"day"===e.type||"hour"===e.type){let r=t[e.type]??0;"2-digit"===n[e.type]?e.value=c.format(r):e.value=u.format(r)}let d=[];for(let e of l){var f;let r=_R[e.type]||e.type,n=_T[r];"era"===r&&1===i.getEras().length&&(n=!1);let l=_T[r]&&null==t[e.type],u=_T[r]?(f=e.value,"era"===r||"dayPeriod"===r?f:"year"===r||"month"===r||"day"===r?_D.getStringForLocale(r,o):"––"):null,c={type:r,text:l?u:e.value,...t.getSegmentLimits(r),isPlaceholder:l,placeholder:u,isEditable:n};"hour"===r?(d.push({type:"literal",text:"⁦",isPlaceholder:!1,placeholder:"",isEditable:!1}),d.push(c),r===a&&d.push({type:"literal",text:"⁩",isPlaceholder:!1,placeholder:"",isEditable:!1})):s.includes(r)&&r===a?(d.push(c),d.push({type:"literal",text:"⁩",isPlaceholder:!1,placeholder:"",isEditable:!1})):d.push(c)}return d})($,w,O,P,h,t,d),[$,O,P,w,h,t,d]),F=(e,t)=>{I(w.cycle(e,t,C,k))},B=(0,c1.useMemo)(()=>_b(y,s,l,u,S),[y,s,l,u,S]),V=_d({...e,value:y,builtinValidation:B}),U=V.displayValidation.isInvalid,W=e.validationState||(U?"invalid":null);return{...V,value:v,defaultValue:e.defaultValue??b,dateValue:$,calendar:h,setValue:I,segments:L,dateFormatter:O,validationState:W,isInvalid:U,granularity:d,maxGranularity:e.maxGranularity??"year",isDisabled:i,isReadOnly:o,isRequired:a,increment(e){F(e,1)},decrement(e){F(e,-1)},incrementPage(e){F(e,_j[e]||1)},decrementPage(e){F(e,-(_j[e]||1))},incrementToMax(e){let t="hour"===e&&"h12"===m?11:w.getSegmentLimits(e).maxValue;I(w.set(e,t,C))},decrementToMin(e){let t="hour"===e&&"h12"===m?12:w.getSegmentLimits(e).minValue;I(w.set(e,t,C))},setSegment(e,t){I(w.set(e,t,C))},confirmPlaceholder(){if(!e.isDisabled&&!e.isReadOnly&&w.isComplete(k)){let e=g0(w.toValue(v??C),c?.calendar||new gv);y&&0===e.compare(y)||g(e),x(new _O(h,m,v))}},clearSegment(e){let t=w;"timeZoneName"!==e&&"literal"!==e&&(t=w.clear(e)),I(t)},formatValue:e=>v?new y8(t,_w(e,S)).format($):"",getDateFormatter:(e,t)=>new y8(e,_w({},{...S,...t}))}}let _M=(0,c1.createContext)(null),_N=(0,c1.createContext)(null),_I=(0,c1.createContext)(null),_$=(0,c1.forwardRef)(function(e,t){let r=(0,c1.useContext)(_N),n=(0,c1.useContext)(_I);return r||n?c3().createElement(_F,{...e,ref:t}):c3().createElement(_L,{...e,ref:t})}),_L=(0,c1.forwardRef)((e,t)=>{let[r,n]=h2({slot:e.slot},t,_M),{locale:i}=y0(),o=_A({...r,locale:i,createCalendar:vs}),a=(0,c1.useRef)(null),{fieldProps:s,inputProps:l}=_i({...r,inputRef:a},o,n);return c3().createElement(h1,{values:[[_N,o],[vI,{...l,ref:a}],[vM,{...s,ref:n,isInvalid:o.isInvalid}]]},c3().createElement(_F,e))}),_F=(0,c1.forwardRef)((e,t)=>{let{className:r,children:n}=e,i=(0,c1.useContext)(_N),o=(0,c1.useContext)(_I),a=null!=i?i:o;return c3().createElement(c3().Fragment,null,c3().createElement(vN,{...e,ref:t,slot:e.slot||void 0,className:null!=r?r:"react-aria-DateInput",isInvalid:a.isInvalid},a.segments.map((e,t)=>(0,c1.cloneElement)(n(e),{key:t}))),c3().createElement(v$,null))});function _B({children:e}){let t=(0,c1.useMemo)(()=>({register:()=>{}}),[]);return c3().createElement(yu.Provider,{value:t},e)}c3().forwardRef(({children:e,...t},r)=>{let n=(0,c1.useRef)(!1),i=(0,c1.useContext)(yu),o=hX(i||{},{...t,register(){n.current=!0,i&&i.register()}});return o.ref=hM(r||i?.ref),m7(i,o.ref),(0,c1.useEffect)(()=>{n.current||(n.current=!0)},[]),c3().createElement(yu.Provider,{value:o},e)});let _V=(0,c1.createContext)({}),_U=c3().createContext(null);function _W(e){let t=hq(),{portalContainer:r=t?null:document.body,isExiting:n}=e,[i,o]=(0,c1.useState)(!1),a=(0,c1.useMemo)(()=>({contain:i,setContain:o}),[i,o]),{getContainer:s}=(0,c1.useContext)(_V)??{};if(!e.portalContainer&&s&&(r=s()),!r)return null;let l=e.children;return e.disableFocusManagement||(l=c3().createElement(vU,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!n},l)),l=c3().createElement(_U.Provider,{value:a},c3().createElement(_B,null,l)),yh().createPortal(l,r)}let _K=(0,c1.createContext)(null),_H=(0,c1.createContext)(null),_z=(0,c1.forwardRef)(function(e,t){let r=e["aria-labelledby"];[e,t]=h2(e,t,_K);let{dialogProps:n,titleProps:i}=function(e,t){let r,n,{role:i="dialog"}=e,o=hJ();o=e["aria-label"]?void 0:o;let a=(0,c1.useRef)(!1);return(0,c1.useEffect)(()=>{if(t.current&&!mh(t.current)){m5(t.current);let e=setTimeout(()=>{(((e=document)=>e.activeElement)()===t.current||((e=document)=>e.activeElement)()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),m5(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),r=(0,c1.useContext)(_U),hL(()=>{n?.(!0)},[n=r?.setContain]),(0,c1.useRef)(!1),(0,c1.useEffect)(()=>{}),{dialogProps:{...ms(e,{labelable:!0}),role:i,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||o,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:o}}}({...e,"aria-labelledby":r},t),o=(0,c1.useContext)(_H);n["aria-label"]||n["aria-labelledby"]||(e["aria-labelledby"]?n["aria-labelledby"]=e["aria-labelledby"]:console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'));let a=h3({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(null==o?void 0:o.close)||(()=>{})}});return c3().createElement("section",{...ms(e),...n,...a,ref:t,slot:e.slot||void 0},c3().createElement(h1,{values:[[yL,{slots:{[h0]:{},title:{...i,level:2}}}],[yI,{slots:{[h0]:{},close:{onPress:()=>null==o?void 0:o.close()}}}]]},a.children))}),_q=(0,c1.createContext)(null),_G=(0,c1.forwardRef)(function(e,t){let r=(0,c1.useContext)(_q);return(null==r?void 0:r.isInvalid)?c3().createElement(_Z,{...e,ref:t}):null}),_Z=(0,c1.forwardRef)((e,t)=>{let r=(0,c1.useContext)(_q),n=ms(e),i=h3({...e,defaultClassName:"react-aria-FieldError",defaultChildren:0===r.validationErrors.length?void 0:r.validationErrors.join(" "),values:r});return null==i.children?null:c3().createElement(yB,{slot:"errorMessage",...n,...i,ref:t})}),_Y=(0,c1.createContext)(null),_J=(0,c1.createContext)({}),_Q=yM(function(e,t){[e,t]=h2(e,t,_J);let{elementType:r="label",...n}=e;return c3().createElement(r,{className:"react-aria-Label",...n,ref:t})}),_X=(0,c1.createContext)({placement:"bottom"}),_0="u">typeof HTMLElement&&"inert"in HTMLElement.prototype,_1=new WeakMap,_3=[];function _4(e,t=-1/0,r=1/0){return Math.min(Math.max(e,t),r)}function _2(e,t){let r=e,n=0,i=t.toString(),o=i.toLowerCase().indexOf("e-");if(o>0)n=Math.abs(Math.floor(Math.log10(Math.abs(t))))+o;else{let e=i.indexOf(".");e>=0&&(n=i.length-e)}if(n>0){let e=Math.pow(10,n);r=Math.round(r*e)/e}return r}function _6(e,t,r,n){t=Number(t),r=Number(r);let i=(e-(isNaN(t)?0:t))%n,o=_2(2*Math.abs(i)>=n?e+Math.sign(i)*(n-Math.abs(i)):e-i,n);return isNaN(t)?!isNaN(r)&&o>r&&(o=Math.floor(_2(r/n,n))*n):o<t?o=t:!isNaN(r)&&o>r&&(o=t+Math.floor(_2((r-t)/n,n))*n),o=_2(o,n)}let _5={top:"top",bottom:"top",left:"left",right:"left"},_8={top:"bottom",bottom:"top",left:"right",right:"left"},_9={top:"left",left:"top"},_7={top:"height",left:"width"},we={width:"totalWidth",height:"totalHeight"},wt={};function wr(e,t){let r=0,n=0,i=0,o=0,a=0,s=0,l={},u=(t?.scale??1)>1;if("BODY"===e.tagName||"HTML"===e.tagName){let u=document.documentElement;i=u.clientWidth,o=u.clientHeight,r=t?.width??i,n=t?.height??o,l.top=u.scrollTop||e.scrollTop,l.left=u.scrollLeft||e.scrollLeft,t&&(a=t.offsetTop,s=t.offsetLeft)}else({width:r,height:n,top:a,left:s}=wl(e,!1)),l.top=e.scrollTop,l.left=e.scrollLeft,i=r,o=n;return mM()&&("BODY"===e.tagName||"HTML"===e.tagName)&&u&&(l.top=0,l.left=0,a=t?.pageTop??0,s=t?.pageLeft??0),{width:r,height:n,totalWidth:i,totalHeight:o,scroll:l,top:a,left:s}}function wn(e,t,r,n,i,o,a){let s=i.scroll[e]??0,l=n[_7[e]],u=a[e]+n.scroll[_5[e]]+o,c=a[e]+n.scroll[_5[e]]+l-o,d=t-s+n.scroll[_5[e]]+a[e]-n[_5[e]],f=t-s+r+n.scroll[_5[e]]+a[e]-n[_5[e]];return d<u?u-d:f>c?Math.max(c-f,u-d):0}function wi(e){if(wt[e])return wt[e];let[t,r]=e.split(" "),n=_5[t]||"right",i=_9[n];_5[r]||(r="center");let o=_7[n],a=_7[i];return wt[e]={placement:t,crossPlacement:r,axis:n,crossAxis:i,size:o,crossSize:a},wt[e]}function wo(e,t,r,n,i,o,a,s,l,u,c){let{placement:d,crossPlacement:f,axis:p,crossAxis:h,size:m,crossSize:y}=n,g={};g[h]=e[h]??0,"center"===f?g[h]+=((e[y]??0)-(r[y]??0))/2:f!==h&&(g[h]+=(e[y]??0)-(r[y]??0)),g[h]+=o;let b=e[h]-r[y]+l+u,v=e[h]+e[y]-l-u;if(g[h]=_4(g[h],b,v),d===p){let t=s?c[m]:c[we[m]];g[_8[p]]=Math.floor(t-e[p]+i)}else g[p]=Math.floor(e[p]+e[m]+i);return g}function wa(e,t,r,n,i,o,a,s){let{placement:l,axis:u,size:c}=o;return l===u?Math.max(0,r[u]-(a.scroll[u]??0)-(e[u]+(s?t[u]:0))-(n[u]??0)-n[_8[u]]-i):Math.max(0,e[c]+e[u]+(s?t[u]:0)-r[u]-r[c]+(a.scroll[u]??0)-(n[u]??0)-n[_8[u]]-i)}function ws(e,t){let{top:r,left:n,width:i,height:o}=e.getBoundingClientRect();return t&&e instanceof e.ownerDocument.defaultView.HTMLElement&&(i=e.offsetWidth,o=e.offsetHeight),{top:r,left:n,width:i,height:o}}function wl(e,t){let{top:r,left:n,width:i,height:o}=ws(e,t),{scrollTop:a,scrollLeft:s,clientTop:l,clientLeft:u}=document.documentElement;return{top:r+a-l,left:n+s-u,width:i,height:o}}function wu(e,t,r){let n,i=window.getComputedStyle(e);if("fixed"===i.position)n=ws(e,r);else{n=wl(e,r);let i=wl(t,r),o=window.getComputedStyle(t);i.top+=(parseInt(o.borderTopWidth,10)||0)-t.scrollTop,i.left+=(parseInt(o.borderLeftWidth,10)||0)-t.scrollLeft,n.top-=i.top,n.left-=i.left}return n.top-=parseInt(i.marginTop,10)||0,n.left-=parseInt(i.marginLeft,10)||0,n}function wc(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 wd=new WeakMap;function wf(e){let{ref:t,box:r,onResize:n}=e,i=yd(n);(0,c1.useEffect)(()=>{let e=t?.current;if(e)if(void 0===window.ResizeObserver)return window.addEventListener("resize",i,!1),()=>{window.removeEventListener("resize",i,!1)};else{let t=new window.ResizeObserver(e=>{e.length&&i()});return t.observe(e,{box:r}),()=>{e&&t.unobserve(e)}}},[t,r])}let wp="u">typeof document?window.visualViewport:null;function wh(e,t){if(e.button>0)return!1;let r=mp(e);if(r){let e=r.ownerDocument;if(!e||!mf(e.documentElement,r)||r.closest("[data-react-aria-top-layer]"))return!1}return!!t.current&&!e.composedPath().includes(t.current)}let wm=[],wy=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function wg(e){return e instanceof HTMLInputElement&&!wy.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let wb="u">typeof document&&window.visualViewport,wv=0;function w_(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function ww(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function wx(e,t){t||!wb?wE(e):wb.addEventListener("resize",()=>wE(e),{once:!0})}function wE(e){let t=document.scrollingElement||document.documentElement,r=e;for(;r&&r!==t;){let e=bE(r);if(e!==document.documentElement&&e!==document.body&&e!==r){let t=e.getBoundingClientRect(),n=r.getBoundingClientRect();if(n.top<t.top||n.bottom>t.top+r.clientHeight){let r=t.bottom;wb&&(r=Math.min(r,wb.offsetTop+wb.height));let i=n.top-t.top-((r-t.top)/2-n.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+i)),behavior:"smooth"})}}r=e.parentElement}}var wS={};function wD(e){var t;let{onDismiss:r,...n}=e,i=by(n,gf((t=wS)&&t.__esModule?t.default:t,"@react-aria/overlays").format("dismiss"));return c3().createElement(b_,null,c3().createElement("button",{...i,tabIndex:-1,onClick:()=>{r&&r()},style:{width:1,height:1}}))}function wO(e,t,r){hL(()=>{if(t&&e.current){if(!("getAnimations"in e.current))return void r();let t=e.current.getAnimations();if(0===t.length)return void r();let n=!1;return Promise.allSettled(t.map(e=>e.finished)).then(()=>{n||(0,yp.flushSync)(()=>{r()})}),()=>{n=!0}}},[e,t,r])}wS={"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 wP=null,wC=new Set,wk=new Map,wT=!1,wj=!1;function wR(e,t){for(let r of wC)r(e,t)}function wA(e){wT=!0,e.metaKey||!mT()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(wP="keyboard",wR("keyboard",e))}function wM(e){wP="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(wT=!0,wR("pointer",e))}function wN(e){mL(e)&&(wT=!0,wP="virtual")}function wI(e){e.target!==window&&e.target!==document&&e.isTrusted&&(wT||wj||(wP="virtual",wR("virtual",e)),wT=!1,wj=!1)}function w$(){wT=!1,wj=!0}function wL(e){if("u"<typeof window||wk.get(md(e)))return;let t=md(e),r=mc(e),n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){wT=!0,n.apply(this,arguments)},r.addEventListener("keydown",wA,!0),r.addEventListener("keyup",wA,!0),r.addEventListener("click",wN,!0),t.addEventListener("focus",wI,!0),t.addEventListener("blur",w$,!1),"u">typeof PointerEvent?(r.addEventListener("pointerdown",wM,!0),r.addEventListener("pointermove",wM,!0),r.addEventListener("pointerup",wM,!0)):(r.addEventListener("mousedown",wM,!0),r.addEventListener("mousemove",wM,!0),r.addEventListener("mouseup",wM,!0)),t.addEventListener("beforeunload",()=>{wF(e)},{once:!0}),wk.set(t,{focus:n})}let wF=(e,t)=>{let r=md(e),n=mc(e);t&&n.removeEventListener("DOMContentLoaded",t),wk.has(r)&&(r.HTMLElement.prototype.focus=wk.get(r).focus,n.removeEventListener("keydown",wA,!0),n.removeEventListener("keyup",wA,!0),n.removeEventListener("click",wN,!0),r.removeEventListener("focus",wI,!0),r.removeEventListener("blur",w$,!1),"u">typeof PointerEvent?(n.removeEventListener("pointerdown",wM,!0),n.removeEventListener("pointermove",wM,!0),n.removeEventListener("pointerup",wM,!0)):(n.removeEventListener("mousedown",wM,!0),n.removeEventListener("mousemove",wM,!0),n.removeEventListener("mouseup",wM,!0)),wk.delete(r))};function wB(e){let[t,r]=vy(e.isOpen,e.defaultOpen||!1,e.onOpenChange),n=(0,c1.useCallback)(()=>{r(!0)},[r]),i=(0,c1.useCallback)(()=>{r(!1)},[r]),o=(0,c1.useCallback)(()=>{r(!t)},[r,t]);return{isOpen:t,setOpen:r,open:n,close:i,toggle:o}}"u">typeof document&&("loading"!==(m=mc(void 0)).readyState?wL(void 0):m.addEventListener("DOMContentLoaded",()=>{wL(void 0)}));let wV=(0,c1.createContext)(null),wU=(0,c1.createContext)(null),wW=(0,c1.forwardRef)(function(e,t){[e,t]=h2(e,t,wV);let r=(0,c1.useContext)(_H),n=wB(e),i=null==e.isOpen&&null==e.defaultOpen&&r?r:n,o=function(e,t){let[r,n]=(0,c1.useState)(t?"open":"closed");switch(r){case"open":t||n("exiting");break;case"closed":case"exiting":t&&n("open")}let i="exiting"===r;return wO(e,i,(0,c1.useCallback)(()=>{n(e=>"exiting"===e?"closed":e)},[])),i}(t,i.isOpen)||e.isExiting||!1,a=(0,c1.useContext)(yA),{direction:s}=y0();if(a){let t=e.children;return"function"==typeof t&&(t=t({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),c3().createElement(c3().Fragment,null,t)}return!i||i.isOpen||o?c3().createElement(wK,{...e,triggerRef:e.triggerRef,state:i,popoverRef:t,isExiting:o,dir:s}):null});function wK({state:e,isExiting:t,UNSTABLE_portalContainer:r,...n}){var i,o;let a=(0,c1.useRef)(null),[s,l]=(0,c1.useState)(0),u=(0,c1.useRef)(null),c=(0,c1.useContext)(wU),f=c&&"SubmenuTrigger"===n.trigger;hL(()=>{a.current&&e.isOpen&&l(a.current.getBoundingClientRect().width)},[e.isOpen,a]);let{popoverProps:p,underlayProps:h,arrowProps:m,placement:y}=function(e,t){let{triggerRef:r,popoverRef:n,groupRef:i,isNonModal:o,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:s,...l}=e,u="SubmenuTrigger"===l.trigger,{overlayProps:c,underlayProps:f}=function(e,t){let{onClose:r,shouldCloseOnBlur:n,isOpen:i,isDismissable:o=!1,isKeyboardDismissDisabled:a=!1,shouldCloseOnInteractOutside:s}=e,l=(0,c1.useRef)(void 0);(0,c1.useEffect)(()=>{if(i&&!wm.includes(t))return wm.push(t),()=>{let e=wm.indexOf(t);e>=0&&wm.splice(e,1)}},[i,t]);let u=()=>{wm[wm.length-1]===t&&r&&r()};!function(e){let{ref:t,onInteractOutside:r,isDisabled:n,onInteractOutsideStart:i}=e,o=(0,c1.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=yd(e=>{r&&wh(e,t)&&(i&&i(e),o.current.isPointerDown=!0)}),s=yd(e=>{r&&r(e)});(0,c1.useEffect)(()=>{let e=o.current;if(n)return;let r=mc(t.current);if("u">typeof PointerEvent){let n=r=>{e.isPointerDown&&wh(r,t)&&s(r),e.isPointerDown=!1};return r.addEventListener("pointerdown",a,!0),r.addEventListener("click",n,!0),()=>{r.removeEventListener("pointerdown",a,!0),r.removeEventListener("click",n,!0)}}},[t,n])}({ref:t,onInteractOutside:o&&i?e=>{(!s||s(mp(e)))&&(wm[wm.length-1]===t&&e.stopPropagation(),l.current===t&&u()),l.current=void 0}:void 0,onInteractOutsideStart:e=>{let r=wm[wm.length-1];l.current=r,(!s||s(mp(e)))&&r===t&&e.stopPropagation()}});let{focusWithinProps:c}=yO({isDisabled:!n,onBlurWithin:e=>{!(!e.relatedTarget||vz(e.relatedTarget,vV))&&(!s||s(e.relatedTarget))&&r?.()}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||a||e.nativeEvent.isComposing||(e.stopPropagation(),e.preventDefault(),u())},...c},underlayProps:{}}}({isOpen:t.isOpen,onClose:t.close,shouldCloseOnBlur:!0,isDismissable:!o||u,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:s},i??n),{overlayProps:p,arrowProps:h,placement:m,triggerAnchorPoint:y}=function(e){var t;let{direction:r}=y0(),{arrowSize:n,targetRef:i,overlayRef:o,arrowRef:a,scrollRef:s=o,placement:l="bottom",containerPadding:u=12,shouldFlip:c=!0,boundaryElement:d="u">typeof document?document.body:null,offset:f=0,crossOffset:p=0,shouldUpdatePosition:h=!0,isOpen:m=!0,onClose:y,maxHeight:g,arrowBoundaryOffset:b=0}=e,[v,w]=(0,c1.useState)(null),x=[h,l,o.current,i.current,a?.current,s.current,u,c,d,f,p,m,r,g,b,n],E=(0,c1.useRef)(wp?.scale);(0,c1.useEffect)(()=>{m&&(E.current=wp?.scale)},[m]);let S=(0,c1.useCallback)(()=>{var e;if(!1===h||!m||!o.current||!i.current||!d||wp?.scale!==E.current)return;let t=null;if(s.current&&mh(s.current)){let e=((e=document)=>e.activeElement)()?.getBoundingClientRect(),r=s.current.getBoundingClientRect();(t={type:"top",offset:(e?.top??0)-r.top}).offset>r.height/2&&(t.type="bottom",t.offset=(e?.bottom??0)-r.bottom)}let y=o.current;!g&&o.current&&(y.style.top="0px",y.style.bottom="",y.style.maxHeight=(window.visualViewport?.height??window.innerHeight)+"px");let v=function(e){let t,r,{placement:n,targetNode:i,overlayNode:o,scrollNode:a,padding:s,shouldFlip:l,boundaryElement:u,offset:c,crossOffset:d,maxHeight:f,arrowSize:p=0,arrowBoundaryOffset:h=0}=e,m="u">typeof document?window.visualViewport:null,y=o instanceof HTMLElement?function(e){let t=e.offsetParent;if(t&&t===document.body&&"static"===window.getComputedStyle(t).position&&!wc(t)&&(t=document.documentElement),null==t)for(t=e.parentElement;t&&!wc(t);)t=t.parentElement;return t||document.documentElement}(o):document.documentElement,g=y===document.documentElement,b=window.getComputedStyle(y).position,v=g?wl(i,!1):wu(i,y,!1);if(!g){let{marginTop:e,marginLeft:t}=window.getComputedStyle(i);v.top+=parseInt(e,10)||0,v.left+=parseInt(t,10)||0}let w=wl(o,!0),x={top:parseInt((t=window.getComputedStyle(o)).marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0};w.width+=(x.left??0)+(x.right??0),w.height+=(x.top??0)+(x.bottom??0),a.scrollTop,a.scrollLeft,a.scrollWidth,a.scrollHeight;let E=wr(u,m),S=wr(y,m);if("BODY"!==u.tagName&&"HTML"!==u.tagName||g)r=("BODY"===u.tagName||"HTML"===u.tagName)&&g?{top:0,left:0,width:0,height:0}:wu(u,y,!1);else{let e=ws(y,!1);r={top:-(e.top-E.top),left:-(e.left-E.left),width:0,height:0}}return function(e,t,r,n,i,o,a,s,l,u,c,d,f,p,h,m,y){var g,b,v;let w,x,E,S=wi(e),{size:D,crossAxis:O,crossSize:P,placement:C,crossPlacement:k}=S,T=wo(t,a,r,S,u,c,l,d,p,h,s),j=u,R=wa(a,l,t,n,i+u,S,s,m);if(o&&r[D]>R){let e=wi(`${_8[C]} ${k}`),o=wo(t,a,r,e,u,c,l,d,p,h,s);wa(a,l,t,n,i+u,e,s,m)>R&&(S=e,T=o,j=u)}let A="bottom";"top"===S.axis?"top"===S.placement?A="top":"bottom"===S.placement&&(A="bottom"):"top"===S.crossAxis&&("top"===S.crossPlacement?A="bottom":"bottom"===S.crossPlacement&&(A="top"));let M=wn(O,T[O],r[P],a,s,i,l);T[O]+=M;let N=(g=T,b=r.height,v=A,w=(null!=g.top?g.top:s[we.height]-(g.bottom??0)-b)-(s.scroll.top??0),x=m?l.top:0,E={top:Math.max(a.top+x,(y?.offsetTop??a.top)+x),bottom:Math.min(a.top+a.height+x,(y?.offsetTop??0)+(y?.height??0))},"top"!==v?Math.max(0,E.bottom-w-((n.top??0)+(n.bottom??0)+i)):Math.max(0,w+b-E.top-((n.top??0)+(n.bottom??0)+i)));f&&f<N&&(N=f),r.height=Math.min(r.height,N),M=wn(O,(T=wo(t,a,r,S,j,c,l,d,p,h,s))[O],r[P],a,s,i,l),T[O]+=M;let I={},$=t[O]-T[O]-n[_5[O]],L=$+.5*t[P],F=p/2+h,B="left"===_5[O]?(n.left??0)+(n.right??0):(n.top??0)+(n.bottom??0),V=r[P]-B-p/2-h,U=_4(L,t[O]+p/2-(T[O]+n[_5[O]]),t[O]+t[P]-p/2-(T[O]+n[_5[O]]));I[O]=_4(U,F,V),({placement:C,crossPlacement:k}=S),p?$=I[O]:"right"===k?$+=t[P]:"center"===k&&($+=t[P]/2);let W="left"===C||"top"===C?r[D]:0,K={x:"top"===C||"bottom"===C?$:W,y:"left"===C||"right"===C?$:W};return{position:T,maxHeight:N,arrowOffsetLeft:I.left,arrowOffsetTop:I.top,placement:C,triggerAnchorPoint:K}}(n,v,w,x,s,l,E,S,r,c,d,!!b&&"static"!==b,f,p,h,mf(u,y),m)}({placement:(e=l,"rtl"===r?e.replace("start","right").replace("end","left"):e.replace("start","left").replace("end","right")),overlayNode:o.current,targetNode:i.current,scrollNode:s.current||o.current,padding:u,shouldFlip:c,boundaryElement:d,offset:f,crossOffset:p,maxHeight:g,arrowSize:n??(a?.current?ws(a.current,!0).width:0),arrowBoundaryOffset:b});if(!v.position)return;y.style.top="",y.style.bottom="",y.style.left="",y.style.right="",Object.keys(v.position).forEach(e=>y.style[e]=v.position[e]+"px"),y.style.maxHeight=null!=v.maxHeight?v.maxHeight+"px":"";let x=((e=document)=>e.activeElement)();if(t&&x&&s.current){let e=x.getBoundingClientRect(),r=s.current.getBoundingClientRect(),n=e[t.type]-r[t.type];s.current.scrollTop+=n-t.offset}w(v)},x);hL(S,x),hL(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t=S]),wf({ref:o,onResize:S}),wf({ref:i,onResize:S});let D=(0,c1.useRef)(!1);hL(()=>{let e,t=()=>{D.current=!0,clearTimeout(e),e=setTimeout(()=>{D.current=!1},500),S()},r=()=>{D.current&&t()};return wp?.addEventListener("resize",t),wp?.addEventListener("scroll",r),()=>{wp?.removeEventListener("resize",t),wp?.removeEventListener("scroll",r)}},[S]);let O=(0,c1.useCallback)(()=>{D.current||y?.()},[y,D]);return!function(e){let{triggerRef:t,isOpen:r,onClose:n}=e;(0,c1.useEffect)(()=>{if(!r||null===n)return;let e=e=>{let r=mp(e);if(!t.current||r instanceof Node&&!mf(r,t.current)||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)return;let i=n||wd.get(t.current);i&&i()};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[r,n,t])}({triggerRef:i,isOpen:m,onClose:y&&O}),{overlayProps:{style:{position:v?"absolute":"fixed",top:v?void 0:0,left:v?void 0:0,zIndex:1e5,...v?.position,maxHeight:v?.maxHeight??"100vh"}},placement:v?.placement??null,triggerAnchorPoint:v?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:v?.arrowOffsetLeft,top:v?.arrowOffsetTop}},updatePosition:S}}({...l,targetRef:r,overlayRef:n,isOpen:t.isOpen,onClose:o&&!u?t.close:null});return!function(e={}){let{isDisabled:t}=e;hL(()=>{if(!t){let e,t,r,n,i,o,a,s;return 1==++wv&&(d=mA()?(t=w_(document.documentElement,"overflow","hidden"),r=!1,n=document.createElement("style"),(i=yl())&&(n.nonce=i),n.textContent=`
22
+ `.trim(),e.head.prepend(t)},[f]),(0,c3.useEffect)(()=>{let e=y.current;return()=>{for(let t of(d||ya(e.target??void 0),e.disposables))t();e.disposables=[]}},[d]),{isPressed:l||h,pressProps:h0(p,k,{[yv]:!0})}}function yw(e){return"A"===e.tagName&&e.hasAttribute("href")}function yx(e,t){let{key:r,code:n}=e,i=t.getAttribute("role");return("Enter"===r||" "===r||"Spacebar"===r||"Space"===n)&&!(t instanceof mf(t).HTMLInputElement&&!yO(t,r)||t instanceof mf(t).HTMLTextAreaElement||t.isContentEditable)&&!(("link"===i||!i&&yw(t))&&"Enter"!==r)}function yE(e,t){let r=t.clientX,n=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:r,clientY:n,key:t.key}}function yS(e,t){return e instanceof HTMLInputElement?!yO(e,t):!(e instanceof HTMLInputElement)&&(e instanceof HTMLButtonElement?"submit"!==e.type&&"reset"!==e.type:!yw(e))}let yD=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function yO(e,t){return"checkbox"===e.type||"radio"===e.type?" "===t:yD.has(e.type)}function yP(e){let{isDisabled:t,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=e,o=(0,c3.useRef)({isFocusWithin:!1}),{addGlobalListener:a,removeAllGlobalListeners:s}=yp(),l=(0,c3.useCallback)(e=>{mp(e.currentTarget,mh(e))&&o.current.isFocusWithin&&!mp(e.currentTarget,e.relatedTarget)&&(o.current.isFocusWithin=!1,s(),r&&r(e),i&&i(!1))},[r,i,o,s]),u=mO(l),c=(0,c3.useCallback)(e=>{if(!mp(e.currentTarget,mh(e)))return;let t=mh(e),r=md(t),s=((e=document)=>e.activeElement)(r);if(!o.current.isFocusWithin&&s===t){n&&n(e),i&&i(!0),o.current.isFocusWithin=!0,u(e);let t=e.currentTarget;a(r,"focus",e=>{let n=mh(e);if(o.current.isFocusWithin&&!mp(t,n)){let e=new r.defaultView.FocusEvent("blur",{relatedTarget:n});mD(e,t),l(mS(e))}},{capture:!0})}},[n,i,u,a,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:c,onBlur:l}}}function yC(e={}){var t;let{autoFocus:r=!1,isTextInput:n,within:i}=e,o=(0,c3.useRef)({isFocused:!1,isFocusVisible:r||m1()}),[a,s]=(0,c3.useState)(!1),[l,u]=(0,c3.useState)(()=>o.current.isFocused&&o.current.isFocusVisible),c=(0,c3.useCallback)(()=>u(o.current.isFocused&&o.current.isFocusVisible),[]),d=(0,c3.useCallback)(e=>{o.current.isFocused=e,o.current.isFocusVisible=m1(),s(e),c()},[c]);t={enabled:a,isTextInput:n},mX(),(0,c3.useEffect)(()=>{if(t?.enabled===!1)return;let e=(e,r)=>{var n;let i,a,s,l,u,d,f,p;n=!!t?.isTextInput,a=md(i=r?mh(r):void 0),l=void 0!==(s=mf(i))?s.HTMLInputElement:HTMLInputElement,u=void 0!==s?s.HTMLTextAreaElement:HTMLTextAreaElement,d=void 0!==s?s.HTMLElement:HTMLElement,f=void 0!==s?s.KeyboardEvent:KeyboardEvent,p=((e=document)=>e.activeElement)(a),(n=n||p instanceof l&&!m3.has(p.type)||p instanceof u||p instanceof d&&p.isContentEditable)&&"keyboard"===e&&r instanceof f&&!mz[r.key]||(e=>{o.current.isFocusVisible=e,c()})(m1())};return mU.add(e),()=>{mU.delete(e)}},[n,a]);let{focusProps:f}=m9({isDisabled:i,onFocusChange:d}),{focusWithinProps:p}=yP({isDisabled:!i,onFocusWithinChange:d});return{isFocused:a,isFocusVisible:l,focusProps:i?p:f}}let yk=!1,yj=0;function yT(e){"touch"===e.pointerType&&(yk=!0,setTimeout(()=>{yk=!1},500))}function yR(){let e=md(null);if(void 0!==e)return 0===yj&&"u">typeof PointerEvent&&e.addEventListener("pointerup",yT),yj++,()=>{!(--yj>0)&&"u">typeof PointerEvent&&e.removeEventListener("pointerup",yT)}}function yA(e){let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,isDisabled:i}=e,[o,a]=(0,c3.useState)(!1),s=(0,c3.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;(0,c3.useEffect)(yR,[]);let{addGlobalListener:l,removeAllGlobalListeners:u}=yp(),{hoverProps:c,triggerHoverEnd:d}=(0,c3.useMemo)(()=>{let e=(e,t)=>{let i=s.target;s.pointerType="",s.target=null,"touch"!==t&&s.isHovered&&i&&(s.isHovered=!1,u(),n&&n({type:"hoverend",target:i,pointerType:t}),r&&r(!1),a(!1))},o={};return"u">typeof PointerEvent&&(o.onPointerEnter=n=>{yk&&"mouse"===n.pointerType||((n,o)=>{if(s.pointerType=o,i||"touch"===o||s.isHovered||!mp(n.currentTarget,mh(n)))return;s.isHovered=!0;let u=n.currentTarget;s.target=u,l(md(mh(n)),"pointerover",t=>{s.isHovered&&s.target&&!mp(s.target,mh(t))&&e(t,t.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:u,pointerType:o}),r&&r(!0),a(!0)})(n,n.pointerType)},o.onPointerLeave=t=>{!i&&mp(t.currentTarget,mh(t))&&e(t,t.pointerType)}),{hoverProps:o,triggerHoverEnd:e}},[t,r,n,i,s,l,u]);return(0,c3.useEffect)(()=>{i&&d({currentTarget:s.target},s.pointerType)},[i]),{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 yM=(0,c3.createContext)(!1);function yN(e){let t=(t,r)=>(0,c3.useContext)(yM)?null:e(t,r);return t.displayName=e.displayName||e.name,(0,c3.forwardRef)(t)}let yI=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),y$=(0,c3.createContext)({}),yL=yN(function(e,t){var r;[e,t]=h6(e,t,y$);let n=((r=e).isPending&&(r.onPress=void 0,r.onPressStart=void 0,r.onPressEnd=void 0,r.onPressChange=void 0,r.onPressUp=void 0,r.onKeyDown=void 0,r.onKeyUp=void 0,r.onClick=void 0,r.href=void 0),e=r),{isPending:i}=n,{buttonProps:o,isPressed:a}=function(e,t){let r,{elementType:n="button",isDisabled:i,onPress:o,onPressStart:a,onPressEnd:s,onPressUp:l,onPressChange:u,preventFocusOnPress:c,allowFocusWhenDisabled:d,onClick:f,href:p,target:h,rel:m,type:y="button"}=e;r="button"===n?{type:y,disabled:i,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:"button",href:"a"!==n||i?void 0:p,target:"a"===n?h:void 0,type:"input"===n?y:void 0,disabled:"input"===n?i:void 0,"aria-disabled":i&&"input"!==n?i:void 0,rel:"a"===n?m:void 0};let{pressProps:g,isPressed:b}=y_({onPressStart:a,onPressEnd:s,onPressChange:u,onPress:o,onPressUp:l,onClick:f,isDisabled:i,preventFocusOnPress:c,ref:t}),{focusableProps:v}=yr(e,t);d&&(v.tabIndex=i?-1:v.tabIndex);let w=h0(v,g,ml(e,{labelable:!0}));return{isPressed:b,buttonProps:h0(r,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"],"aria-disabled":e["aria-disabled"]})}}(e,t),{focusProps:s,isFocused:l,isFocusVisible:u}=yC(e),{hoverProps:c,isHovered:d}=yA({...e,isDisabled:e.isDisabled||i}),f={isHovered:d,isPressed:(n.isPressed||a)&&!i,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:null!=i&&i},p=h4({...e,values:f,defaultClassName:"react-aria-Button"}),h=hJ(o.id),m=hJ(),y=o["aria-labelledby"];i&&(y?y=`${y} ${m}`:o["aria-label"]&&(y=`${h} ${m}`));let g=(0,c3.useRef)(i);return(0,c3.useEffect)(()=>{let e={"aria-labelledby":y||h};!g.current&&l&&i?me(e,"assertive"):g.current&&l&&!i&&me(e,"assertive"),g.current=i},[i,l,y,h]),c4().createElement("button",{...ml(e,{propNames:yI}),...h0(o,s,c),...p,type:"submit"===o.type&&i?"button":o.type,id:h,ref:t,"aria-labelledby":y,slot:e.slot||void 0,"aria-disabled":i?"true":o["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":f.isPressed||void 0,"data-hovered":d||void 0,"data-focused":l||void 0,"data-pending":i||void 0,"data-focus-visible":u||void 0},c4().createElement(h9.Provider,{value:{id:m}},p.children))});(0,c3.createContext)(null),(0,c3.createContext)(null),(0,c3.createContext)(null),(0,c3.createContext)(null),(0,c3.createContext)(null);let yF=(0,c3.createContext)({}),yB=(0,c3.createContext)({}),yV=(0,c3.forwardRef)(function(e,t){[e,t]=h6(e,t,yB);let{elementType:r="span",...n}=e;return c4().createElement(r,{className:"react-aria-Text",...n,ref:t})}),yU=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),yW=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function yK(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),r="function"==typeof t.getTextInfo?t.getTextInfo():t.textInfo;if(r)return"rtl"===r.direction;if(t.script)return yU.has(t.script)}let t=e.split("-")[0];return yW.has(t)}let yH=Symbol.for("react-aria.i18n.locale");function yz(){let e="u">typeof window&&window[yH]||"u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:yK(e)?"rtl":"ltr"}}let yq=yz(),yG=new Set;function yZ(){for(let e of(yq=yz(),yG))e(yq)}function yY(){let e=hG(),[t,r]=(0,c3.useState)(yq);return((0,c3.useEffect)(()=>(0===yG.size&&window.addEventListener("languagechange",yZ),yG.add(r),()=>{yG.delete(r),0===yG.size&&window.removeEventListener("languagechange",yZ)}),[]),e)?{locale:"u">typeof window&&window[yH]||"en-US",direction:"ltr"}:t}let yJ=c4().createContext(null);function yQ(e){let{locale:t,children:r}=e,n=c4().useMemo(()=>({locale:t,direction:yK(t)?"rtl":"ltr"}),[t]);return c4().createElement(yJ.Provider,{value:n},r)}function yX(e){let{children:t}=e,r=yY();return c4().createElement(yJ.Provider,{value:r},t)}function y0(e){let{locale:t,children:r}=e;return t?c4().createElement(yQ,{locale:t,children:r}):c4().createElement(yX,{children:r})}function y1(){let e=yY();return(0,c3.useContext)(yJ)||e}let y3=null;function y4(e,t="assertive",r=7e3){y3?y3.announce(e,t,r):(y3=new y2,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?y3.announce(e,t,r):setTimeout(()=>{y3?.isAttached()&&y3?.announce(e,t,r)},100))}class y2{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))}isAttached(){return this.node?.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",r=7e3){if(!this.node)return;let n=document.createElement("div");"object"==typeof e?(n.setAttribute("role","img"),n.setAttribute("aria-labelledby",e["aria-labelledby"])):n.textContent=e,"assertive"===t?this.assertiveLog?.appendChild(n):this.politeLog?.appendChild(n),""!==e&&setTimeout(()=>{n.remove()},r)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}}var y6={};function y5(e,t){let r=(0,c3.useRef)(null);return e&&r.current&&t(e,r.current)&&(e=r.current),r.current=e,e}y6={"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 y8=new Map;class y9{constructor(e,t={}){this.formatter=ge(e,t),this.options=t}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 r=this.formatter.formatToParts(e),n=this.formatter.formatToParts(t);return[...r.map(e=>({...e,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...n.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.formatter.resolvedOptions();return null==gr&&(gr="h12"===new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle),gr&&(this.resolvedHourCycle||(this.resolvedHourCycle=function(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,"");let r=ge(e+=(e.includes("-u-")?"":"-u")+"-nu-latn",{...t,timeZone:void 0}),n=parseInt(r.formatToParts(new Date(2020,2,3,0)).find(e=>"hour"===e.type).value,10),i=parseInt(r.formatToParts(new Date(2020,2,3,23)).find(e=>"hour"===e.type).value,10);if(0===n&&23===i)return"h23";if(24===n&&23===i)return"h24";if(0===n&&11===i)return"h11";if(12===n&&11===i)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}}let y7={true:{ja:"h11"},false:{}};function ge(e,t={}){if("boolean"==typeof t.hour12&&(null==gt&&(gt="24"===new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))),gt)){let r=y7[String((t={...t}).hour12)][e.split("-")[0]],n=t.hour12?"h12":"h23";t.hourCycle=r??n,delete t.hour12}let r=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(y8.has(r))return y8.get(r);let n=new Intl.DateTimeFormat(e,t);return y8.set(r,n),n}let gt=null,gr=null;function gn(e){e=y5(e??{},gi);let{locale:t}=y1();return(0,c3.useMemo)(()=>new y9(t,e),[t,e])}function gi(e,t){if(e===t)return!0;let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n of r)if(t[n]!==e[n])return!1;return!0}let go=Symbol.for("react-aria.i18n.locale"),ga=Symbol.for("react-aria.i18n.strings");class gs{constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let r=this.getStringsForLocale(t)[e];if(!r)throw Error(`Could not find intl message ${e} in ${t} locale`);return r}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,r="en-US"){var n;if(t[e])return t[e];let i=(n=e,Intl.Locale?new Intl.Locale(n).language:n.split("-")[0]);if(t[i])return t[i];for(let e in t)if(e.startsWith(i+"-"))return t[e];return t[r]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if("u"<typeof window)return null;let t=window[go];if(void 0===h){let e=window[ga];if(!e)return null;for(let r in h={},e)h[r]=new gs({[t]:e[r]},t)}let r=h?.[e];if(!r)throw Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}}let gl=new Map,gu=new Map;class gc{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let r=this.strings.getStringForLocale(e,this.locale);return"function"==typeof r?r(t,this):r}plural(e,t,r="cardinal"){let n=t["="+e];if(n)return"function"==typeof n?n():n;let i=this.locale+":"+r,o=gl.get(i);return o||(o=new Intl.PluralRules(this.locale,{type:r}),gl.set(i,o)),"function"==typeof(n=t[o.select(e)]||t.other)?n():n}number(e){let t=gu.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),gu.set(this.locale,t)),t.format(e)}select(e,t){let r=e[t]||e.other;return"function"==typeof r?r():r}}let gd=new WeakMap;function gf(e,t){let r;return t&&gs.getGlobalDictionaryForPackage(t)||((r=gd.get(e))||(r=new gs(e),gd.set(e,r)),r)}function gp(e,t){let{locale:r}=y1(),n=gf(e,t);return(0,c3.useMemo)(()=>new gc(r,n),[r,n])}function gh(e,t){return e-t*Math.floor(e/t)}function gm(e,t,r,n){let i=(t=gg(e,t))-1,o=-2;return r<=2?o=0:gy(t)&&(o=-1),1721425+365*i+Math.floor(i/4)-Math.floor(i/100)+Math.floor(i/400)+Math.floor((367*r-362)/12+o+n)}function gy(e){return e%4==0&&(e%100!=0||e%400==0)}function gg(e,t){return"BC"===e?1-t:t}function gb(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}let gv={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 g_{fromJulianDay(e){let t=e-1721426,r=Math.floor(t/146097),n=gh(t,146097),i=Math.floor(n/36524),o=gh(n,36524),a=Math.floor(o/1461),s=Math.floor(gh(o,1461)/365),[l,u]=gb(400*r+100*i+4*a+s+ +(4!==i&&4!==s)),c=e-gm(l,u,1,1),d=2;e<gm(l,u,3,1)?d=0:gy(u)&&(d=1);let f=Math.floor(((c+d)*12+373)/367),p=e-gm(l,u,f,1)+1;return new gV(l,u,f,p)}toJulianDay(e){return gm(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return gv[gy(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return gy(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}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 gw(e,t){let r=e.copy(),n="hour"in r?gT(r,t):0;gx(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,gE(r),gS(r),r.day+=7*(t.weeks||0),r.day+=t.days||0,r.day+=n,function(e){for(;e.day<1;)e.month--,gE(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,gE(e)}(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);let i=r.calendar.getYearsInEra(r);if(r.year>i){let e=r.calendar.isInverseEra?.(r);r.year=i,r.month=e?1:r.calendar.getMonthsInYear(r),r.day=e?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);let o=r.calendar.getMonthsInYear(r);return r.month>o&&(r.month=o,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r}function gx(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function gE(e){for(;e.month<1;)gx(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,gx(e,1)}function gS(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 gD(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),gS(e)}function gO(e){let t={};for(let r in e)"number"==typeof e[r]&&(t[r]=-e[r]);return t}function gP(e,t){let r=e.copy();return null!=t.era&&(r.era=t.era),null!=t.year&&(r.year=t.year),null!=t.month&&(r.month=t.month),null!=t.day&&(r.day=t.day),gD(r),r}function gC(e,t){let r=e.copy();return null!=t.hour&&(r.hour=t.hour),null!=t.minute&&(r.minute=t.minute),null!=t.second&&(r.second=t.second),null!=t.millisecond&&(r.millisecond=t.millisecond),gk(r),r}function gk(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 gj(e,t){let r=e%t;return r<0&&(r+=t),r}function gT(e,t){let r;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=gj(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=gj(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=gj(e.minute,60),r=Math.floor(e.hour/24),e.hour=gj(e.hour,24),r}function gR(e,t){let r=e.copy();return gT(r,t),r}function gA(e,t,r,n){let i=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=gN(o,r,0,t.length-1,n?.round),i.era=t[o],gD(i);break}case"year":i.calendar.isInverseEra?.(i)&&(r=-r),i.year=gN(e.year,r,-1/0,9999,n?.round),i.year===-1/0&&(i.year=1),i.calendar.balanceYearMonth&&i.calendar.balanceYearMonth(i,e);break;case"month":i.month=gN(e.month,r,1,e.calendar.getMonthsInYear(e),n?.round);break;case"day":i.day=gN(e.day,r,1,e.calendar.getDaysInMonth(e),n?.round);break;default:throw Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(i),gD(i),i}function gM(e,t,r,n){let i=e.copy();switch(t){case"hour":{let t=e.hour,o=0,a=23;if(n?.hourCycle===12){let e=t>=12;o=12*!!e,a=e?23:11}i.hour=gN(t,r,o,a,n?.round);break}case"minute":i.minute=gN(e.minute,r,0,59,n?.round);break;case"second":i.second=gN(e.second,r,0,59,n?.round);break;case"millisecond":i.millisecond=gN(e.millisecond,r,0,999,n?.round);break;default:throw Error("Unsupported field "+t)}return i}function gN(e,t,r,n,i=!1){if(i){(e+=Math.sign(t))<r&&(e=n);let i=Math.abs(t);(e=t>0?Math.ceil(e/i)*i:Math.floor(e/i)*i)>n&&(e=r)}else(e+=t)<r?e=n-(r-e-1):e>n&&(e=r+(e-n-1));return e}function gI(e,t){let r;return r=(null!=t.years&&0!==t.years||null!=t.months&&0!==t.months||null!=t.weeks&&0!==t.weeks||null!=t.days&&0!==t.days?gY(gw(g0(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days}),e.timeZone):gH(e)-e.offset)+(t.milliseconds||0),r+=1e3*(t.seconds||0),r+=6e4*(t.minutes||0),g1(gQ(r+=36e5*(t.hours||0),e.timeZone),e.calendar)}function g$(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 gL(e){let t,r=g1(e,new g_);return t="BC"===r.era?1===r.year?"0000":"-"+String(Math.abs(1-r.year)).padStart(6,"00"):String(r.year).padStart(4,"0"),`${t}-${String(r.month).padStart(2,"0")}-${String(r.day).padStart(2,"0")}`}function gF(e){return`${gL(e)}T${g$(e)}`}function gB(e){let t,r="object"==typeof e[0]?e.shift():new g_;if("string"==typeof e[0])t=e.shift();else{let e=r.getEras();t=e[e.length-1]}return[r,t,e.shift(),e.shift(),e.shift()]}class gV{#t;constructor(...e){let[t,r,n,i,o]=gB(e);this.calendar=t,this.era=r,this.year=n,this.month=i,this.day=o,gD(this)}copy(){return this.era?new gV(this.calendar,this.era,this.year,this.month,this.day):new gV(this.calendar,this.year,this.month,this.day)}add(e){return gw(this,e)}subtract(e){return gw(this,gO(e))}set(e){return gP(this,e)}cycle(e,t,r){return gA(this,e,t,r)}toDate(e){return gJ(this,e)}toString(){return gL(this)}compare(e){return be(this,e)}}class gU{#t;constructor(e=0,t=0,r=0,n=0){this.hour=e,this.minute=t,this.second=r,this.millisecond=n,gk(this)}copy(){return new gU(this.hour,this.minute,this.second,this.millisecond)}add(e){return gR(this,e)}subtract(e){return gR(this,gO(e))}set(e){return gC(this,e)}cycle(e,t,r){return gM(this,e,t,r)}toString(){return g$(this)}compare(e){var t,r;return t=this,r=e,bt(t)-bt(r)}}class gW{#t;constructor(...e){let[t,r,n,i,o]=gB(e);this.calendar=t,this.era=r,this.year=n,this.month=i,this.day=o,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,gD(this)}copy(){return this.era?new gW(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new gW(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return gw(this,e)}subtract(e){return gw(this,gO(e))}set(e){return gP(gC(this,e),e)}cycle(e,t,r){switch(e){case"era":case"year":case"month":case"day":return gA(this,e,t,r);default:return gM(this,e,t,r)}}toDate(e,t){return gJ(this,e,t)}toString(){return gF(this)}compare(e){var t,r;let n=be(this,e);return 0===n?(t=this,r=g0(e),bt(t)-bt(r)):n}}class gK{#t;constructor(...e){let[t,r,n,i,o]=gB(e),a=e.shift(),s=e.shift();this.calendar=t,this.era=r,this.year=n,this.month=i,this.day=o,this.timeZone=a,this.offset=s,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,gD(this)}copy(){return this.era?new gK(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new gK(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(e){return gI(this,e)}subtract(e){return gI(this,gO(e))}set(e,t){let r,n;return 0===(n=gC(gP(r=g0(this),e),e)).compare(r)?this:g1(gQ(gY(n,this.timeZone,t),this.timeZone),this.calendar)}cycle(e,t,r){return function(e,t,r,n){switch(t){case"hour":{let t=0,i=23;if(n?.hourCycle===12){let r=e.hour>=12;t=12*!!r,i=r?23:11}let o=g0(e),a=g1(gC(o,{hour:t}),new g_),s=[gY(a,e.timeZone,"earlier"),gY(a,e.timeZone,"later")].filter(t=>gQ(t,e.timeZone).day===a.day)[0],l=g1(gC(o,{hour:i}),new g_),u=[gY(l,e.timeZone,"earlier"),gY(l,e.timeZone,"later")].filter(t=>gQ(t,e.timeZone).day===l.day).pop(),c=gH(e)-e.offset,d=Math.floor(c/36e5),f=c%36e5;return g1(gQ(c=36e5*gN(d,r,Math.floor(s/36e5),Math.floor(u/36e5),n?.round)+f,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return gM(e,t,r,n);case"era":case"year":case"month":case"day":return g1(gQ(gY(gA(g0(e),t,r,n),e.timeZone),e.timeZone),e.calendar);default:throw Error("Unsupported field "+t)}}(this,e,t,r)}toDate(){var e;return e=this,new Date(gH(e)-e.offset)}toString(){var e;let t,r,n,i,o;return`${gF(this)}${t=0>Math.sign(e=this.offset)?"-":"+",r=Math.floor((e=Math.abs(e))/36e5),n=Math.floor(e%36e5/6e4),i=Math.floor(e%36e5%6e4/1e3),o=`${t}${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`,0!==i&&(o+=`:${String(i).padStart(2,"0")}`),o}[${this.timeZone}]`}toAbsoluteString(){return this.toDate().toISOString()}compare(e){return this.toDate().getTime()-(function(e,t){if(e instanceof gK){var r,n;return e.timeZone===t?e:(r=e,n=t,g1(gQ(gH(r)-r.offset,n),r.calendar))}return gQ(gY(e,t,void 0),t)})(e,this.timeZone).toDate().getTime()}}function gH(e){return gz(gg((e=g1(e,new g_)).era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function gz(e,t,r,n,i,o,a){let s=new Date;return s.setUTCHours(n,i,o,a),s.setUTCFullYear(e,t-1,r),s.getTime()}function gq(e,t){if("UTC"===t)return 0;if(e>0&&t===bn())return -6e4*new Date(e).getTimezoneOffset();let{year:r,month:n,day:i,hour:o,minute:a,second:s}=gZ(e,t);return gz(r,n,i,o,a,s,0)-1e3*Math.floor(e/1e3)}let gG=new Map;function gZ(e,t){let r=gG.get(t);r||(r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),gG.set(t,r));let n=r.formatToParts(new Date(e)),i={};for(let e of n)"literal"!==e.type&&(i[e.type]=e.value);return{year:"BC"===i.era||"B"===i.era?-i.year+1:+i.year,month:+i.month,day:+i.day,hour:"24"===i.hour?0:+i.hour,minute:+i.minute,second:+i.second}}function gY(e,t,r="compatible"){var n,i,o;let a=g0(e);if("UTC"===t)return gH(a);if(t===bn()&&"compatible"===r){a=g1(a,new g_);let e=new Date,t=gg(a.era,a.year);return e.setFullYear(t,a.month-1,a.day),e.setHours(a.hour,a.minute,a.second,a.millisecond),e.getTime()}let s=gH(a),l=gq(s-864e5,t),u=gq(s+864e5,t),c=(n=a,((i=s-l)==(o=s-u)?[i]:[i,o]).filter(e=>{var r;let i;return r=n,i=gZ(e,t),r.year===i.year&&r.month===i.month&&r.day===i.day&&r.hour===i.hour&&r.minute===i.minute&&r.second===i.second}));if(1===c.length)return c[0];if(c.length>1)switch(r){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw RangeError("Multiple possible absolute times found")}switch(r){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 gJ(e,t,r="compatible"){return new Date(gY(e,t,r))}function gQ(e,t){let r=gq(e,t),n=new Date(e+r),i=n.getUTCFullYear();return new gK(i<1?"BC":"AD",i<1?-i+1:i,n.getUTCMonth()+1,n.getUTCDate(),t,r,n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds())}function gX(e){return new gV(e.calendar,e.era,e.year,e.month,e.day)}function g0(e,t){let r=0,n=0,i=0,o=0;if("timeZone"in e)({hour:r,minute:n,second:i,millisecond:o}=e);else if("hour"in e&&!t)return e;return t&&({hour:r,minute:n,second:i,millisecond:o}=t),new gW(e.calendar,e.era,e.year,e.month,e.day,r,n,i,o)}function g1(e,t){if(g6(e.calendar,t))return e;let r=t.fromJulianDay(e.calendar.toJulianDay(e)),n=e.copy();return n.calendar=t,n.era=r.era,n.year=r.year,n.month=r.month,n.day=r.day,gD(n),n}let g3={"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 g4(e,t){return t=g1(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function g2(e,t){return g6(e.calendar,t.calendar)&&g4(e,t)}function g6(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}let g5={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function g8(e,t,r){let n=Math.ceil(e.calendar.toJulianDay(e)+1-(r?g5[r]:function(e){let t=bl.get(e);if(!t){if(Intl.Locale){let r=new Intl.Locale(e);if("getWeekInfo"in r&&(t=r.getWeekInfo()))return bl.set(e,t),t.firstDay}let r=function(e){if(Intl.Locale){let t=bs.get(e);return!t&&(t=new Intl.Locale(e).maximize().region)&&bs.set(e,t),t}let t=e.split("-")[1];return"u"===t?void 0:t}(e);if(e.includes("-fw-")){let r=e.split("-fw-")[1].split("-")[0];t="mon"===r?{firstDay:1}:"tue"===r?{firstDay:2}:"wed"===r?{firstDay:3}:"thu"===r?{firstDay:4}:"fri"===r?{firstDay:5}:"sat"===r?{firstDay:6}:{firstDay:0}}else t=e.includes("-ca-iso8601")?{firstDay:1}:{firstDay:r&&g3[r]||0};bl.set(e,t)}return t.firstDay}(t)))%7;return n<0&&(n+=7),n}function g9(e){return gQ(Date.now(),e)}function g7(e){return gX(g9(e))}function be(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function bt(e){return 36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}let br=null;function bn(){return null==br&&(br=new Intl.DateTimeFormat().resolvedOptions().timeZone),br}function bi(e){return e.subtract({days:e.day-1})}function bo(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function ba(e,t,r){let n=g8(e,t,r);return e.subtract({days:n})}let bs=new Map,bl=new Map;function bu(e,t,r){let n=e.calendar.getDaysInMonth(e);return Math.ceil((g8(bi(e),t,r)+n)/7)}function bc(e,t){return e&&t?0>=e.compare(t)?e:t:e||t}function bd(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}function bf(e){return e&&e.__esModule?e.default:e}let bp=new WeakMap;function bh(e){return e?.calendar.identifier==="gregory"&&"BC"===e.era?"short":void 0}function bm(e,t,r,n){let i=gp(bf(y6),"@react-aria/calendar"),o=bh(e)||bh(t),a=gn({month:"long",year:"numeric",era:o,calendar:e.calendar.identifier,timeZone:r}),s=gn({month:"long",year:"numeric",day:"numeric",era:o,calendar:e.calendar.identifier,timeZone:r});return(0,c3.useMemo)(()=>{if(g4(e,bi(e))){let o=e,s=t;if(e.calendar.getFormattableMonth&&(o=e.calendar.getFormattableMonth(e)),t.calendar.getFormattableMonth&&(s=t.calendar.getFormattableMonth(t)),g4(t,bo(e)))return a.format(o.toDate(r));if(g4(t,bo(t)))return n?by(a,i,o,s,r):a.formatRange(o.toDate(r),s.toDate(r))}return n?by(s,i,e,t,r):s.formatRange(e.toDate(r),t.toDate(r))},[e,t,a,s,i,r,n])}function by(e,t,r,n,i){let o=e.formatRangeToParts(r.toDate(i),n.toDate(i)),a=-1;for(let e=0;e<o.length;e++){let t=o[e];if("shared"===t.source&&"literal"===t.type)a=e;else if("endRange"===t.source)break}let s="",l="";for(let e=0;e<o.length;e++)e<a?s+=o[e].value:e>a&&(l+=o[e].value);return t.format("dateRange",{startDate:s,endDate:l})}function bg(e,t){let{id:r,"aria-label":n,"aria-labelledby":i}=e;return r=hJ(r),i&&n?i=[...new Set([r,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),n||i||!t||(n=t),{id:r,"aria-label":n,"aria-labelledby":i}}function bb(e,t){let r=(0,c3.useRef)(!0),n=(0,c3.useRef)(null),i=yf(e);(0,c3.useEffect)(()=>(r.current=!0,()=>{r.current=!1}),[]),(0,c3.useEffect)(()=>{let e=n.current;r.current?r.current=!1:(!e||t.some((t,r)=>!Object.is(t,e[r])))&&i(),n.current=t},t)}function bv(e,t){var r;let n,i,o,a,s,l=gp((r=y6)&&r.__esModule?r.default:r,"@react-aria/calendar"),u=ml(e),c=bm(t.visibleRange.start,t.visibleRange.end,t.timeZone,!1),d=bm(t.visibleRange.start,t.visibleRange.end,t.timeZone,!0);bb(()=>{t.isFocused||y4(d)},[d]);let f=(o=gp(bf(y6),"@react-aria/calendar"),"highlightedRange"in t?{start:n,end:i}=t.highlightedRange||{}:n=i=t.value??void 0,a=gn({weekday:"long",month:"long",year:"numeric",day:"numeric",era:bh(n)||bh(i),timeZone:t.timeZone}),s="anchorDate"in t?t.anchorDate:null,(0,c3.useMemo)(()=>{if(!s&&n&&i)if(g4(n,i)){let e=a.format(n.toDate(t.timeZone));return o.format("selectedDateDescription",{date:e})}else{let e=by(a,o,n,i,t.timeZone);return o.format("selectedRangeDescription",{dateRange:e})}return""},[n,i,s,t.timeZone,o,a]));bb(()=>{f&&y4(f,"polite",4e3)},[f]);let p=hQ([!!e.errorMessage,e.isInvalid,e.validationState]);bp.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:e["aria-labelledby"],errorMessageId:p,selectedDateDescription:f});let[h,m]=(0,c3.useState)(!1),y=e.isDisabled||t.isNextVisibleRangeInvalid();y&&h&&(m(!1),t.setFocused(!0));let[g,b]=(0,c3.useState)(!1),v=e.isDisabled||t.isPreviousVisibleRangeInvalid();return v&&g&&(b(!1),t.setFocused(!0)),{calendarProps:h0(u,bg({id:e.id,"aria-label":[e["aria-label"],d].filter(Boolean).join(", "),"aria-labelledby":e["aria-labelledby"]}),{role:"application","aria-details":e["aria-details"]||void 0,"aria-describedby":e["aria-describedby"]||void 0}),nextButtonProps:{onPress:()=>t.focusNextPage(),"aria-label":l.format("next"),isDisabled:y,onFocusChange:m},prevButtonProps:{onPress:()=>t.focusPreviousPage(),"aria-label":l.format("previous"),isDisabled:v,onFocusChange:b},errorMessageProps:{id:p},title:c}}let b_={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 bw(e){let{children:t,elementType:r="div",isFocusable:n,style:i,...o}=e,{visuallyHiddenProps:a}=function(e={}){let{style:t,isFocusable:r}=e,[n,i]=(0,c3.useState)(!1),{focusWithinProps:o}=yP({isDisabled:!r,onFocusWithinChange:e=>i(e)}),a=(0,c3.useMemo)(()=>n?t:t?{...b_,...t}:b_,[n]);return{visuallyHiddenProps:{...o,style:a}}}(e);return c4().createElement(r,h0(o,a),t)}function bx(e,t,r,n){let i=yf(r),o=null==r;(0,c3.useEffect)(()=>{if(o||!e.current)return;let r=e.current;return r.addEventListener(t,i,n),()=>{r.removeEventListener(t,i,n)}},[e,t,n,o])}function bE(e,t){if(!e)return!1;let r=window.getComputedStyle(e),n=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(r.overflow+r.overflowX+r.overflowY);return e===n&&"hidden"!==r.overflow&&(i=!0),i&&t&&(i=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),i}function bS(e,t){let r=e;for(bE(r,t)&&(r=r.parentElement);r&&!bE(r,t);)r=r.parentElement;return r||document.scrollingElement||document.documentElement}function bD(e,t){let r=[],n=document.scrollingElement||document.documentElement;do bE(e,t)&&r.push(e),e=e.parentElement;while(e&&e!==n);return r}function bO(e,t,r={}){let{block:n="nearest",inline:i="nearest"}=r;if(e===t)return;let o=e.scrollTop,a=e.scrollLeft,s=t.getBoundingClientRect(),l=e.getBoundingClientRect(),u=window.getComputedStyle(t),c=window.getComputedStyle(e),d=document.scrollingElement||document.documentElement,f=e===d?0:l.top,p=e===d?e.clientHeight:l.bottom,h=e===d?0:l.left,m=e===d?e.clientWidth:l.right,y=parseInt(u.scrollMarginTop,10)||0,g=parseInt(u.scrollMarginBottom,10)||0,b=parseInt(u.scrollMarginLeft,10)||0,v=parseInt(u.scrollMarginRight,10)||0,w=parseInt(c.scrollPaddingTop,10)||0,x=parseInt(c.scrollPaddingBottom,10)||0,E=parseInt(c.scrollPaddingLeft,10)||0,S=parseInt(c.scrollPaddingRight,10)||0,D=parseInt(c.borderTopWidth,10)||0,O=parseInt(c.borderBottomWidth,10)||0,P=parseInt(c.borderLeftWidth,10)||0,C=parseInt(c.borderRightWidth,10)||0,k=s.top-y,j=s.bottom+g,T=s.left-b,R=s.right+v,A=e===d?0:P+C,M=e===d?0:D+O,N=e.offsetWidth-e.clientWidth-A,I=e.offsetHeight-e.clientHeight-M,$=f+D+w,L=p-O-x-I,F=h+P+E,B=m-C-S;"rtl"!==c.direction||mM()?B-=N:F+=N;let V=k<$||j>L,U=T<F||R>B;if(V&&"start"===n)o+=k-$;else if(V&&"center"===n)o+=(k+j)/2-($+L)/2;else if(V&&"end"===n)o+=j-L;else if(V&&"nearest"===n){let e=k-$,t=j-L;o+=Math.abs(e)<=Math.abs(t)?e:t}if(U&&"start"===i)a+=T-F;else if(U&&"center"===i)a+=(T+R)/2-(F+B)/2;else if(U&&"end"===i)a+=R-B;else if(U&&"nearest"===i){let e=T-F,t=R-B;a+=Math.abs(e)<=Math.abs(t)?e:t}e.scrollTo({left:a,top:o})}function bP(e,t={}){let{containingElement:r}=t;if(e&&e.isConnected){let t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let{left:t,top:n}=e.getBoundingClientRect(),i=bD(e,!0);for(let t of i)bO(t,e);let{left:o,top:a}=e.getBoundingClientRect();if(Math.abs(t-o)>1||Math.abs(n-a)>1)for(let e of i=r?bD(r,!0):[])bO(e,r,{block:"center",inline:"center"})}else{let{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});let{left:i,top:o}=e.getBoundingClientRect();(Math.abs(t-i)>1||Math.abs(n-o)>1)&&(r?.scrollIntoView?.({block:"center",inline:"center"}),e.scrollIntoView?.({block:"nearest"}))}}}let bC=0,bk=new Map;function bj(e){let[t,r]=(0,c3.useState)();return hF(()=>{if(!e)return;let t=bk.get(e);if(t)r(t.element.id);else{let n=`react-aria-description-${bC++}`;r(n);let i=document.createElement("div");i.id=n,i.style.display="none",i.textContent=e,document.body.appendChild(i),t={refCount:0,element:i},bk.set(e,t)}return t.refCount++,()=>{t&&0==--t.refCount&&(t.element.remove(),bk.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}class bT extends g_{fromJulianDay(e){let t=super.fromJulianDay(e);return new gV(this,gg(t.era,t.year)- -543,t.month,t.day)}toJulianDay(e){return super.toJulianDay(bR(e))}getEras(){return["BE"]}getDaysInMonth(e){return super.getDaysInMonth(bR(e))}balanceDate(){}constructor(...e){super(...e),this.identifier="buddhist"}}function bR(e){let[t,r]=gb(e.year+-543);return new gV(t,r,e.month,e.day)}function bA(e,t,r,n){return e+365*t+Math.floor(t/4)+30*(r-1)+n-1}function bM(e,t){let r=Math.floor(4*(t-e)/1461),n=1+Math.floor((t-bA(e,r,1,1))/30),i=t+1-bA(e,r,n,1);return[r,n,i]}function bN(e){return Math.floor(e%4/3)}function bI(e,t){return t%13!=0?30:bN(e)+5}class b${fromJulianDay(e){let[t,r,n]=bM(1723856,e),i="AM";return t<=0&&(i="AA",t+=5500),new gV(this,i,t,r,n)}toJulianDay(e){let t=e.year;return"AA"===e.era&&(t-=5500),bA(1723856,t,e.month,e.day)}getDaysInMonth(e){return bI(e.year,e.month)}getMonthsInYear(){return 13}getDaysInYear(e){return 365+bN(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(e){return"AA"===e.era?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class bL extends b${fromJulianDay(e){let[t,r,n]=bM(1723856,e);return new gV(this,"AA",t+=5500,r,n)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...e){super(...e),this.identifier="ethioaa"}}class bF extends b${fromJulianDay(e){let[t,r,n]=bM(1824665,e),i="CE";return t<=0&&(i="BCE",t=1-t),new gV(this,i,t,r,n)}toJulianDay(e){let t=e.year;return"BCE"===e.era&&(t=1-t),bA(1824665,t,e.month,e.day)}getDaysInMonth(e){let t=e.year;return"BCE"===e.era&&(t=1-t),bI(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 bB=765433;function bV(e){return 7>gh(7*e+1,19)}function bU(e){let t=Math.floor((235*e-234)/19),r=29*t+Math.floor((12084+13753*t)/25920);return 3>gh(3*(r+1),7)&&(r+=1),r}function bW(e){let t,r;return bU(e)+(t=bU(e-1),r=bU(e),bU(e+1)-r==356?2:+(r-t==382))}function bK(e){return bW(e+1)-bW(e)}function bH(e,t){if(t>=6&&!bV(e)&&t++,4===t||7===t||9===t||11===t||13===t)return 29;let r=function(e){let t=bK(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}(e);return 2===t?2===r?30:29:3===t?0===r?29:30:6===t?30*!!bV(e):30}class bz{fromJulianDay(e){let t=e-347997,r=Math.floor((25920*t/bB*19+234)/235)+1,n=bW(r),i=Math.floor(t-n);for(;i<1;)i=Math.floor(t-(n=bW(--r)));let o=1,a=0;for(;a<i;)a+=bH(r,o),o++;let s=i-(a-=bH(r,--o));return new gV(this,r,o,s)}toJulianDay(e){let t=bW(e.year);for(let r=1;r<e.month;r++)t+=bH(e.year,r);return t+e.day+347997}getDaysInMonth(e){return bH(e.year,e.month)}getMonthsInYear(e){return bV(e.year)?13:12}getDaysInYear(e){return bK(e.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(e,t){t.year!==e.year&&(bV(t.year)&&!bV(e.year)&&t.month>6?e.month--:!bV(t.year)&&bV(e.year)&&t.month>6&&e.month++)}constructor(){this.identifier="hebrew"}}class bq extends g_{fromJulianDay(e){let t,r,n,i=super.fromJulianDay(e),o=i.year-78,a=e-gm(i.era,i.year,1,1);if(a<80?(o--,a+=(t=gy(i.year-1)?31:30)+155+90+10):(t=gy(i.year)?31:30,a-=80),a<t)r=1,n=a+1;else{let e=a-t;e<155?(r=Math.floor(e/31)+2,n=e%31+1):(e-=155,r=Math.floor(e/30)+7,n=e%30+1)}return new gV(this,o,r,n)}toJulianDay(e){let t,r,[n,i]=gb(e.year+78);return(gy(i)?(t=31,r=gm(n,i,3,21)):(t=30,r=gm(n,i,3,22)),1===e.month)?r+e.day-1:(r+=t+31*Math.min(e.month-2,5),e.month>=8&&(r+=(e.month-7)*30),r+=e.day-1)}getDaysInMonth(e){return 1===e.month&&gy(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 bG(e,t,r,n){return n+Math.ceil(29.5*(r-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function bZ(e,t,r){let n=Math.floor((30*(r-t)+10646)/10631),i=Math.min(12,Math.ceil((r-(29+bG(t,n,1,1)))/29.5)+1),o=r-bG(t,n,i,1)+1;return new gV(e,n,i,o)}function bY(e){return(14+11*e)%30<11}class bJ{fromJulianDay(e){return bZ(this,1948440,e)}toJulianDay(e){return bG(1948440,e.year,e.month,e.day)}getDaysInMonth(e){let t=29+e.month%2;return 12===e.month&&bY(e.year)&&t++,t}getMonthsInYear(){return 12}getDaysInYear(e){return bY(e.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class bQ extends bJ{fromJulianDay(e){return bZ(this,1948439,e)}toJulianDay(e){return bG(1948439,e.year,e.month,e.day)}constructor(...e){super(...e),this.identifier="islamic-tbla"}}function bX(e){return 460322+c[e-1300]}function b0(e,t){return(u[e-1300]&1<<11-(t-1))==0?29:30}function b1(e,t){let r=bX(e);for(let n=1;n<t;n++)r+=b0(e,n);return r}function b3(e){return c[e+1-1300]-c[e-1300]}class b4 extends bJ{constructor(){if(super(),this.identifier="islamic-umalqura",u||(u=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),e=>e.charCodeAt(0)).buffer)),!c){c=new Uint32Array(301);let e=0;for(let t=1300;t<=1600;t++){c[t-1300]=e;for(let r=1;r<=12;r++)e+=b0(t,r)}}}fromJulianDay(e){let t=e-1948440,r=bX(1300),n=bX(1600);if(t<r||t>n)return super.fromJulianDay(e);{let e=1299,r=1,n=1;for(;n>0;){n=t-bX(++e)+1;let i=b3(e);if(n===i){r=12;break}if(n<i){let t=b0(e,r);for(r=1;n>t;)n-=t,t=b0(e,++r);break}}return new gV(this,e,r,t-b1(e,r)+1)}}toJulianDay(e){return e.year<1300||e.year>1600?super.toJulianDay(e):1948440+b1(e.year,e.month)+(e.day-1)}getDaysInMonth(e){return e.year<1300||e.year>1600?super.getDaysInMonth(e):b0(e.year,e.month)}getDaysInYear(e){return e.year<1300||e.year>1600?super.getDaysInYear(e):b3(e.year)}}let b2=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],b6=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],b5=[1867,1911,1925,1988,2018],b8=["meiji","taisho","showa","heisei","reiwa"];function b9(e){let t=b2.findIndex(([t,r,n])=>!!(e.year<t)||e.year===t&&!!(e.month<r)||e.year===t&&e.month===r&&!!(e.day<n));return -1===t?b2.length-1:0===t?0:t-1}function b7(e){let t=b5[b8.indexOf(e.era)];if(!t)throw Error("Unknown era: "+e.era);return new gV(e.year+t,e.month,e.day)}class ve extends g_{fromJulianDay(e){let t=super.fromJulianDay(e),r=b9(t);return new gV(this,b8[r],t.year-b5[r],t.month,t.day)}toJulianDay(e){return super.toJulianDay(b7(e))}balanceDate(e){let t=b7(e),r=b9(t);b8[r]!==e.era&&(e.era=b8[r],e.year=t.year-b5[r]),this.constrainDate(e)}constrainDate(e){let t=b8.indexOf(e.era),r=b6[t];if(null!=r){let[n,i,o]=r,a=n-b5[t];e.year=Math.max(1,Math.min(a,e.year)),e.year===a&&(e.month=Math.min(i,e.month),e.month===i&&(e.day=Math.min(o,e.day)))}if(1===e.year&&t>=0){let[,r,n]=b2[t];e.month=Math.max(r,e.month),e.month===r&&(e.day=Math.max(n,e.day))}}getEras(){return b8}getYearsInEra(e){let t=b8.indexOf(e.era),r=b2[t],n=b2[t+1];if(null==n)return 9999-r[0]+1;let i=n[0]-r[0];return(e.month<n[1]||e.month===n[1]&&e.day<n[2])&&i++,i}getDaysInMonth(e){return super.getDaysInMonth(b7(e))}getMinimumMonthInYear(e){let t=vt(e);return t?t[1]:1}getMinimumDayInMonth(e){let t=vt(e);return t&&e.month===t[1]?t[2]:1}constructor(...e){super(...e),this.identifier="japanese"}}function vt(e){if(1===e.year)return b2[b8.indexOf(e.era)]}let vr=[0,31,62,93,124,155,186,216,246,276,306,336];class vn{fromJulianDay(e){let t=e-1948320,r=1+Math.floor((33*t+3)/12053),n=t-(365*(r-1)+Math.floor((8*r+21)/33)),i=n<216?Math.floor(n/31):Math.floor((n-6)/30),o=n-vr[i]+1;return new gV(this,r,i+1,o)}toJulianDay(e){let t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return t+=vr[e.month-1],t+=e.day}getMonthsInYear(){return 12}getDaysInMonth(e){return e.month<=6?31:e.month<=11||8>gh(25*e.year+11,33)?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}function vi(e){return"minguo"===e.era?e.year+1911:1-e.year+1911}function vo(e){let t=e-1911;return t>0?["minguo",t]:["before_minguo",1-t]}class va extends g_{fromJulianDay(e){let t=super.fromJulianDay(e),[r,n]=vo(gg(t.era,t.year));return new gV(this,r,n,t.month,t.day)}toJulianDay(e){return super.toJulianDay(vs(e))}getEras(){return["before_minguo","minguo"]}balanceDate(e){let[t,r]=vo(vi(e));e.era=t,e.year=r}isInverseEra(e){return"before_minguo"===e.era}getDaysInMonth(e){return super.getDaysInMonth(vs(e))}getYearsInEra(e){return"before_minguo"===e.era?9999:8088}constructor(...e){super(...e),this.identifier="roc"}}function vs(e){let[t,r]=gb(vi(e));return new gV(t,r,e.month,e.day)}function vl(e){switch(e){case"buddhist":return new bT;case"ethiopic":return new b$;case"ethioaa":return new bL;case"coptic":return new bF;case"hebrew":return new bz;case"indian":return new bq;case"islamic-civil":return new bJ;case"islamic-tbla":return new bQ;case"islamic-umalqura":return new b4;case"japanese":return new ve;case"persian":return new vn;case"roc":return new va;default:return new g_}}function vu(e,t,r){return null!=t&&0>e.compare(t)||null!=r&&e.compare(r)>0}function vc(e,t,r,n,i){let o={};for(let e in t)o[e]=Math.floor(t[e]/2),o[e]>0&&t[e]%2==0&&o[e]--;let a=vd(e,t,r).subtract(o);return vp(e,a,t,r,n,i)}function vd(e,t,r,n,i){let o=e;if(t.years)o=bi(e.subtract({months:e.month-1}));else t.months?o=bi(e):t.weeks&&(o=ba(e,r));return vp(e,o,t,r,n,i)}function vf(e,t,r,n,i){let o={...t};o.days?o.days--:o.weeks?o.weeks--:o.months?o.months--:o.years&&o.years--;let a=vd(e,t,r).subtract(o);return vp(e,a,t,r,n,i)}function vp(e,t,r,n,i,o){if(i&&e.compare(i)>=0){let e=bd(t,vd(gX(i),r,n));e&&(t=e)}if(o&&0>=e.compare(o)){let e=bc(t,vf(gX(o),r,n));e&&(t=e)}return t}function vh(e,t,r){if(t){let r=bd(e,gX(t));r&&(e=r)}if(r){let t=bc(e,gX(r));t&&(e=t)}return e}function vm(e,t,r){if(!r)return e;for(;e.compare(t)>=0&&r(e);)e=e.subtract({days:1});return e.compare(t)>=0?e:null}let vy="u">typeof document?c4().useInsertionEffect??c4().useLayoutEffect:()=>{};function vg(e,t,r){let[n,i]=(0,c3.useState)(e||t),o=(0,c3.useRef)(n),a=(0,c3.useRef)(void 0!==e),s=void 0!==e;(0,c3.useEffect)(()=>{a.current,a.current=s},[s]);let l=s?e:n;vy(()=>{o.current=l});let[,u]=(0,c3.useReducer)(()=>({}),{});return[l,(0,c3.useCallback)((e,...t)=>{let n="function"==typeof e?e(o.current):e;Object.is(o.current,n)||(o.current=n,i(n),u(),r?.(n,...t))},[r])]}function vb(e){let t=(0,c3.useMemo)(()=>new y9(e.locale),[e.locale]),r=(0,c3.useMemo)(()=>t.resolvedOptions(),[t]),{locale:n,createCalendar:i,visibleDuration:o={months:1},minValue:a,maxValue:s,selectionAlignment:l,isDateUnavailable:u,pageBehavior:c="visible",firstDayOfWeek:d}=e,f=(0,c3.useMemo)(()=>i(r.calendar),[i,r.calendar]),[p,h]=vg(e.value,e.defaultValue??null,e.onChange),m=(0,c3.useMemo)(()=>p?g1(gX(p),f):null,[p,f]),y=(0,c3.useMemo)(()=>p&&"timeZone"in p?p.timeZone:r.timeZone,[p,r.timeZone]),[g,b]=vg((0,c3.useMemo)(()=>e.focusedValue?vh(g1(gX(e.focusedValue),f),a,s):void 0,[e.focusedValue,f,a,s]),(0,c3.useMemo)(()=>vh(e.defaultFocusedValue?g1(gX(e.defaultFocusedValue),f):m||g1(g7(y),f),a,s),[e.defaultFocusedValue,m,y,f,a,s]),e.onFocusChange),[v,w]=(0,c3.useState)(()=>{switch(l){case"start":return vd(g,o,n,a,s);case"end":return vf(g,o,n,a,s);default:return vc(g,o,n,a,s)}}),[x,E]=(0,c3.useState)(e.autoFocus||!1),S=(0,c3.useMemo)(()=>{let e={...o};return e.days?e.days--:e.days=-1,v.add(e)},[v,o]),[D,O]=(0,c3.useState)(f);if(!g6(f,D)){let e=g1(g,f);w(vc(e,o,n,a,s)),b(e),O(f)}function P(e){b(e=vh(e,a,s))}function C(t){if(!e.isDisabled&&!e.isReadOnly){let e=t;if(null===e)return void h(null);(e=vm(e=vh(e,a,s),v,u))&&(e=g1(e,p?.calendar||new g_),p&&"hour"in p?h(p.set(e)):h(e))}}vu(g,a,s)?b(vh(g,a,s)):0>g.compare(v)?w(vf(g,o,n,a,s)):g.compare(S)>0&&w(vd(g,o,n,a,s));let k=(0,c3.useMemo)(()=>!!m&&(!!(u&&u(m))||vu(m,a,s)),[m,u,a,s]),j=e.isInvalid||"invalid"===e.validationState||k,T=(0,c3.useMemo)(()=>"visible"===c?o:vv(o),[c,o]);return{isDisabled:e.isDisabled??!1,isReadOnly:e.isReadOnly??!1,value:m,setValue:C,visibleRange:{start:v,end:S},minValue:a,maxValue:s,focusedDate:g,timeZone:y,validationState:j?"invalid":null,isValueInvalid:j,setFocusedDate(e){P(e)},focusNextDay(){P(g.add({days:1}))},focusPreviousDay(){P(g.subtract({days:1}))},focusNextRow(){o.days?this.focusNextPage():(o.weeks||o.months||o.years)&&P(g.add({weeks:1}))},focusPreviousRow(){o.days?this.focusPreviousPage():(o.weeks||o.months||o.years)&&P(g.subtract({weeks:1}))},focusNextPage(){let e=v.add(T);b(vh(g.add(T),a,s)),w(vd(vp(g,e,T,n,a,s),T,n))},focusPreviousPage(){let e=v.subtract(T);b(vh(g.subtract(T),a,s)),w(vd(vp(g,e,T,n,a,s),T,n))},focusSectionStart(){o.days?P(v):o.weeks?P(ba(g,n)):(o.months||o.years)&&P(bi(g))},focusSectionEnd(){o.days?P(S):o.weeks?P(ba(g,n,void 0).add({days:6})):(o.months||o.years)&&P(bo(g))},focusNextSection(e){e||o.days?o.days?this.focusNextPage():o.weeks?P(g.add({months:1})):(o.months||o.years)&&P(g.add({years:1})):P(g.add(vv(o)))},focusPreviousSection(e){e||o.days?o.days?this.focusPreviousPage():o.weeks?P(g.subtract({months:1})):(o.months||o.years)&&P(g.subtract({years:1})):P(g.subtract(vv(o)))},selectFocusedDate(){u&&u(g)||C(g)},selectDate(e){C(e)},isFocused:x,setFocused:E,isInvalid:e=>vu(e,a,s),isSelected(e){return null!=m&&g4(e,m)&&!this.isCellDisabled(e)&&!this.isCellUnavailable(e)},isCellFocused:e=>x&&g&&g4(e,g),isCellDisabled(t){return e.isDisabled||0>t.compare(v)||t.compare(S)>0||this.isInvalid(t)},isCellUnavailable:t=>!!e.isDateUnavailable&&e.isDateUnavailable(t),isPreviousVisibleRangeInvalid(){let e=v.subtract({days:1});return g4(e,v)||this.isInvalid(e)},isNextVisibleRangeInvalid(){let e=S.add({days:1});return g4(e,S)||this.isInvalid(e)},getDatesInWeek(e,t=v){let r=t.add({weeks:e}),i=[],o=g8(r=ba(r,n,d),n,d);for(let e=0;e<o;e++)i.push(null);for(;i.length<7;){i.push(r);let e=r.add({days:1});if(g4(r,e))break;r=e}for(;i.length<7;)i.push(null);return i}}}function vv(e){let t={...e};for(let r in e)t[r]=1;return t}function v_(e,t){return e&&t?(0>t.compare(e)&&([e,t]=[t,e]),{start:gX(e),end:gX(t)}):null}function vw(e,t){return(e=g1(e,t?.calendar||new g_),t&&"hour"in t)?t.set(e):e}function vx(e,t,r){let n=e.add({days:r});for(;(r<0?n.compare(t.visibleRange.start)>=0:0>=n.compare(t.visibleRange.end))&&!t.isCellUnavailable(n);)n=n.add({days:r});if(t.isCellUnavailable(n))return n.add({days:-r})}let vE=(0,c3.createContext)(null),vS=(0,c3.createContext)(null),vD=(0,c3.createContext)(null),vO=(0,c3.createContext)(null),vP=(0,c3.forwardRef)(function(e,t){[e,t]=h6(e,t,vE);let{locale:r}=y1(),n=vb({...e,locale:r,createCalendar:vl}),{calendarProps:i,prevButtonProps:o,nextButtonProps:a,errorMessageProps:s,title:l}=bv(e,n),u=h4({...e,values:{state:n,isDisabled:e.isDisabled||!1,isInvalid:n.isValueInvalid},defaultClassName:"react-aria-Calendar"});return c4().createElement("div",{...u,...i,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":n.isValueInvalid||void 0},c4().createElement(h3,{values:[[y$,{slots:{previous:o,next:a}}],[yF,{"aria-hidden":!0,level:2,children:l}],[vD,n],[vE,e],[yB,{slots:{errorMessage:s}}]]},c4().createElement(bw,null,c4().createElement("h2",null,i["aria-label"])),u.children,c4().createElement(bw,null,c4().createElement("button",{"aria-label":a["aria-label"],disabled:a.isDisabled,onClick:()=>n.focusNextPage(),tabIndex:-1}))))}),vC=(0,c3.forwardRef)(function(e,t){[e,t]=h6(e,t,vS);let{locale:r}=y1(),n=function(e){let{value:t,defaultValue:r,onChange:n,createCalendar:i,locale:o,visibleDuration:a={months:1},minValue:s,maxValue:l,...u}=e,[c,d]=vg(t,r||null,n),[f,p]=(0,c3.useState)(null),h="center";if(c&&c.start&&c.end){let e=vc(gX(c.start),a,o,s,l).add(a).subtract({days:1});c.end.compare(e)>0&&(h="start")}let m=(0,c3.useRef)(null),[y,g]=(0,c3.useState)(null),b=(0,c3.useMemo)(()=>bd(s,y?.start),[s,y]),v=(0,c3.useMemo)(()=>bc(l,y?.end),[l,y]),w=vb({...u,value:c&&c.start,createCalendar:i,locale:o,visibleDuration:a,minValue:b,maxValue:v,selectionAlignment:e.selectionAlignment||h}),x=t=>{t&&e.isDateUnavailable&&!e.allowsNonContiguousRanges?(m.current={start:vx(t,w,-1),end:vx(t,w,1)},g(m.current)):(m.current=null,g(null))},[E,S]=(0,c3.useState)(w.visibleRange);g2(w.visibleRange.start,E.start)&&g2(w.visibleRange.end,E.end)||(x(f),S(w.visibleRange));let D=e=>{e?(p(e),x(e)):(p(null),x(null))},O=f?v_(f,w.focusedDate):c&&v_(c.start,c.end),P=t=>{if(e.isReadOnly)return;let r=vm(vh(t,b,v),w.visibleRange.start,e.isDateUnavailable);if(r)if(f){let e=v_(f,r);e&&d({start:vw(e.start,c?.start),end:vw(e.end,c?.end)}),D(null)}else D(r)},[C,k]=(0,c3.useState)(!1),{isDateUnavailable:j}=e,T=(0,c3.useMemo)(()=>!!c&&!f&&(!!(j&&(j(c.start)||j(c.end)))||vu(c.start,s,l)||vu(c.end,s,l)),[j,c,f,s,l]),R=e.isInvalid||"invalid"===e.validationState||T;return{...w,value:c,setValue:d,anchorDate:f,setAnchorDate:D,highlightedRange:O,validationState:R?"invalid":null,isValueInvalid:R,selectFocusedDate(){P(w.focusedDate)},selectDate:P,highlightDate(e){f&&w.setFocusedDate(e)},isSelected:e=>!!(O&&e.compare(O.start)>=0&&0>=e.compare(O.end)&&!w.isCellDisabled(e)&&!w.isCellUnavailable(e)),isInvalid:e=>w.isInvalid(e)||vu(e,m.current?.start,m.current?.end),isDragging:C,setDragging:k,clearSelection(){D(null),d(null)}}}({...e,locale:r,createCalendar:vl}),{calendarProps:i,prevButtonProps:o,nextButtonProps:a,errorMessageProps:s,title:l}=function(e,t,r){let{commitBehavior:n="select",...i}=e,o=bv(i,t),a=(0,c3.useRef)(!1),s=(0,c3.useRef)("u">typeof window?window:null);bx(s,"pointerdown",e=>{a.current=0===e.width&&0===e.height});let l={clear:()=>t.clearSelection(),reset:()=>t.setAnchorDate(null),select:()=>t.selectFocusedDate()};return bx(s,"pointerup",e=>{if(a.current){a.current=!1;return}if(t.setDragging(!1),!t.anchorDate)return;let i=e.target;r.current&&mm(r.current)&&(!mp(r.current,i)||!i.closest('button, [role="button"]'))&&l[n]()}),o.calendarProps.onBlur=e=>{r.current&&(e.relatedTarget&&mp(r.current,e.relatedTarget)||!t.anchorDate||l[n]())},bx(r,"touchmove",e=>{t.isDragging&&e.preventDefault()},{passive:!1,capture:!0}),o}(e,n,t),u=h4({...e,values:{state:n,isDisabled:e.isDisabled||!1,isInvalid:n.isValueInvalid},defaultClassName:"react-aria-RangeCalendar"});return c4().createElement("div",{...u,...i,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":n.isValueInvalid||void 0},c4().createElement(h3,{values:[[y$,{slots:{previous:o,next:a}}],[yF,{"aria-hidden":!0,level:2,children:l}],[vO,n],[vS,e],[yB,{slots:{errorMessage:s}}]]},c4().createElement(bw,null,c4().createElement("h2",null,i["aria-label"])),u.children,c4().createElement(bw,null,c4().createElement("button",{"aria-label":a["aria-label"],disabled:a.isDisabled,onClick:()=>n.focusNextPage(),tabIndex:-1}))))}),vk=(0,c3.createContext)(null),vj=(0,c3.forwardRef)(function(e,t){var r,n;let i=(0,c3.useContext)(vD),o=(0,c3.useContext)(vO),a=h2(vE),s=h2(vS),l=null!=i?i:o,u=l.visibleRange.start;e.offset&&(u=u.add(e.offset));let c=null!=(r=null==a?void 0:a.firstDayOfWeek)?r:null==s?void 0:s.firstDayOfWeek,{gridProps:d,headerProps:f,weekDays:p}=function(e,t){let{startDate:r=t.visibleRange.start,endDate:n=t.visibleRange.end,firstDayOfWeek:i}=e,{direction:o}=y1(),a=bm(r,n,t.timeZone,!0),{ariaLabel:s,ariaLabelledBy:l}=bp.get(t),u=bg({"aria-label":[s,a].filter(Boolean).join(", "),"aria-labelledby":l}),c=gn({weekday:e.weekdayStyle||"narrow",timeZone:t.timeZone}),{locale:d}=y1(),f=(0,c3.useMemo)(()=>{let e=ba(g7(t.timeZone),d,i);return[...Array(7).keys()].map(r=>{let n=e.add({days:r}).toDate(t.timeZone);return c.format(n)})},[d,t.timeZone,c,i]),p=bu(r,d,i);return{gridProps:h0(u,{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"===o?t.focusNextDay():t.focusPreviousDay();break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),t.focusPreviousRow();break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),"rtl"===o?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:f,weeksInMonth:p}}({startDate:u,endDate:bo(u),weekdayStyle:e.weekdayStyle,firstDayOfWeek:c},l);return c4().createElement(vk.Provider,{value:{headerProps:f,weekDays:p,startDate:u,firstDayOfWeek:c}},c4().createElement("table",{...ml(e),...d,ref:t,style:e.style,className:null!=(n=e.className)?n:"react-aria-CalendarGrid"},"function"!=typeof e.children?e.children:c4().createElement(c4().Fragment,null,c4().createElement(vT,null,e=>c4().createElement(vR,null,e)),c4().createElement(vA,null,e.children))))}),vT=(0,c3.forwardRef)(function(e,t){let{children:r,style:n,className:i}=e,{headerProps:o,weekDays:a}=(0,c3.useContext)(vk);return c4().createElement("thead",{...ml(e),...o,ref:t,style:n,className:i||"react-aria-CalendarGridHeader"},c4().createElement("tr",null,a.map((e,t)=>c4().cloneElement(r(e),{key:t}))))}),vR=(0,c3.forwardRef)(function(e,t){let{children:r,style:n,className:i}=e;return c4().createElement("th",{...ml(e),ref:t,style:n,className:i||"react-aria-CalendarHeaderCell"},r)}),vA=(0,c3.forwardRef)(function(e,t){let{children:r,style:n,className:i}=e,o=(0,c3.useContext)(vD),a=(0,c3.useContext)(vO),s=null!=o?o:a,{startDate:l,firstDayOfWeek:u}=(0,c3.useContext)(vk),{locale:c}=y1(),d=bu(l,c,u);return c4().createElement("tbody",{...ml(e),ref:t,style:n,className:i||"react-aria-CalendarGridBody"},[...Array(d).keys()].map(e=>c4().createElement("tr",{key:e},s.getDatesInWeek(e,l).map((e,t)=>e?c4().cloneElement(r(e),{key:t}):c4().createElement("td",{key:t})))))}),vM=(0,c3.forwardRef)(function({date:e,...t},r){var n,i,o;let a=(0,c3.useContext)(vD),s=(0,c3.useContext)(vO),l=null!=a?a:s,{startDate:u}=null!=(n=(0,c3.useContext)(vk))?n:{startDate:l.visibleRange.start},c=(0,c3.useRef)(null),{cellProps:d,buttonProps:f,...p}=function(e,t,r){var n;let i,{date:o,isDisabled:a}=e,{errorMessageId:s,selectedDateDescription:l}=bp.get(t),u=gp((n=y6)&&n.__esModule?n.default:n,"@react-aria/calendar"),c=gn({weekday:"long",day:"numeric",month:"long",year:"numeric",era:bh(o),timeZone:t.timeZone}),d=t.isSelected(o),f=t.isCellFocused(o)&&!e.isOutsideMonth;a=a||t.isCellDisabled(o);let p=t.isCellUnavailable(o),h=!a&&!p,m=t.isValueInvalid&&!!("highlightedRange"in t?!t.anchorDate&&t.highlightedRange&&o.compare(t.highlightedRange.start)>=0&&0>=o.compare(t.highlightedRange.end):t.value&&g4(t.value,o));m&&(d=!0),o=y5(o,g2);let y=(0,c3.useMemo)(()=>o.toDate(t.timeZone),[o,t.timeZone]),g=g4(o,g7(t.timeZone)),b=(0,c3.useMemo)(()=>{let e="";return"highlightedRange"in t&&t.value&&!t.anchorDate&&(g4(o,t.value.start)||g4(o,t.value.end))&&(e=l+", "),e+=c.format(y),g?e=u.format(d?"todayDateSelected":"todayDate",{date:e}):d&&(e=u.format("dateSelected",{date:e})),t.minValue&&g4(o,t.minValue)?e+=", "+u.format("minimumDate"):t.maxValue&&g4(o,t.maxValue)&&(e+=", "+u.format("maximumDate")),e},[c,y,u,d,g,o,t,l]),v="";"anchorDate"in t&&f&&!t.isReadOnly&&h&&(v=t.anchorDate?u.format("finishRangeSelectionPrompt"):u.format("startRangeSelectionPrompt"));let w=bj(v),x=(0,c3.useRef)(!1),E=(0,c3.useRef)(!1),S=(0,c3.useRef)(void 0),{pressProps:D,isPressed:O}=y_({shouldCancelOnPointerExit:"anchorDate"in t&&!!t.anchorDate,preventFocusOnPress:!0,isDisabled:!h||t.isReadOnly,onPressStart(e){if(t.isReadOnly){t.setFocusedDate(o),t.setFocused(!0);return}if("highlightedRange"in t&&!t.anchorDate&&("mouse"===e.pointerType||"touch"===e.pointerType)){if(t.highlightedRange&&!m){if(g4(o,t.highlightedRange.start)){t.setAnchorDate(t.highlightedRange.end),t.setFocusedDate(o),t.setFocused(!0),t.setDragging(!0),E.current=!0;return}else if(g4(o,t.highlightedRange.end)){t.setAnchorDate(t.highlightedRange.start),t.setFocusedDate(o),t.setFocused(!0),t.setDragging(!0),E.current=!0;return}}let r=()=>{t.setDragging(!0),S.current=void 0,t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0),x.current=!0};"touch"===e.pointerType?S.current=setTimeout(r,200):r()}},onPressEnd(){E.current=!1,x.current=!1,clearTimeout(S.current),S.current=void 0},onPress(){"anchorDate"in t||t.isReadOnly||(t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0))},onPressUp(e){if(!t.isReadOnly&&("anchorDate"in t&&S.current&&(t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0)),"anchorDate"in t))if(E.current)t.setAnchorDate(o);else if(t.anchorDate&&!x.current)t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0);else if("keyboard"!==e.pointerType||t.anchorDate)"virtual"===e.pointerType&&(t.selectDate(o),t.setFocusedDate(o),t.setFocused(!0));else{t.selectDate(o);let e=o.add({days:1});t.isInvalid(e)&&(e=o.subtract({days:1})),t.isInvalid(e)||(t.setFocusedDate(e),t.setFocused(!0))}}});a||(i=g4(o,t.focusedDate)?0:-1),(0,c3.useEffect)(()=>{f&&r.current&&(mu(r.current),"pointer"!==mV&&((e=document)=>e.activeElement)()===r.current&&bP(r.current,{containingElement:bS(r.current)}))},[f,r]);let P=gn({day:"numeric",timeZone:t.timeZone,calendar:o.calendar.identifier}),C=(0,c3.useMemo)(()=>P.formatToParts(y).find(e=>"day"===e.type).value,[P,y]);return{cellProps:{role:"gridcell","aria-disabled":!h||void 0,"aria-selected":d||void 0,"aria-invalid":m||void 0},buttonProps:h0(D,{onFocus(){a||(t.setFocusedDate(o),t.setFocused(!0))},tabIndex:i,role:"button","aria-disabled":!h||void 0,"aria-label":b,"aria-invalid":m||void 0,"aria-describedby":[m?s:void 0,w["aria-describedby"]].filter(Boolean).join(" ")||void 0,onPointerEnter(e){"highlightDate"in t&&("touch"!==e.pointerType||t.isDragging)&&h&&t.highlightDate(o)},onPointerDown(e){let t=mh(e);t instanceof HTMLElement&&"releasePointerCapture"in t&&("hasPointerCapture"in t?t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId):t.releasePointerCapture(e.pointerId))},onContextMenu(e){e.preventDefault()}}),isPressed:O,isFocused:f,isSelected:d,isDisabled:a,isUnavailable:p,isOutsideVisibleRange:0>o.compare(t.visibleRange.start)||o.compare(t.visibleRange.end)>0,isInvalid:m,formattedDate:C}}({date:e},l,c),{hoverProps:h,isHovered:m}=yA({...t,isDisabled:p.isDisabled}),{focusProps:y,isFocusVisible:g}=yC();g&&(g=p.isFocused);let b=(i=u,o=g1(o=e,i.calendar),i=bi(i),o=bi(o),i.era!==o.era||i.year!==o.year||i.month!==o.month),v=!1,w=!1;"highlightedRange"in l&&l.highlightedRange&&(v=g4(e,l.highlightedRange.start),w=g4(e,l.highlightedRange.end));let x=h4({...t,defaultChildren:p.formattedDate,defaultClassName:"react-aria-CalendarCell",values:{date:e,isHovered:m,isOutsideMonth:b,isFocusVisible:g,isSelectionStart:v,isSelectionEnd:w,...p}}),E={"data-focused":p.isFocused||void 0,"data-hovered":m||void 0,"data-pressed":p.isPressed||void 0,"data-unavailable":p.isUnavailable||void 0,"data-disabled":p.isDisabled||void 0,"data-focus-visible":g||void 0,"data-outside-visible-range":p.isOutsideVisibleRange||void 0,"data-outside-month":b||void 0,"data-selected":p.isSelected||void 0,"data-selection-start":v||void 0,"data-selection-end":w||void 0,"data-invalid":p.isInvalid||void 0};return c4().createElement("td",{...d,ref:r},c4().createElement("div",{...h0(ml(t),f,y,h,E,x),ref:c}))}),vN=(0,c3.createContext)({}),vI=(0,c3.forwardRef)(function(e,t){var r,n;[e,t]=h6(e,t,vN);let{isDisabled:i,isInvalid:o,onHoverStart:a,onHoverChange:s,onHoverEnd:l,...u}=e,{hoverProps:c,isHovered:d}=yA({onHoverStart:a,onHoverChange:s,onHoverEnd:l,isDisabled:i}),{isFocused:f,isFocusVisible:p,focusProps:h}=yC({within:!0});null!=i||(i=!!e["aria-disabled"]&&"false"!==e["aria-disabled"]),null!=o||(o=!!e["aria-invalid"]&&"false"!==e["aria-invalid"]);let m=h4({...e,values:{isHovered:d,isFocusWithin:f,isFocusVisible:p,isDisabled:i,isInvalid:o},defaultClassName:"react-aria-Group"});return c4().createElement("div",{...h0(u,h,c),...m,ref:t,role:null!=(r=e.role)?r:"group",slot:null!=(n=e.slot)?n:void 0,"data-focus-within":f||void 0,"data-hovered":d||void 0,"data-focus-visible":p||void 0,"data-disabled":i||void 0,"data-invalid":o||void 0},m.children)}),v$=(0,c3.createContext)({}),vL=yN(function(e,t){[e,t]=h6(e,t,v$);let{hoverProps:r,isHovered:n}=yA(e),{isFocused:i,isFocusVisible:o,focusProps:a}=yC({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e["aria-invalid"]&&"false"!==e["aria-invalid"],l=h4({...e,values:{isHovered:n,isFocused:i,isFocusVisible:o,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:"react-aria-Input"});return c4().createElement("input",{...h0((e=>{let{onHoverStart:t,onHoverChange:r,onHoverEnd:n,...i}=e;return i})(e),a,r),...l,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":n||void 0,"data-focus-visible":o||void 0,"data-invalid":s||void 0})});function vF(e,t,r,n){return e.createTreeWalker(t,r,n)}let vB=c4().createContext(null),vV="react-aria-focus-scope-restore",vU=null;function vW(e){var t,r,n,i,o,a,s,l,u,c;let d,f,p,h,{children:m,contain:y,restoreFocus:g,autoFocus:b}=e,v=(0,c3.useRef)(null),w=(0,c3.useRef)(null),x=(0,c3.useRef)([]),{parentNode:E}=(0,c3.useContext)(vB)||{},S=(0,c3.useMemo)(()=>new v2({scopeRef:x}),[x]);hF(()=>{let e=E||v6.root;if(v6.getTreeNode(e.scopeRef)&&vU&&!vG(vU,e.scopeRef)){let t=v6.getTreeNode(vU);t&&(e=t)}e.addChild(S),v6.addNode(S)},[S,E]),hF(()=>{let e=v6.getTreeNode(x);e&&(e.contain=!!y)},[y]),hF(()=>{let e=v.current?.nextSibling,t=[],r=e=>e.stopPropagation();for(;e&&e!==w.current;)t.push(e),e.addEventListener(vV,r),e=e.nextSibling;return x.current=t,()=>{for(let e of t)e.removeEventListener(vV,r)}},[m]),hF(()=>{if(r||n)return;let e=t.current,i=md(e?e[0]:void 0),o=e=>{let r=mh(e);vz(r,t.current)?vU=t:vq(r)||(vU=null)};return i.addEventListener("focusin",o,!1),e?.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),e?.forEach(e=>e.removeEventListener("focusin",o,!1))}},[t=x,r=g,n=y]),i=x,o=y,d=(0,c3.useRef)(void 0),f=(0,c3.useRef)(void 0),hF(()=>{let e=i.current;if(!o){f.current&&(cancelAnimationFrame(f.current),f.current=void 0);return}let t=md(e?e[0]:void 0),r=e=>{if("Tab"!==e.key||e.altKey||e.ctrlKey||e.metaKey||!vH(i)||e.isComposing)return;let r=((e=document)=>e.activeElement)(t),n=i.current;if(!n||!vz(r,n))return;let o=v0(vK(n),{tabbable:!0},n);if(!r)return;o.currentNode=r;let a=e.shiftKey?o.previousNode():o.nextNode();a||(o.currentNode=e.shiftKey?n[n.length-1].nextElementSibling:n[0].previousElementSibling,a=e.shiftKey?o.previousNode():o.nextNode()),e.preventDefault(),a&&(vZ(a,!0),a instanceof mf(a).HTMLInputElement&&a.select())},n=e=>{(!vU||vG(vU,i))&&vz(mh(e),i.current)?(vU=i,d.current=mh(e)):vH(i)&&!vq(mh(e),i)?d.current?d.current.focus():vU&&vU.current&&vJ(vU.current):vH(i)&&(d.current=mh(e))},a=e=>{f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{let r=mV,n=("virtual"===r||null===r)&&m$()&&mI(),o=((e=document)=>e.activeElement)(t);if(!n&&o&&vH(i)&&!vq(o,i)){vU=i;let t=mh(e);t&&t.isConnected?(d.current=t,d.current?.focus()):vU.current&&vJ(vU.current)}})};return t.addEventListener("keydown",r,!1),t.addEventListener("focusin",n,!1),e?.forEach(e=>e.addEventListener("focusin",n,!1)),e?.forEach(e=>e.addEventListener("focusout",a,!1)),()=>{t.removeEventListener("keydown",r,!1),t.removeEventListener("focusin",n,!1),e?.forEach(e=>e.removeEventListener("focusin",n,!1)),e?.forEach(e=>e.removeEventListener("focusout",a,!1))}},[i,o]),hF(()=>()=>{f.current&&cancelAnimationFrame(f.current)},[f]),a=x,s=g,l=y,p=(0,c3.useRef)("u">typeof document?((e=document)=>e.activeElement)(md(a.current?a.current[0]:void 0)):null),hF(()=>{let e=a.current,t=md(e?e[0]:void 0);if(!s||l)return;let r=()=>{(!vU||vG(vU,a))&&vz(((e=document)=>e.activeElement)(t),a.current)&&(vU=a)};return t.addEventListener("focusin",r,!1),e?.forEach(e=>e.addEventListener("focusin",r,!1)),()=>{t.removeEventListener("focusin",r,!1),e?.forEach(e=>e.removeEventListener("focusin",r,!1))}},[a,l]),hF(()=>{let e=md(a.current?a.current[0]:void 0);if(!s)return;let t=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!vH(a)||t.isComposing)return;let r=e.activeElement;if(!vq(r,a)||!vQ(a))return;let n=v6.getTreeNode(a);if(!n)return;let i=n.nodeToRestore,o=v0(e.body,{tabbable:!0});o.currentNode=r;let s=t.shiftKey?o.previousNode():o.nextNode();if(i&&i.isConnected&&i!==e.body||(i=void 0,n.nodeToRestore=void 0),(!s||!vq(s,a))&&i){o.currentNode=i;do s=t.shiftKey?o.previousNode():o.nextNode();while(vq(s,a));(t.preventDefault(),t.stopPropagation(),s)?vZ(s,!0):vq(i)?vZ(i,!0):r.blur()}};return l||e.addEventListener("keydown",t,!0),()=>{l||e.removeEventListener("keydown",t,!0)}},[a,s,l]),hF(()=>{let e=md(a.current?a.current[0]:void 0);if(!s)return;let t=v6.getTreeNode(a);if(t)return t.nodeToRestore=p.current??void 0,()=>{let t=v6.getTreeNode(a);if(!t)return;let r=t.nodeToRestore,n=((e=document)=>e.activeElement)(e);if(s&&r&&(n&&vq(n,a)||n===e.body&&vQ(a))){let t=v6.clone();requestAnimationFrame(()=>{if(e.activeElement===e.body){let e=t.getTreeNode(a);for(;e;){if(e.nodeToRestore&&e.nodeToRestore.isConnected)return void vX(e.nodeToRestore);e=e.parent}for(e=t.getTreeNode(a);e;){if(e.scopeRef&&e.scopeRef.current&&v6.getTreeNode(e.scopeRef))return void vX(vY(e.scopeRef.current,!0));e=e.parent}}})}}},[a,s]),u=x,c=b,h=c4().useRef(c),(0,c3.useEffect)(()=>{h.current&&(vU=u,!vz(((e=document)=>e.activeElement)(md(u.current?u.current[0]:void 0)),vU.current)&&u.current&&vJ(u.current)),h.current=!1},[u]),(0,c3.useEffect)(()=>{let e=((e=document)=>e.activeElement)(md(x.current?x.current[0]:void 0)),t=null;if(vz(e,x.current)){for(let r of v6.traverse())r.scopeRef&&vz(e,r.scopeRef.current)&&(t=r);t===v6.getTreeNode(x)&&(vU=t.scopeRef)}},[x]),hF(()=>()=>{let e=v6.getTreeNode(x)?.parent?.scopeRef??null;(x===vU||vG(x,vU))&&(!e||v6.getTreeNode(e))&&(vU=e),v6.removeTreeNode(x)},[x]);let D=(0,c3.useMemo)(()=>{var e;return e=x,{focusNext(t={}){let r=e.current,{from:n,tabbable:i,wrap:o,accept:a}=t,s=n||((e=document)=>e.activeElement)(md(r[0]??void 0)),l=r[0].previousElementSibling,u=v0(vK(r),{tabbable:i,accept:a},r);u.currentNode=vz(s,r)?s:l;let c=u.nextNode();return!c&&o&&(u.currentNode=l,c=u.nextNode()),c&&vZ(c,!0),c},focusPrevious(t={}){let r=e.current,{from:n,tabbable:i,wrap:o,accept:a}=t,s=n||((e=document)=>e.activeElement)(md(r[0]??void 0)),l=r[r.length-1].nextElementSibling,u=v0(vK(r),{tabbable:i,accept:a},r);u.currentNode=vz(s,r)?s:l;let c=u.previousNode();return!c&&o&&(u.currentNode=l,c=u.previousNode()),c&&vZ(c,!0),c},focusFirst(t={}){let r=e.current,{tabbable:n,accept:i}=t,o=v0(vK(r),{tabbable:n,accept:i},r);o.currentNode=r[0].previousElementSibling;let a=o.nextNode();return a&&vZ(a,!0),a},focusLast(t={}){let r=e.current,{tabbable:n,accept:i}=t,o=v0(vK(r),{tabbable:n,accept:i},r);o.currentNode=r[r.length-1].nextElementSibling;let a=o.previousNode();return a&&vZ(a,!0),a}}},[]),O=(0,c3.useMemo)(()=>({focusManager:D,parentNode:S}),[S,D]);return c4().createElement(vB.Provider,{value:O},c4().createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:v}),m,c4().createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:w}))}function vK(e){return e[0].parentElement}function vH(e){let t=v6.getTreeNode(vU);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function vz(e,t){return!!e&&!!t&&t.some(t=>mp(t,e))}function vq(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:r}of v6.traverse(v6.getTreeNode(t)))if(r&&vz(e,r.current))return!0;return!1}function vG(e,t){let r=v6.getTreeNode(t)?.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function vZ(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{m8(e)}catch{}}function vY(e,t=!0){let r=e[0].previousElementSibling,n=vK(e),i=v0(n,{tabbable:t},e);i.currentNode=r;let o=i.nextNode();return t&&!o&&((i=v0(n=vK(e),{tabbable:!1},e)).currentNode=r,o=i.nextNode()),o}function vJ(e,t=!0){vZ(vY(e,t))}function vQ(e){let t=v6.getTreeNode(vU);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function vX(e){e.dispatchEvent(new CustomEvent(vV,{bubbles:!0,cancelable:!0}))&&vZ(e)}function v0(e,t,r){let n=t?.tabbable?mx:mw,i=md(e?.nodeType===Node.ELEMENT_NODE?e:null),o=vF(i,e||i,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>mp(t?.from,e)||t?.tabbable&&"INPUT"===e.tagName&&"radio"===e.getAttribute("type")&&(!function(e){if(e.checked)return!0;let t=function(e){if(!e.form)return Array.from(md(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),r=mf(e);return t instanceof r.RadioNodeList?Array.from(t).filter(e=>e instanceof r.HTMLInputElement):t instanceof r.HTMLInputElement?[t]:[]}(e);return t.length>0&&!t.some(e=>e.checked)}(e)||"INPUT"===o.currentNode.tagName&&"radio"===o.currentNode.type&&o.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:n(e)&&(!r||vz(e,r))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(o.currentNode=t.from),o}function v1(e,t={}){return{focusNext(r={}){let n=e.current;if(!n)return null;let{from:i,tabbable:o=t.tabbable,wrap:a=t.wrap,accept:s=t.accept}=r,l=i||((e=document)=>e.activeElement)(md(n)),u=v0(n,{tabbable:o,accept:s});mp(n,l)&&(u.currentNode=l);let c=u.nextNode();return!c&&a&&(u.currentNode=n,c=u.nextNode()),c&&vZ(c,!0),c},focusPrevious(r=t){let n=e.current;if(!n)return null;let{from:i,tabbable:o=t.tabbable,wrap:a=t.wrap,accept:s=t.accept}=r,l=i||((e=document)=>e.activeElement)(md(n)),u=v0(n,{tabbable:o,accept:s});if(mp(n,l))u.currentNode=l;else{let e=v3(u);return e&&vZ(e,!0),e??null}let c=u.previousNode();if(!c&&a){u.currentNode=n;let e=v3(u);if(!e)return null;c=e}return c&&vZ(c,!0),c??null},focusFirst(r=t){let n=e.current;if(!n)return null;let{tabbable:i=t.tabbable,accept:o=t.accept}=r,a=v0(n,{tabbable:i,accept:o}).nextNode();return a&&vZ(a,!0),a},focusLast(r=t){let n=e.current;if(!n)return null;let{tabbable:i=t.tabbable,accept:o=t.accept}=r,a=v3(v0(n,{tabbable:i,accept:o}));return a&&vZ(a,!0),a??null}}}function v3(e){let t,r;do(t=e.lastChild())&&(r=t);while(t);return r}class v4{constructor(){this.fastMap=new Map,this.root=new v2({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,r){let n=this.fastMap.get(t??null);if(!n)return;let i=new v2({scopeRef:e});n.addChild(i),i.parent=n,this.fastMap.set(e,i),r&&(i.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let r=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&vz(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let n=t.children;r&&(r.removeChild(t),n.size>0&&n.forEach(e=>r&&r.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(){let e=new v4;for(let t of this.traverse())e.addTreeNode(t.scopeRef,t.parent?.scopeRef??null,t.nodeToRestore);return e}}class v2{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let v6=new v4;var v5={};function v8(e,t,r){let{direction:n}=y1(),i=(0,c3.useMemo)(()=>v1(t),[t]),o=()=>{if(!t.current)return;let e=window.event?mh(window.event):null,r=v0(t.current,{tabbable:!0});if(e&&(r.currentNode=e,e=r.previousNode()),!e){let t;do(t=r.lastChild())&&(e=t);while(t)}for(;e?.hasAttribute("data-placeholder");){let t=r.previousNode();if(t&&t.hasAttribute("data-placeholder"))e=t;else break}e&&e.focus()},{pressProps:a}=y_({preventFocusOnPress:!0,allowTextSelectionOnPress:!0,onPressStart(e){"mouse"===e.pointerType&&o()},onPress(e){("touch"===e.pointerType||"pen"===e.pointerType)&&o()}});return h0(a,{onKeyDown:o=>{if(mp(o.currentTarget,mh(o))&&(o.altKey&&("ArrowDown"===o.key||"ArrowUp"===o.key)&&"setOpen"in e&&(o.preventDefault(),o.stopPropagation(),e.setOpen(!0)),!r))switch(o.key){case"ArrowLeft":if(o.preventDefault(),o.stopPropagation(),"rtl"===n){if(t.current){let e=mh(o),r=v9(t.current,e.getBoundingClientRect().left,-1);r&&r.focus()}}else i.focusPrevious();break;case"ArrowRight":if(o.preventDefault(),o.stopPropagation(),"rtl"===n){if(t.current){let e=mh(o),r=v9(t.current,e.getBoundingClientRect().left,1);r&&r.focus()}}else i.focusNext()}}})}function v9(e,t,r){let n=v0(e,{tabbable:!0}),i=n.nextNode(),o=null,a=1/0;for(;i;){let e=i.getBoundingClientRect().left-t,s=Math.abs(e);Math.sign(e)===r&&s<a&&(o=i,a=s),i=n.nextNode()}return o}function v7(e){let{description:t,errorMessage:r,isInvalid:n,validationState:i}=e,{labelProps:o,fieldProps:a}=function(e){let{id:t,label:r,"aria-labelledby":n,"aria-label":i,labelElementType:o="label"}=e;t=hJ(t);let a=hJ(),s={};return r&&(n=n?`${a} ${n}`:a,s={id:a,htmlFor:"label"===o?t:void 0}),{labelProps:s,fieldProps:bg({id:t,"aria-label":i,"aria-labelledby":n})}}(e),s=hQ([!!t,!!r,n,i]),l=hQ([!!t,!!r,n,i]);return{labelProps:o,fieldProps:a=h0(a,{"aria-describedby":[s,l,e["aria-describedby"]].filter(Boolean).join(" ")||void 0}),descriptionProps:{id:s},errorMessageProps:{id:l}}}function _e(e,t,r){let n=yf(e=>{r&&!e.defaultPrevented&&r(t)});(0,c3.useEffect)(()=>{let t=e?.current?.form;return t?.addEventListener("reset",n),()=>{t?.removeEventListener("reset",n)}},[e])}function _t(e,t,r){let{validationBehavior:n,focus:i}=e;hF(()=>{if("native"===n&&r?.current&&!r.current.disabled){var e;let n,i=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";r.current.setCustomValidity(i),r.current.hasAttribute("title")||(r.current.title=""),t.realtimeValidation.isInvalid||t.updateValidation({isInvalid:!(e=r.current).validity.valid,validationDetails:{badInput:(n=e.validity).badInput,customError:n.customError,patternMismatch:n.patternMismatch,rangeOverflow:n.rangeOverflow,rangeUnderflow:n.rangeUnderflow,stepMismatch:n.stepMismatch,tooLong:n.tooLong,tooShort:n.tooShort,typeMismatch:n.typeMismatch,valueMissing:n.valueMissing,valid:n.valid},validationErrors:e.validationMessage?[e.validationMessage]:[]})}});let o=(0,c3.useRef)(!1),a=yf(()=>{o.current||t.resetValidation()}),s=yf(e=>{t.displayValidation.isInvalid||t.commitValidation();let n=r?.current?.form;!e.defaultPrevented&&r&&n&&function(e){for(let t=0;t<e.elements.length;t++){let r=e.elements[t];if(r.validity?.valid===!1)return r}return null}(n)===r.current&&(i?i():r.current?.focus(),mV="keyboard",mq("keyboard",null));e.preventDefault()}),l=yf(()=>{t.commitValidation()});(0,c3.useEffect)(()=>{let e=r?.current;if(!e)return;let t=e.form,n=t?.reset;return t&&(t.reset=()=>{o.current=!window.event||"message"===window.event.type&&mh(window.event)instanceof MessagePort,n?.call(t),o.current=!1}),e.addEventListener("invalid",s),e.addEventListener("change",l),t?.addEventListener("reset",a),()=>{e.removeEventListener("invalid",s),e.removeEventListener("change",l),t?.removeEventListener("reset",a),t&&(t.reset=n)}},[r,n])}v5={"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:"Startdatum",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 _r=new WeakMap,_n="__reactAriaDateFieldRole",_i="__reactAriaDateFieldFocusManager";function _o(e,t,r){var n;let i,{isInvalid:o,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=v7({...e,labelElementType:"span",isInvalid:o,errorMessage:e.errorMessage||a}),f=(0,c3.useRef)(null),{focusWithinProps:p}=yP({...e,onFocusWithin(r){f.current=t.value,e.onFocus?.(r)},onBlurWithin:r=>{t.confirmPlaceholder(),t.value!==f.current&&t.commitValidation(),e.onBlur?.(r)},onFocusWithinChange:e.onFocusChange}),h=gp((n=v5)&&n.__esModule?n.default:n,"@react-aria/datepicker"),m="hour"===t.maxGranularity?"selectedTimeDescription":"selectedDateDescription",y="hour"===t.maxGranularity?"time":"date",g=bj(t.value?h.format(m,{[y]:t.formatValue({month:"long"})}):""),b="presentation"===e[_n]?u["aria-describedby"]:[g["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,v=e[_i],w=(0,c3.useMemo)(()=>v||v1(r),[v,r]),x=v8(t,r,"presentation"===e[_n]);_r.set(t,{ariaLabel:e["aria-label"],ariaLabelledBy:[l.id,e["aria-labelledby"]].filter(Boolean).join(" ")||void 0,ariaDescribedBy:b,focusManager:w});let E=(0,c3.useRef)(e.autoFocus);i="presentation"===e[_n]?{role:"presentation"}:h0(u,{role:"group","aria-disabled":e.isDisabled||void 0,"aria-describedby":b}),(0,c3.useEffect)(()=>{E.current&&w.focusFirst(),E.current=!1},[w]),_e(e.inputRef,t.defaultValue,t.setValue),_t({...e,focus(){w.focusFirst()}},t,e.inputRef);let S={type:"hidden",name:e.name,form:e.form,value:t.value?.toString()||"",disabled:e.isDisabled};"native"===e.validationBehavior&&(S.type="text",S.hidden=!0,S.required=e.isRequired,S.onChange=()=>{});let D=ml(e);return{labelProps:{...l,onClick:()=>{w.focusFirst()}},fieldProps:h0(D,i,x,p,{onKeyDown(t){e.onKeyDown&&e.onKeyDown(t)},onKeyUp(t){e.onKeyUp&&e.onKeyUp(t)},style:{unicodeBidi:"isolate"}}),inputProps:S,descriptionProps:c,errorMessageProps:d,isInvalid:o,validationErrors:a,validationDetails:s}}var _a={};_a={"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 Startdatum 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{D6C4}\u{C5EC}\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 _s={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},_l={..._s,customError:!0,valid:!1},_u={isInvalid:!1,validationDetails:_s,validationErrors:[]},_c=(0,c3.createContext)({}),_d="__reactAriaFormValidationState";function _f(e){if(e[_d]){let{realtimeValidation:t,displayValidation:r,updateValidation:n,resetValidation:i,commitValidation:o}=e[_d];return{realtimeValidation:t,displayValidation:r,updateValidation:n,resetValidation:i,commitValidation:o}}return function(e){let{isInvalid:t,validationState:r,name:n,value:i,builtinValidation:o,validate:a,validationBehavior:s="aria"}=e;r&&(t||="invalid"===r);let l=void 0!==t?{isInvalid:t,validationErrors:[],validationDetails:_l}:null,u=(0,c3.useMemo)(()=>a&&null!=i?_h(function(e,t){if("function"==typeof e){let r=e(t);if(r&&"boolean"!=typeof r)return _p(r)}return[]}(a,i)):null,[a,i]);o?.validationDetails.valid&&(o=void 0);let c=(0,c3.useContext)(_c),d=(0,c3.useMemo)(()=>n?Array.isArray(n)?n.flatMap(e=>_p(c[e])):_p(c[n]):[],[c,n]),[f,p]=(0,c3.useState)(c),[h,m]=(0,c3.useState)(!1);c!==f&&(p(c),m(!1));let y=(0,c3.useMemo)(()=>_h(h?[]:d),[h,d]),g=(0,c3.useRef)(_u),[b,v]=(0,c3.useState)(_u),w=(0,c3.useRef)(_u),[x,E]=(0,c3.useState)(!1);return(0,c3.useEffect)(()=>{if(!x)return;E(!1);let e=u||o||g.current;_m(e,w.current)||(w.current=e,v(e))}),{realtimeValidation:l||y||u||o||_u,displayValidation:"native"===s?l||y||b:l||y||u||o||b,updateValidation(e){"aria"!==s||_m(b,e)?g.current=e:v(e)},resetValidation(){_m(_u,w.current)||(w.current=_u,v(_u)),"native"===s&&E(!1),m(!0)},commitValidation(){"native"===s&&E(!0),m(!0)}}}(e)}function _p(e){return e?Array.isArray(e)?e:[e]:[]}function _h(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:_l}:null}function _m(e,t){return e===t||!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,r)=>e===t.validationErrors[r])&&Object.entries(e.validationDetails).every(([e,r])=>t.validationDetails[e]===r)}function _y(...e){let t=new Set,r=!1,n={..._s};for(let i of e){for(let e of i.validationErrors)t.add(e);for(let e in r||=i.isInvalid,n)n[e]||=i.validationDetails[e]}return n.valid=!r,{isInvalid:r,validationErrors:[...t],validationDetails:n}}let _g=new gs((ei=_a)&&ei.__esModule?ei.default:ei);function _b(){let e="u">typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return e}function _v(e,t,r,n,i){let o=null!=e&&null!=r&&e.compare(r)>0,a=null!=e&&null!=t&&0>e.compare(t),s=null!=e&&n?.(e)||!1,l=o||a||s,u=[];if(l){let e=_b(),n=new gc(e,gs.getGlobalDictionaryForPackage("@react-stately/datepicker")||_g),l=new y9(e,_x({},i)),c=l.resolvedOptions().timeZone;a&&null!=t&&u.push(n.format("rangeUnderflow",{minValue:l.format(t.toDate(c))})),o&&null!=r&&u.push(n.format("rangeOverflow",{maxValue:l.format(r.toDate(c))})),s&&u.push(n.format("unavailableDate"))}return{isInvalid:l,validationErrors:u,validationDetails:{badInput:s,customError:!1,patternMismatch:!1,rangeOverflow:o,rangeUnderflow:a,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!l}}}let __={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit"},_w={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};function _x(e,t){e={...t.shouldForceLeadingZeros?_w:__,...e};let r=t.granularity||"minute",n=Object.keys(e),i=n.indexOf(t.maxGranularity??"year");i<0&&(i=0);let o=n.indexOf(r);if(o<0&&(o=2),i>o)throw Error("maxGranularity must be greater than granularity");let a=n.slice(i,o+1).reduce((t,r)=>(t[r]=e[r],t),{});return null!=t.hourCycle&&(a.hour12=12===t.hourCycle),a.timeZone=t.timeZone||"UTC",("hour"===r||"minute"===r||"second"===r)&&t.timeZone&&!t.hideTimeZone&&(a.timeZoneName="short"),t.showEra&&0===i&&(a.era="short"),a}function _E(e){return e&&"hour"in e?e:new gU}function _S(e,t){return null===e?null:e?g1(e,t):void 0}function _D(e,t){let r=e&&"timeZone"in e?e.timeZone:void 0,n=e&&"minute"in e?"minute":"day";if(e&&t&&!(t in e))throw Error("Invalid granularity "+t+" for value "+e.toString());let[i,o]=(0,c3.useState)([n,r]);return e&&(i[0]!==n||i[1]!==r)&&o([n,r]),t||(t=e?n:i[0]),[t,e?r:i[1]]}let _O=new gs({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"},is:{year:"\xe1\xe1\xe1\xe1",month:"mm",day:"dd"},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"},nb:{year:"\xe5\xe5\xe5\xe5",month:"mm",day:"dd"},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");class _P{constructor(e,t,r){if(this.era=r?.era??null,this.calendar=e,this.year=r?.year??null,this.month=r?.month??null,this.day=r?.day??null,this.hour=r?.hour??null,this.hourCycle=t,this.dayPeriod=null,this.minute=r?.minute??null,this.second=r?.second??null,this.millisecond=r?.millisecond??null,this.offset="offset"in(r??{})?r.offset:null,null!=this.hour){let[e,r]=_k(this.hour,t);this.dayPeriod=e,this.hour=r}}copy(){let e=new _P(this.calendar,this.hourCycle);return e.era=this.era,e.year=this.year,e.month=this.month,e.day=this.day,e.hour=this.hour,e.dayPeriod=this.dayPeriod,e.minute=this.minute,e.second=this.second,e.millisecond=this.millisecond,e.offset=this.offset,e}isComplete(e){return e.every(e=>null!=this[e])}validate(e,t){return t.every(t=>{if(("hour"===t||"dayPeriod"===t)&&"hour"in e){let[t,r]=_k(e.hour,this.hourCycle);return this.dayPeriod===t&&this.hour===r}return this[t]===e[t]})}isCleared(e){return e.every(e=>null===this[e])}set(e,t,r){let n=this.copy();return n[e]=t,"hour"===e&&null==n.dayPeriod&&"hour"in r&&(n.dayPeriod=_k(r.hour,this.hourCycle)[0]),"year"===e&&null==n.era&&(n.era=r.era),"second"!==e&&"literal"!==e&&"timeZoneName"!==e&&(n.offset=null),n}clear(e){let t=this.copy();return t[e]=null,"year"===e&&(t.era=null),t.offset=null,t}cycle(e,t,r,n){let i=this.copy();if(null==i[e]&&"dayPeriod"!==e&&"era"!==e){if("hour"===e&&"hour"in r){let[e,t]=_k(r.hour,this.hourCycle);i.dayPeriod=e,i.hour=t}else i[e]=r[e];return"year"===e&&null==i.era&&(i.era=r.era),i}switch(e){case"era":{let e=this.calendar.getEras(),r=e.indexOf(i.era);r=_C(r,t,0,e.length-1),i.era=e[r];break}case"year":{let n=new gV(this.calendar,this.era??r.era,this.year??r.year,this.month??1,this.day??1);i.era=(n=n.cycle(e,t,{round:"year"===e})).era,i.year=n.year;break}case"month":i.month=_C(i.month??1,t,1,this.calendar.getMaximumMonthsInYear());break;case"day":i.day=_C(i.day??1,t,1,this.calendar.getMaximumDaysInMonth());break;case"hour":{let e=n.some(e=>["year","month","day"].includes(e));if("timeZone"in r&&(!e||null!=i.year&&null!=i.month&&null!=i.day)){let e=this.toValue(r),[n,o]=_k((e=e.cycle("hour",t,{hourCycle:"h12"===this.hourCycle?12:24,round:!1})).hour,this.hourCycle);i.hour=o,i.dayPeriod=n,i.offset=e.offset}else{let e=i.hour??0,n=this.getSegmentLimits("hour");i.hour=_C(e,t,n.minValue,n.maxValue),null==i.dayPeriod&&"hour"in r&&(i.dayPeriod=_k(r.hour,this.hourCycle)[0])}break}case"dayPeriod":i.dayPeriod=_C(i.dayPeriod??0,t,0,1);break;case"minute":i.minute=_C(i.minute??0,t,0,59,!0);break;case"second":i.second=_C(i.second??0,t,0,59,!0)}return i}toValue(e){if(!("hour"in e))return e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day});{let t=this.hour;null!=t?t=function(e,t,r){switch(r){case"h11":1===t&&(e+=12);break;case"h12":12===e&&(e=0),1===t&&(e+=12);break;case"h24":e-=1}return e}(t,this.dayPeriod??0,this.hourCycle):("h12"===this.hourCycle||"h11"===this.hourCycle)&&(t=12*(1===this.dayPeriod));let r=e.set({era:this.era??e.era,year:this.year??e.year,month:this.month??e.month,day:this.day??e.day,hour:t??e.hour,minute:this.minute??e.minute,second:this.second??e.second,millisecond:this.millisecond??e.millisecond});return"offset"in r&&null!=this.offset&&r.offset!==this.offset&&(r=r.add({milliseconds:r.offset-this.offset})),r}}getSegmentLimits(e){switch(e){case"era":{let e=this.calendar.getEras();return{value:null!=this.era?e.indexOf(this.era):e.length-1,minValue:0,maxValue:e.length-1}}case"year":return{value:this.year,minValue:1,maxValue:9999};case"month":return{value:this.month,minValue:1,maxValue:this.calendar.getMaximumMonthsInYear()};case"day":return{value:this.day,minValue:1,maxValue:this.calendar.getMaximumDaysInMonth()};case"dayPeriod":return{value:this.dayPeriod,minValue:0,maxValue:1};case"hour":{let e=0,t=23;return"h12"===this.hourCycle?(e=1,t=12):"h11"===this.hourCycle&&(e=0,t=11),{value:this.hour,minValue:e,maxValue:t}}case"minute":return{value:this.minute,minValue:0,maxValue:59};case"second":return{value:this.second,minValue:0,maxValue:59}}}}function _C(e,t,r,n,i=!1){if(i){(e+=Math.sign(t))<r&&(e=n);let i=Math.abs(t);(e=t>0?Math.ceil(e/i)*i:Math.floor(e/i)*i)>n&&(e=r)}else(e+=t)<r?e=n-(r-e-1):e>n&&(e=r+(e-n-1));return e}function _k(e,t){let r=+(e>=12);switch(t){case"h11":e>=12&&(e-=12);break;case"h12":0===e?e=12:e>12&&(e-=12);break;case"h23":r=null;break;case"h24":e+=1,r=null}return[r,e]}var _j=r(59381);let _T={year:!0,month:!0,day:!0,hour:!0,minute:!0,second:!0,dayPeriod:!0,era:!0},_R={year:5,month:2,day:7,hour:2,minute:15,second:15},_A={dayperiod:"dayPeriod",relatedYear:"year",yearName:"literal",unknown:"literal"};function _M(e){let{locale:t,createCalendar:r,hideTimeZone:n,isDisabled:i=!1,isReadOnly:o=!1,isRequired:a=!1,minValue:s,maxValue:l,isDateUnavailable:u}=e,c=e.value||e.defaultValue||e.placeholderValue||null,[d,f]=_D(c,e.granularity),p=f||"UTC";if(c&&!(d in c))throw Error("Invalid granularity "+d+" for value "+c.toString());let[h,m]=(0,c3.useMemo)(()=>{let n=new y9(t,{dateStyle:"short",timeStyle:"short",hour12:null!=e.hourCycle?12===e.hourCycle:void 0}).resolvedOptions();return[r(n.calendar),n.hourCycle]},[t,e.hourCycle,r]),[y,g]=vg(e.value,e.defaultValue??null,e.onChange),[b]=(0,c3.useState)(y),v=(0,c3.useMemo)(()=>_S(y,h)??null,[y,h]),[w,x]=(0,c3.useState)(()=>new _P(h,m,v)),E="gregory"===h.identifier&&"BC"===w.era,S=(0,c3.useMemo)(()=>({granularity:d,maxGranularity:e.maxGranularity??"year",timeZone:f,hideTimeZone:n,hourCycle:e.hourCycle,showEra:E,shouldForceLeadingZeros:e.shouldForceLeadingZeros}),[e.maxGranularity,d,e.hourCycle,e.shouldForceLeadingZeros,f,n,E]),D=(0,c3.useMemo)(()=>_x({},S),[S]),O=(0,c3.useMemo)(()=>new y9(t,D),[t,D]),P=(0,c3.useMemo)(()=>O.resolvedOptions(),[O]),C=(0,c3.useMemo)(()=>(function(e,t,r,n){if(e)return _S(e,r);let i=g1(g9(n??bn()).set({hour:0,minute:0,second:0,millisecond:0}),r);return"year"===t||"month"===t||"day"===t?gX(i):n?i:g0(i)})(e.placeholderValue,d,h,f),[e.placeholderValue,d,h,f]),k=(0,c3.useMemo)(()=>{let t="h11"===m||"h12"===m,r=["era","year","month","day","hour",...t?["dayPeriod"]:[],"minute","second"],n=r.indexOf(e.maxGranularity||"era"),i=r.indexOf("hour"===d&&t?"dayPeriod":d);return r.slice(n,i+1)},[e.maxGranularity,d,m]),[j,T]=(0,c3.useState)(v),[R,A]=(0,c3.useState)(h),[M,N]=(0,c3.useState)(m);v===j&&m===M&&g6(h,R)||(w=new _P(h,m,v),T(v),A(h),N(m),x(w));let I=t=>{if(!e.isDisabled&&!e.isReadOnly)if(null==t||t instanceof _P&&t.isCleared(k))x(new _P(h,m,v)),g(null);else if(t instanceof _P){if(t.isComplete(k)){let e=t.toValue(v??C);if(t.validate(e,k)){let t=g1(e,c?.calendar||new g_);if(!y||0!==t.compare(y)){x(new _P(h,m,v)),g(t);return}}}x(t)}else t=g1(t,c?.calendar||new g_),x(new _P(h,m,v)),g(t)},$=(0,c3.useMemo)(()=>w.toValue(v??C).toDate(p),[w,p,v,C]),L=(0,c3.useMemo)(()=>(function(e,t,r,n,i,o,a){let s=["hour","minute","second"],l=r.formatToParts(e),u=new(0,_j.K)(o,{useGrouping:!1}),c=new(0,_j.K)(o,{useGrouping:!1,minimumIntegerDigits:2});for(let e of l)if("year"===e.type||"month"===e.type||"day"===e.type||"hour"===e.type){let r=t[e.type]??0;"2-digit"===n[e.type]?e.value=c.format(r):e.value=u.format(r)}let d=[];for(let e of l){var f;let r=_A[e.type]||e.type,n=_T[r];"era"===r&&1===i.getEras().length&&(n=!1);let l=_T[r]&&null==t[e.type],u=_T[r]?(f=e.value,"era"===r||"dayPeriod"===r?f:"year"===r||"month"===r||"day"===r?_O.getStringForLocale(r,o):"––"):null,c={type:r,text:l?u:e.value,...t.getSegmentLimits(r),isPlaceholder:l,placeholder:u,isEditable:n};"hour"===r?(d.push({type:"literal",text:"⁦",isPlaceholder:!1,placeholder:"",isEditable:!1}),d.push(c),r===a&&d.push({type:"literal",text:"⁩",isPlaceholder:!1,placeholder:"",isEditable:!1})):s.includes(r)&&r===a?(d.push(c),d.push({type:"literal",text:"⁩",isPlaceholder:!1,placeholder:"",isEditable:!1})):d.push(c)}return d})($,w,O,P,h,t,d),[$,O,P,w,h,t,d]),F=(e,t)=>{I(w.cycle(e,t,C,k))},B=(0,c3.useMemo)(()=>_v(y,s,l,u,S),[y,s,l,u,S]),V=_f({...e,value:y,builtinValidation:B}),U=V.displayValidation.isInvalid,W=e.validationState||(U?"invalid":null);return{...V,value:v,defaultValue:e.defaultValue??b,dateValue:$,calendar:h,setValue:I,segments:L,dateFormatter:O,validationState:W,isInvalid:U,granularity:d,maxGranularity:e.maxGranularity??"year",isDisabled:i,isReadOnly:o,isRequired:a,increment(e){F(e,1)},decrement(e){F(e,-1)},incrementPage(e){F(e,_R[e]||1)},decrementPage(e){F(e,-(_R[e]||1))},incrementToMax(e){let t="hour"===e&&"h12"===m?11:w.getSegmentLimits(e).maxValue;I(w.set(e,t,C))},decrementToMin(e){let t="hour"===e&&"h12"===m?12:w.getSegmentLimits(e).minValue;I(w.set(e,t,C))},setSegment(e,t){I(w.set(e,t,C))},confirmPlaceholder(){if(!e.isDisabled&&!e.isReadOnly&&w.isComplete(k)){let e=g1(w.toValue(v??C),c?.calendar||new g_);y&&0===e.compare(y)||g(e),x(new _P(h,m,v))}},clearSegment(e){let t=w;"timeZoneName"!==e&&"literal"!==e&&(t=w.clear(e)),I(t)},formatValue:e=>v?new y9(t,_x(e,S)).format($):"",getDateFormatter:(e,t)=>new y9(e,_x({},{...S,...t}))}}let _N=(0,c3.createContext)(null),_I=(0,c3.createContext)(null),_$=(0,c3.createContext)(null),_L=(0,c3.forwardRef)(function(e,t){let r=(0,c3.useContext)(_I),n=(0,c3.useContext)(_$);return r||n?c4().createElement(_B,{...e,ref:t}):c4().createElement(_F,{...e,ref:t})}),_F=(0,c3.forwardRef)((e,t)=>{let[r,n]=h6({slot:e.slot},t,_N),{locale:i}=y1(),o=_M({...r,locale:i,createCalendar:vl}),a=(0,c3.useRef)(null),{fieldProps:s,inputProps:l}=_o({...r,inputRef:a},o,n);return c4().createElement(h3,{values:[[_I,o],[v$,{...l,ref:a}],[vN,{...s,ref:n,isInvalid:o.isInvalid}]]},c4().createElement(_B,e))}),_B=(0,c3.forwardRef)((e,t)=>{let{className:r,children:n}=e,i=(0,c3.useContext)(_I),o=(0,c3.useContext)(_$),a=null!=i?i:o;return c4().createElement(c4().Fragment,null,c4().createElement(vI,{...e,ref:t,slot:e.slot||void 0,className:null!=r?r:"react-aria-DateInput",isInvalid:a.isInvalid},a.segments.map((e,t)=>(0,c3.cloneElement)(n(e),{key:t}))),c4().createElement(vL,null))});function _V({children:e}){let t=(0,c3.useMemo)(()=>({register:()=>{}}),[]);return c4().createElement(yc.Provider,{value:t},e)}c4().forwardRef(({children:e,...t},r)=>{let n=(0,c3.useRef)(!1),i=(0,c3.useContext)(yc),o=h0(i||{},{...t,register(){n.current=!0,i&&i.register()}});return o.ref=hN(r||i?.ref),ye(i,o.ref),(0,c3.useEffect)(()=>{n.current||(n.current=!0)},[]),c4().createElement(yc.Provider,{value:o},e)});let _U=(0,c3.createContext)({}),_W=c4().createContext(null);function _K(e){let t=hG(),{portalContainer:r=t?null:document.body,isExiting:n}=e,[i,o]=(0,c3.useState)(!1),a=(0,c3.useMemo)(()=>({contain:i,setContain:o}),[i,o]),{getContainer:s}=(0,c3.useContext)(_U)??{};if(!e.portalContainer&&s&&(r=s()),!r)return null;let l=e.children;return e.disableFocusManagement||(l=c4().createElement(vW,{restoreFocus:!0,contain:(e.shouldContainFocus||i)&&!n},l)),l=c4().createElement(_W.Provider,{value:a},c4().createElement(_V,null,l)),ym().createPortal(l,r)}let _H=(0,c3.createContext)(null),_z=(0,c3.createContext)(null),_q=(0,c3.forwardRef)(function(e,t){let r=e["aria-labelledby"];[e,t]=h6(e,t,_H);let{dialogProps:n,titleProps:i}=function(e,t){let r,n,{role:i="dialog"}=e,o=hQ();o=e["aria-label"]?void 0:o;let a=(0,c3.useRef)(!1);return(0,c3.useEffect)(()=>{if(t.current&&!mm(t.current)){m8(t.current);let e=setTimeout(()=>{(((e=document)=>e.activeElement)()===t.current||((e=document)=>e.activeElement)()===document.body)&&(a.current=!0,t.current&&(t.current.blur(),m8(t.current)),a.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),r=(0,c3.useContext)(_W),hF(()=>{n?.(!0)},[n=r?.setContain]),(0,c3.useRef)(!1),(0,c3.useEffect)(()=>{}),{dialogProps:{...ml(e,{labelable:!0}),role:i,tabIndex:-1,"aria-labelledby":e["aria-labelledby"]||o,onBlur:e=>{a.current&&e.stopPropagation()}},titleProps:{id:o}}}({...e,"aria-labelledby":r},t),o=(0,c3.useContext)(_z);n["aria-label"]||n["aria-labelledby"]||(e["aria-labelledby"]?n["aria-labelledby"]=e["aria-labelledby"]:console.warn('If a Dialog does not contain a <Heading slot="title">, it must have an aria-label or aria-labelledby attribute for accessibility.'));let a=h4({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(null==o?void 0:o.close)||(()=>{})}});return c4().createElement("section",{...ml(e),...n,...a,ref:t,slot:e.slot||void 0},c4().createElement(h3,{values:[[yF,{slots:{[h1]:{},title:{...i,level:2}}}],[y$,{slots:{[h1]:{},close:{onPress:()=>null==o?void 0:o.close()}}}]]},a.children))}),_G=(0,c3.createContext)(null),_Z=(0,c3.forwardRef)(function(e,t){let r=(0,c3.useContext)(_G);return(null==r?void 0:r.isInvalid)?c4().createElement(_Y,{...e,ref:t}):null}),_Y=(0,c3.forwardRef)((e,t)=>{let r=(0,c3.useContext)(_G),n=ml(e),i=h4({...e,defaultClassName:"react-aria-FieldError",defaultChildren:0===r.validationErrors.length?void 0:r.validationErrors.join(" "),values:r});return null==i.children?null:c4().createElement(yV,{slot:"errorMessage",...n,...i,ref:t})}),_J=(0,c3.createContext)(null),_Q=(0,c3.createContext)({}),_X=yN(function(e,t){[e,t]=h6(e,t,_Q);let{elementType:r="label",...n}=e;return c4().createElement(r,{className:"react-aria-Label",...n,ref:t})}),_0=(0,c3.createContext)({placement:"bottom"}),_1="u">typeof HTMLElement&&"inert"in HTMLElement.prototype,_3=new WeakMap,_4=[];function _2(e,t=-1/0,r=1/0){return Math.min(Math.max(e,t),r)}function _6(e,t){let r=e,n=0,i=t.toString(),o=i.toLowerCase().indexOf("e-");if(o>0)n=Math.abs(Math.floor(Math.log10(Math.abs(t))))+o;else{let e=i.indexOf(".");e>=0&&(n=i.length-e)}if(n>0){let e=Math.pow(10,n);r=Math.round(r*e)/e}return r}function _5(e,t,r,n){t=Number(t),r=Number(r);let i=(e-(isNaN(t)?0:t))%n,o=_6(2*Math.abs(i)>=n?e+Math.sign(i)*(n-Math.abs(i)):e-i,n);return isNaN(t)?!isNaN(r)&&o>r&&(o=Math.floor(_6(r/n,n))*n):o<t?o=t:!isNaN(r)&&o>r&&(o=t+Math.floor(_6((r-t)/n,n))*n),o=_6(o,n)}let _8={top:"top",bottom:"top",left:"left",right:"left"},_9={top:"bottom",bottom:"top",left:"right",right:"left"},_7={top:"left",left:"top"},we={top:"height",left:"width"},wt={width:"totalWidth",height:"totalHeight"},wr={};function wn(e,t){let r=0,n=0,i=0,o=0,a=0,s=0,l={},u=(t?.scale??1)>1;if("BODY"===e.tagName||"HTML"===e.tagName){let u=document.documentElement;i=u.clientWidth,o=u.clientHeight,r=t?.width??i,n=t?.height??o,l.top=u.scrollTop||e.scrollTop,l.left=u.scrollLeft||e.scrollLeft,t&&(a=t.offsetTop,s=t.offsetLeft)}else({width:r,height:n,top:a,left:s}=wu(e,!1)),l.top=e.scrollTop,l.left=e.scrollLeft,i=r,o=n;return mN()&&("BODY"===e.tagName||"HTML"===e.tagName)&&u&&(l.top=0,l.left=0,a=t?.pageTop??0,s=t?.pageLeft??0),{width:r,height:n,totalWidth:i,totalHeight:o,scroll:l,top:a,left:s}}function wi(e,t,r,n,i,o,a){let s=i.scroll[e]??0,l=n[we[e]],u=a[e]+n.scroll[_8[e]]+o,c=a[e]+n.scroll[_8[e]]+l-o,d=t-s+n.scroll[_8[e]]+a[e]-n[_8[e]],f=t-s+r+n.scroll[_8[e]]+a[e]-n[_8[e]];return d<u?u-d:f>c?Math.max(c-f,u-d):0}function wo(e){if(wr[e])return wr[e];let[t,r]=e.split(" "),n=_8[t]||"right",i=_7[n];_8[r]||(r="center");let o=we[n],a=we[i];return wr[e]={placement:t,crossPlacement:r,axis:n,crossAxis:i,size:o,crossSize:a},wr[e]}function wa(e,t,r,n,i,o,a,s,l,u,c){let{placement:d,crossPlacement:f,axis:p,crossAxis:h,size:m,crossSize:y}=n,g={};g[h]=e[h]??0,"center"===f?g[h]+=((e[y]??0)-(r[y]??0))/2:f!==h&&(g[h]+=(e[y]??0)-(r[y]??0)),g[h]+=o;let b=e[h]-r[y]+l+u,v=e[h]+e[y]-l-u;if(g[h]=_2(g[h],b,v),d===p){let t=s?c[m]:c[wt[m]];g[_9[p]]=Math.floor(t-e[p]+i)}else g[p]=Math.floor(e[p]+e[m]+i);return g}function ws(e,t,r,n,i,o,a,s){let{placement:l,axis:u,size:c}=o;return l===u?Math.max(0,r[u]-(a.scroll[u]??0)-(e[u]+(s?t[u]:0))-(n[u]??0)-n[_9[u]]-i):Math.max(0,e[c]+e[u]+(s?t[u]:0)-r[u]-r[c]+(a.scroll[u]??0)-(n[u]??0)-n[_9[u]]-i)}function wl(e,t){let{top:r,left:n,width:i,height:o}=e.getBoundingClientRect();return t&&e instanceof e.ownerDocument.defaultView.HTMLElement&&(i=e.offsetWidth,o=e.offsetHeight),{top:r,left:n,width:i,height:o}}function wu(e,t){let{top:r,left:n,width:i,height:o}=wl(e,t),{scrollTop:a,scrollLeft:s,clientTop:l,clientLeft:u}=document.documentElement;return{top:r+a-l,left:n+s-u,width:i,height:o}}function wc(e,t,r){let n,i=window.getComputedStyle(e);if("fixed"===i.position)n=wl(e,r);else{n=wu(e,r);let i=wu(t,r),o=window.getComputedStyle(t);i.top+=(parseInt(o.borderTopWidth,10)||0)-t.scrollTop,i.left+=(parseInt(o.borderLeftWidth,10)||0)-t.scrollLeft,n.top-=i.top,n.left-=i.left}return n.top-=parseInt(i.marginTop,10)||0,n.left-=parseInt(i.marginLeft,10)||0,n}function wd(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 wf=new WeakMap;function wp(e){let{ref:t,box:r,onResize:n}=e,i=yf(n);(0,c3.useEffect)(()=>{let e=t?.current;if(e)if(void 0===window.ResizeObserver)return window.addEventListener("resize",i,!1),()=>{window.removeEventListener("resize",i,!1)};else{let t=new window.ResizeObserver(e=>{e.length&&i()});return t.observe(e,{box:r}),()=>{e&&t.unobserve(e)}}},[t,r])}let wh="u">typeof document?window.visualViewport:null;function wm(e,t){if(e.button>0)return!1;let r=mh(e);if(r){let e=r.ownerDocument;if(!e||!mp(e.documentElement,r)||r.closest("[data-react-aria-top-layer]"))return!1}return!!t.current&&!e.composedPath().includes(t.current)}let wy=[],wg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function wb(e){return e instanceof HTMLInputElement&&!wg.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let wv="u">typeof document&&window.visualViewport,w_=0;function ww(e,t,r){let n=e.style[t];return e.style[t]=r,()=>{e.style[t]=n}}function wx(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function wE(e,t){t||!wv?wS(e):wv.addEventListener("resize",()=>wS(e),{once:!0})}function wS(e){let t=document.scrollingElement||document.documentElement,r=e;for(;r&&r!==t;){let e=bS(r);if(e!==document.documentElement&&e!==document.body&&e!==r){let t=e.getBoundingClientRect(),n=r.getBoundingClientRect();if(n.top<t.top||n.bottom>t.top+r.clientHeight){let r=t.bottom;wv&&(r=Math.min(r,wv.offsetTop+wv.height));let i=n.top-t.top-((r-t.top)/2-n.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+i)),behavior:"smooth"})}}r=e.parentElement}}var wD={};function wO(e){var t;let{onDismiss:r,...n}=e,i=bg(n,gp((t=wD)&&t.__esModule?t.default:t,"@react-aria/overlays").format("dismiss"));return c4().createElement(bw,null,c4().createElement("button",{...i,tabIndex:-1,onClick:()=>{r&&r()},style:{width:1,height:1}}))}function wP(e,t,r){hF(()=>{if(t&&e.current){if(!("getAnimations"in e.current))return void r();let t=e.current.getAnimations();if(0===t.length)return void r();let n=!1;return Promise.allSettled(t.map(e=>e.finished)).then(()=>{n||(0,yh.flushSync)(()=>{r()})}),()=>{n=!0}}},[e,t,r])}wD={"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 wC=null,wk=new Set,wj=new Map,wT=!1,wR=!1;function wA(e,t){for(let r of wk)r(e,t)}function wM(e){wT=!0,e.metaKey||!mT()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(wC="keyboard",wA("keyboard",e))}function wN(e){wC="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(wT=!0,wA("pointer",e))}function wI(e){mF(e)&&(wT=!0,wC="virtual")}function w$(e){e.target!==window&&e.target!==document&&e.isTrusted&&(wT||wR||(wC="virtual",wA("virtual",e)),wT=!1,wR=!1)}function wL(){wT=!1,wR=!0}function wF(e){if("u"<typeof window||wj.get(mf(e)))return;let t=mf(e),r=md(e),n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){wT=!0,n.apply(this,arguments)},r.addEventListener("keydown",wM,!0),r.addEventListener("keyup",wM,!0),r.addEventListener("click",wI,!0),t.addEventListener("focus",w$,!0),t.addEventListener("blur",wL,!1),"u">typeof PointerEvent?(r.addEventListener("pointerdown",wN,!0),r.addEventListener("pointermove",wN,!0),r.addEventListener("pointerup",wN,!0)):(r.addEventListener("mousedown",wN,!0),r.addEventListener("mousemove",wN,!0),r.addEventListener("mouseup",wN,!0)),t.addEventListener("beforeunload",()=>{wB(e)},{once:!0}),wj.set(t,{focus:n})}let wB=(e,t)=>{let r=mf(e),n=md(e);t&&n.removeEventListener("DOMContentLoaded",t),wj.has(r)&&(r.HTMLElement.prototype.focus=wj.get(r).focus,n.removeEventListener("keydown",wM,!0),n.removeEventListener("keyup",wM,!0),n.removeEventListener("click",wI,!0),r.removeEventListener("focus",w$,!0),r.removeEventListener("blur",wL,!1),"u">typeof PointerEvent?(n.removeEventListener("pointerdown",wN,!0),n.removeEventListener("pointermove",wN,!0),n.removeEventListener("pointerup",wN,!0)):(n.removeEventListener("mousedown",wN,!0),n.removeEventListener("mousemove",wN,!0),n.removeEventListener("mouseup",wN,!0)),wj.delete(r))};function wV(e){let[t,r]=vg(e.isOpen,e.defaultOpen||!1,e.onOpenChange),n=(0,c3.useCallback)(()=>{r(!0)},[r]),i=(0,c3.useCallback)(()=>{r(!1)},[r]),o=(0,c3.useCallback)(()=>{r(!t)},[r,t]);return{isOpen:t,setOpen:r,open:n,close:i,toggle:o}}"u">typeof document&&("loading"!==(m=md(void 0)).readyState?wF(void 0):m.addEventListener("DOMContentLoaded",()=>{wF(void 0)}));let wU=(0,c3.createContext)(null),wW=(0,c3.createContext)(null),wK=(0,c3.forwardRef)(function(e,t){[e,t]=h6(e,t,wU);let r=(0,c3.useContext)(_z),n=wV(e),i=null==e.isOpen&&null==e.defaultOpen&&r?r:n,o=function(e,t){let[r,n]=(0,c3.useState)(t?"open":"closed");switch(r){case"open":t||n("exiting");break;case"closed":case"exiting":t&&n("open")}let i="exiting"===r;return wP(e,i,(0,c3.useCallback)(()=>{n(e=>"exiting"===e?"closed":e)},[])),i}(t,i.isOpen)||e.isExiting||!1,a=(0,c3.useContext)(yM),{direction:s}=y1();if(a){let t=e.children;return"function"==typeof t&&(t=t({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),c4().createElement(c4().Fragment,null,t)}return!i||i.isOpen||o?c4().createElement(wH,{...e,triggerRef:e.triggerRef,state:i,popoverRef:t,isExiting:o,dir:s}):null});function wH({state:e,isExiting:t,UNSTABLE_portalContainer:r,...n}){var i,o;let a=(0,c3.useRef)(null),[s,l]=(0,c3.useState)(0),u=(0,c3.useRef)(null),c=(0,c3.useContext)(wW),f=c&&"SubmenuTrigger"===n.trigger;hF(()=>{a.current&&e.isOpen&&l(a.current.getBoundingClientRect().width)},[e.isOpen,a]);let{popoverProps:p,underlayProps:h,arrowProps:m,placement:y}=function(e,t){let{triggerRef:r,popoverRef:n,groupRef:i,isNonModal:o,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:s,...l}=e,u="SubmenuTrigger"===l.trigger,{overlayProps:c,underlayProps:f}=function(e,t){let{onClose:r,shouldCloseOnBlur:n,isOpen:i,isDismissable:o=!1,isKeyboardDismissDisabled:a=!1,shouldCloseOnInteractOutside:s}=e,l=(0,c3.useRef)(void 0);(0,c3.useEffect)(()=>{if(i&&!wy.includes(t))return wy.push(t),()=>{let e=wy.indexOf(t);e>=0&&wy.splice(e,1)}},[i,t]);let u=()=>{wy[wy.length-1]===t&&r&&r()};!function(e){let{ref:t,onInteractOutside:r,isDisabled:n,onInteractOutsideStart:i}=e,o=(0,c3.useRef)({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=yf(e=>{r&&wm(e,t)&&(i&&i(e),o.current.isPointerDown=!0)}),s=yf(e=>{r&&r(e)});(0,c3.useEffect)(()=>{let e=o.current;if(n)return;let r=md(t.current);if("u">typeof PointerEvent){let n=r=>{e.isPointerDown&&wm(r,t)&&s(r),e.isPointerDown=!1};return r.addEventListener("pointerdown",a,!0),r.addEventListener("click",n,!0),()=>{r.removeEventListener("pointerdown",a,!0),r.removeEventListener("click",n,!0)}}},[t,n])}({ref:t,onInteractOutside:o&&i?e=>{(!s||s(mh(e)))&&(wy[wy.length-1]===t&&e.stopPropagation(),l.current===t&&u()),l.current=void 0}:void 0,onInteractOutsideStart:e=>{let r=wy[wy.length-1];l.current=r,(!s||s(mh(e)))&&r===t&&e.stopPropagation()}});let{focusWithinProps:c}=yP({isDisabled:!n,onBlurWithin:e=>{!(!e.relatedTarget||vq(e.relatedTarget,vU))&&(!s||s(e.relatedTarget))&&r?.()}});return{overlayProps:{onKeyDown:e=>{"Escape"!==e.key||a||e.nativeEvent.isComposing||(e.stopPropagation(),e.preventDefault(),u())},...c},underlayProps:{}}}({isOpen:t.isOpen,onClose:t.close,shouldCloseOnBlur:!0,isDismissable:!o||u,isKeyboardDismissDisabled:a,shouldCloseOnInteractOutside:s},i??n),{overlayProps:p,arrowProps:h,placement:m,triggerAnchorPoint:y}=function(e){var t;let{direction:r}=y1(),{arrowSize:n,targetRef:i,overlayRef:o,arrowRef:a,scrollRef:s=o,placement:l="bottom",containerPadding:u=12,shouldFlip:c=!0,boundaryElement:d="u">typeof document?document.body:null,offset:f=0,crossOffset:p=0,shouldUpdatePosition:h=!0,isOpen:m=!0,onClose:y,maxHeight:g,arrowBoundaryOffset:b=0}=e,[v,w]=(0,c3.useState)(null),x=[h,l,o.current,i.current,a?.current,s.current,u,c,d,f,p,m,r,g,b,n],E=(0,c3.useRef)(wh?.scale);(0,c3.useEffect)(()=>{m&&(E.current=wh?.scale)},[m]);let S=(0,c3.useCallback)(()=>{var e;if(!1===h||!m||!o.current||!i.current||!d||wh?.scale!==E.current)return;let t=null;if(s.current&&mm(s.current)){let e=((e=document)=>e.activeElement)()?.getBoundingClientRect(),r=s.current.getBoundingClientRect();(t={type:"top",offset:(e?.top??0)-r.top}).offset>r.height/2&&(t.type="bottom",t.offset=(e?.bottom??0)-r.bottom)}let y=o.current;!g&&o.current&&(y.style.top="0px",y.style.bottom="",y.style.maxHeight=(window.visualViewport?.height??window.innerHeight)+"px");let v=function(e){let t,r,{placement:n,targetNode:i,overlayNode:o,scrollNode:a,padding:s,shouldFlip:l,boundaryElement:u,offset:c,crossOffset:d,maxHeight:f,arrowSize:p=0,arrowBoundaryOffset:h=0}=e,m="u">typeof document?window.visualViewport:null,y=o instanceof HTMLElement?function(e){let t=e.offsetParent;if(t&&t===document.body&&"static"===window.getComputedStyle(t).position&&!wd(t)&&(t=document.documentElement),null==t)for(t=e.parentElement;t&&!wd(t);)t=t.parentElement;return t||document.documentElement}(o):document.documentElement,g=y===document.documentElement,b=window.getComputedStyle(y).position,v=g?wu(i,!1):wc(i,y,!1);if(!g){let{marginTop:e,marginLeft:t}=window.getComputedStyle(i);v.top+=parseInt(e,10)||0,v.left+=parseInt(t,10)||0}let w=wu(o,!0),x={top:parseInt((t=window.getComputedStyle(o)).marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0};w.width+=(x.left??0)+(x.right??0),w.height+=(x.top??0)+(x.bottom??0),a.scrollTop,a.scrollLeft,a.scrollWidth,a.scrollHeight;let E=wn(u,m),S=wn(y,m);if("BODY"!==u.tagName&&"HTML"!==u.tagName||g)r=("BODY"===u.tagName||"HTML"===u.tagName)&&g?{top:0,left:0,width:0,height:0}:wc(u,y,!1);else{let e=wl(y,!1);r={top:-(e.top-E.top),left:-(e.left-E.left),width:0,height:0}}return function(e,t,r,n,i,o,a,s,l,u,c,d,f,p,h,m,y){var g,b,v;let w,x,E,S=wo(e),{size:D,crossAxis:O,crossSize:P,placement:C,crossPlacement:k}=S,j=wa(t,a,r,S,u,c,l,d,p,h,s),T=u,R=ws(a,l,t,n,i+u,S,s,m);if(o&&r[D]>R){let e=wo(`${_9[C]} ${k}`),o=wa(t,a,r,e,u,c,l,d,p,h,s);ws(a,l,t,n,i+u,e,s,m)>R&&(S=e,j=o,T=u)}let A="bottom";"top"===S.axis?"top"===S.placement?A="top":"bottom"===S.placement&&(A="bottom"):"top"===S.crossAxis&&("top"===S.crossPlacement?A="bottom":"bottom"===S.crossPlacement&&(A="top"));let M=wi(O,j[O],r[P],a,s,i,l);j[O]+=M;let N=(g=j,b=r.height,v=A,w=(null!=g.top?g.top:s[wt.height]-(g.bottom??0)-b)-(s.scroll.top??0),x=m?l.top:0,E={top:Math.max(a.top+x,(y?.offsetTop??a.top)+x),bottom:Math.min(a.top+a.height+x,(y?.offsetTop??0)+(y?.height??0))},"top"!==v?Math.max(0,E.bottom-w-((n.top??0)+(n.bottom??0)+i)):Math.max(0,w+b-E.top-((n.top??0)+(n.bottom??0)+i)));f&&f<N&&(N=f),r.height=Math.min(r.height,N),M=wi(O,(j=wa(t,a,r,S,T,c,l,d,p,h,s))[O],r[P],a,s,i,l),j[O]+=M;let I={},$=t[O]-j[O]-n[_8[O]],L=$+.5*t[P],F=p/2+h,B="left"===_8[O]?(n.left??0)+(n.right??0):(n.top??0)+(n.bottom??0),V=r[P]-B-p/2-h,U=_2(L,t[O]+p/2-(j[O]+n[_8[O]]),t[O]+t[P]-p/2-(j[O]+n[_8[O]]));I[O]=_2(U,F,V),({placement:C,crossPlacement:k}=S),p?$=I[O]:"right"===k?$+=t[P]:"center"===k&&($+=t[P]/2);let W="left"===C||"top"===C?r[D]:0,K={x:"top"===C||"bottom"===C?$:W,y:"left"===C||"right"===C?$:W};return{position:j,maxHeight:N,arrowOffsetLeft:I.left,arrowOffsetTop:I.top,placement:C,triggerAnchorPoint:K}}(n,v,w,x,s,l,E,S,r,c,d,!!b&&"static"!==b,f,p,h,mp(u,y),m)}({placement:(e=l,"rtl"===r?e.replace("start","right").replace("end","left"):e.replace("start","left").replace("end","right")),overlayNode:o.current,targetNode:i.current,scrollNode:s.current||o.current,padding:u,shouldFlip:c,boundaryElement:d,offset:f,crossOffset:p,maxHeight:g,arrowSize:n??(a?.current?wl(a.current,!0).width:0),arrowBoundaryOffset:b});if(!v.position)return;y.style.top="",y.style.bottom="",y.style.left="",y.style.right="",Object.keys(v.position).forEach(e=>y.style[e]=v.position[e]+"px"),y.style.maxHeight=null!=v.maxHeight?v.maxHeight+"px":"";let x=((e=document)=>e.activeElement)();if(t&&x&&s.current){let e=x.getBoundingClientRect(),r=s.current.getBoundingClientRect(),n=e[t.type]-r[t.type];s.current.scrollTop+=n-t.offset}w(v)},x);hF(S,x),hF(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t=S]),wp({ref:o,onResize:S}),wp({ref:i,onResize:S});let D=(0,c3.useRef)(!1);hF(()=>{let e,t=()=>{D.current=!0,clearTimeout(e),e=setTimeout(()=>{D.current=!1},500),S()},r=()=>{D.current&&t()};return wh?.addEventListener("resize",t),wh?.addEventListener("scroll",r),()=>{wh?.removeEventListener("resize",t),wh?.removeEventListener("scroll",r)}},[S]);let O=(0,c3.useCallback)(()=>{D.current||y?.()},[y,D]);return!function(e){let{triggerRef:t,isOpen:r,onClose:n}=e;(0,c3.useEffect)(()=>{if(!r||null===n)return;let e=e=>{let r=mh(e);if(!t.current||r instanceof Node&&!mp(r,t.current)||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)return;let i=n||wf.get(t.current);i&&i()};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[r,n,t])}({triggerRef:i,isOpen:m,onClose:y&&O}),{overlayProps:{style:{position:v?"absolute":"fixed",top:v?void 0:0,left:v?void 0:0,zIndex:1e5,...v?.position,maxHeight:v?.maxHeight??"100vh"}},placement:v?.placement??null,triggerAnchorPoint:v?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:v?.arrowOffsetLeft,top:v?.arrowOffsetTop}},updatePosition:S}}({...l,targetRef:r,overlayRef:n,isOpen:t.isOpen,onClose:o&&!u?t.close:null});return!function(e={}){let{isDisabled:t}=e;hF(()=>{if(!t){let e,t,r,n,i,o,a,s;return 1==++w_&&(d=mM()?(t=ww(document.documentElement,"overflow","hidden"),r=!1,n=document.createElement("style"),(i=yu())&&(n.nonce=i),n.textContent=`
23
23
  @layer {
24
24
  * {
25
25
  overscroll-behavior: contain;
26
26
  }
27
- }`.trim(),document.head.prepend(n),o=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(e){let t=((e=document)=>e.activeElement)(),r=null!=t&&wg(t);o.call(this,{...e,preventScroll:!0}),e&&e.preventScroll||wx(this,r)},a=h$(ww(document,"touchstart",t=>{let n=mp(t);e=bx(n)?n:bE(n,!0),r=!1;let i=n.ownerDocument.defaultView.getSelection();i&&!i.isCollapsed&&i.containsNode(n,!0)&&(r=!0),t.composedPath().some(e=>e instanceof HTMLInputElement&&"range"===e.type)&&(r=!0),"selectionStart"in n&&"selectionEnd"in n&&n.selectionStart<n.selectionEnd&&n.ownerDocument.activeElement===n&&(r=!0)},{passive:!1,capture:!0}),ww(document,"touchmove",t=>{if(2!==t.touches.length&&!r){if(!e||e===document.documentElement||e===document.body)return void t.preventDefault();e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault()}},{passive:!1,capture:!0}),ww(document,"blur",e=>{let t=mp(e),r=e.relatedTarget;if(r&&wg(r))r.focus({preventScroll:!0}),wx(r,wg(t));else if(!r){let e=t.parentElement?.closest("[tabindex]");e?.focus({preventScroll:!0})}},!0)),()=>{t(),a(),n.remove(),HTMLElement.prototype.focus=o}):h$((s=window.innerWidth-document.documentElement.clientWidth)>0&&("scrollbarGutter"in document.documentElement.style?w_(document.documentElement,"scrollbarGutter","stable"):w_(document.documentElement,"paddingRight",`${s}px`)),w_(document.documentElement,"overflow","hidden"))),()=>{0==--wv&&d()}}},[t])}({isDisabled:o||!t.isOpen}),(0,c1.useEffect)(()=>{if(t.isOpen&&n.current)if(o){var e,r,a=i?.current??n.current;let t=_3[_3.length-1];return t&&!t.visibleNodes.has(a)?(t.visibleNodes.add(a),()=>{t.visibleNodes.delete(a)}):void 0}else{let t,o,a,s,l,u,c,d,f,p,h;return e=[i?.current??n.current],o=(r={shouldUseInert:!0})instanceof(t=md(e?.[0])).Element?{root:r}:r,a=o?.root??document.body,s=o?.shouldUseInert&&_0,l=new Set(e),u=new Set,c=(e,r)=>{s&&e instanceof t.HTMLElement?e.inert=r:r?e.setAttribute("aria-hidden","true"):(e.removeAttribute("aria-hidden"),e instanceof t.HTMLElement&&(e.inert=!1))},d=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))l.add(t);let t=e=>{if(u.has(e)||l.has(e)||e.parentElement&&u.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of l)if(mf(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},r=vL(mc(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),n=t(e);if(n===NodeFilter.FILTER_ACCEPT&&f(e),n!==NodeFilter.FILTER_REJECT){let e=r.nextNode();for(;null!=e;)f(e),e=r.nextNode()}},f=e=>{let r=_1.get(e)??0;(s&&e instanceof t.HTMLElement?e.inert:"true"===e.getAttribute("aria-hidden"))&&0===r||(0===r&&c(e,!0),u.add(e),_1.set(e,r+1))},_3.length&&_3[_3.length-1].disconnect(),d(a),(p=new MutationObserver(e=>{for(let r of e)if("childList"===r.type&&r.target.isConnected&&![...l,...u].some(e=>mf(e,r.target)))for(let e of r.addedNodes){var t;(e instanceof HTMLElement||e instanceof SVGElement)&&("true"===(t=e).dataset.liveAnnouncer||void 0!==t.dataset.reactAriaTopLayer)?l.add(e):e instanceof Element&&d(e)}})).observe(a,{childList:!0,subtree:!0}),h={visibleNodes:l,hiddenNodes:u,observe(){p.observe(a,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}},_3.push(h),()=>{for(let e of(p.disconnect(),u)){let t=_1.get(e);null!=t&&(1===t?(c(e,!1),_1.delete(e)):_1.set(e,t-1))}h===_3[_3.length-1]?(_3.pop(),_3.length&&_3[_3.length-1].observe()):_3.splice(_3.indexOf(h),1)}}},[o,t.isOpen,n,i]),{popoverProps:hX(c,p),arrowProps:h,underlayProps:f,placement:m,triggerAnchorPoint:y}}({...n,offset:null!=(i=n.offset)?i:8,arrowSize:s,groupRef:f?c:u},e),g=n.popoverRef,b=function(e,t=!0){let[r,n]=(0,c1.useState)(!0),i=r&&t;return hL(()=>{if(i&&e.current&&"getAnimations"in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),wO(e,i,(0,c1.useCallback)(()=>n(!1),[])),i}(g,!!y)||n.isEntering||!1,v=h3({...n,defaultClassName:"react-aria-Popover",values:{trigger:n.trigger||null,placement:y,isEntering:b,isExiting:t}}),w=!n.isNonModal||"SubmenuTrigger"===n.trigger,[x,E]=(0,c1.useState)(!1);hL(()=>{g.current&&E(w&&!g.current.querySelector("[role=dialog]"))},[g,w]),(0,c1.useEffect)(()=>{var e;let t,r;x&&g.current&&!g.current.contains(document.activeElement)&&(r=((e=document)=>e.activeElement)(t=mc(e=g.current)),"virtual"===wP?m6(()=>{((e=document)=>e.activeElement)(t)===r&&e.isConnected&&ml(e)}):ml(e))},[x,g]);let S={...p.style,...v.style},D=c3().createElement("div",{...hX(ms(n),p),...v,role:x?"dialog":void 0,tabIndex:x?-1:void 0,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],ref:g,slot:n.slot||void 0,style:S,dir:n.dir,"data-trigger":n.trigger,"data-placement":y,"data-entering":b||void 0,"data-exiting":t||void 0},!n.isNonModal&&c3().createElement(wD,{onDismiss:e.close}),c3().createElement(_X.Provider,{value:{...m,placement:y,ref:a}},v.children),c3().createElement(wD,{onDismiss:e.close}));return f?c3().createElement(_W,{...n,shouldContainFocus:x,isExiting:t,portalContainer:null!=(o=null!=r?r:null==c?void 0:c.current)?o:void 0},D):c3().createElement(_W,{...n,shouldContainFocus:x,isExiting:t,portalContainer:r},!n.isNonModal&&e.isOpen&&c3().createElement("div",{"data-testid":"underlay",...h,style:{position:"fixed",inset:0}}),c3().createElement("div",{ref:u,style:{display:"contents"}},c3().createElement(wU.Provider,{value:u},D)))}function wH(e){return e?.start!=null&&null!=e.end}let wz=(0,c1.createContext)(null),wq=(0,c1.createContext)(null),wG=(0,c1.createContext)(null),wZ=(0,c1.createContext)(null),wY=(0,c1.forwardRef)(function(e,t){var r,n;[e,t]=h2(e,t,wz);let{validationBehavior:i}=h4(_Y)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",a=function(e){let t=wB(e),[r,n]=vy(e.value,e.defaultValue||null,e.onChange),[i]=(0,c1.useState)(r),o=r||e.placeholderValue||null,[a,s]=_S(o,e.granularity),l=null!=r?r.toDate(s??"UTC"):null,u="hour"===a||"minute"===a||"second"===a,c=e.shouldCloseOnSelect??!0,[d,f]=(0,c1.useState)(null),[p,h]=(0,c1.useState)(null);if(r&&(d=r,"hour"in r&&(p=r)),o&&!(a in o))throw Error("Invalid granularity "+a+" for value "+o.toString());let m=r?.calendar.identifier==="gregory"&&"BC"===r.era,y=(0,c1.useMemo)(()=>({granularity:a,timeZone:s,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:m}),[a,e.hourCycle,e.shouldForceLeadingZeros,s,e.hideTimeZone,m]),{minValue:g,maxValue:b,isDateUnavailable:v}=e,w=(0,c1.useMemo)(()=>_b(r,g,b,v,y),[r,g,b,v,y]),x=_d({...e,value:r,builtinValidation:w}),E=x.displayValidation.isInvalid,S=e.validationState||(E?"invalid":null),D=(e,t)=>{n("timeZone"in t?t.set(gQ(e)):gX(e,t)),f(null),h(null),x.commitValidation()};return{...x,value:r,defaultValue:e.defaultValue??i,setValue:n,dateValue:d,timeValue:p,setDateValue:r=>{let i="function"==typeof c?c():c;u?p||i?D(r,p||_x(e.defaultValue||e.placeholderValue)):f(r):(n(r),x.commitValidation()),i&&t.setOpen(!1)},setTimeValue:e=>{d&&e?D(d,e):h(e)},granularity:a,hasTime:u,...t,setOpen(n){!n&&!r&&d&&u&&D(d,p||_x(e.defaultValue||e.placeholderValue)),t.setOpen(n)},validationState:S,isInvalid:E,formatValue:(e,t)=>l?new y8(e,_w(t,y)).format(l):"",getDateFormatter:(e,t)=>new y8(e,_w({},{...y,...t}))}}({...e,validationBehavior:o}),s=(0,c1.useRef)(null),[l,u]=h6(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,fieldProps:f,buttonProps:p,dialogProps:h,calendarProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,r){var n;let i=hY(),o=hY(),a=hY(),s=gf((n=v6)&&n.__esModule?n.default:n,"@react-aria/datepicker"),{isInvalid:l,validationErrors:u,validationDetails:c}=t.displayValidation,{labelProps:d,fieldProps:f,descriptionProps:p,errorMessageProps:h}=v9({...e,labelElementType:"span",isInvalid:l,errorMessage:e.errorMessage||u}),m=v5(t,r),y=f["aria-labelledby"]||f.id,{locale:g}=y0(),b=t.formatValue(g,{month:"long"}),v=bk(b?s.format("selectedDateDescription",{date:b}):""),w=[v["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,x=ms(e),E=(0,c1.useMemo)(()=>v0(r),[r]),S=(0,c1.useRef)(!1),{focusWithinProps:D}=yO({...e,isDisabled:t.isOpen,onBlurWithin:t=>{mf(document.getElementById(o),t.relatedTarget)||(S.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{S.current||(S.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}});return{groupProps:hX(x,m,f,v,D,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":y,"aria-describedby":w,onKeyDown(r){!t.isOpen&&e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){!t.isOpen&&e.onKeyUp&&e.onKeyUp(r)}}),labelProps:{...d,onClick:()=>{E.focusFirst()}},fieldProps:{...f,id:a,[_r]:"presentation","aria-describedby":w,value:t.value,defaultValue:t.defaultValue,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,[_c]:t,autoFocus:e.autoFocus,name:e.name,form:e.form},descriptionProps:p,errorMessageProps:h,buttonProps:{...v,id:i,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${i} ${y}`,"aria-describedby":w,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:o,"aria-labelledby":`${i} ${y}`},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(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:l,validationErrors:u,validationDetails:c}}({...h5(e),label:u,validationBehavior:o},a,s),[v,w]=(0,c1.useState)(null),x=(0,c1.useCallback)(()=>{s.current&&w(s.current.offsetWidth+"px")},[]);wf({ref:s,onResize:x});let{focusProps:E,isFocused:S,isFocusVisible:D}=yP({within:!0}),O=h3({...e,values:{state:a,isFocusWithin:S,isFocusVisible:D,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DatePicker"}),P=ms(e);return delete P.id,c3().createElement(h1,{values:[[wG,a],[vM,{...c,ref:s,isInvalid:a.isInvalid}],[_M,f],[yI,{...p,isPressed:a.isOpen}],[_J,{...d,ref:l,elementType:"span"}],[vx,m],[_H,a],[wV,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":v}}],[_K,h],[yF,{slots:{description:y,errorMessage:g}}],[_q,b]]},c3().createElement("div",{...E,...P,...O,ref:t,slot:e.slot||void 0,"data-focus-within":S||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":D||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))}),wJ=(0,c1.forwardRef)(function(e,t){var r,n;[e,t]=h2(e,t,wq);let{validationBehavior:i}=h4(_Y)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",a=function(e){let t=wB(e),[r,n]=vy(e.value,e.defaultValue||null,e.onChange),[i]=(0,c1.useState)(r),[o,a]=(0,c1.useState)(()=>r||{start:null,end:null});null==r&&o.start&&o.end&&a(o={start:null,end:null});let s=r||o,l=e=>{a(s=e||{start:null,end:null}),wH(s)?n(s):n(null)},[u,c]=_S(s?.start||s?.end||e.placeholderValue||null,e.granularity),d="hour"===u||"minute"===u||"second"===u,f=e.shouldCloseOnSelect??!0,[p,h]=(0,c1.useState)(null),[m,y]=(0,c1.useState)(null);s&&wH(s)&&(p=s,"hour"in s.start&&(m=s));let g=(e,t)=>{l({start:"timeZone"in t.start?t.start.set(gQ(e.start)):gX(e.start,t.start),end:"timeZone"in t.end?t.end.set(gQ(e.end)):gX(e.end,t.end)}),h(null),y(null),P.commitValidation()},b=r=>{let n="function"==typeof f?f():f;d?wH(r)&&(n||m?.start&&m?.end)?g(r,{start:m?.start||_x(e.placeholderValue),end:m?.end||_x(e.placeholderValue)}):h(r):wH(r)?(l(r),P.commitValidation()):h(r),n&&t.setOpen(!1)},v=e=>{wH(p)&&wH(e)?g(p,e):y(e)},w=s?.start?.calendar.identifier==="gregory"&&"BC"===s.start.era||s?.end?.calendar.identifier==="gregory"&&"BC"===s.end.era,x=(0,c1.useMemo)(()=>({granularity:u,timeZone:c,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:w}),[u,e.hourCycle,e.shouldForceLeadingZeros,c,e.hideTimeZone,w]),{minValue:E,maxValue:S,isDateUnavailable:D}=e,O=(0,c1.useMemo)(()=>{var e;let t;return e=s,t=_m(_b(e?.start??null,E,S,D,x),_b(e?.end??null,E,S,D,x)),e?.end!=null&&null!=e.start&&0>e.end.compare(e.start)&&(t=_m(t,{isInvalid:!0,validationErrors:[(ga.getGlobalDictionaryForPackage("@react-stately/datepicker")||_y).getStringForLocale("rangeReversed",_g())],validationDetails:{..._a,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})),t},[s,E,S,D,x]),P=_d({...e,value:r,name:(0,c1.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:O}),C=P.displayValidation.isInvalid,k=e.validationState||(C?"invalid":null);return{...P,value:s,defaultValue:e.defaultValue??i,setValue:l,dateRange:p,timeRange:m,granularity:u,hasTime:d,setDate(e,t){"start"===e?b({start:t,end:p?.end??null}):b({start:p?.start??null,end:t})},setTime(e,t){"start"===e?v({start:t,end:m?.end??null}):v({start:m?.start??null,end:t})},setDateTime(e,t){"start"===e?l({start:t,end:s?.end??null}):l({start:s?.start??null,end:t})},setDateRange:b,setTimeRange:v,...t,setOpen(r){!r&&!(s?.start&&s?.end)&&wH(p)&&d&&g(p,{start:m?.start||_x(e.placeholderValue),end:m?.end||_x(e.placeholderValue)}),t.setOpen(r)},validationState:k,isInvalid:C,formatValue(t,r){let n;if(!s||!s.start||!s.end)return null;let i="timeZone"in s.start?s.start.timeZone:void 0,o=e.granularity||(s.start&&"minute"in s.start?"minute":"day"),a="timeZone"in s.end?s.end.timeZone:void 0,l=e.granularity||(s.end&&"minute"in s.end?"minute":"day"),u=_w(r,{granularity:o,timeZone:i,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===s.start.calendar.identifier&&"BC"===s.start.era||"gregory"===s.end.calendar.identifier&&"BC"===s.end.era}),c=s.start.toDate(i||"UTC"),d=s.end.toDate(a||"UTC"),f=new y8(t,u);if(i===a&&o===l&&0!==s.start.compare(s.end)){try{let e=f.formatRangeToParts(c,d),t=-1;for(let r=0;r<e.length;r++){let n=e[r];if("shared"===n.source&&"literal"===n.type)t=r;else if("endRange"===n.source)break}let r="",n="";for(let i=0;i<e.length;i++)i<t?r+=e[i].value:i>t&&(n+=e[i].value);return{start:r,end:n}}catch{}n=f}else n=new y8(t,_w(r,{granularity:l,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:f.format(c),end:n.format(d)}},getDateFormatter:(e,t)=>new y8(e,_w({},{...x,...t}))}}({...e,validationBehavior:o}),s=(0,c1.useRef)(null),[l,u]=h6(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,startFieldProps:f,endFieldProps:p,buttonProps:h,dialogProps:m,calendarProps:y,descriptionProps:g,errorMessageProps:b,...v}=function(e,t,r){var n;let i=gf((n=v6)&&n.__esModule?n.default:n,"@react-aria/datepicker"),{isInvalid:o,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=v9({...e,labelElementType:"span",isInvalid:o,errorMessage:e.errorMessage||a}),f=u["aria-labelledby"]||u.id,{locale:p}=y0(),h=t.formatValue(p,{month:"long"}),m=bk(h?i.format("selectedRangeDescription",{startDate:h.start,endDate:h.end}):""),y={"aria-label":i.format("startDate"),"aria-labelledby":f},g={"aria-label":i.format("endDate"),"aria-labelledby":f},b=hY(),v=hY(),w=v5(t,r),x=[m["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,E=(0,c1.useMemo)(()=>v0(r,{accept:e=>e.id!==b}),[r,b]),S={[_n]:E,[_r]:"presentation","aria-describedby":x,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},D=ms(e),O=(0,c1.useRef)(!1),{focusWithinProps:P}=yO({...e,isDisabled:t.isOpen,onBlurWithin:t=>{mf(document.getElementById(v),t.relatedTarget)||(O.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{O.current||(O.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}}),C=(0,c1.useRef)(_l),k=(0,c1.useRef)(_l);return{groupProps:hX(D,w,u,m,P,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":x,onKeyDown(r){!t.isOpen&&e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){!t.isOpen&&e.onKeyUp&&e.onKeyUp(r)}}),labelProps:{...l,onClick:()=>{E.focusFirst()}},buttonProps:{...m,id:b,"aria-haspopup":"dialog","aria-label":i.format("calendar"),"aria-labelledby":`${b} ${f}`,"aria-describedby":x,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:v,"aria-labelledby":`${b} ${f}`},startFieldProps:{...y,...S,value:t.value?.start??null,defaultValue:t.defaultValue?.start,onChange:e=>t.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[_c]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){C.current=e,t.updateValidation(_m(e,k.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...g,...S,value:t.value?.end??null,defaultValue:t.defaultValue?.end,onChange:e=>t.setDateTime("end",e),name:e.endName,form:e.form,[_c]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){k.current=e,t.updateValidation(_m(C.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:c,errorMessageProps:d,calendarProps:{autoFocus:!0,value:t.dateRange?.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(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:o,validationErrors:a,validationDetails:s}}({...h5(e),label:u,validationBehavior:o},a,s),[w,x]=(0,c1.useState)(null),E=(0,c1.useCallback)(()=>{s.current&&x(s.current.offsetWidth+"px")},[]);wf({ref:s,onResize:E});let{focusProps:S,isFocused:D,isFocusVisible:O}=yP({within:!0}),P=h3({...e,values:{state:a,isFocusWithin:D,isFocusVisible:O,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DateRangePicker"}),C=ms(e);return delete C.id,c3().createElement(h1,{values:[[wZ,a],[vM,{...c,ref:s,isInvalid:a.isInvalid}],[yI,{...h,isPressed:a.isOpen}],[_J,{...d,ref:l,elementType:"span"}],[vE,y],[_H,a],[wV,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":w}}],[_K,m],[_M,{slots:{start:f,end:p}}],[yF,{slots:{description:g,errorMessage:b}}],[_q,v]]},c3().createElement("div",{...S,...C,...P,ref:t,slot:e.slot||void 0,"data-focus-within":D||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":O||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))});function wQ(e){return c3().createElement(yX,e)}function wX(e,t,r=!1){if(null==e)return r?e:void 0;if("string"==typeof e&&!e)return r?null:void 0;if(e instanceof gB||e instanceof gU||e instanceof gW)return t?g0(e,t):e;{let r=fM()(e).toDate(),n=new gB(r.getFullYear(),r.getMonth()+1,r.getDate());return t?g0(n,t):n}}function w0(e){if(e)return e.toDate(br())}function w1(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function w3(e){let t=e??"",r=w1(t);if(!r)return t;try{return new Intl.DisplayNames([r],{type:"language"}).of(r)??t}catch{return t}}function w4(){let e=window.i18next.language,t=w1(e)??e;return"ht"===t&&(t="fr-HT"),t}if("u">typeof navigator){let e=navigator;eo=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;eo=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var w2=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch{return"en-US"}}(eo||"en-US"),w6=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},w5={};for(let e=1;e<100;e++)w5[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var w8={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},w9="[1234567890一二三四五六七八九〇\\d]",w7={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},xe={},xt={"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},xr={zone:xt,year:w5,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:{}},xn={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(xt).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,}"},xi={...xn,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}"},xo={},xa=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=w2){return xo[t.toLowerCase()]||(xo[t.toLowerCase()]=new e(t)),xo[t.toLowerCase()]}constructor(e=w2){this.locale=e,this.lookups={...xr},this.vars={...xn};let 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 r=0;r<e.length;r++)t+=String(this.lookups.digit[e[r]]);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 r=this.lookups.meridiem[t?.toLowerCase()]||0,n=this.toInt(e);return n<12&&12===r&&(n+=12),12===n&&0===r&&(n=0),n}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,r,n]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(r)+this.toInt(n||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=w7: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(xe[e])return xe[e];if("fullwide"===e||"hanidec"===e)return{group:w9,lookup:{...w7}};let t=w8[e];if(!t)return{group:"\\d",lookup:{...w7}};let r=String.fromCharCode(t),n=String.fromCharCode(t+9),i={};for(let e=0;e<10;e++)i[String.fromCharCode(t+e)]=e;return xe[e]={group:`[${r}-${n}]`,lookup:i},xe[e]}(this.numberingSystem);for(let r in this.lookups.digit=t,xi)xi.hasOwnProperty(r)&&(this.vars[r]=xi[r].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((r,n)=>{["","k","kuu","kuuta"].forEach((i,o)=>{e[r+i+(o<2?"\\.?":"")]=!0,t[r+i]=n+1})});else{let r=[],n=e=>"month"===e.type;for(let e=0;e<12;e++)r.push(new Date(2017,e,1));for(let i of["full","long","medium"]){let o=Intl.DateTimeFormat(this.locale,{dateStyle:i});for(let a=0;a<12;a++){let s=o.formatToParts(r[a]).find(n).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===i?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=a+1)}}let i=Intl.DateTimeFormat(this.locale,{month:"short"});for(let o=0;o<12;o++){let a=i.formatToParts(r[o]).find(n).value.toLocaleLowerCase(this.locale);a=a.replace(/\.$/,""),e[`${a}\\.?`]=!0,t[a]=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 r=[],n={};for(let i of["long","short"]){let o=Intl.DateTimeFormat(this.locale,{weekday:i});for(let a=0;a<7;a++){let s=o.formatToParts(e[a]).find(t).value.toLocaleLowerCase(this.locale);"short"===i?(s=s.replace(/\.$/,""),r.push(`${s}\\.?`)):r.push(s),n[s]=a}}this.vars.DAYNAME=r.join("|"),this.lookups.dayname=n}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,r=[],n={},i=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let o=0;o<2;o++){let a=i.formatToParts(e[o]).find(t);if(!a)return;let s=a.value.toLocaleLowerCase(this.locale);r.push(s),n[s]=12*o}this.vars.MERIDIEM=r.join("|"),this.lookups.meridiem=n}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")}},xs=["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"],xl={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},xu=()=>new Date;function xc(e){return function(t){let r={};for(let n=0,i=e.length;n<i;n++){let i=e[n];i&&(r[i]=t[n])}return r}}var xd=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:r,formatter:n}){this.doneChecker=e,this.fallback=t,this.patterns=r,this.formatter=n}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),r={},n=!1;for(let e of this.patterns){let i=t.match(e.regex);if(!i)continue;n=!0;let o=e.handler(i);if(o){for(let[e,t]of Object.entries(o))e in r||void 0===t||(r[e]=t);if(t=(t=t.slice(0,i.index)+t.slice(i.index+i[0].length+1)).trim(),this.doneChecker(r,t))break}}return n?this.formatter(r):this.fallback(e)}},xf=["year","month","day","hour","minute","second","millisecond","offset"],xp={};function xh(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 xm=[[/([^\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"]],xy={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," "],...xm],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:xm,id:xm,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function xg(e,t=w2){let r=function(e){if(!xp[e]){var t,r;let n,i,o=xa.factory(e);xp[e]=new xd({doneChecker:xh,fallback:(t=e,function(e){let r=String(e).slice(0,50);return""===r&&(r="(empty string)"),{invalid:`Unable to parse "${r}" with locale "${t}"`}}),patterns:(n=[{name:"timestampWithOffset",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:xc(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:xc(["","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:xc(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:o.compile(`^(${w9}{2,4})\\s*\u5E74\\s*(${w9}{1,2})\\s*\u6708\\s*(${w9}{1,2})\\s*\u65E5$`),handler:xc(["","year","month","day"])},{name:"korean",regex:o.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:xc(["","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:xc(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=xu(),r=e[1].toLowerCase();switch(r){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}let n={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===r&&(n.hour=t.getUTCHours(),n.minute=t.getUTCMinutes(),n.second=t.getUTCSeconds(),n.millisecond=t.getUTCMilliseconds()),console.log("today=>",r,n),n}},{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,r,n]){t=parseFloat(t),"week"===(r=r.length<=2?xl[r]:(r=r.replace(/s$/,"")).toLowerCase())&&(r="day",t*=7),("-"===e||n)&&(t*=-1);let i=xu();return"millisecond"===r?i.setUTCMilliseconds(i.getUTCMilliseconds()+t):"second"===r?i.setUTCSeconds(i.getUTCSeconds()+t):"minute"===r?i.setUTCMinutes(i.getUTCMinutes()+t):"hour"===r?i.setUTCHours(i.getUTCHours()+t):"day"===r?i.setUTCDate(i.getUTCDate()+t):"month"===r?i.setUTCMonth(i.getUTCMonth()+t):"year"===r&&i.setUTCFullYear(i.getUTCFullYear()+t),{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.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:xc(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:xc(["","hour","minute","second","millisecond","zone"])},{name:"hms12",regex:o.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:xc(["","hour","minute","second","meridiem"])},{name:"hms24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:xc(["","hour","minute","second","millisecond"])},{name:"hm12",regex:o.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:xc(["","hour","minute","meridiem"])},{name:"hm24",regex:o.compile("(_H24_):(_MIN_)"),handler:xc(["","hour","minute"])},{name:"h12",regex:o.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:xc(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:xc(["","year","month","day"])},{name:"yearMonthnameDay",regex:o.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:xc(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:o.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:xc(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:o.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:xc(["","monthname","day","","year"])},{name:"dayMonthname",regex:o.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:xc(["","day","","monthname"])},{name:"monthnameDay",regex:o.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:xc(["","monthname","day"])},{name:"hmsNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:xc(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:xc(["","hour","minute"])},{name:"ymd",regex:o.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:xc(["","year","","month","day"])},{name:"mdy",regex:o.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:xc(["","month","","day","year"])},{name:"dmy",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:xc(["","day","month","year"])},{name:"yearLoose",regex:o.compile("_YEAR4_"),handler:xc(["year"])},{name:"dayMonthnameLoose",regex:o.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:xc(["","day","monthname"])},{name:"monthnameDayLoose",regex:o.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:xc(["","monthname","day"])},{name:"monthname",regex:o.compile("_MONTHNAME_"),handler:xc(["monthname"])},{name:"year4",regex:o.compile("_YEAR4_"),handler:xc(["year"])},{name:"md",regex:o.compile("(_MONTH_)[/-](_DAY_)"),handler:xc(["","month","day"])},{name:"dm",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:xc(["","day","month"])},{name:"day",regex:o.compile("_DAY_"),handler:xc(["day"])},{name:"year2",regex:o.compile("_YEAR2_"),handler:xc(["year"])},{name:"onlyZone",regex:o.compile("_ZONE_"),handler:xc(["zone"])}],i=o.baseName.slice(0,5),xs.includes(i)?n:n.filter(e=>!["mdy","md"].includes(e.name))),formatter:(r=o,function(e){let t={};for(let[n,i]of Object.entries(e))if("monthname"===n){if(i){let e=r.monthNameToInt(i);void 0!==e&&(t.month=e)}}else if("hour"===n&&e.meridiem){let n=r.h12ToInt(i,e.meridiem);void 0!==n&&(t.hour=n)}else if("zone"===n){if(i){let e=r.zoneToOffset(i);void 0!==e&&(t.offset=e)}}else if("offset"===n){let e=r.offsetToMinutes(i);void 0!==e&&(t.offset=e)}else if("millisecond"===n){let e=r.millisecondToInt(i);"number"==typeof e&&(t.millisecond=e)}else if(xf.includes(n)){let e=r.toInt(i);"number"==typeof e&&(t[n]=e)}return t.year<100&&(t.year=w5[t.year]),t.year&&"buddhist"===r.dateOptions.calendar&&(t.year-=543),t})})}return xp[e]}(t),n=function(e,t){let r=xy[t.slice(0,2).toLowerCase()];if(!r)return e;for(let[t,n]of r)e=e.replace(t,n);return e}(e,t);return r.attempt(n)}function xb(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new w6(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 w6(t.valueOf()-60*e.offset*1e3):t}function xv(e,t=w2){let r=xg(e,t),n=r.invalid?new w6(NaN):xb(r);return n.isValid()||(n.invalid=`Unable to parse date "${e}"`),n}function x_(e,t=w2){return e instanceof Date?new w6(e.valueOf()):"number"==typeof e?new w6(e):xv(e,t)}Date.fromString=w6.fromString=xv,Date.fromAny=w6.fromAny=x_,"u">typeof window&&(window.anyDateParser={fromString:xv,fromAny:x_,fromObject:xb,attempt:xg});var xw=r(5238),xx=r(83826);let xE=function(e){return null==e};function xS(e,t){var r=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return r.get?r.get.call(e):r.value}fA.extend(fN),fA.extend(xx),fA.extend(xw);let xD="YYYY-MM-DDTHH:mm:ss.SSSZZ";function xO(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&fA(e,xD).isValid()}function xP(e){return fA(e).isToday()}function xC(e){return xO(e)?fA(e,xD).toDate():null}function xk(e,t=!1){let r=fA(e);return t&&(r=r.utc()),r.format(xD)}function xT(e){return fA(e).toDate()}var xj=new WeakMap;let xR=new class{register(e,t){xS(this,xj).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(xS(this,xj).has(t))return xS(this,xj).get(t)}if(e.language&&xS(this,xj).has(e.language))return xS(this,xj).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return xS(this,xj).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,r){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,r)}(this,xj,{writable:!0,value:new Map})}};function xA(e,t){xR.register(e,t)}function xM(e){let t=e??w4();return xR.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let xN={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function xI(e,t={}){let r=xg(e,w4());if(r.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!xE(r.day)&&xE(r.month)&&(r=Object.assign({},tO(r,"day"),{month:r.day})),r.month&&(r.month-=1),r.day&&(r=Object.assign({},tO(r,"day"),{date:r.day}));let n=fA().set(r).toDate();return xE(r.year)&&(t.year=!1),xE(r.month)&&(t.month=!1),xE(r.date)&&(t.day=!1),x$(n,t)}function x$(e,t){let r,n=t?.locale??w4(),i=new Intl.Locale(n),{calendar:o,mode:a,time:s,day:l,month:u,year:c,noToday:d,numberingSystem:f}={...xN,...{noToday:"am"===i.language},...t},p={calendar:o??xM(i),year:c?"numeric":void 0,month:u?"short":void 0,day:l?"2-digit":void 0,numberingSystem:f},h=fA(e).isToday();if(h&&!d)r=(r=new Intl.RelativeTimeFormat(n,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(n)+r.slice(1);else{"en"===i.language&&(n="en-GB");let t=new Intl.DateTimeFormat(n,p).formatToParts(e);("en"===i.language||"am"===i.language)&&"standard"==a&&c&&l&&(t=t.map(xL("-"))),"wide"==a&&(t=t.map(xL(" — "))),"ethiopic"===p.calendar&&(t=t.filter((e,t,r)=>"era"!==e.type&&("literal"!==e.type||!(t<r.length-1)||"era"!==r[t+1].type))),r=t.map(e=>e.value).join("")}return(!0===s||h&&"for today"===s)&&(r+=`, ${xF(e)}`),r}let xL=e=>(t,r,n)=>"literal"!==t.type||" "!==t.value||r<n.length-1&&"era"===n[r+1].type?t:{type:"literal",value:e};function xF(e){return e.toLocaleTimeString(w4(),{hour:"2-digit",minute:"2-digit"})}function xB(e,t){return x$(e,{...t,time:!0})}function xV(e,t){let r=xM("string"==typeof t?new Intl.Locale(t):t);return r?g0(e,vs(r)):e}function xU(e,t){return new Intl.DurationFormat(w4(),t).format(e)}function xW(e,t){if(null==e)return null;if("string"==typeof e){let r=xg(e,w4());return r.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(r.day&&!r.month&&(r={...tO(r,"day"),...{month:r.day}}),r.month&&(r.month-=1),r.day&&(r={...tO(r,"day"),...{date:r.day}}),fA(t).set(r))}return fA(e)}let xK=["years","months","days","hours","minutes","seconds"],xH={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},xz={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function xq(e,t=fA(),r){let n,i=fA(t),o=xW(e,i);if(null==o)return null;if("string"==typeof r){let e=xH[r]??r;return{[e]:i.diff(o,e)}}let{thresholds:a,largestUnit:s,smallestUnit:l}=r??{};if(void 0!==s||void 0!==l){let e,t=l?xH[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,r){let n=xK.indexOf(r);for(let i=0;i<xK.length;i++){let o=xK[i];if(t.diff(e,o)>0)return i<=n?o:r}return r}(o,i,t??"seconds"):xH[s]??s,function(e,t,r,n){let i=xK.indexOf(r),o=xK.indexOf(n),a=xK.slice(i,o+1),s={},l=e;for(let e of a){let r=t.diff(l,e);s[e]=r,l=l.add(r,e)}return s}(o,i,e,t??e)}let u=(n=function(e){let t={...xz};if(e)for(let[r,n]of Object.entries(e))void 0!==n&&(t[xH[r]??r]=n);return t}(a),i.diff(o,"seconds")<n.seconds?"seconds":i.diff(o,"minutes")<n.minutes?"minutes":i.diff(o,"hours")<n.hours?"hours":i.diff(o,"days")<n.days?"days":i.diff(o,"months")<n.months?"months":"years");return{[u]:i.diff(o,u)}}let xG={style:"short",localeMatcher:"lookup"};function xZ(e,t=fA(),r){let n=xq(e,t,r);return null==n?null:xU(n,"object"==typeof r&&r.formatOptions?{...xG,...r.formatOptions}:xG)}let xY=(0,c1.createContext)(null);function xJ(){let e=dQ({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,c1.useMemo)(()=>{let t=w4();return e[t]&&(t=e[t]),t},[window.i18next.language]),r=(0,c1.useMemo)(()=>{let e=xM(t);return void 0!==e?vs(e):void 0},[t]),n=(0,c1.useMemo)(()=>new Intl.Locale(t,{calendar:r?.identifier}),[t,r]),i=(0,c1.useMemo)(()=>r?g0(g9(br()),r):g9(br()),[r]);return{calendar:r,intlLocale:n,today_:i}}let xQ=new gB(1793,1,1);var xX={};function x0(){return"u">typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}function x1(e={}){let{locale:t}=y0();return(0,c1.useMemo)(()=>new(0,_k.K)(t,e),[t,e])}xX={"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 x3={};x3={"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:"空白"}};let x4=()=>{};function x2(e){var t;let r=(0,c1.useRef)(void 0),{value:n,textValue:i,minValue:o,maxValue:a,isDisabled:s,isReadOnly:l,isRequired:u,onIncrement:c,onIncrementPage:d,onDecrement:f,onDecrementPage:p,onDecrementToMin:h,onIncrementToMax:m}=e,y=gf((t=x3)&&t.__esModule?t.default:t,"@react-aria/spinbutton"),g=(0,c1.useRef)(!1),b=(0,c1.useCallback)(()=>{clearTimeout(r.current),g.current=!1},[]),v=yd(()=>{b()});(0,c1.useEffect)(()=>()=>v(),[]);let w=(0,c1.useRef)(!1),x=()=>{w.current=!0},E=()=>{w.current=!1},S=""===i?y.format("Empty"):(i||`${n}`).replace("-","−");(0,c1.useEffect)(()=>{w.current&&(y1&&y1.clear("assertive"),y3(S,"assertive"))},[S]);let D=(0,c1.useCallback)(()=>{b()},[b]),O=yd(c??x4),P=yd(f??x4),C=yd(()=>{(void 0===a||isNaN(a)||void 0===n||isNaN(n)||n<a)&&(O(),k(60))}),k=yd(e=>{v(),g.current=!0,r.current=window.setTimeout(C,e)}),T=yd(()=>{(void 0===o||isNaN(o)||void 0===n||isNaN(n)||n>o)&&(P(),j(60))}),j=yd(e=>{v(),g.current=!0,r.current=window.setTimeout(T,e)}),R=e=>{e.preventDefault()},{addGlobalListener:A,removeAllGlobalListeners:M}=yf(),N=(0,c1.useRef)(!1),[I,$]=(0,c1.useState)(null);(0,c1.useEffect)(()=>{"touch"===I?k(600):I&&k(400)},[I]);let[L,F]=(0,c1.useState)(null);return(0,c1.useEffect)(()=>{"touch"===L?j(600):L&&j(400)},[L]),{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===n||isNaN(n)?void 0:n,"aria-valuetext":S,"aria-valuemin":o,"aria-valuemax":a,"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&&!e.nativeEvent.isComposing)switch(e.key){case"PageUp":if(d){e.preventDefault(),d?.();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),c?.());break;case"PageDown":if(p){e.preventDefault(),p?.();break}case"ArrowDown":case"Down":f&&(e.preventDefault(),f?.());break;case"Home":h&&(e.preventDefault(),h?.());break;case"End":m&&(e.preventDefault(),m?.())}},onFocus:x,onBlur:E},incrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(c?.(),$("mouse")):(A(window,"pointercancel",D,{capture:!0}),N.current=!1,$("touch")),A(window,"contextmenu",R)},onPressUp:e=>{b(),"touch"===e.pointerType&&(N.current=!0),M(),$(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&N.current&&c?.(),N.current=!1,$(null)},onFocus:x,onBlur:E},decrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(f?.(),F("mouse")):(A(window,"pointercancel",D,{capture:!0}),N.current=!1,F("touch"))},onPressUp:e=>{b(),"touch"===e.pointerType&&(N.current=!0),M(),F(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&N.current&&f?.(),N.current=!1,F(null)},onFocus:x,onBlur:E}}}let x6=null;var x5=r(66284);function x8(e,t,r){let n="+"===e?t+r:t-r;if(t%1!=0||r%1!=0){let i=t.toString().split("."),o=r.toString().split("."),a=Math.pow(10,Math.max(i[1]&&i[1].length||0,o[1]&&o[1].length||0));t=Math.round(t*a),r=Math.round(r*a),n=("+"===e?t+r:t-r)/a}return n}let x9=(0,c1.createContext)(null),x7=(0,c1.createContext)(null),Ee=(0,c1.forwardRef)(function(e,t){var r,n;[e,t]=h2(e,t,x9);let{validationBehavior:i}=h4(_Y)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",{locale:a}=y0(),s=function(e){let{minValue:t,maxValue:r,step:n,formatOptions:i,value:o,defaultValue:a=NaN,onChange:s,locale:l,isDisabled:u,isReadOnly:c,commitBehavior:d="snap"}=e;null===o&&(o=NaN);let f=(0,c1.useCallback)(e=>void 0===n||isNaN(n)?_4(e,t,r):_6(e,t,r,n),[n,t,r]);void 0===o||isNaN(o)||"snap"!==d||(o=f(o)),isNaN(a)||"snap"!==d||(a=f(a));let[p,h]=vy(o,isNaN(a)?NaN:a,s),[m]=(0,c1.useState)(p),[y,g]=(0,c1.useState)(()=>isNaN(p)?"":new(0,_k.K)(l,i).format(p)),b=(0,c1.useMemo)(()=>new(0,x5.d)(l,i),[l,i]),v=(0,c1.useMemo)(()=>b.getNumberingSystem(y),[b,y]),w=(0,c1.useMemo)(()=>new(0,_k.K)(l,{...i,numberingSystem:v}),[l,i,v]),x=(0,c1.useMemo)(()=>w.resolvedOptions(),[w]),E=(0,c1.useCallback)(e=>isNaN(e)||null===e?"":w.format(e),[w]),S=_d({...e,value:p}),D=void 0===n||isNaN(n)?1:n;"percent"===x.style&&(void 0===n||isNaN(n))&&(D=.01);let[O,P]=(0,c1.useState)(p),[C,k]=(0,c1.useState)(l),[T,j]=(0,c1.useState)(i);Object.is(p,O)&&l===C&&i===T||(g(E(p)),P(p),k(l),j(i));let R=(0,c1.useMemo)(()=>b.parse(y),[b,y]),A=(e,n=0)=>{if(isNaN(R))return _6(isNaN(n)?0:n,t,r,D);{let n=_6(R,t,r,D);return"+"===e&&n>R||"-"===e&&n<R?n:_6(x8(e,R,D),t,r,D)}},M=(0,c1.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===r||isNaN(r)||_6(R,t,r,D)>R||x8("+",R,D)<=r),[u,c,t,r,D,R]),N=(0,c1.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===t||isNaN(t)||_6(R,t,r,D)<R||x8("-",R,D)>=t),[u,c,t,r,D,R]);return{...S,validate:e=>b.isValidPartialNumber(e,t,r),increment:()=>{let e=A("+",t);e===p&&g(E(e)),h(e),S.commitValidation()},incrementToMax:()=>{null!=r&&(h(_6(r,t,r,D)),S.commitValidation())},decrement:()=>{let e=A("-",r);e===p&&g(E(e)),h(e),S.commitValidation()},decrementToMin:()=>{null!=t&&(h(t),S.commitValidation())},canIncrement:M,canDecrement:N,minValue:t,maxValue:r,numberValue:R,defaultNumberValue:isNaN(a)?m:a,setNumberValue:h,setInputValue:g,inputValue:y,commit:e=>{let t=void 0===e?y:e,r=R;if(void 0!==e&&(r=b.parse(t)),!t.length){h(NaN),g(void 0===o?"":E(p));return}if(isNaN(r))return void g(E(p));let n="snap"===d?f(r):r,i=(n=b.parse(E(n)))!==p;h(n),g(E(void 0===o?n:p)),i&&S.commitValidation()}}}({...e,locale:a,validationBehavior:o}),l=(0,c1.useRef)(null),[u,c]=h6(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:f,inputProps:p,incrementButtonProps:h,decrementButtonProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,r){var n,i,o,a,s,l,u,c,d;let f,{id:p,decrementAriaLabel:h,incrementAriaLabel:m,isDisabled:y,isReadOnly:g,isRequired:b,minValue:v,maxValue:w,autoFocus:x,label:E,formatOptions:S,onBlur:D=()=>{},onFocus:O,onFocusChange:P,onKeyDown:C,onKeyUp:k,description:T,errorMessage:j,isWheelDisabled:R,...A}=e,{increment:M,incrementToMax:N,decrement:I,decrementToMin:$,numberValue:L,inputValue:F,commit:B,commitValidation:V}=t,U=gf((n=xX)&&n.__esModule?n.default:n,"@react-aria/numberfield"),W=(0,c1.useCallback)(()=>{let e=r.current?.value??"";(0,yp.flushSync)(()=>{B()}),r.current?.value!==e&&y3(r.current?.value??"","assertive")},[B,r]),K=hY(p),{focusProps:H}=m8({onBlur(){W()}}),z=x1(S),q=(0,c1.useMemo)(()=>z.resolvedOptions(),[z]),G=x1({...S,currencySign:void 0}),Z=(0,c1.useMemo)(()=>isNaN(L)?"":G.format(L),[G,L]),{spinButtonProps:Y,incrementButtonProps:J,decrementButtonProps:Q}=x2({isDisabled:y,isReadOnly:g,isRequired:b,maxValue:w,minValue:v,onIncrement:M,onIncrementToMax:N,onDecrement:I,onDecrementToMin:$,value:L,textValue:Z}),[X,ee]=(0,c1.useState)(!1),{focusWithinProps:et}=yO({isDisabled:y,onFocusWithinChange:ee});!function(e,t){let{onScroll:r,isDisabled:n}=e,i=(0,c1.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),r&&r({deltaX:e.deltaX,deltaY:e.deltaY}))},[r]);bw(t,"wheel",n?void 0:i)}({onScroll:(0,c1.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?M():e.deltaY<0&&I())},[I,M]),isDisabled:R||y||g||!X},r);let er=(q.maximumFractionDigits??0)>0,en=void 0===t.minValue||isNaN(t.minValue)||t.minValue<0,ei="numeric";mj()?en?ei="text":er&&(ei="decimal"):mI()&&(en?ei="numeric":er&&(ei="decimal"));let eo=ms(e),ea=(0,c1.useCallback)(e=>{e.nativeEvent.isComposing||("Enter"===e.key?((0,yp.flushSync)(()=>{B()}),V()):e.continuePropagation())},[B,V]),{isInvalid:es,validationErrors:el,validationDetails:eu}=t.displayValidation,{labelProps:ec,inputProps:ed,descriptionProps:ef,errorMessageProps:ep}=function(e,t,r){let n=yd(e=>{let n=r.current;if(!n)return;let i=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":i=n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteContentForward":i=n.selectionEnd===n.selectionStart?n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd+1):n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteContentBackward":i=n.selectionEnd===n.selectionStart?n.value.slice(0,n.selectionStart-1)+n.value.slice(n.selectionStart):n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":i=n.value.slice(n.selectionStart);break;default:null!=e.data&&(i=n.value.slice(0,n.selectionStart)+e.data+n.value.slice(n.selectionEnd))}null!=i&&t.validate(i)||e.preventDefault()});(0,c1.useEffect)(()=>{if(!x0()||!r.current)return;let e=r.current;return e.addEventListener("beforeinput",n,!1),()=>{e.removeEventListener("beforeinput",n,!1)}},[r]);let i=x0()?null:e=>{let r=mp(e).value.slice(0,mp(e).selectionStart)+e.data+mp(e).value.slice(mp(e).selectionEnd);t.validate(r)||e.preventDefault()},{labelProps:o,inputProps:a,descriptionProps:s,errorMessageProps:l,...u}=function(e,t){let{inputElementType:r="input",isDisabled:n=!1,isRequired:i=!1,isReadOnly:o=!1,type:a="text",validationBehavior:s="aria"}=e,[l,u]=vy(e.value,e.defaultValue||"",e.onChange),{focusableProps:c}=yt(e,t),d=_d({...e,value:l}),{isInvalid:f,validationErrors:p,validationDetails:h}=d.displayValidation,{labelProps:m,fieldProps:y,descriptionProps:g,errorMessageProps:b}=v9({...e,isInvalid:f,errorMessage:e.errorMessage||p}),v=ms(e,{labelable:!0}),w={type:a,pattern:e.pattern},[x]=(0,c1.useState)(l);return v7(t,e.defaultValue??x,u),_e(e,d,t),{labelProps:m,inputProps:hX(v,"input"===r?w:void 0,{disabled:n,readOnly:o,required:i&&"native"===s,"aria-required":i&&"aria"===s||void 0,"aria-invalid":f||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(mp(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(c3().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,...y}),descriptionProps:g,errorMessageProps:b,isInvalid:f,validationErrors:p,validationDetails:h}}(e,r),c=(0,c1.useRef)(null);return{inputProps:hX(a,{onBeforeInput:i,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:n}=r.current;c.current={value:e,selectionStart:t,selectionEnd:n}},onCompositionEnd(){if(r.current&&!t.validate(r.current.value)){let{value:e,selectionStart:n,selectionEnd:i}=c.current;r.current.value=e,r.current.setSelectionRange(n,i),t.setInputValue(e)}}}),labelProps:o,descriptionProps:s,errorMessageProps:l,...u}}({...A,...eo,name:void 0,form:void 0,label:E,autoFocus:x,isDisabled:y,isReadOnly:g,isRequired:b,validate:void 0,[_c]:t,value:F,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:K,type:"text",inputMode:ei,onChange:e=>{t.validate(e)&&t.setInputValue(e)},onBlur:D,onFocus:O,onFocusChange:P,onKeyDown:(0,c1.useMemo)(()=>h$(ea,C),[ea,C]),onKeyUp:k,onPaste:t=>{e.onPaste?.(t);let r=mp(t);r&&(r.selectionEnd??-1)-(r.selectionStart??0)===r.value.length&&(t.preventDefault(),B(t.clipboardData?.getData?.("text/plain")?.trim()??""))},description:T,errorMessage:j},t,r);v7(r,t.defaultNumberValue,t.setNumberValue),i=t,o=e.validationBehavior,a=e.commitBehavior,s=r,l=t.minValue,u=t.maxValue,c=e.step,d=t.numberValue,hL(()=>{let e=s.current;if("validate"!==a||i.realtimeValidation.isInvalid||!e||e.disabled||(!x6&&"u">typeof document&&((x6=document.createElement("input")).type="number"),!x6))return;x6.min=null==l||isNaN(l)?"":String(l),x6.max=null==u||isNaN(u)?"":String(u),x6.step=null==c||isNaN(c)?"":String(c),x6.value=null==d||isNaN(d)?"":String(d);let t=e.validity.valid&&x6.validity.valid,r=e.validationMessage||x6.validationMessage,n={isInvalid:!t,validationErrors:r?[r]:[],validationDetails:{badInput:e.validity.badInput,customError:e.validity.customError,patternMismatch:e.validity.patternMismatch,rangeOverflow:x6.validity.rangeOverflow,rangeUnderflow:x6.validity.rangeUnderflow,stepMismatch:x6.validity.stepMismatch,tooLong:e.validity.tooLong,tooShort:e.validity.tooShort,typeMismatch:e.validity.typeMismatch,valueMissing:e.validity.valueMissing,valid:t}};i.updateValidation(n),"native"!==o||x6.validity.valid||e.setCustomValidity(x6.validationMessage)});let eh=hX(Y,H,ed,{role:null,"aria-roledescription":mA()?null:U.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(eh["aria-required"]=void 0);let em=e=>{((e=document)=>e.activeElement)()!==r.current&&("mouse"===e.pointerType?r.current?.focus():e.target.focus())},ey=e["aria-label"]||("string"==typeof e.label?e.label:"");ey||(f=null!=e.label?ec.id:e["aria-labelledby"]);let eg=hY(),eb=hY(),ev=hX(J,{"aria-label":m||U.format("increase",{fieldLabel:ey}).trim(),id:f&&!m?eg:null,"aria-labelledby":f&&!m?`${eg} ${f}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:em}),e_=hX(Q,{"aria-label":h||U.format("decrease",{fieldLabel:ey}).trim(),id:f&&!h?eb:null,"aria-labelledby":f&&!h?`${eb} ${f}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:em});return{groupProps:{...et,role:"group","aria-disabled":y,"aria-invalid":es?"true":void 0},labelProps:ec,inputProps:eh,incrementButtonProps:ev,decrementButtonProps:e_,errorMessageProps:ep,descriptionProps:ef,isInvalid:es,validationErrors:el,validationDetails:eu}}({...h5(e),label:c,validationBehavior:o},s,l),v=h3({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:b.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),w=ms(e);return delete w.id,c3().createElement(h1,{values:[[x7,s],[vM,f],[vI,{...p,ref:l}],[_J,{...d,ref:u}],[yI,{slots:{increment:h,decrement:m}}],[yF,{slots:{description:y,errorMessage:g}}],[_q,b]]},c3().createElement("div",{...w,...v,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":b.isInvalid||void 0}),e.name&&c3().createElement("input",{type:"hidden",name:e.name,value:isNaN(s.numberValue)?"":s.numberValue}))});function Et(e,t){return Number.parseInt(x$(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let Er=(0,c1.forwardRef)(function(e,t){let{className:r}=e,n=(0,c1.useContext)(vS),i=(0,c1.useContext)(vD),o=n??i,a=(0,c1.useContext)(xY),s=br(),l=x$(o.visibleRange.start.toDate(s),{calendar:a.calendar,locale:a.baseName,day:!1,year:!1,noToday:!0}),u=Et(o.visibleRange.start.toDate(s),a),c=o.maxValue?Et(o.maxValue.toDate(s),a):void 0,d=o.minValue?Et(o.minValue.toDate(s),a):void 0,f=(0,c1.useCallback)(e=>{o.setFocusedDate(o.focusedDate.cycle("year",e-o.focusedDate.year))},[]);return o&&(0,fW.jsxs)("span",{ref:t,className:r,children:[(0,fW.jsx)("span",{children:l}),(0,fW.jsxs)(Ee,{formatOptions:{useGrouping:!1},maxValue:c,minValue:d,onChange:f,value:u,children:[(0,fW.jsx)(v$,{}),(0,fW.jsxs)(vN,{children:[(0,fW.jsx)(y$,{slot:"increment",children:(0,fW.jsx)(pu,{size:8})}),(0,fW.jsx)(y$,{slot:"decrement",children:(0,fW.jsx)(pa,{size:8})})]})]})]})}),En="-esm-form-builder__datepicker-module__inputGroup___-wpzr",Ei="-esm-form-builder__datepicker-module__inputSegment___ocu7L",Eo="-esm-form-builder__datepicker-module__dateInputWrapper___909Km",Ea="-esm-form-builder__datepicker-module__invalidText___oHJHi",Es="-esm-form-builder__datepicker-module__flatButton___i9LDo",El="-esm-form-builder__datepicker-module__flatButtonMd___VZMkc",Eu="-esm-form-builder__datepicker-module__flatButtonSm___VA5wy",Ec="-esm-form-builder__datepicker-module__flatButtonLg___MnYLl";function Ed({children:e}){let t=(0,c1.useContext)(wG),r=(0,c1.useContext)(wZ),n=t??r,i=fx(()=>n?.close());return(0,fW.jsx)(_z,{className:"-esm-form-builder__datepicker-module__dialog___2pADb",ref:i,children:e})}let Ef=(0,c1.forwardRef)(function({variant:e,today_:t,minDate:r,maxDate:n},i){let o="range"===e;return(0,fW.jsx)(wW,{ref:i,className:"-esm-form-builder__datepicker-module__popover___pb58i",placement:"bottom start",offset:1,isNonModal:!0,children:(0,fW.jsx)(Ed,{children:(0,fW.jsxs)(o?vP:vO,{...o?{minValue:r,maxValue:n,className:"cds--date-picker__calendar"}:{},children:[(0,fW.jsxs)("header",{className:"-esm-form-builder__datepicker-module__header___+fi16",children:[(0,fW.jsx)(y$,{className:fH()(Es,El),slot:"previous",children:(0,fW.jsx)(py,{size:16})}),(0,fW.jsx)(Er,{className:"-esm-form-builder__datepicker-module__monthYear___mGhot"}),(0,fW.jsx)(y$,{className:fH()(Es,El),slot:"next",children:(0,fW.jsx)(pg,{size:16})})]}),(0,fW.jsx)(vk,{className:"-esm-form-builder__datepicker-module__calendarGrid___z07wV",children:e=>(0,fW.jsx)(vA,{className:fH()("cds--date-picker__day",{"-esm-form-builder__datepicker-module__today___dNc4M":0===t.compare(e)}),date:e},e.toString())})]})})})}),Ep=(0,c1.forwardRef)(function(e,t){let r=(0,c1.useContext)(wG),[n,i]=h2({slot:e.slot},t,_M),{locale:o}=y0(),a=_A({...n,locale:o,createCalendar:vs}),s=(0,c1.useRef)(null),{fieldProps:l,inputProps:u}=_i({...n,inputRef:s},a,i),c=(0,c1.useCallback)(()=>{a.isDisabled||r.toggle()},[]);return(0,fW.jsxs)(h1,{values:[[_N,a],[vI,{...u,ref:s}],[vM,{...l,ref:i,isInvalid:a.isInvalid}]],children:[(0,fW.jsx)(vN,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:a.isDisabled,isInvalid:a.isInvalid,onClick:c,children:a.segments.map((t,r)=>(0,c1.cloneElement)(e.children(t),{key:r}))}),(0,fW.jsx)(v$,{})]})}),Eh=(0,c1.forwardRef)(function(e,t){let r=(0,c1.useContext)(wG),n=(0,c1.useContext)(wZ);return(r??n).isInvalid?(0,fW.jsx)(hS,{ref:t,size:16,...e}):(0,fW.jsx)(po,{ref:t,size:16,...e})});class Em{constructor(e,t){this.locale=e,this.dictionary=t}of(e){return this.dictionary.getStringForLocale(e,this.locale)}}let Ey=new Map,Eg=(0,c1.forwardRef)(function({segment:e,...t},r){let n=(0,c1.useContext)(_N),i=hM(r),{segmentProps:o}=function(e,t,r){let n,i,o,a,s=(0,c1.useRef)(""),{locale:l,direction:u}=y0(),c=function(){var e;let{locale:t}=y0(),r=gd((e=v6)&&e.__esModule?e.default:e,"@react-aria/datepicker");return(0,c1.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new Em(t,r)}},[t,r])}(),{ariaLabel:d,ariaLabelledBy:f,ariaDescribedBy:p,focusManager:h}=_t.get(t),m=e.isPlaceholder?"":e.text,y=(0,c1.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),g=gr({month:"long",timeZone:y.timeZone}),b=gr({hour:"numeric",hour12:y.hour12,timeZone:y.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(m=b.format(t.dateValue));else{let e=g.format(t.dateValue);m=e!==m?`${m} \u{2013} ${e}`:e}let{spinButtonProps:v}=x2({value:e.value??void 0,textValue:m,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="",t.incrementToMax(e.type)},onDecrementToMin:()=>{s.current="",t.decrementToMin(e.type)}}),w=(0,c1.useMemo)(()=>new(0,x5.d)(l,{maximumFractionDigits:0}),[l]),x=()=>{if(e.text===e.placeholder&&h.focusPrevious(),!w.isValidPartialNumber(e.text)||t.isReadOnly||e.isPlaceholder)("dayPeriod"===e.type||"era"===e.type)&&t.clearSegment(e.type);else{let r=e.text.slice(0,-1),n=w.parse(r);0===(r=0===n?"":r).length||0===n?t.clearSegment(e.type):t.setSegment(e.type,n),s.current=r}},{startsWith:E}=(n=function(e){let{locale:t}=y0(),r=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(Ey.has(r))return Ey.get(r);let n=new Intl.Collator(t,e);return Ey.set(r,n),n}({usage:"search",sensitivity:"base"}),i=(0,c1.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(0,t.length),t)),[n]),o=(0,c1.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(-t.length),t)),[n]),a=(0,c1.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let r=0,i=(t=t.normalize("NFC")).length;for(;r+i<=e.length;r++){let o=e.slice(r,r+i);if(0===n.compare(t,o))return!0}return!1},[n]),(0,c1.useMemo)(()=>({startsWith:i,endsWith:o,contains:a}),[i,o,a])),S=gr({hour:"numeric",hour12:!0}),D=(0,c1.useMemo)(()=>{let e=new Date;return e.setHours(0),S.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[S]),O=(0,c1.useMemo)(()=>{let e=new Date;return e.setHours(12),S.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[S]),P=gr({year:"numeric",era:"narrow",timeZone:"UTC"}),C=(0,c1.useMemo)(()=>{if("era"!==e.type)return[];let r=g0(new gB(1,1,1),t.calendar),n=t.calendar.getEras().map(e=>{let t=r.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:P.formatToParts(t).find(e=>"era"===e.type).value}}),i=function(e){e.sort();let t=e[0],r=e[e.length-1];for(let e=0;e<t.length;e++)if(t[e]!==r[e])return e;return 0}(n.map(e=>e.formatted));if(i)for(let e of n)e.formatted=e.formatted.slice(i);return n},[P,t.calendar,e.type]),k=r=>{if(t.isDisabled||t.isReadOnly)return;let n=s.current+r;switch(e.type){case"dayPeriod":if(E(D,r))t.setSegment("dayPeriod",0);else if(E(O,r))t.setSegment("dayPeriod",1);else break;h.focusNext();break;case"era":{let e=C.find(e=>E(e.formatted,r));e&&(t.setSegment("era",e.era),h.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!w.isValidPartialNumber(n))return;let i=w.parse(n),o=i;if(void 0!==e.maxValue&&i>e.maxValue&&(o=w.parse(r)),isNaN(i))return;t.setSegment(e.type,o),void 0!==e.maxValue&&(Number(i+"0")>e.maxValue||n.length>=String(e.maxValue).length)?(s.current="",h.focusNext()):s.current=n}}};bw((0,c1.useRef)("u">typeof document?document:null),"selectionchange",()=>{let e=window.getSelection();e?.anchorNode&&mf(r.current,e?.anchorNode)&&e.collapse(r.current)});let T=(0,c1.useRef)("");bw(r,"beforeinput",n=>{if(r.current)switch(n.preventDefault(),n.inputType){case"deleteContentBackward":case"deleteContentForward":w.isValidPartialNumber(e.text)&&!t.isReadOnly&&x();break;case"insertCompositionText":T.current=r.current.textContent,r.current.textContent=r.current.textContent;break;default:null!=n.data&&k(n.data)}}),bw(r,"input",e=>{let{inputType:t,data:n}=e;"insertCompositionText"===t&&(r.current&&(r.current.textContent=T.current),null!=n&&(E(D,n)||E(O,n))&&k(n))}),hL(()=>{let e=r.current;return()=>{((e=document)=>e.activeElement)()===e&&(h.focusPrevious()||h.focusNext())}},[r,h]);let j=mA()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,c1.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])||t.isInvalid||(p=void 0);let R=hY(),A=!t.isDisabled&&!t.isReadOnly&&e.isEditable,M="literal"===e.type?"":c.of(e.type),N=by({"aria-label":`${M}${d?`, ${d}`:""}${f?", ":""}`,"aria-labelledby":f});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let I={caretColor:"transparent"};if("rtl"===u){I.unicodeBidi="embed";let t=y[e.type];("numeric"===t||"2-digit"===t)&&(I.direction="ltr")}return{segmentProps:hX(v,N,{id:R,...j,"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:A,suppressContentEditableWarning:A,spellCheck:A?"false":void 0,autoCorrect:A?"off":void 0,[parseInt(c3().version,10)>=17?"enterKeyHint":"enterkeyhint"]:A?"next":void 0,inputMode:t.isDisabled||"dayPeriod"===e.type||"era"===e.type||!A?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:e=>{if("a"===e.key&&(mT()?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(),x()}},onFocus:()=>{s.current="",r.current&&bO(r.current,{containingElement:bE(r.current)});let e=window.getSelection();e?.collapse(r.current)},style:I,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}(e,n,i),{focusProps:a,isFocused:s,isFocusVisible:l}=yP(),{hoverProps:u,isHovered:c}=yR({...t,isDisabled:n.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=e;return(0,c1.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:i}):t,l="function"==typeof r?r({...s,defaultStyle:a||{}}):r,u="function"==typeof n?n({...s,defaultChildren:o}):null==n?o:n,{className:e??i,style:l||a?{...a,...l}:void 0,children:u??o,"data-rac":""}},[t,r,n,i,o,a,s])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:n.isInvalid,isDisabled:n.isDisabled,isHovered:c,isFocused:s,isFocusVisible:l},defaultChildren:e.text}),f=(0,c1.useCallback)(e=>{e.stopPropagation()},[]);return(0,fW.jsx)("span",{...hX(ms(t),o,a,u),...d,ref:i,style:o.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":n.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":n.isDisabled||void 0,"data-type":e.type,"data-hovered":c||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0,onClick:f})}),Eb={short:!1,size:"md"},Ev=(0,c1.forwardRef)(function(e,t){let{className:r,defaultValue:n,isDisabled:i,invalid:o,invalidText:a,isInvalid:s,label:l,labelText:u,light:c,maxDate:d,minDate:f,onChange:p,onChangeRaw:h,short:m,size:y,value:g,...b}={...Eb,...e},{calendar:v,intlLocale:w,today_:x}=xJ(),E=(0,c1.useId)(),S=!!(u??l),D=(0,c1.useMemo)(()=>wX(n,v),[n,v]),O=(0,c1.useMemo)(()=>wX(g,v,!0),[g,v]),P=(0,c1.useMemo)(()=>wX(d,v),[d,v]),C=(0,c1.useMemo)(()=>wX(f??xQ,v),[f,v]),k=(0,c1.useMemo)(()=>o||s,[o,s]),T=(0,c1.useMemo)(()=>(h&&p&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),h??(e=>p?.(w0(e)))),[h,p]);return(0,fW.jsx)(wQ,{locale:w.toString(),children:(0,fW.jsx)("div",{className:fH()("cds--form-item",r),children:(0,fW.jsx)(h1,{values:[[xY,w]],children:(0,fW.jsxs)(wY,{className:fH()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":m,"cds--date-picker--light":c}),defaultValue:D,isDisabled:i,isInvalid:k,maxValue:P,minValue:C,value:O,shouldForceLeadingZeros:"en"===w.language||void 0,...b,onChange:T,children:[(0,fW.jsxs)("div",{className:"cds--date-picker-container",children:[S&&(0,fW.jsx)(_Q,{className:fH()("cds--label",{"cds--label--disabled":i}),htmlFor:E,children:u??l}),(0,fW.jsxs)(vN,{className:En,children:[(0,fW.jsx)(Ep,{id:S?E:void 0,ref:t,className:fH()("cds--date-picker-input__wrapper","-esm-form-builder__datepicker-module__inputWrapper___MHJAy",{"-esm-form-builder__datepicker-module__inputWrapperSm___esx4E":"sm"===y,"-esm-form-builder__datepicker-module__inputWrapperMd___VQbzP":"md"===y||!y||0===y.length,"-esm-form-builder__datepicker-module__inputWrapperLg___Rk9Ce":"lg"===y}),children:e=>"era"!==e.type?(0,fW.jsx)(Eg,{className:Ei,segment:e}):(0,fW.jsx)(c3().Fragment,{})}),(0,fW.jsx)(y$,{className:fH()(Es,{[Eu]:"sm"===y,[El]:"md"===y||!y||0===y.length,[Ec]:"lg"===y}),children:(0,fW.jsx)(Eh,{})})]}),(0,fW.jsx)(_G,{className:Ea,children:a})]}),(0,fW.jsx)(Ef,{variant:"single",today_:x})]})})})})}),E_=(0,c1.forwardRef)(function({className:e,defaultValue:t,invalid:r,invalidText:n,isDisabled:i,isInvalid:o,label:a,labelText:s,light:l,maxDate:u,minDate:c,onChange:d,onChangeRaw:f,size:p="md",value:h,...m},y){let{calendar:g,intlLocale:b,today_:v}=xJ(),w=(0,c1.useId)(),x=!!(s??a),E=(0,c1.useMemo)(()=>{if(h)return{start:wX(h[0],g,!1),end:wX(h[1],g,!1)}},[h,g]),S=(0,c1.useMemo)(()=>{if(t)return{start:wX(t[0],g,!1),end:wX(t[1],g,!1)}},[t,g]),D=(0,c1.useMemo)(()=>wX(c??xQ,g,!0),[c,g]),O=(0,c1.useMemo)(()=>wX(u,g,!0),[u,g]),P=(0,c1.useMemo)(()=>r||o,[r,o]),C=(0,c1.useMemo)(()=>(f&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),f??(e=>d?.([w0(e.start),w0(e.end)]))),[f,d]);return(0,fW.jsx)(wQ,{locale:b.toString(),children:(0,fW.jsx)("div",{className:fH()("cds--form-item",e),children:(0,fW.jsx)(h1,{values:[[xY,b]],children:(0,fW.jsx)(wJ,{id:x?w:void 0,className:fH()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":i}),isInvalid:P,shouldForceLeadingZeros:"en"===b.language||void 0,maxValue:O,minValue:D,value:E,defaultValue:S,ref:y,isDisabled:i,...m,onChange:C,children:(0,fW.jsxs)("div",{className:"cds--date-picker-container",children:[x&&(0,fW.jsx)(_Q,{className:fH()("cds--label",{"cds--label--disabled":i}),htmlFor:w,children:s??a}),(0,fW.jsxs)(vN,{className:En,children:[(0,fW.jsxs)("div",{className:fH()("-esm-form-builder__datepicker-module__inputsWrapper___UyGoG",{"-esm-form-builder__datepicker-module__inputsWrapperSm___qrGsA":"sm"===p,"-esm-form-builder__datepicker-module__inputsWrapperMd___pofu4":"md"===p||!p||0===p.length,"-esm-form-builder__datepicker-module__inputsWrapperLg___eF1Im":"lg"===p}),children:[(0,fW.jsx)(_$,{className:fH()("cds--date-picker-input__wrapper","-esm-form-builder__datepicker-module__startInput___C8vnM",Eo),slot:"start",children:e=>(0,fW.jsx)(Eg,{className:Ei,segment:e})}),(0,fW.jsx)("div",{className:"-esm-form-builder__datepicker-module__separator___vHLFZ",children:(0,fW.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,fW.jsx)(_$,{className:fH()("cds--date-picker-input__wrapper","-esm-form-builder__datepicker-module__endInput___25OF9",Eo),slot:"end",children:e=>(0,fW.jsx)(Eg,{className:Ei,segment:e})})]}),(0,fW.jsx)(y$,{className:fH()(Es,{[Eu]:"sm"===p,[El]:"md"===p||!p||0===p.length,[Ec]:"lg"===p}),children:(0,fW.jsx)(Eh,{})})]}),(0,fW.jsx)(_G,{className:Ea,children:n}),(0,fW.jsx)(Ef,{variant:"range",today_:v,minDate:D,maxDate:O})]})})})})})}),Ew=({diagnoses:e})=>{let{diagnosisTags:t}=dQ({externalModuleName:"@openmrs/esm-styleguide"});return(0,fW.jsx)("div",{className:"-esm-form-builder__diagnosis-tags-module__container___l7XiW",children:e.map(e=>{let{rank:r,uuid:n,display:i}=e,o=t[1===r?"primaryColor":"secondaryColor"];return(0,fW.jsx)(fq.vwO,{type:o,children:i},n)})})},Ex={action:"-esm-form-builder__empty-card-module__action___l4wUo",content:"-esm-form-builder__empty-card-module__content___XbsSJ",desktopHeading:"-esm-form-builder__empty-card-module__desktopHeading___0EPXX",tabletHeading:"-esm-form-builder__empty-card-module__tabletHeading___unl1F",tile:"-esm-form-builder__empty-card-module__tile___vS3Sj"},EE=({width:e="64",height:t="64"})=>(0,fW.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,fW.jsx)("use",{href:"#omrs-empty-data-illustration"})}),ES=e=>{let t="tablet"===fg(),r=e.launchForm;return(0,fW.jsx)(fq.Wdr,{className:Ex.layer,children:(0,fW.jsxs)(fq.FAs,{className:Ex.tile,children:[(0,fW.jsx)("div",{className:t?Ex.tabletHeading:Ex.desktopHeading,children:(0,fW.jsx)("h4",{children:e.headerTitle})}),(0,fW.jsx)(EE,{}),(0,fW.jsx)("p",{className:Ex.content,children:os("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,fW.jsx)("p",{className:Ex.action,children:r&&(0,fW.jsx)(fq.$nd,{onClick:()=>r(),kind:"ghost",size:t?"lg":"sm",children:os("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},ED=({error:e,headerTitle:t})=>{let r="tablet"===fg();return(0,fW.jsx)(fq.Wdr,{children:(0,fW.jsxs)(fq.FAs,{className:"-esm-form-builder__error-state-module__tile___hHM56",children:[(0,fW.jsx)("div",{className:r?"-esm-form-builder__error-state-module__tabletHeading___W7a4U":"-esm-form-builder__error-state-module__desktopHeading___VL8Rv",children:(0,fW.jsx)("h4",{children:t})}),(0,fW.jsxs)("p",{className:"-esm-form-builder__error-state-module__errorMessage___IytZy",children:[os("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,fW.jsx)("p",{className:"-esm-form-builder__error-state-module__errorCopy___E1yZO",children:os("errorCopy")})]})})},EO=ED,EP=c3().forwardRef((e,t)=>{let{slotName:r,basePath:n,componentContext:i,state:o}=f_(),a=window.location??{pathname:""},s=df(r??"");return e.isChildOfHeader&&r&&s.length>0?(0,fW.jsxs)(fq.f8J,{"aria-label":os("leftNavigation","Left navigation"),className:"-esm-form-builder__left-nav-module__leftNav___ZqLpw",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,fW.jsx)(dm,{name:"global-nav-menu-slot"}),r?(0,fW.jsx)(dW,{value:i,fallback:(0,fW.jsx)(dm,{name:r,state:{basePath:n,currentPath:a,...o}}),children:(0,fW.jsx)(dt.Provider,{value:i,children:(0,fW.jsx)(dm,{name:r,state:{basePath:n,currentPath:a,...o}})})}):null]}):null}),EC=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:r,locationsPerRequest:n=50,onChange:i})=>{let[o,a]=(0,c1.useState)(""),s=(0,c1.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:r,error:n,isLoading:i}=(0,d3.A)(t,n9,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,c1.useMemo)(()=>({location:r?.data?.entry?r.data.entry[0]:null,error:t?n:null,isLoading:!!t&&i}),[r,i,n,t])}(t),{locations:u,isLoading:c,hasMore:d,loadingNewData:f,error:p,setPage:h}=function(e,t=0,r=""){let n=d1(r),{data:i,isLoading:o,isValidating:a,setSize:s,error:l}=fu(function(r,i){if(i){let e=i.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=`${n6}/Location?`,a=new URLSearchParams;return a.append("_summary","data"),t&&a.append("_count",""+t),r&&a.append("_getpagesoffset",""+r*t),e&&a.append("_tag",e),"string"==typeof n&&""!==n&&a.append("name:contains",n),o+a.toString()},n9);return(0,c1.useMemo)(()=>({locations:i?.length?i?.flatMap(e=>e?.data?.entry??[]):[],isLoading:o,totalResults:i?.[0]?.data?.total,hasMore:!!i?.length&&i?.[i.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:a,error:l||null,setPage:s}),[o,i,a,s,l])}(r,n,o),m=(0,c1.useMemo)(()=>l&&!o&&t?[l,...u.filter(({resource:e})=>e.id!==t)]:u??[],[l,u,t,o]),y=(0,c1.useCallback)(e=>{i(),a(e.trim())},[i]),g=fE((0,c1.useCallback)(()=>{!f&&d&&h(e=>e+1)},[f,d,h])),b=d?Math.max(0,Math.floor(m.length-n/2)):-1;return(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsx)(fq.vji,{"aria-describedby":p?`${s}-error`:void 0,labelText:os("searchForLocation"),id:s,placeholder:os("searchForLocation"),onChange:e=>y(e.target.value),size:"lg"}),p&&(0,fW.jsx)("div",{className:"-esm-form-builder__location-picker-module__errorNotification___MBWvf",id:`${s}-error`,children:(0,fW.jsx)(fq.jeF,{kind:"error",subtitle:os("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:os("error","Error")})}),(0,fW.jsx)("div",{className:"-esm-form-builder__location-picker-module__searchResults___aCL93",children:c?(0,fW.jsx)("div",{className:"-esm-form-builder__location-picker-module__loadingContainer___Vn1H0",children:Array.from({length:5}).map((e,t)=>(0,fW.jsx)(fq.Psq,{className:"-esm-form-builder__location-picker-module__radioButtonSkeleton___RKMHj",role:"progressbar"},t))}):(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsx)("div",{className:"-esm-form-builder__location-picker-module__locationResultsContainer___5yuvs",children:m.length>0?(0,fW.jsx)(fq.zWQ,{name:"loginLocations",onChange:e=>{i(e?.toString())},orientation:"vertical",valueSelected:e,children:m.map((e,t)=>(0,fW.jsx)(fq.aaP,{className:"-esm-form-builder__location-picker-module__locationRadioButton___b52LI",id:e.resource.id,labelText:(0,fW.jsx)("span",{ref:t===b?g:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,fW.jsx)("div",{className:"-esm-form-builder__location-picker-module__emptyState___qiPqQ",children:(0,fW.jsx)("p",{className:"-esm-form-builder__location-picker-module__locationNotFound___tKDOJ",children:os("noResultsToDisplay")})})}),f&&(0,fW.jsx)("div",{className:"-esm-form-builder__location-picker-module__loadingIcon___PGwvc",children:(0,fW.jsx)(fq.OuH,{description:os("loading")})})]})})]})},Ek=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],ET=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"];function Ej(e){if(e)return"--"===e?"normal":Ek.includes(e)?e.toLowerCase():ET.includes(e)?e:"normal"}function ER(e,t){if(!t||null==e||""===e)return"normal";let r="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(r)?"normal":null!==t.hiAbsolute&&void 0!==t.hiAbsolute&&r>t.hiAbsolute?"off_scale_high":null!==t.hiCritical&&void 0!==t.hiCritical&&r>=t.hiCritical?"critically_high":null!==t.hiNormal&&void 0!==t.hiNormal&&r>t.hiNormal?"high":null!==t.lowAbsolute&&void 0!==t.lowAbsolute&&r<t.lowAbsolute?"off_scale_low":null!==t.lowCritical&&void 0!==t.lowCritical&&r<=t.lowCritical?"critically_low":null!==t.lowNormal&&void 0!==t.lowNormal&&r<t.lowNormal?"low":"normal"}function EA(e,t){let r=null;e&&(r=t?`${n2}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${n2}/conceptreferencerange/?concept=${e}&v=full`);let{data:n,error:i,isLoading:o}=(0,d3.A)(r,n9),a=n?.data?.results?.[0];return{referenceRange:a?{hiNormal:a.hiNormal??null,hiAbsolute:a.hiAbsolute??null,hiCritical:a.hiCritical??null,lowNormal:a.lowNormal??null,lowAbsolute:a.lowAbsolute??null,lowCritical:a.lowCritical??null}:void 0,error:i,isLoading:o}}let EM={container:"-esm-form-builder__numeric-observation-module__container___+Kqi9",card:"-esm-form-builder__numeric-observation-module__card___Q-ECG","abnormal-value":"-esm-form-builder__numeric-observation-module__abnormal-value___bx1h9","critical-value":"-esm-form-builder__numeric-observation-module__critical-value___nSKSX",cell:"-esm-form-builder__numeric-observation-module__cell___wc90e","critically-high":"-esm-form-builder__numeric-observation-module__critically-high___fmZfJ","critically-low":"-esm-form-builder__numeric-observation-module__critically-low___h9797",high:"-esm-form-builder__numeric-observation-module__high___0-YpP",low:"-esm-form-builder__numeric-observation-module__low___TuqAk","label-container":"-esm-form-builder__numeric-observation-module__label-container___FtozC","value-container":"-esm-form-builder__numeric-observation-module__value-container___R9qoY",label:"-esm-form-builder__numeric-observation-module__label___0DGA5",value:"-esm-form-builder__numeric-observation-module__value___ohqoh",units:"-esm-form-builder__numeric-observation-module__units___xvMd3","pad-right":"-esm-form-builder__numeric-observation-module__pad-right___umcen","off-scale-low":"-esm-form-builder__numeric-observation-module__off-scale-low___my+0i","off-scale-high":"-esm-form-builder__numeric-observation-module__off-scale-high___so9dv",arrow:"-esm-form-builder__numeric-observation-module__arrow___Agoh9"},EN=({value:e,unit:t,label:r,interpretation:n,referenceRange:i,conceptUuid:o,variant:a="card",patientUuid:s})=>{let l=(0,c1.useId)(),{referenceRange:u,isLoading:c}=EA(i||n?void 0:o,s),d=i??u,f=(0,c1.useMemo)(()=>n?Ej(n):d&&!c?ER(e,d):"normal",[n,d,e,c])??"normal",p="critically_low"===f||"critically_high"===f||"off_scale_low"===f||"off_scale_high"===f,h="normal"!==f,m=r?`omrs-numeric-obs-label-${r.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,y=`omrs-numeric-obs-value-${l}`,g=`omrs-numeric-obs-unit-${l}`,b=null!=e&&""!==e,v=b?e:os("notAvailable","Not available"),w=fH()({[EM["critically-low"]]:"critically_low"===f||"off_scale_low"===f,[EM["critically-high"]]:"critically_high"===f||"off_scale_high"===f,[EM.low]:"low"===f,[EM.high]:"high"===f,[EM["off-scale-low"]]:"off_scale_low"===f,[EM["off-scale-high"]]:"off_scale_high"===f}),x=fH()({[EM.container]:!0,[EM.card]:!0,[EM["critical-value"]]:p,[EM["abnormal-value"]]:h&&!p}),E=fH()({[EM.cell]:!0,[w]:!0});return"cell"===a?(0,fW.jsxs)("div",{className:E,children:[v,b&&t?` ${t}`:""]}):(0,fW.jsxs)("section",{className:x,"data-testid":"numeric-observation-card",children:[r&&(0,fW.jsxs)("div",{className:EM["label-container"],children:[(0,fW.jsx)("span",{id:m,className:EM.label,children:r}),h&&(0,fW.jsx)("span",{className:EM[f.replace("_","-")],title:os("abnormalValue","Abnormal value")})]}),(0,fW.jsxs)("div",{className:EM["value-container"],children:[(0,fW.jsx)("span",{id:y,"aria-labelledby":m&&g?`${m} ${g}`:m||g||void 0,className:EM.value,children:v}),b&&t&&(0,fW.jsx)("span",{id:g,className:EM.units,children:t})]})]})},EI=K("modalState",{modalContainer:null,modalStack:[]});function E$(e,t={},r=()=>{}){let n=()=>{let e=EI.getState().modalStack.find(e=>e.onClose===r);e&&function(e){if("TO_BE_DELETED"===e.state||"DELETED"===e.state)return;e.state="TO_BE_DELETED";let t=EI.getState();EI.setState({...t,modalStack:[...t.modalStack]})}(e)};if(function(e){let t=c2.getState().modals[e];if(!t){let n=cP(e);if(n){var r;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.`),r=t,c2.setState(e=>(e.modals[r.name]=r,e))}}return t}(e)){var i;let o,a;i={state:"NEW",onClose:r,modalName:e,props:{close:n,...t}},a=[i,...(o=EI.getState()).modalStack],EI.setState({...o,modalStack:a})}else j(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return n}window.getComputedStyle(document.body).overflow;var EL=r(66401);let EF=new ea.Subject,EB=0,EV=new ea.Subject,EU=0;function EW(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!(0,EL.A)(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{EF.next({...e,id:EB++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function EK(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!(0,EL.A)(t))?setTimeout(()=>{EV.next({...e,id:EU++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let EH="-esm-form-builder__page-header-module__pageHeader___XNJYe",Ez=e=>{if("children"in e){let{children:t,className:r,...n}=e;return(0,fW.jsx)("div",{className:fH()(EH,r),...n,children:t})}{let{title:t,illustration:r,className:n,...i}=e;return(0,fW.jsx)("div",{className:fH()(EH,n),...i,children:(0,fW.jsx)(Eq,{title:t,illustration:r})})}},Eq=({title:e,illustration:t,className:r})=>{let[n,i]=(0,c1.useState)(null);return(0,c1.useEffect)(()=>{t2("@openmrs/esm-styleguide").then(e=>{i(e)})},[]),(0,fW.jsxs)("div",{className:fH()("-esm-form-builder__page-header-module__pageHeaderContent___V-mTz",r),children:[t,(0,fW.jsxs)("div",{className:"-esm-form-builder__page-header-module__pageLabels___vGJvg",children:[n?.implementationName&&(0,fW.jsx)("p",{children:os(n.implementationName)}),(0,fW.jsx)("p",{className:"-esm-form-builder__page-header-module__pageName___+eYMc",children:e})]})]})},EG=({totalItems:e,pageSize:t,onPageNumberChange:r,pageNumber:n,dashboardLinkUrl:i,currentItems:o,dashboardLinkLabel:a})=>{let{pageSizes:s,pageItemsCount:l}=fO(t,e,n,o),u="tablet"===fg(),c=os("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,fW.jsx)(fW.Fragment,{children:e>0&&(0,fW.jsxs)("div",{className:fH()({"-esm-form-builder__pagination-module__tablet___DdaYk":u,"-esm-form-builder__pagination-module__desktop___rSwlo":!u}),children:[(0,fW.jsxs)("div",{children:[c,i&&(0,fW.jsx)(c4,{to:i,className:"-esm-form-builder__pagination-module__configurableLink___cTCLf",children:a??os("seeAll","See all")})]}),(0,fW.jsx)(fq.dKS,{className:"-esm-form-builder__pagination-module__pagination___U6anZ",page:n,pageSize:t,pageSizes:s,totalItems:e,onChange:r,pageRangeText:(e,t)=>os("paginationOfPages","of {{count}} pages",{count:t}),size:u?"lg":"sm"})]})})};function EZ(e){return EJ(EX(e,"usual","official"))}function EY(e){return EZ(e)}function EJ(e){var t;let r;return e?e.text??(r=(t=e).given??[],(t.family?r.concat(t.family):r).join(" ")):""}function EQ(e){return EJ(e)}function EX(e,...t){for(let r of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,n;return t=e,n=r,t.use?t.use===n:"usual"===n});if(t)return t}}function E0(e,t=fA()){let r=fA(t),n=xW(e,r);if(null==n)return null;let i=r.diff(n,"hours"),o=r.diff(n,"days"),a=r.diff(n,"weeks"),s=r.diff(n,"months"),l=r.diff(n,"years"),u={};if(i<2)u.minutes=r.diff(n,"minutes");else if(o<2)u.hours=i;else if(a<4)u.days=o;else if(l<1){let e=r.subtract(a,"weeks").diff(n,"days");u.weeks=a,u.days=e}else if(l<2){let e=r.subtract(s,"months").diff(n,"days");u.months=s,u.days=e}else if(l<18){let e=r.subtract(l,"year").diff(n,"months");u.years=l,u.months=e}else u.years=l;return u}function E1(e,t=fA()){let r=E0(e,t);if(null==r)return null;let n={style:"short",localeMatcher:"lookup"};return"minutes"in r&&0===r.minutes&&(n.minutesDisplay="always"),xU(r,n)}let E3={container:"-esm-form-builder__patient-banner-patient-info-module__container___WV40g",activePatientContainer:"-esm-form-builder__patient-banner-patient-info-module__activePatientContainer___YBgYK",patientBanner:"-esm-form-builder__patient-banner-patient-info-module__patientBanner___o-DQc",patientName:"-esm-form-builder__patient-banner-patient-info-module__patientName___KWLAJ",patientAvatar:"-esm-form-builder__patient-banner-patient-info-module__patientAvatar___gG4I3",patientAvatarButton:"-esm-form-builder__patient-banner-patient-info-module__patientAvatarButton___by4L9",patientInfo:"-esm-form-builder__patient-banner-patient-info-module__patientInfo___VU1fL",demographics:"-esm-form-builder__patient-banner-patient-info-module__demographics___xDHsd",row:"-esm-form-builder__patient-banner-patient-info-module__row___MlVwp",flexRow:"-esm-form-builder__patient-banner-patient-info-module__flexRow___9Aj3s",tagsSlot:"-esm-form-builder__patient-banner-patient-info-module__tagsSlot___PqCHJ",identifiers:"-esm-form-builder__patient-banner-patient-info-module__identifiers___bbREn",identifier:"-esm-form-builder__patient-banner-patient-info-module__identifier___HQzz8",primaryIdentifier:"-esm-form-builder__patient-banner-patient-info-module__primaryIdentifier___ocKCs",secondaryIdentifier:"-esm-form-builder__patient-banner-patient-info-module__secondaryIdentifier___4MLDH",value:"-esm-form-builder__patient-banner-patient-info-module__value___tkQTC",tag:"-esm-form-builder__patient-banner-patient-info-module__tag___u7Kco",gender:"-esm-form-builder__patient-banner-patient-info-module__gender___7eQuO",separator:"-esm-form-builder__patient-banner-patient-info-module__separator___CZBA8",tooltipPadding:"-esm-form-builder__patient-banner-patient-info-module__tooltipPadding___UQr5s",tooltipSmallText:"-esm-form-builder__patient-banner-patient-info-module__tooltipSmallText___MRUhY",actionsButtonText:"-esm-form-builder__patient-banner-patient-info-module__actionsButtonText___8ZC1R"};function E4({showIdentifierLabel:e,type:t,value:r}){return(0,fW.jsx)("span",{className:E3.primaryIdentifier,children:(0,fW.jsxs)(fq.vwO,{className:E3.tag,type:"gray",children:[e&&t?.text&&(0,fW.jsxs)("span",{className:E3.label,children:[t.text,": "]}),(0,fW.jsx)("span",{className:E3.value,children:r})]})})}function E2({showIdentifierLabel:e,type:t,value:r}){return(0,fW.jsxs)(fq.lRv,{className:E3.secondaryIdentifier,id:`patient-banner-identifier-${r}`,children:[e&&(0,fW.jsxs)("span",{className:E3.label,children:[t?.text,": "]}),(0,fW.jsx)("span",{className:E3.value,children:r})]})}function E6({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:r}=dQ(),{primaryIdentifierCode:n}=fk(),i=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!r?.uuids.includes(t)})??[];return(0,fW.jsx)(fW.Fragment,{children:i?.length?i.map(({value:e,type:r},o)=>(0,fW.jsxs)(c3().Fragment,{children:[(0,fW.jsx)("span",{className:E3.identifier,children:r?.coding?.[0]?.code===n?(0,fW.jsx)(E4,{showIdentifierLabel:t,type:r,value:e}):(0,fW.jsx)(E2,{showIdentifierLabel:t,type:r,value:e})}),o<i.length-1&&(0,fW.jsx)("span",{className:E3.separator,children:"\xb7"})]},e)):""})}let E5={Female:pk,Male:pT,Other:pj,Unknown:pR},E8=({gender:e})=>{let t=E5[e];return t?(0,fW.jsx)(t,{fill:"#525252"}):null},E9={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function E7({patient:e,renderedFrom:t}){var r;let n,i,o=EZ(e),a=e?.gender&&(i=E9[n=(r=e.gender).toLowerCase()]??"Unknown",{displayText:os(n,r),iconKey:i}),s=(0,c1.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,fW.jsxs)("div",{className:E3.patientInfo,children:[(0,fW.jsx)("div",{className:fH()(E3.row,E3.patientNameRow),children:(0,fW.jsxs)("div",{className:E3.flexRow,children:[(0,fW.jsx)("span",{className:E3.patientName,children:o}),a&&(0,fW.jsxs)("div",{className:E3.gender,children:[(0,fW.jsx)(E8,{gender:a.iconKey}),(0,fW.jsx)("span",{children:a.displayText})]}),(0,fW.jsx)(dm,{className:E3.tagsSlot,name:"patient-banner-tags-slot",state:s})]})}),(0,fW.jsxs)("div",{className:E3.demographics,children:[e.birthDate&&(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsx)("span",{children:E1(e.birthDate)}),(0,fW.jsx)("span",{className:E3.separator,children:"\xb7"}),(0,fW.jsx)("span",{children:xI(e.birthDate,{time:!1})}),(0,fW.jsx)("span",{className:E3.separator,children:"\xb7"})]}),(0,fW.jsx)(E6,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,fW.jsx)(dm,{className:E3.extensionSlot,name:"patient-banner-bottom-slot",state:s})]})]})}var Se=r(81673);function St({patient:e,patientUuid:t,actionsSlotName:r,additionalActionsSlotState:n}){let[i,o]=(0,c1.useState)(!1),{extensions:a}=dp(r),s="tablet"===fg(),l=fx(()=>o(!1),i),u=(0,c1.useRef)(null),c=(0,c1.useRef)(null),d=(0,c1.useId)(),f=`patient-actions-menu-trigger-${d}`,p=`patient-actions-menu-${d}`,h=(0,c1.useCallback)(()=>o(e=>!e),[]),m=(0,c1.useCallback)(()=>{o(!1),u.current?.focus()},[]),y=(0,c1.useCallback)(e=>{if("Escape"===e.key&&i){e.stopPropagation(),m();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&i){e.preventDefault();let t=c.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let r=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,n=Array.from(t).indexOf(r);if(-1===n)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let i=n+("ArrowDown"===e.key?1:-1),o=i<0?t.length-1:i>=t.length?0:i;t[o]?.focus()}},[m,i]);(0,c1.useEffect)(()=>{if(i&&c.current){let e=c.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[i]);let g=(0,c1.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:m,...n}),[t,e,m,n]);return 0===a.length?null:(0,fW.jsx)("div",{className:"-esm-form-builder__patient-banner-actions-menu-module__overflowMenuContainer___7eCLh",children:(0,fW.jsxs)("div",{"data-overflow-menu":!0,className:fH()("cds--overflow-menu",fG),ref:l,children:[(0,fW.jsxs)("button",{className:fH()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":i},fJ),"aria-controls":p,"aria-expanded":i,"aria-haspopup":"true",id:f,onClick:h,onKeyDown:y,ref:u,children:[(0,fW.jsx)("span",{className:"-esm-form-builder__patient-banner-actions-menu-module__actionsButtonText___TbM5a",children:os("actions","Actions")})," ",(0,fW.jsx)(Se.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,fW.jsxs)("div",{className:fH()("cds--overflow-menu-options","cds--overflow-menu--flip",fZ,{[fY]:i}),"aria-labelledby":f,"data-floating-menu-direction":"bottom",id:p,onKeyDown:y,ref:c,role:"menu",tabIndex:-1,children:[(0,fW.jsx)("ul",{className:fH()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":s}),children:(0,fW.jsx)(dm,{name:r,state:g},r)}),(0,fW.jsx)("span",{})]})]})})}function Sr({showContactDetails:e,toggleContactDetails:t,className:r}){return(0,fW.jsx)(fq.$nd,{className:r,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?pb:pm,children:e?os("showLess","Show less"):os("showMore","Show more")})}let Sn={contactDetails:"-esm-form-builder__patient-banner-contact-details-module__contactDetails___AvROu",deceased:"-esm-form-builder__patient-banner-contact-details-module__deceased___DDd39",heading:"-esm-form-builder__patient-banner-contact-details-module__heading___GGJyV",row:"-esm-form-builder__patient-banner-contact-details-module__row___8JcKK",col:"-esm-form-builder__patient-banner-contact-details-module__col___ct1O9",relationship:"-esm-form-builder__patient-banner-contact-details-module__relationship___GTTsg"},Si=({patientUuid:e})=>{let{cohorts:t=[],isLoading:r}=function(e){let t=e?`${n2}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:r,isLoading:n}=(0,dj.Ay)(t,n9),i=r?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,c1.useMemo)(()=>({cohorts:i,isLoading:n}),[n,i])}(e);return(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsxs)("p",{className:Sn.heading,children:[os("patientLists","Patient Lists")," (",t?.length??0,")"]}),r?(0,fW.jsx)(fq.OuH,{description:`${os("loading","Loading")} ...`,role:"progressbar"}):(0,fW.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>xT(e?.startDate).getTime()-xT(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,fW.jsx)("li",{children:(0,fW.jsx)(c4,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,fW.jsx)("li",{children:"--"})})(),t.length>3&&(0,fW.jsx)("li",{className:Sn.link,children:(0,fW.jsx)(c4,{to:`${window.spaBase}/home/patient-lists`,children:os("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},So=({patientId:e})=>{let{patient:t,isLoading:r}=fC(e),n=t?.address?.find(e=>"home"===e.use),i=e=>e.split("#")[1];return r?(0,fW.jsx)(fq.OuH,{description:`${os("loading","Loading")} ...`,role:"progressbar"}):(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsx)("p",{className:Sn.heading,children:os("address","Address")}),(0,fW.jsx)("ul",{children:n?Object.entries(n).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?n.extension?.[0]?.extension?.map((t,r)=>(0,fW.jsxs)("li",{children:[os(i(t.url),i(t.url)),": ",t.valueString]},`address-${e}-${r}`)):(0,fW.jsxs)("li",{children:[os(e,e),": ",t]},`address-${e}`)):(0,fW.jsx)("li",{children:"--"})})]})},Sa=({patientUuid:e})=>{let{isLoading:t,contactAttributes:r}=(e=>{let{contactAttributeTypes:t=[]}=dQ({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:r,error:n,isLoading:i}=(e=>{let{data:t,error:r,isLoading:n}=(0,d3.A)(`${n2}/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)))`,n9);return{isLoading:n,attributes:t?.data.person.attributes??[],error:r}})(e);return{contactAttributes:(0,c1.useMemo)(()=>r.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[r,t]),isLoading:i,error:n}})(e),n=(0,c1.useMemo)(()=>r?[...r?.map(e=>[e.attributeType.display?os(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[r]);return(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsx)("p",{className:Sn.heading,children:os("contactDetails","Contact Details")}),t?(0,fW.jsx)(fq.OuH,{description:`${os("loading","Loading")} ...`,role:"progressbar"}):(0,fW.jsx)("ul",{children:n.length?n.map(([e,t],r)=>(0,fW.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${r}`)):(0,fW.jsx)("li",{children:"--"})})]})},Ss=({patientId:e})=>{let{data:t,isLoading:r}=function(e){let t=`${n2}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:r,error:n,isLoading:i,isValidating:o}=(0,dj.Ay)(e?t:null,n9),a=r?.data?.results?.length?function(e,t){let r=[];for(let n of t)e===n.personA.uuid?r.push({uuid:`${n.uuid}`,display:n.personB.display,relativeAge:n.personB.age,relativeUuid:n.personB.uuid,relationshipType:n.relationshipType.bIsToA}):r.push({uuid:`${n.uuid}`,display:n.personA.display,relativeAge:n.personA.age,relativeUuid:n.personA.uuid,relationshipType:n.relationshipType.aIsToB});return r}(e,r.data.results):null;return{data:r?a:null,error:n,isLoading:i,isValidating:o}}(e);return(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsx)("p",{className:Sn.heading,children:os("relationships","Relationships")}),r?(0,fW.jsx)(fq.OuH,{description:`${os("loading","Loading")} ...`,role:"progressbar"}):(0,fW.jsx)("ul",{children:t&&t.length>0?(0,fW.jsx)(fW.Fragment,{children:t.map(e=>(0,fW.jsxs)("li",{className:Sn.relationship,children:[(0,fW.jsx)("div",{children:(0,fW.jsx)(c4,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,fW.jsx)("div",{children:e.relationshipType}),(0,fW.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?os("yearAbbreviation","yr"):os("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,fW.jsx)("li",{children:"--"})})]})};function Sl({patientId:e,deceased:t}){return(0,fW.jsxs)("div",{className:fH()(Sn.contactDetails,{[Sn.deceased]:t}),children:[(0,fW.jsxs)("div",{className:Sn.row,children:[(0,fW.jsx)("div",{className:Sn.col,children:(0,fW.jsx)(So,{patientId:e})}),(0,fW.jsx)("div",{className:Sn.col,children:(0,fW.jsx)(Sa,{patientUuid:e})})]}),(0,fW.jsxs)("div",{className:Sn.row,children:[(0,fW.jsx)("div",{className:Sn.col,children:(0,fW.jsx)(Ss,{patientId:e})}),(0,fW.jsx)("div",{className:Sn.col,children:(0,fW.jsx)(Si,{patientUuid:e})})]})]})}var Su=r(16767),Sc=r.n(Su);function Sd(e){let{patientPhotoConceptUuid:t}=dQ({externalModuleName:"@openmrs/esm-styleguide"}),r=t?`${n2}/obs?patient=${e}&concept=${t}&v=full`:null,{data:n,error:i,isLoading:o}=(0,dj.Ay)(e?r:null,n9),a=n?.data?.results[0];return{data:a?{dateTime:a?.obsDatetime,imageSrc:a?.value?.links?.uri}:null,error:i,isLoading:o}}let Sf=({width:e=56,height:t=56,"aria-label":r})=>{let{t:n}=(0,dT.useTranslation)();return(0,fW.jsxs)("svg",{"aria-label":r??n("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,fW.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,fW.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"})]})},Sp="-esm-form-builder__patient-photo-module__avatar___R93LX";function Sh({patientUuid:e,patientName:t,alt:r}){let{data:n,isLoading:i}=Sd(e),[o,a]=(0,c1.useState)(null),[s,l]=(0,c1.useState)(!1),u=(0,c1.useMemo)(()=>Sc().generate(e),[e]);(0,c1.useEffect)(()=>{if(n?.imageSrc){let e=new URL(n.imageSrc,window.location.origin).pathname;l(!0);let t=!1,r=new Image;return r.onload=()=>{t||(a(e),l(!1))},r.onerror=()=>{t||(a(null),l(!1))},r.src=e,()=>{t=!0}}a(null),l(!1)},[n?.imageSrc]);let c=(0,c1.useMemo)(()=>r||(o?os("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):os("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[r,o,t]);return i||s?(0,fW.jsx)(fq.ryE,{className:"-esm-form-builder__patient-photo-module__skeleton___I-6iq","data-testid":"skeleton-icon"}):n?.imageSrc&&!o?(0,fW.jsx)(Sf,{"aria-label":os("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):o?(0,fW.jsx)("div",{"aria-label":c,children:(0,fW.jsx)("img",{className:Sp,src:o,alt:c,title:t})}):(0,fW.jsx)("div",{"aria-label":c,children:(0,fW.jsx)("div",{className:Sp,title:t,style:{backgroundImage:u.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,fW.jsx)("span",{className:"-esm-form-builder__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 Sm=["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-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"],Sy=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),Sg=Sy,Sb=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),Sv=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),S_=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),Sw=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),Sx=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),SE=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),SS=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),SD=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),SO=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),SP=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),SC=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),Sk=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),ST=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),Sj=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),SR=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),SA=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),SM=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),SN=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),SI=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),S$=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),SL=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),SF=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),SB=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),SV=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),SU=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),SW=(0,c1.memo)((0,c1.forwardRef)(function(e,t){return(0,fW.jsx)(Sq,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),SK=SO,SH=SM,Sz=(0,c1.memo)((0,c1.forwardRef)(function({pictogram:e,fallback:t,...r},n){let i=(0,c1.useRef)(document.getElementById(e));return(0,c1.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),r=new MutationObserver(t=>{for(let r of t)"childList"===r.type&&(i.current=document.getElementById(e))});return t&&r.observe(t,{childList:!0}),()=>r.disconnect()},[e]),(0,fW.jsx)(dW,{value:i.current,fallback:t,children:(0,fW.jsx)(Sq,{ref:n,pictogram:e,pictogramProps:r})})})),Sq=(0,c1.memo)((0,c1.forwardRef)(function({pictogram:e,pictogramProps:t},r){let{className:n,size:i}=Object.assign({},{size:92},t);return(i<=26||i>144)&&(console.error(`Invalid size '${i}' specified for ${e}. Defaulting to 92.`),i=92),(0,fW.jsx)("svg",{ref:r,className:fH()("-esm-form-builder__pictograms-module__pictogram___LTPzD",n),height:i,width:i,children:(0,fW.jsx)("use",{href:`#${e}`})})})),SG=({children:e})=>"tablet"===fg()?(0,fW.jsx)(fq.Wdr,{children:e}):(0,fW.jsx)(fW.Fragment,{children:e}),SZ=new ea.Subject,SY=0;function SJ(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{SZ.next({...e,id:SY++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let SQ=new ea.Subject,SX=0;function S0(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!(0,EL.A)(t))?setTimeout(()=>{SQ.next({...e,id:SX++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}function S1(e,t=!1){if(t)return!0;let r=S5[e];return!r||!r()}function S3(e,t){let r=Dr.getState()?.workspaceGroup,n=r?.name;n&&e===n&&Do(()=>{let n=Dc(e);n&&(n.setState({},!0),n.subscribe(()=>{})()),"function"==typeof r?.cleanup&&r.cleanup(),Dr.setState(e=>({...e,workspaceGroup:void 0})),"function"==typeof t&&t()},n?e=>e.currentWorkspaceGroup===n:()=>!0)}function S4(e,t){let{name:r,additionalProps:n}=t;c9(r);let i=()=>{S7(e.name,{ignoreChanges:!0,onWorkspaceClose:()=>S2(r,n),closeWorkspaceGroup:!1})};S1(e.name)?i():Ds("closing-workspace-launching-new-workspace",i,e.title??e.name)}function S2(e,t){let r=c9(e),n=Dr.getState().workspaceGroup;if(n&&!n.members?.includes(e))return void S3(n.name,()=>{S2(e,t)});let i=Dr.getState().workspaceGroup?.name,o={...r,title:Dl(r,t),closeWorkspace:(t={})=>S7(e,t),closeWorkspaceWithSavedChanges:t=>S7(e,{ignoreChanges:!0,...t}),promptBeforeClosing:t=>{var r,n;return r=e,n=t,void(S5[r]=n)},setTitle:(t,r)=>{o.title=t,o.titleNode=r,Dr.setState(t=>{let r=t.openWorkspaces.map(t=>t.name===e?o:t);return{...t,openWorkspaces:r}})},currentWorkspaceGroup:i,additionalProps:t??{}};function a(e,t){Dr.setState(r=>{let n=[e,...t??r.openWorkspaces],i=Di(e);return{...r,openWorkspaces:n,workspaceWindowState:i}})}i&&Dc(i,t);let s=Dr.getState().openWorkspaces,l=s.findIndex(t=>t.name===e),u=s.find(e=>e.type==o.type);if(0===s.length)a(o);else if(s[0].canHide||0===l)if(l>=0){let t=s[l];a({...t,additionalProps:o.additionalProps,...t.title===Dl(t,t.additionalProps)&&{title:Dl(o,o.additionalProps)}},s.filter(t=>t.name!=e))}else u?(a(u,Dr.getState().openWorkspaces.filter(e=>e.type!=o.type)),S4(u,{name:e,additionalProps:t})):a(o);else S4(s[0],{name:e,additionalProps:t})}function S6({targetUrl:e,contextKey:t,workspaceName:r,additionalProps:n}){De(t),S2(r,n),nX({to:e})}let S5={};function S8(){let e=Dr.getState();Dr.setState({...e,prompt:null})}let S9={ignoreChanges:!1,onWorkspaceClose:()=>{},closeWorkspaceGroup:!0};function S7(e,t={}){t={...S9,...t};let r=()=>{let r=Dr.getState();r.openWorkspaces.find(t=>t.name===e);let n=r.openWorkspaces.filter(t=>t.name!=e),i=Dr.getState().workspaceGroup?.name;i&&t.closeWorkspaceGroup&&S3(i),S5[e]=()=>!1,Dr.setState(e=>({...e,prompt:null,openWorkspaces:n,workspaceWindowState:Di(n?.[0])})),t?.onWorkspaceClose?.()};return S1(e,t?.ignoreChanges)?(r(),!0):(Ds("closing-workspace",r,c9(e).title??e),!1)}function De(e){Dr.getState().context!=e&&Dr.setState({context:e,openWorkspaces:[],prompt:null})}let Dt={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},Dr=K("workspace",Dt);function Dn(e){let t=Dr.getState();Dr.setState({...t,workspaceWindowState:e})}function Di(e){return e?.preferredWindowSize??"normal"}function Do(e=()=>{},t=()=>!0){let r=Dr.getState().openWorkspaces.filter(t).every(({name:e})=>S1(e)),n=()=>{Du(),e?.()};r?n():Ds("closing-all-workspaces",n)}function Da(){let{workspaceWindowState:e,openWorkspaces:t,prompt:r,workspaceGroup:n}=di(Dr);return(0,c1.useMemo)(()=>({active:t.length>0,prompt:r,workspaceWindowState:e,workspaces:t,workspaceGroup:n}),[t,e,r,n])}function Ds(e,t=()=>{},r=""){let n;switch(e){case"closing-workspace":n={title:os("unsavedChangesTitleText","Unsaved changes"),body:os("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:()=>{t?.()},confirmText:os("discard","Discard")};break;case"closing-all-workspaces":{let e=Dr.getState().openWorkspaces.filter(({name:e})=>!S1(e)).map(({title:e},t)=>`${t+1}. ${e}`);n={title:os("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:os("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:os("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:e.length})};break}case"closing-workspace-launching-new-workspace":n={title:os("unsavedChangesTitleText","Unsaved changes"),body:os("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:r}),onConfirm:()=>{Dr.setState(e=>({...e,prompt:null})),t?.()},confirmText:os("openAnyway","Open anyway")};break;default:console.error(`Workspace system trying to open unknown prompt type "${e}" in function "showWorkspacePrompts"`),t?.();return}Dr.setState(e=>({...e,prompt:n}))}function Dl(e,t){return t?.workspaceTitle??e.title}function Du(){Dr.setState(Dt)}function Dc(e,t={}){if(!e||"default"===e)return;let r=z(e,{});return t&&r.setState(e=>({...e,...t})),r}let Dd="-esm-form-builder__action-menu-button-module__container___Uwne-",Df="-esm-form-builder__action-menu-button-module__elementContainer___vWkQO",Dp="-esm-form-builder__action-menu-button-module__active___D7Idw";function Dh({getIcon:e,formOpenInTheBackground:t,tagContent:r}){return(0,fW.jsxs)(fW.Fragment,{children:[e({size:16}),t?(0,fW.jsx)("span",{className:"-esm-form-builder__action-menu-button-module__interruptedTag___7undI",children:"!"}):(0,fW.jsx)("span",{className:"-esm-form-builder__action-menu-button-module__countTag___XJRiM",children:r})]})}let Dm=({getIcon:e,label:t,iconDescription:r,handler:n,type:i,tagContent:o})=>{let a=fg(),{workspaces:s,workspaceWindowState:l}=Da(),u=s?.findIndex(({type:e})=>e===i)??-1,c="hidden"!==l&&0===u,d=u>0||0===u&&"hidden"===l;return"tablet"===a||"phone"===a?(0,fW.jsxs)(fq.$nd,{className:fH()(Dd,{[Dp]:c}),iconDescription:r,kind:"ghost",onClick:n,role:"button",tabIndex:0,size:"md",children:[(0,fW.jsx)("span",{className:Df,children:(0,fW.jsx)(Dh,{formOpenInTheBackground:d,getIcon:e,tagContent:o})}),(0,fW.jsx)("span",{children:t})]}):(0,fW.jsx)(fq.K0,{align:"left","aria-label":r,className:fH()(Dd,{[Dp]:c}),enterDelayMs:300,kind:"ghost",label:t,onClick:n,size:"md",children:(0,fW.jsx)("div",{className:Df,children:(0,fW.jsx)(Dh,{formOpenInTheBackground:d,getIcon:e,tagContent:o})})})};var Dy=r(54535),Dg=r(40771),Db=/[\\^$.*+?()[\]{}|]/g,Dv=RegExp(Db.source);let D_=function(e){return(e=(0,tm.A)(e))&&Dv.test(e)?e.replace(Db,"\\$&"):e};function Dw({contextKey:e}){let{prompt:t}=Da();return(0,c1.useEffect)(()=>{RegExp(`/${D_(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,c1.useEffect)(()=>(De(e),()=>{De(null)}),[e]),(0,c1.useEffect)(()=>{let t=t=>{let{detail:{cancelNavigation:r,newUrl:n}}=t,i=RegExp(`/${D_(e)}(/|$)`),o=new URL(n),a=i.test(o.pathname),s=Dr.getState().openWorkspaces.every(({name:e})=>S1(e));a||(s?Du():(r?.(),Do(()=>{nX({to:n})})))};return window.addEventListener("single-spa:before-routing-event",t),()=>{window.removeEventListener("single-spa:before-routing-event",t)}},[]),null!=t?(0,fW.jsxs)(fq.KXP,{open:!0,onClose:S8,children:[(0,fW.jsx)(fq.rQ0,{title:t.title}),(0,fW.jsx)(fq.cwr,{children:(0,fW.jsx)("p",{className:"-esm-form-builder__workspace-notification-module__messageBody___M3IAD",children:t.body})}),(0,fW.jsxs)(fq.jlY,{children:[(0,fW.jsx)(fq.$nd,{kind:"secondary",onClick:S8,children:t.cancelText??os("cancel")}),(0,fW.jsx)(fq.$nd,{kind:"danger",onClick:t.onConfirm,children:t.confirmText??os("confirm")})]})]}):null}function Dx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function DE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dx(Object(r),!0).forEach(function(t){DD(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dx(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function DS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function DD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DO(e){return(DO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function DP(e,t){return(DP=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function DC(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Dk=function(e){var t=c1.Component;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),t&&DP(a,t);var r,n,i,o=(r=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=DO(a);e=r?Reflect.construct(t,arguments,DO(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 DC(this)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),DD(DC(t=o.call(this,e)),"handleRef",function(e){t.el=e}),DD(DC(t),"addThingToDo",function(e,r){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then(function(){if(!t.unmounted||"unmount"===e)return r.apply(void 0,arguments)}).catch(function(r){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),r&&r.message&&(r.message="During '".concat(e,"', parcel threw an error: ").concat(r.message)),t.props.handleError?t.props.handleError(r):setTimeout(function(){throw r}),r}))}),DD(DC(t),"getParcelProps",function(){var e=DE(DE({},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 n=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var t,r=e.props.mountParcel||e.mountParcel;if(!r)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(r){t.style[r]=e.props.wrapStyle[r]}),e.props.appendTo.appendChild(t)),e.parcel=r(e.props.config,DE({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 dx&&dx.Consumer?c1.createElement(dx.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):null;var t=dx&&dx.Consumer?c1.createElement(dx.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):void 0;return c1.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}],DS(a.prototype,n),i&&DS(a,i),a}();DD(Dk,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});function DT({workspace:e,additionalPropsFromPage:t}){let[r,n]=(0,c1.useState)(),i=function(e){let[t,r]=(0,c1.useState)({}),[n,i]=(0,c1.useState)(e);return(0,c1.useEffect)(()=>{n!==e&&i(e)},[e]),(0,c1.useEffect)(()=>{let e,t=Dc(n);return t&&(r(t.getState()),e=t.subscribe(r)),()=>{t&&e?.()}},[n]),t}(e.currentWorkspaceGroup);(0,c1.useEffect)(()=>{let t=!0;return e.load().then(e=>{t&&n(e)}),()=>{t=!1}},[e]);let o=(0,c1.useMemo)(()=>e&&{closeWorkspace:e.closeWorkspace,closeWorkspaceWithSavedChanges:e.closeWorkspaceWithSavedChanges,promptBeforeClosing:e.promptBeforeClosing,setTitle:e.setTitle,...t,...i,...e.additionalProps},[e,t,i]);return r?(0,fW.jsx)(Dk,{config:r,mountParcel:cU,...o},e.name):(0,fW.jsx)(fq.OuH,{className:"-esm-form-builder__workspace-module__loader___v7QFg",description:`${os("loading","Loading")} ...`})}let Dj=function({isWithinWorkspace:e,name:t,actionMenuProps:r={}}){let[n,i]=(0,c1.useState)(!1),o=(0,c1.useRef)(window.innerHeight),{featureName:a}=(0,c1.useContext)(dt),s=fg();(0,c1.useEffect)(()=>{let e=()=>{i(!fb(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:a}-items-slot`;return(0,fW.jsx)("aside",{className:fH()("-esm-form-builder__action-menu-module__sideRail___Aa96v",{"-esm-form-builder__action-menu-module__withinWorkspace___2bJET":e,"-esm-form-builder__action-menu-module__sideRailHidden___Yb0w9":n,"-esm-form-builder__action-menu-module__sideRailVisible___XIAk7":!n}),children:(0,fW.jsx)("div",{className:"-esm-form-builder__action-menu-module__container___mzfAh",children:(0,fW.jsx)(dm,{className:"-esm-form-builder__action-menu-module__chartExtensions___DiJtm",name:l,state:r})})})};function DR({contextKey:e,overlay:t,showSiderailAndBottomNav:r,additionalWorkspaceProps:n,actionMenuProps:i}){let o=fg(),{workspaces:a,workspaceWindowState:s,workspaceGroup:l}=Da(),u=l?.name,c=a[0],d="hidden"===s||null==c,f=c?.width??(t?"wider":"narrow"),p=(0,c1.useMemo)(()=>r||u&&!d,[u,d,r]);return dZ(!d&&!fb(o)),(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsxs)("div",{className:r?"-esm-form-builder__workspace-module__workspaceContainerWithActionMenu___6x1qS":"-esm-form-builder__workspace-module__workspaceContainerWithoutActionMenu___TJHnt",children:[(0,fW.jsx)("aside",{className:fH()(t?"-esm-form-builder__workspace-module__workspaceOverlayOuterContainer___4y++2":"-esm-form-builder__workspace-module__workspaceWindowSpacer___6kF9R",{"-esm-form-builder__workspace-module__hiddenRelative___qqT-4":d,"-esm-form-builder__workspace-module__narrowWorkspace___MMI1u":"narrow"===f,"-esm-form-builder__workspace-module__widerWorkspace___be-UT":"wider"===f,"-esm-form-builder__workspace-module__extraWideWorkspace___JmWmj":"extra-wide"===f}),children:(0,fW.jsx)("div",{className:fH()("-esm-form-builder__workspace-module__workspaceFixedContainer___TfJP7",{"-esm-form-builder__workspace-module__maximizedWindow___71jv4":"maximized"===s,"-esm-form-builder__workspace-module__hiddenFixed___48wS9":d}),children:a.map((e,t)=>(0,fW.jsx)("div",{className:fH()("-esm-form-builder__workspace-module__workspaceInnerContainer___h3oyO",{"-esm-form-builder__workspace-module__hiddenExtraWorkspace___AP+Vj":0!==t}),children:(0,fW.jsx)(c1.Suspense,{fallback:null,children:(0,fW.jsx)(dT.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName,children:(0,fW.jsx)(DA,{workspaceInstance:e,additionalWorkspaceProps:n})})})},`workspace-container-${e?e.name:`empty-${t}`}`))})}),(0,fW.jsx)(Dw,{contextKey:e})]}),p&&(0,fW.jsx)(Dj,{name:u,isWithinWorkspace:!r,actionMenuProps:i})]})}function DA({workspaceInstance:e,additionalWorkspaceProps:t}){let{t:r}=(0,dT.useTranslation)(),n=fg(),{workspaceWindowState:i,workspaceGroup:o}=Da(),a=o?.name,s="maximized"===i;(0,c1.useEffect)(()=>{let t=r(e.title);t!==e.title&&e.setTitle(t)},[e.title,r,e.setTitle]);let{featureName:l}=(0,c1.useContext)(dt),u=(0,c1.useCallback)(()=>{Dn(s?"normal":"maximized")},[s]),{canHide:c=!1,canMaximize:d=!1,currentWorkspaceGroup:f="",closeWorkspace:p}=(0,c1.useMemo)(()=>e??{},[e]),h=(0,c1.useMemo)(()=>({...t,...e?.additionalProps}),[t,e]);return e&&(0,fW.jsxs)(fW.Fragment,{children:[(0,fW.jsxs)(fq.Y9Y,{"aria-label":os("workspaceHeader","Workspace Header"),className:"-esm-form-builder__workspace-module__header___nACZO",children:[!fb(n)&&!c&&(0,fW.jsx)(fq.dJ2,{"aria-label":os("close","Close"),renderMenuIcon:(0,fW.jsx)(pe,{}),onClick:()=>p()}),(0,fW.jsx)(fq.bCw,{prefix:"",children:e.titleNode??r(e.title)}),(0,fW.jsx)("div",{className:"-esm-form-builder__workspace-module__overlayHeaderSpacer___HBnr+"}),(0,fW.jsxs)(fq.wdv,{className:"-esm-form-builder__workspace-module__headerButtons___heP0Q",children:[(0,fW.jsx)(dm,{name:`workspace-header-group-${e.currentWorkspaceGroup}-slot`,state:h}),(0,fW.jsx)(dm,{name:`workspace-header-type-${e.type}-slot`,state:h}),(0,fW.jsx)(dm,{name:`workspace-header-${l}-slot`,state:h}),fb(n)&&(0,fW.jsxs)(fW.Fragment,{children:[(d||s)&&(0,fW.jsx)(fq.V8d,{"aria-label":s?os("minimize","Minimize"):os("maximize","Maximize"),onClick:u,children:s?(0,fW.jsx)(Dy.Xj,{}):(0,fW.jsx)(Dy.hz,{})}),c&&!a?(0,fW.jsx)(fq.V8d,{"aria-label":os("hide","Hide"),onClick:()=>Dn("hidden"),children:(0,fW.jsx)(pt,{})}):(0,fW.jsx)(fq.V8d,{"aria-label":os("close","Close"),onClick:()=>p?.(),children:(0,fW.jsx)(pv,{})})]}),"tablet"===n&&c&&(0,fW.jsx)(fq.V8d,{"aria-label":os("close","Close"),onClick:()=>p?.(),children:(0,fW.jsx)(Dg.d3,{})})]})]}),(0,fW.jsx)("div",{className:fH()("-esm-form-builder__workspace-module__workspaceContent___oYdxI",{"-esm-form-builder__workspace-module__marginWorkspaceContent___7hwHu":!!f}),children:(0,fW.jsx)(DT,{workspace:e,additionalPropsFromPage:t},e.name)})]})}async function DM(e,t){let{openedGroup:r}=c7.getState();if(r){if(r.groupName===e&&D$(r.props,t))return!0;else if(!await DL({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return c7.setState(r=>({...r,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function DN(e){let{openedGroup:t,openedWindows:r}=c7.getState();if(t){if(r.length>0&&!(e||await DL({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;c7.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function DI(e,t=null,r=null,n=null){let i=c7.getState();if(!i.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let o=function(e){let{registeredWorkspacesByName:t,registeredWindowsByName:r}=c7.getState(),n=t[e];if(n){let t=r[n.window];if(t)return t;throw Error(`No workspace window found with name: ${n.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}(e);if(!o)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:a}=i,{name:s}=o,l=function(e){let{registeredGroupsByName:t,registeredWindowsByName:r}=c7.getState(),n=r[e];if(n){let r=t[n.group];if(r)return r;throw Error(`No workspace group found with name: ${n.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}(s);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${o.name} is not registered to a workspace group`);let u=de(e);if(a&&(a.groupName!==l.name||!D$(a.props,n)))return!!await DL({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(c7.setState({...i,openedGroup:{groupName:l.name,props:n},openedWindows:[{windowName:s,openedWorkspaces:[DU(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(u>=0){let n=i.openedWindows[u],o=i.openedGroup?.props??{},a=i.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:c}=n;if(D$(n.props,r)){let d=c.find(t=>t.workspaceName===e);return d&&D$(d.props,t)?((a||u!==i.openedWindows.length-1)&&c7.setState(DF.restoreWindow(i,s)),!0):!!await DL({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})&&(c7.setState({...i,openedGroup:{groupName:l.name,props:i?.openedGroup?.props??o},openedWindows:[...i.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[DU(e,t)],props:n?.props??r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await DL({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})&&(c7.setState({...i,openedGroup:{groupName:l.name,props:o??i?.openedGroup?.props},openedWindows:[...i.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[DU(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(c7.setState({...i,openedGroup:{groupName:l.name,props:n??i?.openedGroup?.props??null},openedWindows:[...i.openedWindows,{windowName:s,openedWorkspaces:[DU(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await DL({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:o.name})&&(c7.setState({...i,openedGroup:{groupName:l.name,props:n??i?.openedGroup?.props??null},openedWindows:[{windowName:s,openedWorkspaces:[DU(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function D$(e,t){return null==e||null==t||M(e,t)}function DL(e){function t(e,t){let r=[];for(let n=e.openedWorkspaces.length-1;n>=0;n--){let i=e.openedWorkspaces[n];if(i.hasUnsavedChanges&&r.push(i),t&&i.workspaceName===t)break}return r}let{openedWindows:r,workspaceTitleByWorkspaceName:n}=c7.getState(),i=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":i=r.flatMap(e=>t(e));break;case"CLOSE_WINDOW":{let n=r.find(t=>t.windowName===e.windowName);if(!n)throw Error(`Window ${e.windowName} not found in opened windows.`);i=t(n);break}case"CLOSE_WORKSPACE":{let n=r.find(t=>t.windowName===e.windowName);if(!n)throw Error(`Window ${e.windowName} not found in opened windows.`);i=t(n,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":i=r.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>t(e))}return 0===i.length?Promise.resolve(!0):new Promise(e=>{let t=E$("workspace2-close-prompt",{size:"sm",onConfirm:()=>{t(),e(!0)},onCancel:()=>{t(),e(!1)},affectedWorkspaceTitles:i.map(e=>n[e.workspaceName])})})}let DF={setWindowMaximized(e,t,r){let n=e.openedWindows.findIndex(e=>e.windowName===t),i=[...e.openedWindows],o={...i[n],maximized:r};return i[n]=o,{...e,openedWindows:i}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let r=e.openedWindows.findIndex(e=>e.windowName===t),n=e.openedWindows[r],i=[...e.openedWindows.filter((e,t)=>t!==r),n];return{...e,openedWindows:i,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let r=de(t);if(r<0)return e;let n={...e.openedWindows[r]},i=n.openedWorkspaces.findIndex(e=>e.workspaceName===t),o=[...e.openedWindows];n.openedWorkspaces=n.openedWorkspaces.slice(0,i);let a=e.isMostRecentlyOpenedWindowHidden;if(0===n.openedWorkspaces.length){let t=r===e.openedWindows.length-1;o.splice(r,1),t&&o.length>0&&(a=!1)}else o[r]=n;return{...e,openedWindows:o,isMostRecentlyOpenedWindowHidden:a}},openChildWorkspace(e,t,r,n){let i=e.registeredWorkspacesByName[r];if(!i)throw Error(`No workspace named "${r}" registered`);let o=e.registeredWorkspacesByName[t];if(!o)throw Error(`No workspace named "${t}" registered`);if(o.window!==i.window)throw Error(`Child workspace ${r} does not belong to the same workspace window as parent workspace ${t}`);let a=e.openedWindows.findIndex(e=>e.windowName===i.window);if(-1==a)throw Error(`Cannot open child workspace ${r} as window ${i.window} is not opened`);let{openedWorkspaces:s}=e.openedWindows[a],l=s.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${r} 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==a?{...e,openedWorkspaces:[...u,DU(r,n)]}:e)}},setHasUnsavedChanges(e,t,r){let n=de(t);if(n<0)return e;let i={...e.openedWindows[n]},o=i.openedWorkspaces.findIndex(e=>e.workspaceName===t);if(o<0)return e;i.openedWorkspaces[o]={...i.openedWorkspaces[o],hasUnsavedChanges:r};let a=[...e.openedWindows];return a[n]=i,{...e,openedWindows:a}},setWorkspaceTitle(e,t,r){let n={...e.workspaceTitleByWorkspaceName};return null===r?delete n[t]:n[t]=r,{...e,workspaceTitleByWorkspaceName:n}}},DB=()=>(0,c1.useContext)(dx),DV=()=>Object.keys(c7.getState().registeredWorkspacesByName);function DU(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:cJ()}}let DW={workspaceOuterContainer:"-esm-form-builder__workspace2-module__workspaceOuterContainer___DLiCR",narrowWorkspace:"-esm-form-builder__workspace2-module__narrowWorkspace___VL0kF",widerWorkspace:"-esm-form-builder__workspace2-module__widerWorkspace___3QgrA",extraWideWorkspace:"-esm-form-builder__workspace2-module__extraWideWorkspace___s7nnh",workspaceMiddleContainer:"-esm-form-builder__workspace2-module__workspaceMiddleContainer___mTGNN",maximized:"-esm-form-builder__workspace2-module__maximized___-yo9l",hidden:"-esm-form-builder__workspace2-module__hidden___K2ryM",workspaceInnerContainer:"-esm-form-builder__workspace2-module__workspaceInnerContainer___o3zVl",workspaceSpacer:"-esm-form-builder__workspace2-module__workspaceSpacer___N6-ox",loader:"-esm-form-builder__workspace2-module__loader___29hpw",hiddenExtraWorkspace:"-esm-form-builder__workspace2-module__hiddenExtraWorkspace___-W7TY",header:"-esm-form-builder__workspace2-module__header___p0kuD",headerButtons:"-esm-form-builder__workspace2-module__headerButtons___hMydG",workspaceContent:"-esm-form-builder__workspace2-module__workspaceContent___uROr7",overlayHeaderSpacer:"-esm-form-builder__workspace2-module__overlayHeaderSpacer___zdrhx",isActionMenuOpened:"-esm-form-builder__workspace2-module__isActionMenuOpened___Wc1Il",showActionMenu:"-esm-form-builder__workspace2-module__showActionMenu___qCVQ-",marginWorkspaceContent:"-esm-form-builder__workspace2-module__marginWorkspaceContent___A+20C",workspaceContainerWithActionMenu:"-esm-form-builder__workspace2-module__workspaceContainerWithActionMenu___S98dq",workspaceFixedContainer:"-esm-form-builder__workspace2-module__workspaceFixedContainer___c9Uny",workspaceContainerWithoutActionMenu:"-esm-form-builder__workspace2-module__workspaceContainerWithoutActionMenu___u8FbT"},DK=({title:e,children:t,hasUnsavedChanges:r=!1})=>{let n=fg(),{setWindowMaximized:i,hideWindow:o,setHasUnsavedChanges:a,openedWindows:s,openedGroup:l,registeredGroupsByName:u,registeredWindowsByName:c,registeredWorkspacesByName:d,workspaceTitleByWorkspaceName:f,setWorkspaceTitle:p,isMostRecentlyOpenedWindowHidden:h}=da(c7,DF),{workspaceName:m,isRootWorkspace:y,closeWorkspace:g,showActionMenu:b}=DB(),v=de(m),w=s[v],x=w?.openedWorkspaces.find(e=>e.workspaceName===m);if((0,c1.useEffect)(()=>{x?.hasUnsavedChanges!=r&&a(m,r??!1)},[x?.hasUnsavedChanges,r,m,a]),(0,c1.useEffect)(()=>{f[m]!==e&&p(m,e)},[f,m,e,p]),v<0||null==l||null==x)return null;let E=u[l.groupName];if(!E)throw Error(`Cannot find registered workspace group ${l.groupName}`);let S=d[m].window,D=c[S];if(!D)throw Error(`Cannot find registered workspace window ${S}`);let{icon:O,canMaximize:P}=D,C="closable"===E.persistence,k=!!O&&!C,{maximized:T}=w,j=D?.width??"narrow",R=Object.values(c).some(e=>e.group===l.groupName&&void 0!==e.icon),A=v<s.length-1||h;return(0,fW.jsxs)("div",{className:fH()(DW.workspaceOuterContainer,{[DW.narrowWorkspace]:"narrow"===j,[DW.widerWorkspace]:"wider"===j,[DW.extraWideWorkspace]:"extra-wide"===j,[DW.isActionMenuOpened]:R}),children:[(0,fW.jsx)("div",{className:fH()(DW.workspaceSpacer,{[DW.hidden]:A})}),(0,fW.jsx)("div",{className:fH()(DW.workspaceMiddleContainer,{[DW.maximized]:T,[DW.hidden]:A,[DW.isRootWorkspace]:y,[DW.showActionMenu]:b}),children:(0,fW.jsxs)("div",{className:fH()(DW.workspaceInnerContainer,{[DW.maximized]:T,[DW.hidden]:A,[DW.isRootWorkspace]:y}),children:[(0,fW.jsxs)(fq.Y9Y,{"aria-label":os("workspaceHeader"),className:DW.header,children:[(0,fW.jsx)(fq.bCw,{prefix:"",children:e}),(0,fW.jsx)("div",{className:DW.overlayHeaderSpacer}),(0,fW.jsx)(fq.wdv,{className:DW.headerButtons,children:fb(n)?(0,fW.jsxs)(fW.Fragment,{children:[(P||T)&&(0,fW.jsx)(fq.V8d,{"aria-label":T?os("minimize"):os("maximize"),onClick:()=>i(S,!T),children:T?(0,fW.jsx)(Dy.Xj,{}):(0,fW.jsx)(Dy.hz,{})}),k&&(0,fW.jsx)(fq.V8d,{"aria-label":os("hide"),onClick:()=>o(),children:(0,fW.jsx)(pt,{})}),!C&&(0,fW.jsx)(fq.V8d,{"aria-label":os("close"),onClick:()=>g({closeWindow:!0}),children:(0,fW.jsx)(pv,{})})]}):(0,fW.jsxs)(fW.Fragment,{children:[k&&(0,fW.jsx)(fq.V8d,{"aria-label":os("hide"),onClick:()=>o(),children:(0,fW.jsx)(Dg.d3,{})}),(0,fW.jsx)(fq.V8d,{"aria-label":os("close"),onClick:()=>{C?DN():g({closeWindow:!0})},children:(0,fW.jsx)(pv,{})})]})})]}),(0,fW.jsx)("div",{className:fH()(DW.workspaceContent),children:t})]})})]})},DH="-esm-form-builder__action-menu-button2-module__container___gYRoa",Dz="-esm-form-builder__action-menu-button2-module__elementContainer___vBViO",Dq="-esm-form-builder__action-menu-button2-module__active___uRJRA",DG="-esm-form-builder__action-menu-button2-module__focused___D4VYB";function DZ({getIcon:e,hasUnsavedChanges:t,tagContent:r}){return(0,fW.jsxs)(fW.Fragment,{children:[e({size:16}),t?(0,fW.jsx)("span",{className:"-esm-form-builder__action-menu-button2-module__interruptedTag___35fO7",children:"!"}):(0,fW.jsx)("span",{className:"-esm-form-builder__action-menu-button2-module__countTag___l8lfc",children:r})]})}let DY=({icon:e,label:t,tagContent:r,workspaceToLaunch:n,onBeforeWorkspaceLaunch:i})=>{let o=fg(),{openedWindows:a,restoreWindow:s,hideWindow:l,isMostRecentlyOpenedWindowHidden:u}=da(c7,DF),{extension:c}=(0,c1.useContext)(dt),d=a.findIndex(e=>e.windowName===c?.extensionId),f=a[d],p=null!=f,h=p&&(d<a.length-1||u),m=p&&!h,y=f?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,g=async()=>{if(p)h?s(f.windowName):l();else if(await (i?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:r}=n;DI(e,t,r)}};return"tablet"===o||"phone"===o?(0,fW.jsxs)(fq.$nd,{className:fH()(DH,{[Dq]:p&&!m,[DG]:m}),iconDescription:t,kind:"ghost",onClick:g,role:"button",tabIndex:0,size:"md",children:[(0,fW.jsx)("span",{className:Dz,children:(0,fW.jsx)(DZ,{hasUnsavedChanges:y,getIcon:e,tagContent:r})}),(0,fW.jsx)("span",{children:t})]}):(0,fW.jsx)(fq.K0,{align:"left","aria-label":t,className:fH()(DH,{[Dq]:p&&!m,[DG]:m}),enterDelayMs:300,kind:"ghost",label:t,onClick:g,size:"md",children:(0,fW.jsx)("div",{className:Dz,children:(0,fW.jsx)(DZ,{hasUnsavedChanges:y,getIcon:e,tagContent:r})})})};function DJ(e,t,r){if(null==e)return r;let n=w1(e);if(!n)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),r;let i=[];for(let e of t){let t=w1(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}i.push({canonical:t,original:e})}let o=n;for(;o;){let e=i.find(e=>e.canonical===o);if(e)return e.original;let t=o+"-",r=i.find(e=>e.canonical.startsWith(t));if(r)return r.original;if("ht"===o){o="fr-HT";continue}let n=o.lastIndexOf("-");if(-1===n)break;let a=(o=o.slice(0,n)).lastIndexOf("-");-1!==a&&o.length-a==2&&(o=o.slice(0,a))}return r}function DQ(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function DX(e){return!!e&&e.constructor===Object}var D0=r(99589);function D1(e){let[t,r,n]=e.split(".");return`${t}.${r}.${n}`}function D3(e,t){let r=function(e){let t=e.indexOf("-");if(t>=0){let r=D1(e.slice(0,t)),n=e.slice(t+1);return`${r}-${n}`}return D1(e)}(t);return D0.satisfies(r,e,{includePrerelease:!0})}async function D4(e,t={}){let r,{shouldRetry:n,getDelay:i,onError:o}=t;n=n??(e=>e<=5),i=i??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let a=0;do try{return await D2(i(a)),await e()}catch(e){o?.(e,a),r=e}while(n(a++));throw r}async function D2(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}},241(e,t,r){"use strict";r.d(t,{A:()=>n});let n=r(41917).A.Symbol},76912(e,t,r){"use strict";r.d(t,{A:()=>n});let n=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},76335(e,t,r){"use strict";r.d(t,{A:()=>u});var n=r(76912),i=r(241),o=r(20018),a=r(92049),s=i.A?i.A.isConcatSpreadable:void 0;let l=function(e){return(0,a.A)(e)||(0,o.A)(e)||!!(s&&e&&e[s])},u=function e(t,r,i,o,a){var s=-1,u=t.length;for(i||(i=l),a||(a=[]);++s<u;){var c=t[s];r>0&&i(c)?r>1?e(c,r-1,i,o,a):(0,n.A)(a,c):o||(a[a.length]=c)}return a}},18348(e,t,r){"use strict";r.d(t,{A:()=>d});var n=r(241),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.A?n.A.toStringTag:void 0;let l=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i};var u=Object.prototype.toString,c=n.A?n.A.toStringTag:void 0;let d=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":c&&c in Object(e)?l(e):u.call(e)}},72136(e,t,r){"use strict";r.d(t,{A:()=>n});let n="object"==typeof global&&global&&global.Object===Object&&global},41917(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(72136),i="object"==typeof self&&self&&self.Object===Object&&self;let o=n.A||i||Function("return this")()},20018(e,t,r){"use strict";r.d(t,{A:()=>u});var n=r(18348),i=r(53098);let o=function(e){return(0,i.A)(e)&&"[object Arguments]"==(0,n.A)(e)};var a=Object.prototype,s=a.hasOwnProperty,l=a.propertyIsEnumerable;let u=o(function(){return arguments}())?o:function(e){return(0,i.A)(e)&&s.call(e,"callee")&&!l.call(e,"callee")}},92049(e,t,r){"use strict";r.d(t,{A:()=>n});let n=Array.isArray},53098(e,t,r){"use strict";r.d(t,{A:()=>n});let n=function(e){return null!=e&&"object"==typeof e}}}]);
27
+ }`.trim(),document.head.prepend(n),o=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(e){let t=((e=document)=>e.activeElement)(),r=null!=t&&wb(t);o.call(this,{...e,preventScroll:!0}),e&&e.preventScroll||wE(this,r)},a=hL(wx(document,"touchstart",t=>{let n=mh(t);e=bE(n)?n:bS(n,!0),r=!1;let i=n.ownerDocument.defaultView.getSelection();i&&!i.isCollapsed&&i.containsNode(n,!0)&&(r=!0),t.composedPath().some(e=>e instanceof HTMLInputElement&&"range"===e.type)&&(r=!0),"selectionStart"in n&&"selectionEnd"in n&&n.selectionStart<n.selectionEnd&&n.ownerDocument.activeElement===n&&(r=!0)},{passive:!1,capture:!0}),wx(document,"touchmove",t=>{if(2!==t.touches.length&&!r){if(!e||e===document.documentElement||e===document.body)return void t.preventDefault();e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault()}},{passive:!1,capture:!0}),wx(document,"blur",e=>{let t=mh(e),r=e.relatedTarget;if(r&&wb(r))r.focus({preventScroll:!0}),wE(r,wb(t));else if(!r){let e=t.parentElement?.closest("[tabindex]");e?.focus({preventScroll:!0})}},!0)),()=>{t(),a(),n.remove(),HTMLElement.prototype.focus=o}):hL((s=window.innerWidth-document.documentElement.clientWidth)>0&&("scrollbarGutter"in document.documentElement.style?ww(document.documentElement,"scrollbarGutter","stable"):ww(document.documentElement,"paddingRight",`${s}px`)),ww(document.documentElement,"overflow","hidden"))),()=>{0==--w_&&d()}}},[t])}({isDisabled:o||!t.isOpen}),(0,c3.useEffect)(()=>{if(t.isOpen&&n.current)if(o){var e,r,a=i?.current??n.current;let t=_4[_4.length-1];return t&&!t.visibleNodes.has(a)?(t.visibleNodes.add(a),()=>{t.visibleNodes.delete(a)}):void 0}else{let t,o,a,s,l,u,c,d,f,p,h;return e=[i?.current??n.current],o=(r={shouldUseInert:!0})instanceof(t=mf(e?.[0])).Element?{root:r}:r,a=o?.root??document.body,s=o?.shouldUseInert&&_1,l=new Set(e),u=new Set,c=(e,r)=>{s&&e instanceof t.HTMLElement?e.inert=r:r?e.setAttribute("aria-hidden","true"):(e.removeAttribute("aria-hidden"),e instanceof t.HTMLElement&&(e.inert=!1))},d=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))l.add(t);let t=e=>{if(u.has(e)||l.has(e)||e.parentElement&&u.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of l)if(mp(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},r=vF(md(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),n=t(e);if(n===NodeFilter.FILTER_ACCEPT&&f(e),n!==NodeFilter.FILTER_REJECT){let e=r.nextNode();for(;null!=e;)f(e),e=r.nextNode()}},f=e=>{let r=_3.get(e)??0;(s&&e instanceof t.HTMLElement?e.inert:"true"===e.getAttribute("aria-hidden"))&&0===r||(0===r&&c(e,!0),u.add(e),_3.set(e,r+1))},_4.length&&_4[_4.length-1].disconnect(),d(a),(p=new MutationObserver(e=>{for(let r of e)if("childList"===r.type&&r.target.isConnected&&![...l,...u].some(e=>mp(e,r.target)))for(let e of r.addedNodes){var t;(e instanceof HTMLElement||e instanceof SVGElement)&&("true"===(t=e).dataset.liveAnnouncer||void 0!==t.dataset.reactAriaTopLayer)?l.add(e):e instanceof Element&&d(e)}})).observe(a,{childList:!0,subtree:!0}),h={visibleNodes:l,hiddenNodes:u,observe(){p.observe(a,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}},_4.push(h),()=>{for(let e of(p.disconnect(),u)){let t=_3.get(e);null!=t&&(1===t?(c(e,!1),_3.delete(e)):_3.set(e,t-1))}h===_4[_4.length-1]?(_4.pop(),_4.length&&_4[_4.length-1].observe()):_4.splice(_4.indexOf(h),1)}}},[o,t.isOpen,n,i]),{popoverProps:h0(c,p),arrowProps:h,underlayProps:f,placement:m,triggerAnchorPoint:y}}({...n,offset:null!=(i=n.offset)?i:8,arrowSize:s,groupRef:f?c:u},e),g=n.popoverRef,b=function(e,t=!0){let[r,n]=(0,c3.useState)(!0),i=r&&t;return hF(()=>{if(i&&e.current&&"getAnimations"in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),wP(e,i,(0,c3.useCallback)(()=>n(!1),[])),i}(g,!!y)||n.isEntering||!1,v=h4({...n,defaultClassName:"react-aria-Popover",values:{trigger:n.trigger||null,placement:y,isEntering:b,isExiting:t}}),w=!n.isNonModal||"SubmenuTrigger"===n.trigger,[x,E]=(0,c3.useState)(!1);hF(()=>{g.current&&E(w&&!g.current.querySelector("[role=dialog]"))},[g,w]),(0,c3.useEffect)(()=>{var e;let t,r;x&&g.current&&!g.current.contains(document.activeElement)&&(r=((e=document)=>e.activeElement)(t=md(e=g.current)),"virtual"===wC?m5(()=>{((e=document)=>e.activeElement)(t)===r&&e.isConnected&&mu(e)}):mu(e))},[x,g]);let S={...p.style,...v.style},D=c4().createElement("div",{...h0(ml(n),p),...v,role:x?"dialog":void 0,tabIndex:x?-1:void 0,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],ref:g,slot:n.slot||void 0,style:S,dir:n.dir,"data-trigger":n.trigger,"data-placement":y,"data-entering":b||void 0,"data-exiting":t||void 0},!n.isNonModal&&c4().createElement(wO,{onDismiss:e.close}),c4().createElement(_0.Provider,{value:{...m,placement:y,ref:a}},v.children),c4().createElement(wO,{onDismiss:e.close}));return f?c4().createElement(_K,{...n,shouldContainFocus:x,isExiting:t,portalContainer:null!=(o=null!=r?r:null==c?void 0:c.current)?o:void 0},D):c4().createElement(_K,{...n,shouldContainFocus:x,isExiting:t,portalContainer:r},!n.isNonModal&&e.isOpen&&c4().createElement("div",{"data-testid":"underlay",...h,style:{position:"fixed",inset:0}}),c4().createElement("div",{ref:u,style:{display:"contents"}},c4().createElement(wW.Provider,{value:u},D)))}function wz(e){return e?.start!=null&&null!=e.end}let wq=(0,c3.createContext)(null),wG=(0,c3.createContext)(null),wZ=(0,c3.createContext)(null),wY=(0,c3.createContext)(null),wJ=(0,c3.forwardRef)(function(e,t){var r,n;[e,t]=h6(e,t,wq);let{validationBehavior:i}=h2(_J)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",a=function(e){let t=wV(e),[r,n]=vg(e.value,e.defaultValue||null,e.onChange),[i]=(0,c3.useState)(r),o=r||e.placeholderValue||null,[a,s]=_D(o,e.granularity),l=null!=r?r.toDate(s??"UTC"):null,u="hour"===a||"minute"===a||"second"===a,c=e.shouldCloseOnSelect??!0,[d,f]=(0,c3.useState)(null),[p,h]=(0,c3.useState)(null);if(r&&(d=r,"hour"in r&&(p=r)),o&&!(a in o))throw Error("Invalid granularity "+a+" for value "+o.toString());let m=r?.calendar.identifier==="gregory"&&"BC"===r.era,y=(0,c3.useMemo)(()=>({granularity:a,timeZone:s,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:m}),[a,e.hourCycle,e.shouldForceLeadingZeros,s,e.hideTimeZone,m]),{minValue:g,maxValue:b,isDateUnavailable:v}=e,w=(0,c3.useMemo)(()=>_v(r,g,b,v,y),[r,g,b,v,y]),x=_f({...e,value:r,builtinValidation:w}),E=x.displayValidation.isInvalid,S=e.validationState||(E?"invalid":null),D=(e,t)=>{n("timeZone"in t?t.set(gX(e)):g0(e,t)),f(null),h(null),x.commitValidation()};return{...x,value:r,defaultValue:e.defaultValue??i,setValue:n,dateValue:d,timeValue:p,setDateValue:r=>{let i="function"==typeof c?c():c;u?p||i?D(r,p||_E(e.defaultValue||e.placeholderValue)):f(r):(n(r),x.commitValidation()),i&&t.setOpen(!1)},setTimeValue:e=>{d&&e?D(d,e):h(e)},granularity:a,hasTime:u,...t,setOpen(n){!n&&!r&&d&&u&&D(d,p||_E(e.defaultValue||e.placeholderValue)),t.setOpen(n)},validationState:S,isInvalid:E,formatValue:(e,t)=>l?new y9(e,_x(t,y)).format(l):"",getDateFormatter:(e,t)=>new y9(e,_x({},{...y,...t}))}}({...e,validationBehavior:o}),s=(0,c3.useRef)(null),[l,u]=h5(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,fieldProps:f,buttonProps:p,dialogProps:h,calendarProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,r){var n;let i=hJ(),o=hJ(),a=hJ(),s=gp((n=v5)&&n.__esModule?n.default:n,"@react-aria/datepicker"),{isInvalid:l,validationErrors:u,validationDetails:c}=t.displayValidation,{labelProps:d,fieldProps:f,descriptionProps:p,errorMessageProps:h}=v7({...e,labelElementType:"span",isInvalid:l,errorMessage:e.errorMessage||u}),m=v8(t,r),y=f["aria-labelledby"]||f.id,{locale:g}=y1(),b=t.formatValue(g,{month:"long"}),v=bj(b?s.format("selectedDateDescription",{date:b}):""),w=[v["aria-describedby"],f["aria-describedby"]].filter(Boolean).join(" ")||void 0,x=ml(e),E=(0,c3.useMemo)(()=>v1(r),[r]),S=(0,c3.useRef)(!1),{focusWithinProps:D}=yP({...e,isDisabled:t.isOpen,onBlurWithin:t=>{mp(document.getElementById(o),t.relatedTarget)||(S.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{S.current||(S.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}});return{groupProps:h0(x,m,f,v,D,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":y,"aria-describedby":w,onKeyDown(r){!t.isOpen&&e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){!t.isOpen&&e.onKeyUp&&e.onKeyUp(r)}}),labelProps:{...d,onClick:()=>{E.focusFirst()}},fieldProps:{...f,id:a,[_n]:"presentation","aria-describedby":w,value:t.value,defaultValue:t.defaultValue,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,[_d]:t,autoFocus:e.autoFocus,name:e.name,form:e.form},descriptionProps:p,errorMessageProps:h,buttonProps:{...v,id:i,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${i} ${y}`,"aria-describedby":w,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:o,"aria-labelledby":`${i} ${y}`},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(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:l,validationErrors:u,validationDetails:c}}({...h8(e),label:u,validationBehavior:o},a,s),[v,w]=(0,c3.useState)(null),x=(0,c3.useCallback)(()=>{s.current&&w(s.current.offsetWidth+"px")},[]);wp({ref:s,onResize:x});let{focusProps:E,isFocused:S,isFocusVisible:D}=yC({within:!0}),O=h4({...e,values:{state:a,isFocusWithin:S,isFocusVisible:D,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DatePicker"}),P=ml(e);return delete P.id,c4().createElement(h3,{values:[[wZ,a],[vN,{...c,ref:s,isInvalid:a.isInvalid}],[_N,f],[y$,{...p,isPressed:a.isOpen}],[_Q,{...d,ref:l,elementType:"span"}],[vE,m],[_z,a],[wU,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":v}}],[_H,h],[yB,{slots:{description:y,errorMessage:g}}],[_G,b]]},c4().createElement("div",{...E,...P,...O,ref:t,slot:e.slot||void 0,"data-focus-within":S||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":D||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))}),wQ=(0,c3.forwardRef)(function(e,t){var r,n;[e,t]=h6(e,t,wG);let{validationBehavior:i}=h2(_J)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",a=function(e){let t=wV(e),[r,n]=vg(e.value,e.defaultValue||null,e.onChange),[i]=(0,c3.useState)(r),[o,a]=(0,c3.useState)(()=>r||{start:null,end:null});null==r&&o.start&&o.end&&a(o={start:null,end:null});let s=r||o,l=e=>{a(s=e||{start:null,end:null}),wz(s)?n(s):n(null)},[u,c]=_D(s?.start||s?.end||e.placeholderValue||null,e.granularity),d="hour"===u||"minute"===u||"second"===u,f=e.shouldCloseOnSelect??!0,[p,h]=(0,c3.useState)(null),[m,y]=(0,c3.useState)(null);s&&wz(s)&&(p=s,"hour"in s.start&&(m=s));let g=(e,t)=>{l({start:"timeZone"in t.start?t.start.set(gX(e.start)):g0(e.start,t.start),end:"timeZone"in t.end?t.end.set(gX(e.end)):g0(e.end,t.end)}),h(null),y(null),P.commitValidation()},b=r=>{let n="function"==typeof f?f():f;d?wz(r)&&(n||m?.start&&m?.end)?g(r,{start:m?.start||_E(e.placeholderValue),end:m?.end||_E(e.placeholderValue)}):h(r):wz(r)?(l(r),P.commitValidation()):h(r),n&&t.setOpen(!1)},v=e=>{wz(p)&&wz(e)?g(p,e):y(e)},w=s?.start?.calendar.identifier==="gregory"&&"BC"===s.start.era||s?.end?.calendar.identifier==="gregory"&&"BC"===s.end.era,x=(0,c3.useMemo)(()=>({granularity:u,timeZone:c,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:w}),[u,e.hourCycle,e.shouldForceLeadingZeros,c,e.hideTimeZone,w]),{minValue:E,maxValue:S,isDateUnavailable:D}=e,O=(0,c3.useMemo)(()=>{var e;let t;return e=s,t=_y(_v(e?.start??null,E,S,D,x),_v(e?.end??null,E,S,D,x)),e?.end!=null&&null!=e.start&&0>e.end.compare(e.start)&&(t=_y(t,{isInvalid:!0,validationErrors:[(gs.getGlobalDictionaryForPackage("@react-stately/datepicker")||_g).getStringForLocale("rangeReversed",_b())],validationDetails:{..._s,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})),t},[s,E,S,D,x]),P=_f({...e,value:r,name:(0,c3.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:O}),C=P.displayValidation.isInvalid,k=e.validationState||(C?"invalid":null);return{...P,value:s,defaultValue:e.defaultValue??i,setValue:l,dateRange:p,timeRange:m,granularity:u,hasTime:d,setDate(e,t){"start"===e?b({start:t,end:p?.end??null}):b({start:p?.start??null,end:t})},setTime(e,t){"start"===e?v({start:t,end:m?.end??null}):v({start:m?.start??null,end:t})},setDateTime(e,t){"start"===e?l({start:t,end:s?.end??null}):l({start:s?.start??null,end:t})},setDateRange:b,setTimeRange:v,...t,setOpen(r){!r&&!(s?.start&&s?.end)&&wz(p)&&d&&g(p,{start:m?.start||_E(e.placeholderValue),end:m?.end||_E(e.placeholderValue)}),t.setOpen(r)},validationState:k,isInvalid:C,formatValue(t,r){let n;if(!s||!s.start||!s.end)return null;let i="timeZone"in s.start?s.start.timeZone:void 0,o=e.granularity||(s.start&&"minute"in s.start?"minute":"day"),a="timeZone"in s.end?s.end.timeZone:void 0,l=e.granularity||(s.end&&"minute"in s.end?"minute":"day"),u=_x(r,{granularity:o,timeZone:i,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===s.start.calendar.identifier&&"BC"===s.start.era||"gregory"===s.end.calendar.identifier&&"BC"===s.end.era}),c=s.start.toDate(i||"UTC"),d=s.end.toDate(a||"UTC"),f=new y9(t,u);if(i===a&&o===l&&0!==s.start.compare(s.end)){try{let e=f.formatRangeToParts(c,d),t=-1;for(let r=0;r<e.length;r++){let n=e[r];if("shared"===n.source&&"literal"===n.type)t=r;else if("endRange"===n.source)break}let r="",n="";for(let i=0;i<e.length;i++)i<t?r+=e[i].value:i>t&&(n+=e[i].value);return{start:r,end:n}}catch{}n=f}else n=new y9(t,_x(r,{granularity:l,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:f.format(c),end:n.format(d)}},getDateFormatter:(e,t)=>new y9(e,_x({},{...x,...t}))}}({...e,validationBehavior:o}),s=(0,c3.useRef)(null),[l,u]=h5(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,startFieldProps:f,endFieldProps:p,buttonProps:h,dialogProps:m,calendarProps:y,descriptionProps:g,errorMessageProps:b,...v}=function(e,t,r){var n;let i=gp((n=v5)&&n.__esModule?n.default:n,"@react-aria/datepicker"),{isInvalid:o,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=v7({...e,labelElementType:"span",isInvalid:o,errorMessage:e.errorMessage||a}),f=u["aria-labelledby"]||u.id,{locale:p}=y1(),h=t.formatValue(p,{month:"long"}),m=bj(h?i.format("selectedRangeDescription",{startDate:h.start,endDate:h.end}):""),y={"aria-label":i.format("startDate"),"aria-labelledby":f},g={"aria-label":i.format("endDate"),"aria-labelledby":f},b=hJ(),v=hJ(),w=v8(t,r),x=[m["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,E=(0,c3.useMemo)(()=>v1(r,{accept:e=>e.id!==b}),[r,b]),S={[_i]:E,[_n]:"presentation","aria-describedby":x,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},D=ml(e),O=(0,c3.useRef)(!1),{focusWithinProps:P}=yP({...e,isDisabled:t.isOpen,onBlurWithin:t=>{mp(document.getElementById(v),t.relatedTarget)||(O.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{O.current||(O.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}}),C=(0,c3.useRef)(_u),k=(0,c3.useRef)(_u);return{groupProps:h0(D,w,u,m,P,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":x,onKeyDown(r){!t.isOpen&&e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){!t.isOpen&&e.onKeyUp&&e.onKeyUp(r)}}),labelProps:{...l,onClick:()=>{E.focusFirst()}},buttonProps:{...m,id:b,"aria-haspopup":"dialog","aria-label":i.format("calendar"),"aria-labelledby":`${b} ${f}`,"aria-describedby":x,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:v,"aria-labelledby":`${b} ${f}`},startFieldProps:{...y,...S,value:t.value?.start??null,defaultValue:t.defaultValue?.start,onChange:e=>t.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[_d]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){C.current=e,t.updateValidation(_y(e,k.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...g,...S,value:t.value?.end??null,defaultValue:t.defaultValue?.end,onChange:e=>t.setDateTime("end",e),name:e.endName,form:e.form,[_d]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){k.current=e,t.updateValidation(_y(C.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:c,errorMessageProps:d,calendarProps:{autoFocus:!0,value:t.dateRange?.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(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:o,validationErrors:a,validationDetails:s}}({...h8(e),label:u,validationBehavior:o},a,s),[w,x]=(0,c3.useState)(null),E=(0,c3.useCallback)(()=>{s.current&&x(s.current.offsetWidth+"px")},[]);wp({ref:s,onResize:E});let{focusProps:S,isFocused:D,isFocusVisible:O}=yC({within:!0}),P=h4({...e,values:{state:a,isFocusWithin:D,isFocusVisible:O,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DateRangePicker"}),C=ml(e);return delete C.id,c4().createElement(h3,{values:[[wY,a],[vN,{...c,ref:s,isInvalid:a.isInvalid}],[y$,{...h,isPressed:a.isOpen}],[_Q,{...d,ref:l,elementType:"span"}],[vS,y],[_z,a],[wU,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":w}}],[_H,m],[_N,{slots:{start:f,end:p}}],[yB,{slots:{description:g,errorMessage:b}}],[_G,v]]},c4().createElement("div",{...S,...C,...P,ref:t,slot:e.slot||void 0,"data-focus-within":D||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":O||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))});function wX(e){return c4().createElement(y0,e)}function w0(e,t,r=!1){if(null==e)return r?e:void 0;if("string"==typeof e&&!e)return r?null:void 0;if(e instanceof gV||e instanceof gW||e instanceof gK)return t?g1(e,t):e;{let r=fN()(e).toDate(),n=new gV(r.getFullYear(),r.getMonth()+1,r.getDate());return t?g1(n,t):n}}function w1(e){if(e)return e.toDate(bn())}function w3(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function w4(e){let t=e??"",r=w3(t);if(!r)return t;try{return new Intl.DisplayNames([r],{type:"language"}).of(r)??t}catch{return t}}function w2(){let e=window.i18next.language,t=w3(e)??e;return"ht"===t&&(t="fr-HT"),t}if("u">typeof navigator){let e=navigator;eo=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;eo=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var w6=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch{return"en-US"}}(eo||"en-US"),w5=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},w8={};for(let e=1;e<100;e++)w8[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var w9={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},w7="[1234567890一二三四五六七八九〇\\d]",xe={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},xt={},xr={"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},xn={zone:xr,year:w8,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:{}},xi={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(xr).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,}"},xo={...xi,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}"},xa={},xs=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=w6){return xa[t.toLowerCase()]||(xa[t.toLowerCase()]=new e(t)),xa[t.toLowerCase()]}constructor(e=w6){this.locale=e,this.lookups={...xn},this.vars={...xi};let 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 r=0;r<e.length;r++)t+=String(this.lookups.digit[e[r]]);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 r=this.lookups.meridiem[t?.toLowerCase()]||0,n=this.toInt(e);return n<12&&12===r&&(n+=12),12===n&&0===r&&(n=0),n}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,r,n]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(r)+this.toInt(n||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=xe: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(xt[e])return xt[e];if("fullwide"===e||"hanidec"===e)return{group:w7,lookup:{...xe}};let t=w9[e];if(!t)return{group:"\\d",lookup:{...xe}};let r=String.fromCharCode(t),n=String.fromCharCode(t+9),i={};for(let e=0;e<10;e++)i[String.fromCharCode(t+e)]=e;return xt[e]={group:`[${r}-${n}]`,lookup:i},xt[e]}(this.numberingSystem);for(let r in this.lookups.digit=t,xo)xo.hasOwnProperty(r)&&(this.vars[r]=xo[r].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((r,n)=>{["","k","kuu","kuuta"].forEach((i,o)=>{e[r+i+(o<2?"\\.?":"")]=!0,t[r+i]=n+1})});else{let r=[],n=e=>"month"===e.type;for(let e=0;e<12;e++)r.push(new Date(2017,e,1));for(let i of["full","long","medium"]){let o=Intl.DateTimeFormat(this.locale,{dateStyle:i});for(let a=0;a<12;a++){let s=o.formatToParts(r[a]).find(n).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===i?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=a+1)}}let i=Intl.DateTimeFormat(this.locale,{month:"short"});for(let o=0;o<12;o++){let a=i.formatToParts(r[o]).find(n).value.toLocaleLowerCase(this.locale);a=a.replace(/\.$/,""),e[`${a}\\.?`]=!0,t[a]=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 r=[],n={};for(let i of["long","short"]){let o=Intl.DateTimeFormat(this.locale,{weekday:i});for(let a=0;a<7;a++){let s=o.formatToParts(e[a]).find(t).value.toLocaleLowerCase(this.locale);"short"===i?(s=s.replace(/\.$/,""),r.push(`${s}\\.?`)):r.push(s),n[s]=a}}this.vars.DAYNAME=r.join("|"),this.lookups.dayname=n}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,r=[],n={},i=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let o=0;o<2;o++){let a=i.formatToParts(e[o]).find(t);if(!a)return;let s=a.value.toLocaleLowerCase(this.locale);r.push(s),n[s]=12*o}this.vars.MERIDIEM=r.join("|"),this.lookups.meridiem=n}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")}},xl=["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"],xu={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},xc=()=>new Date;function xd(e){return function(t){let r={};for(let n=0,i=e.length;n<i;n++){let i=e[n];i&&(r[i]=t[n])}return r}}var xf=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:r,formatter:n}){this.doneChecker=e,this.fallback=t,this.patterns=r,this.formatter=n}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),r={},n=!1;for(let e of this.patterns){let i=t.match(e.regex);if(!i)continue;n=!0;let o=e.handler(i);if(o){for(let[e,t]of Object.entries(o))e in r||void 0===t||(r[e]=t);if(t=(t=t.slice(0,i.index)+t.slice(i.index+i[0].length+1)).trim(),this.doneChecker(r,t))break}}return n?this.formatter(r):this.fallback(e)}},xp=["year","month","day","hour","minute","second","millisecond","offset"],xh={};function xm(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 xy=[[/([^\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"]],xg={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," "],...xy],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:xy,id:xy,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function xb(e,t=w6){let r=function(e){if(!xh[e]){var t,r;let n,i,o=xs.factory(e);xh[e]=new xf({doneChecker:xm,fallback:(t=e,function(e){let r=String(e).slice(0,50);return""===r&&(r="(empty string)"),{invalid:`Unable to parse "${r}" with locale "${t}"`}}),patterns:(n=[{name:"timestampWithOffset",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:xd(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:xd(["","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:xd(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:o.compile(`^(${w7}{2,4})\\s*\u5E74\\s*(${w7}{1,2})\\s*\u6708\\s*(${w7}{1,2})\\s*\u65E5$`),handler:xd(["","year","month","day"])},{name:"korean",regex:o.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:xd(["","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:xd(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=xc(),r=e[1].toLowerCase();switch(r){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}let n={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===r&&(n.hour=t.getUTCHours(),n.minute=t.getUTCMinutes(),n.second=t.getUTCSeconds(),n.millisecond=t.getUTCMilliseconds()),console.log("today=>",r,n),n}},{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,r,n]){t=parseFloat(t),"week"===(r=r.length<=2?xu[r]:(r=r.replace(/s$/,"")).toLowerCase())&&(r="day",t*=7),("-"===e||n)&&(t*=-1);let i=xc();return"millisecond"===r?i.setUTCMilliseconds(i.getUTCMilliseconds()+t):"second"===r?i.setUTCSeconds(i.getUTCSeconds()+t):"minute"===r?i.setUTCMinutes(i.getUTCMinutes()+t):"hour"===r?i.setUTCHours(i.getUTCHours()+t):"day"===r?i.setUTCDate(i.getUTCDate()+t):"month"===r?i.setUTCMonth(i.getUTCMonth()+t):"year"===r&&i.setUTCFullYear(i.getUTCFullYear()+t),{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.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:xd(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:xd(["","hour","minute","second","millisecond","zone"])},{name:"hms12",regex:o.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:xd(["","hour","minute","second","meridiem"])},{name:"hms24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:xd(["","hour","minute","second","millisecond"])},{name:"hm12",regex:o.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:xd(["","hour","minute","meridiem"])},{name:"hm24",regex:o.compile("(_H24_):(_MIN_)"),handler:xd(["","hour","minute"])},{name:"h12",regex:o.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:xd(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:xd(["","year","month","day"])},{name:"yearMonthnameDay",regex:o.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:xd(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:o.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:xd(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:o.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:xd(["","monthname","day","","year"])},{name:"dayMonthname",regex:o.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:xd(["","day","","monthname"])},{name:"monthnameDay",regex:o.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:xd(["","monthname","day"])},{name:"hmsNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:xd(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:xd(["","hour","minute"])},{name:"ymd",regex:o.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:xd(["","year","","month","day"])},{name:"mdy",regex:o.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:xd(["","month","","day","year"])},{name:"dmy",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:xd(["","day","month","year"])},{name:"yearLoose",regex:o.compile("_YEAR4_"),handler:xd(["year"])},{name:"dayMonthnameLoose",regex:o.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:xd(["","day","monthname"])},{name:"monthnameDayLoose",regex:o.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:xd(["","monthname","day"])},{name:"monthname",regex:o.compile("_MONTHNAME_"),handler:xd(["monthname"])},{name:"year4",regex:o.compile("_YEAR4_"),handler:xd(["year"])},{name:"md",regex:o.compile("(_MONTH_)[/-](_DAY_)"),handler:xd(["","month","day"])},{name:"dm",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:xd(["","day","month"])},{name:"day",regex:o.compile("_DAY_"),handler:xd(["day"])},{name:"year2",regex:o.compile("_YEAR2_"),handler:xd(["year"])},{name:"onlyZone",regex:o.compile("_ZONE_"),handler:xd(["zone"])}],i=o.baseName.slice(0,5),xl.includes(i)?n:n.filter(e=>!["mdy","md"].includes(e.name))),formatter:(r=o,function(e){let t={};for(let[n,i]of Object.entries(e))if("monthname"===n){if(i){let e=r.monthNameToInt(i);void 0!==e&&(t.month=e)}}else if("hour"===n&&e.meridiem){let n=r.h12ToInt(i,e.meridiem);void 0!==n&&(t.hour=n)}else if("zone"===n){if(i){let e=r.zoneToOffset(i);void 0!==e&&(t.offset=e)}}else if("offset"===n){let e=r.offsetToMinutes(i);void 0!==e&&(t.offset=e)}else if("millisecond"===n){let e=r.millisecondToInt(i);"number"==typeof e&&(t.millisecond=e)}else if(xp.includes(n)){let e=r.toInt(i);"number"==typeof e&&(t[n]=e)}return t.year<100&&(t.year=w8[t.year]),t.year&&"buddhist"===r.dateOptions.calendar&&(t.year-=543),t})})}return xh[e]}(t),n=function(e,t){let r=xg[t.slice(0,2).toLowerCase()];if(!r)return e;for(let[t,n]of r)e=e.replace(t,n);return e}(e,t);return r.attempt(n)}function xv(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new w5(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 w5(t.valueOf()-60*e.offset*1e3):t}function x_(e,t=w6){let r=xb(e,t),n=r.invalid?new w5(NaN):xv(r);return n.isValid()||(n.invalid=`Unable to parse date "${e}"`),n}function xw(e,t=w6){return e instanceof Date?new w5(e.valueOf()):"number"==typeof e?new w5(e):x_(e,t)}Date.fromString=w5.fromString=x_,Date.fromAny=w5.fromAny=xw,"u">typeof window&&(window.anyDateParser={fromString:x_,fromAny:xw,fromObject:xv,attempt:xb});var xx=r(5238),xE=r(83826);let xS=function(e){return null==e};function xD(e,t){var r=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return r.get?r.get.call(e):r.value}fM.extend(fI),fM.extend(xE),fM.extend(xx);let xO="YYYY-MM-DDTHH:mm:ss.SSSZZ";function xP(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&fM(e,xO).isValid()}function xC(e){return fM(e).isToday()}function xk(e){return xP(e)?fM(e,xO).toDate():null}function xj(e,t=!1){let r=fM(e);return t&&(r=r.utc()),r.format(xO)}function xT(e){return fM(e).toDate()}var xR=new WeakMap;let xA=new class{register(e,t){xD(this,xR).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(xD(this,xR).has(t))return xD(this,xR).get(t)}if(e.language&&xD(this,xR).has(e.language))return xD(this,xR).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return xD(this,xR).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,r){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,r)}(this,xR,{writable:!0,value:new Map})}};function xM(e,t){xA.register(e,t)}function xN(e){let t=e??w2();return xA.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let xI={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function x$(e,t={}){let r=xb(e,w2());if(r.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!xS(r.day)&&xS(r.month)&&(r=Object.assign({},tO(r,"day"),{month:r.day})),r.month&&(r.month-=1),r.day&&(r=Object.assign({},tO(r,"day"),{date:r.day}));let n=fM().set(r).toDate();return xS(r.year)&&(t.year=!1),xS(r.month)&&(t.month=!1),xS(r.date)&&(t.day=!1),xL(n,t)}function xL(e,t){let r,n=t?.locale??w2(),i=new Intl.Locale(n),{calendar:o,mode:a,time:s,day:l,month:u,year:c,noToday:d,numberingSystem:f}={...xI,...{noToday:"am"===i.language},...t},p={calendar:o??xN(i),year:c?"numeric":void 0,month:u?"short":void 0,day:l?"2-digit":void 0,numberingSystem:f},h=fM(e).isToday();if(h&&!d)r=(r=new Intl.RelativeTimeFormat(n,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(n)+r.slice(1);else{"en"===i.language&&(n="en-GB");let t=new Intl.DateTimeFormat(n,p).formatToParts(e);("en"===i.language||"am"===i.language)&&"standard"==a&&c&&l&&(t=t.map(xF("-"))),"wide"==a&&(t=t.map(xF(" — "))),"ethiopic"===p.calendar&&(t=t.filter((e,t,r)=>"era"!==e.type&&("literal"!==e.type||!(t<r.length-1)||"era"!==r[t+1].type))),r=t.map(e=>e.value).join("")}return(!0===s||h&&"for today"===s)&&(r+=`, ${xB(e)}`),r}let xF=e=>(t,r,n)=>"literal"!==t.type||" "!==t.value||r<n.length-1&&"era"===n[r+1].type?t:{type:"literal",value:e};function xB(e){return e.toLocaleTimeString(w2(),{hour:"2-digit",minute:"2-digit"})}function xV(e,t){return xL(e,{...t,time:!0})}function xU(e,t){let r=xN("string"==typeof t?new Intl.Locale(t):t);return r?g1(e,vl(r)):e}function xW(e,t){return new Intl.DurationFormat(w2(),t).format(e)}function xK(e,t){if(null==e)return null;if("string"==typeof e){let r=xb(e,w2());return r.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(r.day&&!r.month&&(r={...tO(r,"day"),...{month:r.day}}),r.month&&(r.month-=1),r.day&&(r={...tO(r,"day"),...{date:r.day}}),fM(t).set(r))}return fM(e)}let xH=["years","months","days","hours","minutes","seconds"],xz={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},xq={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function xG(e,t=fM(),r){let n,i=fM(t),o=xK(e,i);if(null==o)return null;if("string"==typeof r){let e=xz[r]??r;return{[e]:i.diff(o,e)}}let{thresholds:a,largestUnit:s,smallestUnit:l}=r??{};if(void 0!==s||void 0!==l){let e,t=l?xz[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,r){let n=xH.indexOf(r);for(let i=0;i<xH.length;i++){let o=xH[i];if(t.diff(e,o)>0)return i<=n?o:r}return r}(o,i,t??"seconds"):xz[s]??s,function(e,t,r,n){let i=xH.indexOf(r),o=xH.indexOf(n),a=xH.slice(i,o+1),s={},l=e;for(let e of a){let r=t.diff(l,e);s[e]=r,l=l.add(r,e)}return s}(o,i,e,t??e)}let u=(n=function(e){let t={...xq};if(e)for(let[r,n]of Object.entries(e))void 0!==n&&(t[xz[r]??r]=n);return t}(a),i.diff(o,"seconds")<n.seconds?"seconds":i.diff(o,"minutes")<n.minutes?"minutes":i.diff(o,"hours")<n.hours?"hours":i.diff(o,"days")<n.days?"days":i.diff(o,"months")<n.months?"months":"years");return{[u]:i.diff(o,u)}}let xZ={style:"short",localeMatcher:"lookup"};function xY(e,t=fM(),r){let n=xG(e,t,r);return null==n?null:xW(n,"object"==typeof r&&r.formatOptions?{...xZ,...r.formatOptions}:xZ)}let xJ=(0,c3.createContext)(null);function xQ(){let e=dX({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,c3.useMemo)(()=>{let t=w2();return e[t]&&(t=e[t]),t},[window.i18next.language]),r=(0,c3.useMemo)(()=>{let e=xN(t);return void 0!==e?vl(e):void 0},[t]),n=(0,c3.useMemo)(()=>new Intl.Locale(t,{calendar:r?.identifier}),[t,r]),i=(0,c3.useMemo)(()=>r?g1(g7(bn()),r):g7(bn()),[r]);return{calendar:r,intlLocale:n,today_:i}}let xX=new gV(1793,1,1);var x0={};function x1(){return"u">typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}function x3(e={}){let{locale:t}=y1();return(0,c3.useMemo)(()=>new(0,_j.K)(t,e),[t,e])}x0={"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 x4={};x4={"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:"空白"}};let x2=()=>{};function x6(e){var t;let r=(0,c3.useRef)(void 0),{value:n,textValue:i,minValue:o,maxValue:a,isDisabled:s,isReadOnly:l,isRequired:u,onIncrement:c,onIncrementPage:d,onDecrement:f,onDecrementPage:p,onDecrementToMin:h,onIncrementToMax:m}=e,y=gp((t=x4)&&t.__esModule?t.default:t,"@react-aria/spinbutton"),g=(0,c3.useRef)(!1),b=(0,c3.useCallback)(()=>{clearTimeout(r.current),g.current=!1},[]),v=yf(()=>{b()});(0,c3.useEffect)(()=>()=>v(),[]);let w=(0,c3.useRef)(!1),x=()=>{w.current=!0},E=()=>{w.current=!1},S=""===i?y.format("Empty"):(i||`${n}`).replace("-","−");(0,c3.useEffect)(()=>{w.current&&(y3&&y3.clear("assertive"),y4(S,"assertive"))},[S]);let D=(0,c3.useCallback)(()=>{b()},[b]),O=yf(c??x2),P=yf(f??x2),C=yf(()=>{(void 0===a||isNaN(a)||void 0===n||isNaN(n)||n<a)&&(O(),k(60))}),k=yf(e=>{v(),g.current=!0,r.current=window.setTimeout(C,e)}),j=yf(()=>{(void 0===o||isNaN(o)||void 0===n||isNaN(n)||n>o)&&(P(),T(60))}),T=yf(e=>{v(),g.current=!0,r.current=window.setTimeout(j,e)}),R=e=>{e.preventDefault()},{addGlobalListener:A,removeAllGlobalListeners:M}=yp(),N=(0,c3.useRef)(!1),[I,$]=(0,c3.useState)(null);(0,c3.useEffect)(()=>{"touch"===I?k(600):I&&k(400)},[I]);let[L,F]=(0,c3.useState)(null);return(0,c3.useEffect)(()=>{"touch"===L?T(600):L&&T(400)},[L]),{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===n||isNaN(n)?void 0:n,"aria-valuetext":S,"aria-valuemin":o,"aria-valuemax":a,"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&&!e.nativeEvent.isComposing)switch(e.key){case"PageUp":if(d){e.preventDefault(),d?.();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),c?.());break;case"PageDown":if(p){e.preventDefault(),p?.();break}case"ArrowDown":case"Down":f&&(e.preventDefault(),f?.());break;case"Home":h&&(e.preventDefault(),h?.());break;case"End":m&&(e.preventDefault(),m?.())}},onFocus:x,onBlur:E},incrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(c?.(),$("mouse")):(A(window,"pointercancel",D,{capture:!0}),N.current=!1,$("touch")),A(window,"contextmenu",R)},onPressUp:e=>{b(),"touch"===e.pointerType&&(N.current=!0),M(),$(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&N.current&&c?.(),N.current=!1,$(null)},onFocus:x,onBlur:E},decrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(f?.(),F("mouse")):(A(window,"pointercancel",D,{capture:!0}),N.current=!1,F("touch"))},onPressUp:e=>{b(),"touch"===e.pointerType&&(N.current=!0),M(),F(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&N.current&&f?.(),N.current=!1,F(null)},onFocus:x,onBlur:E}}}let x5=null;var x8=r(66284);function x9(e,t,r){let n="+"===e?t+r:t-r;if(t%1!=0||r%1!=0){let i=t.toString().split("."),o=r.toString().split("."),a=Math.pow(10,Math.max(i[1]&&i[1].length||0,o[1]&&o[1].length||0));t=Math.round(t*a),r=Math.round(r*a),n=("+"===e?t+r:t-r)/a}return n}let x7=(0,c3.createContext)(null),Ee=(0,c3.createContext)(null),Et=(0,c3.forwardRef)(function(e,t){var r,n;[e,t]=h6(e,t,x7);let{validationBehavior:i}=h2(_J)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",{locale:a}=y1(),s=function(e){let{minValue:t,maxValue:r,step:n,formatOptions:i,value:o,defaultValue:a=NaN,onChange:s,locale:l,isDisabled:u,isReadOnly:c,commitBehavior:d="snap"}=e;null===o&&(o=NaN);let f=(0,c3.useCallback)(e=>void 0===n||isNaN(n)?_2(e,t,r):_5(e,t,r,n),[n,t,r]);void 0===o||isNaN(o)||"snap"!==d||(o=f(o)),isNaN(a)||"snap"!==d||(a=f(a));let[p,h]=vg(o,isNaN(a)?NaN:a,s),[m]=(0,c3.useState)(p),[y,g]=(0,c3.useState)(()=>isNaN(p)?"":new(0,_j.K)(l,i).format(p)),b=(0,c3.useMemo)(()=>new(0,x8.d)(l,i),[l,i]),v=(0,c3.useMemo)(()=>b.getNumberingSystem(y),[b,y]),w=(0,c3.useMemo)(()=>new(0,_j.K)(l,{...i,numberingSystem:v}),[l,i,v]),x=(0,c3.useMemo)(()=>w.resolvedOptions(),[w]),E=(0,c3.useCallback)(e=>isNaN(e)||null===e?"":w.format(e),[w]),S=_f({...e,value:p}),D=void 0===n||isNaN(n)?1:n;"percent"===x.style&&(void 0===n||isNaN(n))&&(D=.01);let[O,P]=(0,c3.useState)(p),[C,k]=(0,c3.useState)(l),[j,T]=(0,c3.useState)(i);Object.is(p,O)&&l===C&&i===j||(g(E(p)),P(p),k(l),T(i));let R=(0,c3.useMemo)(()=>b.parse(y),[b,y]),A=(e,n=0)=>{if(isNaN(R))return _5(isNaN(n)?0:n,t,r,D);{let n=_5(R,t,r,D);return"+"===e&&n>R||"-"===e&&n<R?n:_5(x9(e,R,D),t,r,D)}},M=(0,c3.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===r||isNaN(r)||_5(R,t,r,D)>R||x9("+",R,D)<=r),[u,c,t,r,D,R]),N=(0,c3.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===t||isNaN(t)||_5(R,t,r,D)<R||x9("-",R,D)>=t),[u,c,t,r,D,R]);return{...S,validate:e=>b.isValidPartialNumber(e,t,r),increment:()=>{let e=A("+",t);e===p&&g(E(e)),h(e),S.commitValidation()},incrementToMax:()=>{null!=r&&(h(_5(r,t,r,D)),S.commitValidation())},decrement:()=>{let e=A("-",r);e===p&&g(E(e)),h(e),S.commitValidation()},decrementToMin:()=>{null!=t&&(h(t),S.commitValidation())},canIncrement:M,canDecrement:N,minValue:t,maxValue:r,numberValue:R,defaultNumberValue:isNaN(a)?m:a,setNumberValue:h,setInputValue:g,inputValue:y,commit:e=>{let t=void 0===e?y:e,r=R;if(void 0!==e&&(r=b.parse(t)),!t.length){h(NaN),g(void 0===o?"":E(p));return}if(isNaN(r))return void g(E(p));let n="snap"===d?f(r):r,i=(n=b.parse(E(n)))!==p;h(n),g(E(void 0===o?n:p)),i&&S.commitValidation()}}}({...e,locale:a,validationBehavior:o}),l=(0,c3.useRef)(null),[u,c]=h5(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:f,inputProps:p,incrementButtonProps:h,decrementButtonProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,r){var n,i,o,a,s,l,u,c,d;let f,{id:p,decrementAriaLabel:h,incrementAriaLabel:m,isDisabled:y,isReadOnly:g,isRequired:b,minValue:v,maxValue:w,autoFocus:x,label:E,formatOptions:S,onBlur:D=()=>{},onFocus:O,onFocusChange:P,onKeyDown:C,onKeyUp:k,description:j,errorMessage:T,isWheelDisabled:R,...A}=e,{increment:M,incrementToMax:N,decrement:I,decrementToMin:$,numberValue:L,inputValue:F,commit:B,commitValidation:V}=t,U=gp((n=x0)&&n.__esModule?n.default:n,"@react-aria/numberfield"),W=(0,c3.useCallback)(()=>{let e=r.current?.value??"";(0,yh.flushSync)(()=>{B()}),r.current?.value!==e&&y4(r.current?.value??"","assertive")},[B,r]),K=hJ(p),{focusProps:H}=m9({onBlur(){W()}}),z=x3(S),q=(0,c3.useMemo)(()=>z.resolvedOptions(),[z]),G=x3({...S,currencySign:void 0}),Z=(0,c3.useMemo)(()=>isNaN(L)?"":G.format(L),[G,L]),{spinButtonProps:Y,incrementButtonProps:J,decrementButtonProps:Q}=x6({isDisabled:y,isReadOnly:g,isRequired:b,maxValue:w,minValue:v,onIncrement:M,onIncrementToMax:N,onDecrement:I,onDecrementToMin:$,value:L,textValue:Z}),[X,ee]=(0,c3.useState)(!1),{focusWithinProps:et}=yP({isDisabled:y,onFocusWithinChange:ee});!function(e,t){let{onScroll:r,isDisabled:n}=e,i=(0,c3.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),r&&r({deltaX:e.deltaX,deltaY:e.deltaY}))},[r]);bx(t,"wheel",n?void 0:i)}({onScroll:(0,c3.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?M():e.deltaY<0&&I())},[I,M]),isDisabled:R||y||g||!X},r);let er=(q.maximumFractionDigits??0)>0,en=void 0===t.minValue||isNaN(t.minValue)||t.minValue<0,ei="numeric";mR()?en?ei="text":er&&(ei="decimal"):m$()&&(en?ei="numeric":er&&(ei="decimal"));let eo=ml(e),ea=(0,c3.useCallback)(e=>{e.nativeEvent.isComposing||("Enter"===e.key?((0,yh.flushSync)(()=>{B()}),V()):e.continuePropagation())},[B,V]),{isInvalid:es,validationErrors:el,validationDetails:eu}=t.displayValidation,{labelProps:ec,inputProps:ed,descriptionProps:ef,errorMessageProps:ep}=function(e,t,r){let n=yf(e=>{let n=r.current;if(!n)return;let i=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":i=n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteContentForward":i=n.selectionEnd===n.selectionStart?n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd+1):n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteContentBackward":i=n.selectionEnd===n.selectionStart?n.value.slice(0,n.selectionStart-1)+n.value.slice(n.selectionStart):n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":i=n.value.slice(n.selectionStart);break;default:null!=e.data&&(i=n.value.slice(0,n.selectionStart)+e.data+n.value.slice(n.selectionEnd))}null!=i&&t.validate(i)||e.preventDefault()});(0,c3.useEffect)(()=>{if(!x1()||!r.current)return;let e=r.current;return e.addEventListener("beforeinput",n,!1),()=>{e.removeEventListener("beforeinput",n,!1)}},[r]);let i=x1()?null:e=>{let r=mh(e).value.slice(0,mh(e).selectionStart)+e.data+mh(e).value.slice(mh(e).selectionEnd);t.validate(r)||e.preventDefault()},{labelProps:o,inputProps:a,descriptionProps:s,errorMessageProps:l,...u}=function(e,t){let{inputElementType:r="input",isDisabled:n=!1,isRequired:i=!1,isReadOnly:o=!1,type:a="text",validationBehavior:s="aria"}=e,[l,u]=vg(e.value,e.defaultValue||"",e.onChange),{focusableProps:c}=yr(e,t),d=_f({...e,value:l}),{isInvalid:f,validationErrors:p,validationDetails:h}=d.displayValidation,{labelProps:m,fieldProps:y,descriptionProps:g,errorMessageProps:b}=v7({...e,isInvalid:f,errorMessage:e.errorMessage||p}),v=ml(e,{labelable:!0}),w={type:a,pattern:e.pattern},[x]=(0,c3.useState)(l);return _e(t,e.defaultValue??x,u),_t(e,d,t),{labelProps:m,inputProps:h0(v,"input"===r?w:void 0,{disabled:n,readOnly:o,required:i&&"native"===s,"aria-required":i&&"aria"===s||void 0,"aria-invalid":f||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(mh(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(c4().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,...y}),descriptionProps:g,errorMessageProps:b,isInvalid:f,validationErrors:p,validationDetails:h}}(e,r),c=(0,c3.useRef)(null);return{inputProps:h0(a,{onBeforeInput:i,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:n}=r.current;c.current={value:e,selectionStart:t,selectionEnd:n}},onCompositionEnd(){if(r.current&&!t.validate(r.current.value)){let{value:e,selectionStart:n,selectionEnd:i}=c.current;r.current.value=e,r.current.setSelectionRange(n,i),t.setInputValue(e)}}}),labelProps:o,descriptionProps:s,errorMessageProps:l,...u}}({...A,...eo,name:void 0,form:void 0,label:E,autoFocus:x,isDisabled:y,isReadOnly:g,isRequired:b,validate:void 0,[_d]:t,value:F,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:K,type:"text",inputMode:ei,onChange:e=>{t.validate(e)&&t.setInputValue(e)},onBlur:D,onFocus:O,onFocusChange:P,onKeyDown:(0,c3.useMemo)(()=>hL(ea,C),[ea,C]),onKeyUp:k,onPaste:t=>{e.onPaste?.(t);let r=mh(t);r&&(r.selectionEnd??-1)-(r.selectionStart??0)===r.value.length&&(t.preventDefault(),B(t.clipboardData?.getData?.("text/plain")?.trim()??""))},description:j,errorMessage:T},t,r);_e(r,t.defaultNumberValue,t.setNumberValue),i=t,o=e.validationBehavior,a=e.commitBehavior,s=r,l=t.minValue,u=t.maxValue,c=e.step,d=t.numberValue,hF(()=>{let e=s.current;if("validate"!==a||i.realtimeValidation.isInvalid||!e||e.disabled||(!x5&&"u">typeof document&&((x5=document.createElement("input")).type="number"),!x5))return;x5.min=null==l||isNaN(l)?"":String(l),x5.max=null==u||isNaN(u)?"":String(u),x5.step=null==c||isNaN(c)?"":String(c),x5.value=null==d||isNaN(d)?"":String(d);let t=e.validity.valid&&x5.validity.valid,r=e.validationMessage||x5.validationMessage,n={isInvalid:!t,validationErrors:r?[r]:[],validationDetails:{badInput:e.validity.badInput,customError:e.validity.customError,patternMismatch:e.validity.patternMismatch,rangeOverflow:x5.validity.rangeOverflow,rangeUnderflow:x5.validity.rangeUnderflow,stepMismatch:x5.validity.stepMismatch,tooLong:e.validity.tooLong,tooShort:e.validity.tooShort,typeMismatch:e.validity.typeMismatch,valueMissing:e.validity.valueMissing,valid:t}};i.updateValidation(n),"native"!==o||x5.validity.valid||e.setCustomValidity(x5.validationMessage)});let eh=h0(Y,H,ed,{role:null,"aria-roledescription":mM()?null:U.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(eh["aria-required"]=void 0);let em=e=>{((e=document)=>e.activeElement)()!==r.current&&("mouse"===e.pointerType?r.current?.focus():e.target.focus())},ey=e["aria-label"]||("string"==typeof e.label?e.label:"");ey||(f=null!=e.label?ec.id:e["aria-labelledby"]);let eg=hJ(),eb=hJ(),ev=h0(J,{"aria-label":m||U.format("increase",{fieldLabel:ey}).trim(),id:f&&!m?eg:null,"aria-labelledby":f&&!m?`${eg} ${f}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:em}),e_=h0(Q,{"aria-label":h||U.format("decrease",{fieldLabel:ey}).trim(),id:f&&!h?eb:null,"aria-labelledby":f&&!h?`${eb} ${f}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:em});return{groupProps:{...et,role:"group","aria-disabled":y,"aria-invalid":es?"true":void 0},labelProps:ec,inputProps:eh,incrementButtonProps:ev,decrementButtonProps:e_,errorMessageProps:ep,descriptionProps:ef,isInvalid:es,validationErrors:el,validationDetails:eu}}({...h8(e),label:c,validationBehavior:o},s,l),v=h4({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:b.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),w=ml(e);return delete w.id,c4().createElement(h3,{values:[[Ee,s],[vN,f],[v$,{...p,ref:l}],[_Q,{...d,ref:u}],[y$,{slots:{increment:h,decrement:m}}],[yB,{slots:{description:y,errorMessage:g}}],[_G,b]]},c4().createElement("div",{...w,...v,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":b.isInvalid||void 0}),e.name&&c4().createElement("input",{type:"hidden",name:e.name,value:isNaN(s.numberValue)?"":s.numberValue}))});function Er(e,t){return Number.parseInt(xL(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let En=(0,c3.forwardRef)(function(e,t){let{className:r}=e,n=(0,c3.useContext)(vD),i=(0,c3.useContext)(vO),o=n??i,a=(0,c3.useContext)(xJ),s=bn(),l=xL(o.visibleRange.start.toDate(s),{calendar:a.calendar,locale:a.baseName,day:!1,year:!1,noToday:!0}),u=Er(o.visibleRange.start.toDate(s),a),c=o.maxValue?Er(o.maxValue.toDate(s),a):void 0,d=o.minValue?Er(o.minValue.toDate(s),a):void 0,f=(0,c3.useCallback)(e=>{o.setFocusedDate(o.focusedDate.cycle("year",e-o.focusedDate.year))},[]);return o&&(0,fK.jsxs)("span",{ref:t,className:r,children:[(0,fK.jsx)("span",{children:l}),(0,fK.jsxs)(Et,{formatOptions:{useGrouping:!1},maxValue:c,minValue:d,onChange:f,value:u,children:[(0,fK.jsx)(vL,{}),(0,fK.jsxs)(vI,{children:[(0,fK.jsx)(yL,{slot:"increment",children:(0,fK.jsx)(pc,{size:8})}),(0,fK.jsx)(yL,{slot:"decrement",children:(0,fK.jsx)(ps,{size:8})})]})]})]})}),Ei="-esm-form-builder__datepicker-module__inputGroup___-wpzr",Eo="-esm-form-builder__datepicker-module__inputSegment___ocu7L",Ea="-esm-form-builder__datepicker-module__dateInputWrapper___909Km",Es="-esm-form-builder__datepicker-module__invalidText___oHJHi",El="-esm-form-builder__datepicker-module__flatButton___i9LDo",Eu="-esm-form-builder__datepicker-module__flatButtonMd___VZMkc",Ec="-esm-form-builder__datepicker-module__flatButtonSm___VA5wy",Ed="-esm-form-builder__datepicker-module__flatButtonLg___MnYLl";function Ef({children:e}){let t=(0,c3.useContext)(wZ),r=(0,c3.useContext)(wY),n=t??r,i=fE(()=>n?.close());return(0,fK.jsx)(_q,{className:"-esm-form-builder__datepicker-module__dialog___2pADb",ref:i,children:e})}let Ep=(0,c3.forwardRef)(function({variant:e,today_:t,minDate:r,maxDate:n},i){let o="range"===e;return(0,fK.jsx)(wK,{ref:i,className:"-esm-form-builder__datepicker-module__popover___pb58i",placement:"bottom start",offset:1,isNonModal:!0,children:(0,fK.jsx)(Ef,{children:(0,fK.jsxs)(o?vC:vP,{...o?{minValue:r,maxValue:n,className:"cds--date-picker__calendar"}:{},children:[(0,fK.jsxs)("header",{className:"-esm-form-builder__datepicker-module__header___+fi16",children:[(0,fK.jsx)(yL,{className:fz()(El,Eu),slot:"previous",children:(0,fK.jsx)(pg,{size:16})}),(0,fK.jsx)(En,{className:"-esm-form-builder__datepicker-module__monthYear___mGhot"}),(0,fK.jsx)(yL,{className:fz()(El,Eu),slot:"next",children:(0,fK.jsx)(pb,{size:16})})]}),(0,fK.jsx)(vj,{className:"-esm-form-builder__datepicker-module__calendarGrid___z07wV",children:e=>(0,fK.jsx)(vM,{className:fz()("cds--date-picker__day",{"-esm-form-builder__datepicker-module__today___dNc4M":0===t.compare(e)}),date:e},e.toString())})]})})})}),Eh=(0,c3.forwardRef)(function(e,t){let r=(0,c3.useContext)(wZ),[n,i]=h6({slot:e.slot},t,_N),{locale:o}=y1(),a=_M({...n,locale:o,createCalendar:vl}),s=(0,c3.useRef)(null),{fieldProps:l,inputProps:u}=_o({...n,inputRef:s},a,i),c=(0,c3.useCallback)(()=>{a.isDisabled||r.toggle()},[]);return(0,fK.jsxs)(h3,{values:[[_I,a],[v$,{...u,ref:s}],[vN,{...l,ref:i,isInvalid:a.isInvalid}]],children:[(0,fK.jsx)(vI,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:a.isDisabled,isInvalid:a.isInvalid,onClick:c,children:a.segments.map((t,r)=>(0,c3.cloneElement)(e.children(t),{key:r}))}),(0,fK.jsx)(vL,{})]})}),Em=(0,c3.forwardRef)(function(e,t){let r=(0,c3.useContext)(wZ),n=(0,c3.useContext)(wY);return(r??n).isInvalid?(0,fK.jsx)(hD,{ref:t,size:16,...e}):(0,fK.jsx)(pa,{ref:t,size:16,...e})});class Ey{constructor(e,t){this.locale=e,this.dictionary=t}of(e){return this.dictionary.getStringForLocale(e,this.locale)}}let Eg=new Map,Eb=(0,c3.forwardRef)(function({segment:e,...t},r){let n=(0,c3.useContext)(_I),i=hN(r),{segmentProps:o}=function(e,t,r){let n,i,o,a,s=(0,c3.useRef)(""),{locale:l,direction:u}=y1(),c=function(){var e;let{locale:t}=y1(),r=gf((e=v5)&&e.__esModule?e.default:e,"@react-aria/datepicker");return(0,c3.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new Ey(t,r)}},[t,r])}(),{ariaLabel:d,ariaLabelledBy:f,ariaDescribedBy:p,focusManager:h}=_r.get(t),m=e.isPlaceholder?"":e.text,y=(0,c3.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),g=gn({month:"long",timeZone:y.timeZone}),b=gn({hour:"numeric",hour12:y.hour12,timeZone:y.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(m=b.format(t.dateValue));else{let e=g.format(t.dateValue);m=e!==m?`${m} \u{2013} ${e}`:e}let{spinButtonProps:v}=x6({value:e.value??void 0,textValue:m,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="",t.incrementToMax(e.type)},onDecrementToMin:()=>{s.current="",t.decrementToMin(e.type)}}),w=(0,c3.useMemo)(()=>new(0,x8.d)(l,{maximumFractionDigits:0}),[l]),x=()=>{if(e.text===e.placeholder&&h.focusPrevious(),!w.isValidPartialNumber(e.text)||t.isReadOnly||e.isPlaceholder)("dayPeriod"===e.type||"era"===e.type)&&t.clearSegment(e.type);else{let r=e.text.slice(0,-1),n=w.parse(r);0===(r=0===n?"":r).length||0===n?t.clearSegment(e.type):t.setSegment(e.type,n),s.current=r}},{startsWith:E}=(n=function(e){let{locale:t}=y1(),r=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(Eg.has(r))return Eg.get(r);let n=new Intl.Collator(t,e);return Eg.set(r,n),n}({usage:"search",sensitivity:"base"}),i=(0,c3.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(0,t.length),t)),[n]),o=(0,c3.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(-t.length),t)),[n]),a=(0,c3.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let r=0,i=(t=t.normalize("NFC")).length;for(;r+i<=e.length;r++){let o=e.slice(r,r+i);if(0===n.compare(t,o))return!0}return!1},[n]),(0,c3.useMemo)(()=>({startsWith:i,endsWith:o,contains:a}),[i,o,a])),S=gn({hour:"numeric",hour12:!0}),D=(0,c3.useMemo)(()=>{let e=new Date;return e.setHours(0),S.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[S]),O=(0,c3.useMemo)(()=>{let e=new Date;return e.setHours(12),S.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[S]),P=gn({year:"numeric",era:"narrow",timeZone:"UTC"}),C=(0,c3.useMemo)(()=>{if("era"!==e.type)return[];let r=g1(new gV(1,1,1),t.calendar),n=t.calendar.getEras().map(e=>{let t=r.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:P.formatToParts(t).find(e=>"era"===e.type).value}}),i=function(e){e.sort();let t=e[0],r=e[e.length-1];for(let e=0;e<t.length;e++)if(t[e]!==r[e])return e;return 0}(n.map(e=>e.formatted));if(i)for(let e of n)e.formatted=e.formatted.slice(i);return n},[P,t.calendar,e.type]),k=r=>{if(t.isDisabled||t.isReadOnly)return;let n=s.current+r;switch(e.type){case"dayPeriod":if(E(D,r))t.setSegment("dayPeriod",0);else if(E(O,r))t.setSegment("dayPeriod",1);else break;h.focusNext();break;case"era":{let e=C.find(e=>E(e.formatted,r));e&&(t.setSegment("era",e.era),h.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!w.isValidPartialNumber(n))return;let i=w.parse(n),o=i;if(void 0!==e.maxValue&&i>e.maxValue&&(o=w.parse(r)),isNaN(i))return;t.setSegment(e.type,o),void 0!==e.maxValue&&(Number(i+"0")>e.maxValue||n.length>=String(e.maxValue).length)?(s.current="",h.focusNext()):s.current=n}}};bx((0,c3.useRef)("u">typeof document?document:null),"selectionchange",()=>{let e=window.getSelection();e?.anchorNode&&mp(r.current,e?.anchorNode)&&e.collapse(r.current)});let j=(0,c3.useRef)("");bx(r,"beforeinput",n=>{if(r.current)switch(n.preventDefault(),n.inputType){case"deleteContentBackward":case"deleteContentForward":w.isValidPartialNumber(e.text)&&!t.isReadOnly&&x();break;case"insertCompositionText":j.current=r.current.textContent,r.current.textContent=r.current.textContent;break;default:null!=n.data&&k(n.data)}}),bx(r,"input",e=>{let{inputType:t,data:n}=e;"insertCompositionText"===t&&(r.current&&(r.current.textContent=j.current),null!=n&&(E(D,n)||E(O,n))&&k(n))}),hF(()=>{let e=r.current;return()=>{((e=document)=>e.activeElement)()===e&&(h.focusPrevious()||h.focusNext())}},[r,h]);let T=mM()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,c3.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])||t.isInvalid||(p=void 0);let R=hJ(),A=!t.isDisabled&&!t.isReadOnly&&e.isEditable,M="literal"===e.type?"":c.of(e.type),N=bg({"aria-label":`${M}${d?`, ${d}`:""}${f?", ":""}`,"aria-labelledby":f});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let I={caretColor:"transparent"};if("rtl"===u){I.unicodeBidi="embed";let t=y[e.type];("numeric"===t||"2-digit"===t)&&(I.direction="ltr")}return{segmentProps:h0(v,N,{id:R,...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:A,suppressContentEditableWarning:A,spellCheck:A?"false":void 0,autoCorrect:A?"off":void 0,[parseInt(c4().version,10)>=17?"enterKeyHint":"enterkeyhint"]:A?"next":void 0,inputMode:t.isDisabled||"dayPeriod"===e.type||"era"===e.type||!A?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:e=>{if("a"===e.key&&(mT()?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(),x()}},onFocus:()=>{s.current="",r.current&&bP(r.current,{containingElement:bS(r.current)});let e=window.getSelection();e?.collapse(r.current)},style:I,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}(e,n,i),{focusProps:a,isFocused:s,isFocusVisible:l}=yC(),{hoverProps:u,isHovered:c}=yA({...t,isDisabled:n.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=e;return(0,c3.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:i}):t,l="function"==typeof r?r({...s,defaultStyle:a||{}}):r,u="function"==typeof n?n({...s,defaultChildren:o}):null==n?o:n,{className:e??i,style:l||a?{...a,...l}:void 0,children:u??o,"data-rac":""}},[t,r,n,i,o,a,s])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:n.isInvalid,isDisabled:n.isDisabled,isHovered:c,isFocused:s,isFocusVisible:l},defaultChildren:e.text}),f=(0,c3.useCallback)(e=>{e.stopPropagation()},[]);return(0,fK.jsx)("span",{...h0(ml(t),o,a,u),...d,ref:i,style:o.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":n.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":n.isDisabled||void 0,"data-type":e.type,"data-hovered":c||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0,onClick:f})}),Ev={short:!1,size:"md"},E_=(0,c3.forwardRef)(function(e,t){let{className:r,defaultValue:n,isDisabled:i,invalid:o,invalidText:a,isInvalid:s,label:l,labelText:u,light:c,maxDate:d,minDate:f,onChange:p,onChangeRaw:h,short:m,size:y,value:g,...b}={...Ev,...e},{calendar:v,intlLocale:w,today_:x}=xQ(),E=(0,c3.useId)(),S=!!(u??l),D=(0,c3.useMemo)(()=>w0(n,v),[n,v]),O=(0,c3.useMemo)(()=>w0(g,v,!0),[g,v]),P=(0,c3.useMemo)(()=>w0(d,v),[d,v]),C=(0,c3.useMemo)(()=>w0(f??xX,v),[f,v]),k=(0,c3.useMemo)(()=>o||s,[o,s]),j=(0,c3.useMemo)(()=>(h&&p&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),h??(e=>p?.(w1(e)))),[h,p]);return(0,fK.jsx)(wX,{locale:w.toString(),children:(0,fK.jsx)("div",{className:fz()("cds--form-item",r),children:(0,fK.jsx)(h3,{values:[[xJ,w]],children:(0,fK.jsxs)(wJ,{className:fz()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":m,"cds--date-picker--light":c}),defaultValue:D,isDisabled:i,isInvalid:k,maxValue:P,minValue:C,value:O,shouldForceLeadingZeros:"en"===w.language||void 0,...b,onChange:j,children:[(0,fK.jsxs)("div",{className:"cds--date-picker-container",children:[S&&(0,fK.jsx)(_X,{className:fz()("cds--label",{"cds--label--disabled":i}),htmlFor:E,children:u??l}),(0,fK.jsxs)(vI,{className:Ei,children:[(0,fK.jsx)(Eh,{id:S?E:void 0,ref:t,className:fz()("cds--date-picker-input__wrapper","-esm-form-builder__datepicker-module__inputWrapper___MHJAy",{"-esm-form-builder__datepicker-module__inputWrapperSm___esx4E":"sm"===y,"-esm-form-builder__datepicker-module__inputWrapperMd___VQbzP":"md"===y||!y||0===y.length,"-esm-form-builder__datepicker-module__inputWrapperLg___Rk9Ce":"lg"===y}),children:e=>"era"!==e.type?(0,fK.jsx)(Eb,{className:Eo,segment:e}):(0,fK.jsx)(c4().Fragment,{})}),(0,fK.jsx)(yL,{className:fz()(El,{[Ec]:"sm"===y,[Eu]:"md"===y||!y||0===y.length,[Ed]:"lg"===y}),children:(0,fK.jsx)(Em,{})})]}),(0,fK.jsx)(_Z,{className:Es,children:a})]}),(0,fK.jsx)(Ep,{variant:"single",today_:x})]})})})})}),Ew=(0,c3.forwardRef)(function({className:e,defaultValue:t,invalid:r,invalidText:n,isDisabled:i,isInvalid:o,label:a,labelText:s,light:l,maxDate:u,minDate:c,onChange:d,onChangeRaw:f,size:p="md",value:h,...m},y){let{calendar:g,intlLocale:b,today_:v}=xQ(),w=(0,c3.useId)(),x=!!(s??a),E=(0,c3.useMemo)(()=>{if(h)return{start:w0(h[0],g,!1),end:w0(h[1],g,!1)}},[h,g]),S=(0,c3.useMemo)(()=>{if(t)return{start:w0(t[0],g,!1),end:w0(t[1],g,!1)}},[t,g]),D=(0,c3.useMemo)(()=>w0(c??xX,g,!0),[c,g]),O=(0,c3.useMemo)(()=>w0(u,g,!0),[u,g]),P=(0,c3.useMemo)(()=>r||o,[r,o]),C=(0,c3.useMemo)(()=>(f&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),f??(e=>d?.([w1(e.start),w1(e.end)]))),[f,d]);return(0,fK.jsx)(wX,{locale:b.toString(),children:(0,fK.jsx)("div",{className:fz()("cds--form-item",e),children:(0,fK.jsx)(h3,{values:[[xJ,b]],children:(0,fK.jsx)(wQ,{id:x?w:void 0,className:fz()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":i}),isInvalid:P,shouldForceLeadingZeros:"en"===b.language||void 0,maxValue:O,minValue:D,value:E,defaultValue:S,ref:y,isDisabled:i,...m,onChange:C,children:(0,fK.jsxs)("div",{className:"cds--date-picker-container",children:[x&&(0,fK.jsx)(_X,{className:fz()("cds--label",{"cds--label--disabled":i}),htmlFor:w,children:s??a}),(0,fK.jsxs)(vI,{className:Ei,children:[(0,fK.jsxs)("div",{className:fz()("-esm-form-builder__datepicker-module__inputsWrapper___UyGoG",{"-esm-form-builder__datepicker-module__inputsWrapperSm___qrGsA":"sm"===p,"-esm-form-builder__datepicker-module__inputsWrapperMd___pofu4":"md"===p||!p||0===p.length,"-esm-form-builder__datepicker-module__inputsWrapperLg___eF1Im":"lg"===p}),children:[(0,fK.jsx)(_L,{className:fz()("cds--date-picker-input__wrapper","-esm-form-builder__datepicker-module__startInput___C8vnM",Ea),slot:"start",children:e=>(0,fK.jsx)(Eb,{className:Eo,segment:e})}),(0,fK.jsx)("div",{className:"-esm-form-builder__datepicker-module__separator___vHLFZ",children:(0,fK.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,fK.jsx)(_L,{className:fz()("cds--date-picker-input__wrapper","-esm-form-builder__datepicker-module__endInput___25OF9",Ea),slot:"end",children:e=>(0,fK.jsx)(Eb,{className:Eo,segment:e})})]}),(0,fK.jsx)(yL,{className:fz()(El,{[Ec]:"sm"===p,[Eu]:"md"===p||!p||0===p.length,[Ed]:"lg"===p}),children:(0,fK.jsx)(Em,{})})]}),(0,fK.jsx)(_Z,{className:Es,children:n}),(0,fK.jsx)(Ep,{variant:"range",today_:v,minDate:D,maxDate:O})]})})})})})}),Ex=({diagnoses:e})=>{let{diagnosisTags:t}=dX({externalModuleName:"@openmrs/esm-styleguide"});return(0,fK.jsx)("div",{className:"-esm-form-builder__diagnosis-tags-module__container___l7XiW",children:e.map(e=>{let{rank:r,uuid:n,display:i}=e,o=t[1===r?"primaryColor":"secondaryColor"];return(0,fK.jsx)(fG.vwO,{type:o,children:i},n)})})},EE={action:"-esm-form-builder__empty-card-module__action___l4wUo",content:"-esm-form-builder__empty-card-module__content___XbsSJ",desktopHeading:"-esm-form-builder__empty-card-module__desktopHeading___0EPXX",tabletHeading:"-esm-form-builder__empty-card-module__tabletHeading___unl1F",tile:"-esm-form-builder__empty-card-module__tile___vS3Sj"},ES=({width:e="64",height:t="64"})=>(0,fK.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,fK.jsx)("use",{href:"#omrs-empty-data-illustration"})}),ED=e=>{let t="tablet"===fb(),r=e.launchForm;return(0,fK.jsx)(fG.Wdr,{className:EE.layer,children:(0,fK.jsxs)(fG.FAs,{className:EE.tile,children:[(0,fK.jsx)("div",{className:t?EE.tabletHeading:EE.desktopHeading,children:(0,fK.jsx)("h4",{children:e.headerTitle})}),(0,fK.jsx)(ES,{}),(0,fK.jsx)("p",{className:EE.content,children:os("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,fK.jsx)("p",{className:EE.action,children:r&&(0,fK.jsx)(fG.$nd,{onClick:()=>r(),kind:"ghost",size:t?"lg":"sm",children:os("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},EO=({error:e,headerTitle:t})=>{let r="tablet"===fb();return(0,fK.jsx)(fG.Wdr,{children:(0,fK.jsxs)(fG.FAs,{className:"-esm-form-builder__error-state-module__tile___hHM56",children:[(0,fK.jsx)("div",{className:r?"-esm-form-builder__error-state-module__tabletHeading___W7a4U":"-esm-form-builder__error-state-module__desktopHeading___VL8Rv",children:(0,fK.jsx)("h4",{children:t})}),(0,fK.jsxs)("p",{className:"-esm-form-builder__error-state-module__errorMessage___IytZy",children:[os("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,fK.jsx)("p",{className:"-esm-form-builder__error-state-module__errorCopy___E1yZO",children:os("errorCopy")})]})})},EP=EO,EC=c4().forwardRef((e,t)=>{let{slotName:r,basePath:n,componentContext:i,state:o}=fw(),a=window.location??{pathname:""},s=dp(r??"");return e.isChildOfHeader&&r&&s.length>0?(0,fK.jsxs)(fG.f8J,{"aria-label":os("leftNavigation","Left navigation"),className:"-esm-form-builder__left-nav-module__leftNav___ZqLpw",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,fK.jsx)(dy,{name:"global-nav-menu-slot"}),r?(0,fK.jsx)(dK,{value:i,fallback:(0,fK.jsx)(dy,{name:r,state:{basePath:n,currentPath:a,...o}}),children:(0,fK.jsx)(dr.Provider,{value:i,children:(0,fK.jsx)(dy,{name:r,state:{basePath:n,currentPath:a,...o}})})}):null]}):null}),Ek=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:r,locationsPerRequest:n=50,onChange:i})=>{let[o,a]=(0,c3.useState)(""),s=(0,c3.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:r,error:n,isLoading:i}=(0,d4.A)(t,n9,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,c3.useMemo)(()=>({location:r?.data?.entry?r.data.entry[0]:null,error:t?n:null,isLoading:!!t&&i}),[r,i,n,t])}(t),{locations:u,isLoading:c,hasMore:d,loadingNewData:f,error:p,setPage:h}=function(e,t=0,r=""){let n=d3(r),{data:i,isLoading:o,isValidating:a,setSize:s,error:l}=fc(function(r,i){if(i){let e=i.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=`${n6}/Location?`,a=new URLSearchParams;return a.append("_summary","data"),t&&a.append("_count",""+t),r&&a.append("_getpagesoffset",""+r*t),e&&a.append("_tag",e),"string"==typeof n&&""!==n&&a.append("name:contains",n),o+a.toString()},n9);return(0,c3.useMemo)(()=>({locations:i?.length?i?.flatMap(e=>e?.data?.entry??[]):[],isLoading:o,totalResults:i?.[0]?.data?.total,hasMore:!!i?.length&&i?.[i.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:a,error:l||null,setPage:s}),[o,i,a,s,l])}(r,n,o),m=(0,c3.useMemo)(()=>l&&!o&&t?[l,...u.filter(({resource:e})=>e.id!==t)]:u??[],[l,u,t,o]),y=(0,c3.useCallback)(e=>{i(),a(e.trim())},[i]),g=fS((0,c3.useCallback)(()=>{!f&&d&&h(e=>e+1)},[f,d,h])),b=d?Math.max(0,Math.floor(m.length-n/2)):-1;return(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsx)(fG.vji,{"aria-describedby":p?`${s}-error`:void 0,labelText:os("searchForLocation"),id:s,placeholder:os("searchForLocation"),onChange:e=>y(e.target.value),size:"lg"}),p&&(0,fK.jsx)("div",{className:"-esm-form-builder__location-picker-module__errorNotification___MBWvf",id:`${s}-error`,children:(0,fK.jsx)(fG.jeF,{kind:"error",subtitle:os("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:os("error","Error")})}),(0,fK.jsx)("div",{className:"-esm-form-builder__location-picker-module__searchResults___aCL93",children:c?(0,fK.jsx)("div",{className:"-esm-form-builder__location-picker-module__loadingContainer___Vn1H0",children:Array.from({length:5}).map((e,t)=>(0,fK.jsx)(fG.Psq,{className:"-esm-form-builder__location-picker-module__radioButtonSkeleton___RKMHj",role:"progressbar"},t))}):(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsx)("div",{className:"-esm-form-builder__location-picker-module__locationResultsContainer___5yuvs",children:m.length>0?(0,fK.jsx)(fG.zWQ,{name:"loginLocations",onChange:e=>{i(e?.toString())},orientation:"vertical",valueSelected:e,children:m.map((e,t)=>(0,fK.jsx)(fG.aaP,{className:"-esm-form-builder__location-picker-module__locationRadioButton___b52LI",id:e.resource.id,labelText:(0,fK.jsx)("span",{ref:t===b?g:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,fK.jsx)("div",{className:"-esm-form-builder__location-picker-module__emptyState___qiPqQ",children:(0,fK.jsx)("p",{className:"-esm-form-builder__location-picker-module__locationNotFound___tKDOJ",children:os("noResultsToDisplay")})})}),f&&(0,fK.jsx)("div",{className:"-esm-form-builder__location-picker-module__loadingIcon___PGwvc",children:(0,fK.jsx)(fG.OuH,{description:os("loading")})})]})})]})},Ej=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],ET=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"];function ER(e){if(e)return"--"===e?"normal":Ej.includes(e)?e.toLowerCase():ET.includes(e)?e:"normal"}function EA(e,t){if(!t||null==e||""===e)return"normal";let r="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(r)?"normal":null!==t.hiAbsolute&&void 0!==t.hiAbsolute&&r>t.hiAbsolute?"off_scale_high":null!==t.hiCritical&&void 0!==t.hiCritical&&r>=t.hiCritical?"critically_high":null!==t.hiNormal&&void 0!==t.hiNormal&&r>t.hiNormal?"high":null!==t.lowAbsolute&&void 0!==t.lowAbsolute&&r<t.lowAbsolute?"off_scale_low":null!==t.lowCritical&&void 0!==t.lowCritical&&r<=t.lowCritical?"critically_low":null!==t.lowNormal&&void 0!==t.lowNormal&&r<t.lowNormal?"low":"normal"}function EM(e,t){let r=null;e&&(r=t?`${n2}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${n2}/conceptreferencerange/?concept=${e}&v=full`);let{data:n,error:i,isLoading:o}=(0,d4.A)(r,n9),a=n?.data?.results?.[0];return{referenceRange:a?{hiNormal:a.hiNormal??null,hiAbsolute:a.hiAbsolute??null,hiCritical:a.hiCritical??null,lowNormal:a.lowNormal??null,lowAbsolute:a.lowAbsolute??null,lowCritical:a.lowCritical??null}:void 0,error:i,isLoading:o}}let EN={container:"-esm-form-builder__numeric-observation-module__container___+Kqi9",card:"-esm-form-builder__numeric-observation-module__card___Q-ECG","abnormal-value":"-esm-form-builder__numeric-observation-module__abnormal-value___bx1h9","critical-value":"-esm-form-builder__numeric-observation-module__critical-value___nSKSX",cell:"-esm-form-builder__numeric-observation-module__cell___wc90e","critically-high":"-esm-form-builder__numeric-observation-module__critically-high___fmZfJ","critically-low":"-esm-form-builder__numeric-observation-module__critically-low___h9797",high:"-esm-form-builder__numeric-observation-module__high___0-YpP",low:"-esm-form-builder__numeric-observation-module__low___TuqAk","label-container":"-esm-form-builder__numeric-observation-module__label-container___FtozC","value-container":"-esm-form-builder__numeric-observation-module__value-container___R9qoY",label:"-esm-form-builder__numeric-observation-module__label___0DGA5",value:"-esm-form-builder__numeric-observation-module__value___ohqoh",units:"-esm-form-builder__numeric-observation-module__units___xvMd3","pad-right":"-esm-form-builder__numeric-observation-module__pad-right___umcen","off-scale-low":"-esm-form-builder__numeric-observation-module__off-scale-low___my+0i","off-scale-high":"-esm-form-builder__numeric-observation-module__off-scale-high___so9dv",arrow:"-esm-form-builder__numeric-observation-module__arrow___Agoh9"},EI=({value:e,unit:t,label:r,interpretation:n,referenceRange:i,conceptUuid:o,variant:a="card",patientUuid:s})=>{let l=(0,c3.useId)(),{referenceRange:u,isLoading:c}=EM(i||n?void 0:o,s),d=i??u,f=(0,c3.useMemo)(()=>n?ER(n):d&&!c?EA(e,d):"normal",[n,d,e,c])??"normal",p="critically_low"===f||"critically_high"===f||"off_scale_low"===f||"off_scale_high"===f,h="normal"!==f,m=r?`omrs-numeric-obs-label-${r.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,y=`omrs-numeric-obs-value-${l}`,g=`omrs-numeric-obs-unit-${l}`,b=null!=e&&""!==e,v=b?e:os("notAvailable","Not available"),w=fz()({[EN["critically-low"]]:"critically_low"===f||"off_scale_low"===f,[EN["critically-high"]]:"critically_high"===f||"off_scale_high"===f,[EN.low]:"low"===f,[EN.high]:"high"===f,[EN["off-scale-low"]]:"off_scale_low"===f,[EN["off-scale-high"]]:"off_scale_high"===f}),x=fz()({[EN.container]:!0,[EN.card]:!0,[EN["critical-value"]]:p,[EN["abnormal-value"]]:h&&!p}),E=fz()({[EN.cell]:!0,[w]:!0});return"cell"===a?(0,fK.jsxs)("div",{className:E,children:[v,b&&t?` ${t}`:""]}):(0,fK.jsxs)("section",{className:x,"data-testid":"numeric-observation-card",children:[r&&(0,fK.jsxs)("div",{className:EN["label-container"],children:[(0,fK.jsx)("span",{id:m,className:EN.label,children:r}),h&&(0,fK.jsx)("span",{className:EN[f.replace("_","-")],title:os("abnormalValue","Abnormal value")})]}),(0,fK.jsxs)("div",{className:EN["value-container"],children:[(0,fK.jsx)("span",{id:y,"aria-labelledby":m&&g?`${m} ${g}`:m||g||void 0,className:EN.value,children:v}),b&&t&&(0,fK.jsx)("span",{id:g,className:EN.units,children:t})]})]})},E$=K("modalState",{modalContainer:null,modalStack:[]});function EL(e,t={},r=()=>{}){let n=()=>{let e=E$.getState().modalStack.find(e=>e.onClose===r);e&&function(e){if("TO_BE_DELETED"===e.state||"DELETED"===e.state)return;e.state="TO_BE_DELETED";let t=E$.getState();E$.setState({...t,modalStack:[...t.modalStack]})}(e)};if(function(e){let t=c6.getState().modals[e];if(!t){let n=cP(e);if(n){var r;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.`),r=t,c6.setState(e=>(e.modals[r.name]=r,e))}}return t}(e)){var i;let o,a;i={state:"NEW",onClose:r,modalName:e,props:{close:n,...t}},a=[i,...(o=E$.getState()).modalStack],E$.setState({...o,modalStack:a})}else T(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return n}window.getComputedStyle(document.body).overflow;var EF=r(66401);let EB=new ea.Subject,EV=0,EU=new ea.Subject,EW=0;function EK(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!(0,EF.A)(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{EB.next({...e,id:EV++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function EH(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!(0,EF.A)(t))?setTimeout(()=>{EU.next({...e,id:EW++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let Ez="-esm-form-builder__page-header-module__pageHeader___XNJYe",Eq=e=>{if("children"in e){let{children:t,className:r,...n}=e;return(0,fK.jsx)("div",{className:fz()(Ez,r),...n,children:t})}{let{title:t,illustration:r,className:n,...i}=e;return(0,fK.jsx)("div",{className:fz()(Ez,n),...i,children:(0,fK.jsx)(EG,{title:t,illustration:r})})}},EG=({title:e,illustration:t,className:r})=>{let[n,i]=(0,c3.useState)(null);return(0,c3.useEffect)(()=>{t2("@openmrs/esm-styleguide").then(e=>{i(e)})},[]),(0,fK.jsxs)("div",{className:fz()("-esm-form-builder__page-header-module__pageHeaderContent___V-mTz",r),children:[t,(0,fK.jsxs)("div",{className:"-esm-form-builder__page-header-module__pageLabels___vGJvg",children:[n?.implementationName&&(0,fK.jsx)("p",{children:os(n.implementationName)}),(0,fK.jsx)("p",{className:"-esm-form-builder__page-header-module__pageName___+eYMc",children:e})]})]})},EZ=({totalItems:e,pageSize:t,onPageNumberChange:r,pageNumber:n,dashboardLinkUrl:i,currentItems:o,dashboardLinkLabel:a})=>{let{pageSizes:s,pageItemsCount:l}=fP(t,e,n,o),u="tablet"===fb(),c=os("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,fK.jsx)(fK.Fragment,{children:e>0&&(0,fK.jsxs)("div",{className:fz()({"-esm-form-builder__pagination-module__tablet___DdaYk":u,"-esm-form-builder__pagination-module__desktop___rSwlo":!u}),children:[(0,fK.jsxs)("div",{children:[c,i&&(0,fK.jsx)(c2,{to:i,className:"-esm-form-builder__pagination-module__configurableLink___cTCLf",children:a??os("seeAll","See all")})]}),(0,fK.jsx)(fG.dKS,{className:"-esm-form-builder__pagination-module__pagination___U6anZ",page:n,pageSize:t,pageSizes:s,totalItems:e,onChange:r,pageRangeText:(e,t)=>os("paginationOfPages","of {{count}} pages",{count:t}),size:u?"lg":"sm"})]})})};function EY(e){return EQ(E0(e,"usual","official"))}function EJ(e){return EY(e)}function EQ(e){var t;let r;return e?e.text??(r=(t=e).given??[],(t.family?r.concat(t.family):r).join(" ")):""}function EX(e){return EQ(e)}function E0(e,...t){for(let r of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,n;return t=e,n=r,t.use?t.use===n:"usual"===n});if(t)return t}}function E1(e,t=fM()){let r=fM(t),n=xK(e,r);if(null==n)return null;let i=r.diff(n,"hours"),o=r.diff(n,"days"),a=r.diff(n,"weeks"),s=r.diff(n,"months"),l=r.diff(n,"years"),u={};if(i<2)u.minutes=r.diff(n,"minutes");else if(o<2)u.hours=i;else if(a<4)u.days=o;else if(l<1){let e=r.subtract(a,"weeks").diff(n,"days");u.weeks=a,u.days=e}else if(l<2){let e=r.subtract(s,"months").diff(n,"days");u.months=s,u.days=e}else if(l<18){let e=r.subtract(l,"year").diff(n,"months");u.years=l,u.months=e}else u.years=l;return u}function E3(e,t=fM()){let r=E1(e,t);if(null==r)return null;let n={style:"short",localeMatcher:"lookup"};return"minutes"in r&&0===r.minutes&&(n.minutesDisplay="always"),xW(r,n)}let E4={container:"-esm-form-builder__patient-banner-patient-info-module__container___WV40g",activePatientContainer:"-esm-form-builder__patient-banner-patient-info-module__activePatientContainer___YBgYK",patientBanner:"-esm-form-builder__patient-banner-patient-info-module__patientBanner___o-DQc",patientName:"-esm-form-builder__patient-banner-patient-info-module__patientName___KWLAJ",patientAvatar:"-esm-form-builder__patient-banner-patient-info-module__patientAvatar___gG4I3",patientAvatarButton:"-esm-form-builder__patient-banner-patient-info-module__patientAvatarButton___by4L9",patientInfo:"-esm-form-builder__patient-banner-patient-info-module__patientInfo___VU1fL",demographics:"-esm-form-builder__patient-banner-patient-info-module__demographics___xDHsd",row:"-esm-form-builder__patient-banner-patient-info-module__row___MlVwp",flexRow:"-esm-form-builder__patient-banner-patient-info-module__flexRow___9Aj3s",tagsSlot:"-esm-form-builder__patient-banner-patient-info-module__tagsSlot___PqCHJ",identifiers:"-esm-form-builder__patient-banner-patient-info-module__identifiers___bbREn",identifier:"-esm-form-builder__patient-banner-patient-info-module__identifier___HQzz8",primaryIdentifier:"-esm-form-builder__patient-banner-patient-info-module__primaryIdentifier___ocKCs",secondaryIdentifier:"-esm-form-builder__patient-banner-patient-info-module__secondaryIdentifier___4MLDH",value:"-esm-form-builder__patient-banner-patient-info-module__value___tkQTC",tag:"-esm-form-builder__patient-banner-patient-info-module__tag___u7Kco",gender:"-esm-form-builder__patient-banner-patient-info-module__gender___7eQuO",separator:"-esm-form-builder__patient-banner-patient-info-module__separator___CZBA8",tooltipPadding:"-esm-form-builder__patient-banner-patient-info-module__tooltipPadding___UQr5s",tooltipSmallText:"-esm-form-builder__patient-banner-patient-info-module__tooltipSmallText___MRUhY",actionsButtonText:"-esm-form-builder__patient-banner-patient-info-module__actionsButtonText___8ZC1R"};function E2({showIdentifierLabel:e,type:t,value:r}){return(0,fK.jsx)("span",{className:E4.primaryIdentifier,children:(0,fK.jsxs)(fG.vwO,{className:E4.tag,type:"gray",children:[e&&t?.text&&(0,fK.jsxs)("span",{className:E4.label,children:[t.text,": "]}),(0,fK.jsx)("span",{className:E4.value,children:r})]})})}function E6({showIdentifierLabel:e,type:t,value:r}){return(0,fK.jsxs)(fG.lRv,{className:E4.secondaryIdentifier,id:`patient-banner-identifier-${r}`,children:[e&&(0,fK.jsxs)("span",{className:E4.label,children:[t?.text,": "]}),(0,fK.jsx)("span",{className:E4.value,children:r})]})}function E5({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:r}=dX(),{primaryIdentifierCode:n}=fj(),i=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!r?.uuids.includes(t)})??[];return(0,fK.jsx)(fK.Fragment,{children:i?.length?i.map(({value:e,type:r},o)=>(0,fK.jsxs)(c4().Fragment,{children:[(0,fK.jsx)("span",{className:E4.identifier,children:r?.coding?.[0]?.code===n?(0,fK.jsx)(E2,{showIdentifierLabel:t,type:r,value:e}):(0,fK.jsx)(E6,{showIdentifierLabel:t,type:r,value:e})}),o<i.length-1&&(0,fK.jsx)("span",{className:E4.separator,children:"\xb7"})]},e)):""})}let E8={Female:pj,Male:pT,Other:pR,Unknown:pA},E9=({gender:e})=>{let t=E8[e];return t?(0,fK.jsx)(t,{fill:"#525252"}):null},E7={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function Se({patient:e,renderedFrom:t}){var r;let n,i,o=EY(e),a=e?.gender&&(i=E7[n=(r=e.gender).toLowerCase()]??"Unknown",{displayText:os(n,r),iconKey:i}),s=(0,c3.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,fK.jsxs)("div",{className:E4.patientInfo,children:[(0,fK.jsx)("div",{className:fz()(E4.row,E4.patientNameRow),children:(0,fK.jsxs)("div",{className:E4.flexRow,children:[(0,fK.jsx)("span",{className:E4.patientName,children:o}),a&&(0,fK.jsxs)("div",{className:E4.gender,children:[(0,fK.jsx)(E9,{gender:a.iconKey}),(0,fK.jsx)("span",{children:a.displayText})]}),(0,fK.jsx)(dy,{className:E4.tagsSlot,name:"patient-banner-tags-slot",state:s})]})}),(0,fK.jsxs)("div",{className:E4.demographics,children:[e.birthDate&&(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsx)("span",{children:E3(e.birthDate)}),(0,fK.jsx)("span",{className:E4.separator,children:"\xb7"}),(0,fK.jsx)("span",{children:x$(e.birthDate,{time:!1})}),(0,fK.jsx)("span",{className:E4.separator,children:"\xb7"})]}),(0,fK.jsx)(E5,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,fK.jsx)(dy,{className:E4.extensionSlot,name:"patient-banner-bottom-slot",state:s})]})]})}var St=r(81673);function Sr({patient:e,patientUuid:t,actionsSlotName:r,additionalActionsSlotState:n}){let[i,o]=(0,c3.useState)(!1),{extensions:a}=dh(r),s="tablet"===fb(),l=fE(()=>o(!1),i),u=(0,c3.useRef)(null),c=(0,c3.useRef)(null),d=(0,c3.useId)(),f=`patient-actions-menu-trigger-${d}`,p=`patient-actions-menu-${d}`,h=(0,c3.useCallback)(()=>o(e=>!e),[]),m=(0,c3.useCallback)(()=>{o(!1),u.current?.focus()},[]),y=(0,c3.useCallback)(e=>{if("Escape"===e.key&&i){e.stopPropagation(),m();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&i){e.preventDefault();let t=c.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let r=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,n=Array.from(t).indexOf(r);if(-1===n)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let i=n+("ArrowDown"===e.key?1:-1),o=i<0?t.length-1:i>=t.length?0:i;t[o]?.focus()}},[m,i]);(0,c3.useEffect)(()=>{if(i&&c.current){let e=c.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[i]);let g=(0,c3.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:m,...n}),[t,e,m,n]);return 0===a.length?null:(0,fK.jsx)("div",{className:"-esm-form-builder__patient-banner-actions-menu-module__overflowMenuContainer___7eCLh",children:(0,fK.jsxs)("div",{"data-overflow-menu":!0,className:fz()("cds--overflow-menu",fZ),ref:l,children:[(0,fK.jsxs)("button",{className:fz()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":i},fQ),"aria-controls":p,"aria-expanded":i,"aria-haspopup":"true",id:f,onClick:h,onKeyDown:y,ref:u,children:[(0,fK.jsx)("span",{className:"-esm-form-builder__patient-banner-actions-menu-module__actionsButtonText___TbM5a",children:os("actions","Actions")})," ",(0,fK.jsx)(St.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,fK.jsxs)("div",{className:fz()("cds--overflow-menu-options","cds--overflow-menu--flip",fY,{[fJ]:i}),"aria-labelledby":f,"data-floating-menu-direction":"bottom",id:p,onKeyDown:y,ref:c,role:"menu",tabIndex:-1,children:[(0,fK.jsx)("ul",{className:fz()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":s}),children:(0,fK.jsx)(dy,{name:r,state:g},r)}),(0,fK.jsx)("span",{})]})]})})}function Sn({showContactDetails:e,toggleContactDetails:t,className:r}){return(0,fK.jsx)(fG.$nd,{className:r,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?pv:py,children:e?os("showLess","Show less"):os("showMore","Show more")})}let Si={contactDetails:"-esm-form-builder__patient-banner-contact-details-module__contactDetails___AvROu",deceased:"-esm-form-builder__patient-banner-contact-details-module__deceased___DDd39",heading:"-esm-form-builder__patient-banner-contact-details-module__heading___GGJyV",row:"-esm-form-builder__patient-banner-contact-details-module__row___8JcKK",col:"-esm-form-builder__patient-banner-contact-details-module__col___ct1O9",relationship:"-esm-form-builder__patient-banner-contact-details-module__relationship___GTTsg"},So=({patientUuid:e})=>{let{cohorts:t=[],isLoading:r}=function(e){let t=e?`${n2}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:r,isLoading:n}=(0,dR.Ay)(t,n9),i=r?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,c3.useMemo)(()=>({cohorts:i,isLoading:n}),[n,i])}(e);return(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsxs)("p",{className:Si.heading,children:[os("patientLists","Patient Lists")," (",t?.length??0,")"]}),r?(0,fK.jsx)(fG.OuH,{description:`${os("loading","Loading")} ...`,role:"progressbar"}):(0,fK.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>xT(e?.startDate).getTime()-xT(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,fK.jsx)("li",{children:(0,fK.jsx)(c2,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,fK.jsx)("li",{children:"--"})})(),t.length>3&&(0,fK.jsx)("li",{className:Si.link,children:(0,fK.jsx)(c2,{to:`${window.spaBase}/home/patient-lists`,children:os("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},Sa=({patientId:e})=>{let{patient:t,isLoading:r}=fk(e),n=t?.address?.find(e=>"home"===e.use),i=e=>e.split("#")[1];return r?(0,fK.jsx)(fG.OuH,{description:`${os("loading","Loading")} ...`,role:"progressbar"}):(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsx)("p",{className:Si.heading,children:os("address","Address")}),(0,fK.jsx)("ul",{children:n?Object.entries(n).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?n.extension?.[0]?.extension?.map((t,r)=>(0,fK.jsxs)("li",{children:[os(i(t.url),i(t.url)),": ",t.valueString]},`address-${e}-${r}`)):(0,fK.jsxs)("li",{children:[os(e,e),": ",t]},`address-${e}`)):(0,fK.jsx)("li",{children:"--"})})]})},Ss=({patientUuid:e})=>{let{isLoading:t,contactAttributes:r}=(e=>{let{contactAttributeTypes:t=[]}=dX({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:r,error:n,isLoading:i}=(e=>{let{data:t,error:r,isLoading:n}=(0,d4.A)(`${n2}/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)))`,n9);return{isLoading:n,attributes:t?.data.person.attributes??[],error:r}})(e);return{contactAttributes:(0,c3.useMemo)(()=>r.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[r,t]),isLoading:i,error:n}})(e),n=(0,c3.useMemo)(()=>r?[...r?.map(e=>[e.attributeType.display?os(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[r]);return(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsx)("p",{className:Si.heading,children:os("contactDetails","Contact Details")}),t?(0,fK.jsx)(fG.OuH,{description:`${os("loading","Loading")} ...`,role:"progressbar"}):(0,fK.jsx)("ul",{children:n.length?n.map(([e,t],r)=>(0,fK.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${r}`)):(0,fK.jsx)("li",{children:"--"})})]})},Sl=({patientId:e})=>{let{data:t,isLoading:r}=function(e){let t=`${n2}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:r,error:n,isLoading:i,isValidating:o}=(0,dR.Ay)(e?t:null,n9),a=r?.data?.results?.length?function(e,t){let r=[];for(let n of t)e===n.personA.uuid?r.push({uuid:`${n.uuid}`,display:n.personB.display,relativeAge:n.personB.age,relativeUuid:n.personB.uuid,relationshipType:n.relationshipType.bIsToA}):r.push({uuid:`${n.uuid}`,display:n.personA.display,relativeAge:n.personA.age,relativeUuid:n.personA.uuid,relationshipType:n.relationshipType.aIsToB});return r}(e,r.data.results):null;return{data:r?a:null,error:n,isLoading:i,isValidating:o}}(e);return(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsx)("p",{className:Si.heading,children:os("relationships","Relationships")}),r?(0,fK.jsx)(fG.OuH,{description:`${os("loading","Loading")} ...`,role:"progressbar"}):(0,fK.jsx)("ul",{children:t&&t.length>0?(0,fK.jsx)(fK.Fragment,{children:t.map(e=>(0,fK.jsxs)("li",{className:Si.relationship,children:[(0,fK.jsx)("div",{children:(0,fK.jsx)(c2,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,fK.jsx)("div",{children:e.relationshipType}),(0,fK.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?os("yearAbbreviation","yr"):os("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,fK.jsx)("li",{children:"--"})})]})};function Su({patientId:e,deceased:t}){return(0,fK.jsxs)("div",{className:fz()(Si.contactDetails,{[Si.deceased]:t}),children:[(0,fK.jsxs)("div",{className:Si.row,children:[(0,fK.jsx)("div",{className:Si.col,children:(0,fK.jsx)(Sa,{patientId:e})}),(0,fK.jsx)("div",{className:Si.col,children:(0,fK.jsx)(Ss,{patientUuid:e})})]}),(0,fK.jsxs)("div",{className:Si.row,children:[(0,fK.jsx)("div",{className:Si.col,children:(0,fK.jsx)(Sl,{patientId:e})}),(0,fK.jsx)("div",{className:Si.col,children:(0,fK.jsx)(So,{patientUuid:e})})]})]})}var Sc=r(16767),Sd=r.n(Sc);function Sf(e){let{patientPhotoConceptUuid:t}=dX({externalModuleName:"@openmrs/esm-styleguide"}),r=t?`${n2}/obs?patient=${e}&concept=${t}&v=full`:null,{data:n,error:i,isLoading:o}=(0,dR.Ay)(e?r:null,n9),a=n?.data?.results[0];return{data:a?{dateTime:a?.obsDatetime,imageSrc:a?.value?.links?.uri}:null,error:i,isLoading:o}}let Sp=({width:e=56,height:t=56,"aria-label":r})=>{let{t:n}=(0,dT.useTranslation)();return(0,fK.jsxs)("svg",{"aria-label":r??n("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,fK.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,fK.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"})]})},Sh="-esm-form-builder__patient-photo-module__avatar___R93LX";function Sm({patientUuid:e,patientName:t,alt:r}){let{data:n,isLoading:i}=Sf(e),[o,a]=(0,c3.useState)(null),[s,l]=(0,c3.useState)(!1),u=(0,c3.useMemo)(()=>Sd().generate(e),[e]);(0,c3.useEffect)(()=>{if(n?.imageSrc){let e=new URL(n.imageSrc,window.location.origin).pathname;l(!0);let t=!1,r=new Image;return r.onload=()=>{t||(a(e),l(!1))},r.onerror=()=>{t||(a(null),l(!1))},r.src=e,()=>{t=!0}}a(null),l(!1)},[n?.imageSrc]);let c=(0,c3.useMemo)(()=>r||(o?os("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):os("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[r,o,t]);return i||s?(0,fK.jsx)(fG.ryE,{className:"-esm-form-builder__patient-photo-module__skeleton___I-6iq","data-testid":"skeleton-icon"}):n?.imageSrc&&!o?(0,fK.jsx)(Sp,{"aria-label":os("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):o?(0,fK.jsx)("div",{"aria-label":c,children:(0,fK.jsx)("img",{className:Sh,src:o,alt:c,title:t})}):(0,fK.jsx)("div",{"aria-label":c,children:(0,fK.jsx)("div",{className:Sh,title:t,style:{backgroundImage:u.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,fK.jsx)("span",{className:"-esm-form-builder__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 Sy=["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-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"],Sg=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),Sb=Sg,Sv=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),S_=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),Sw=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),Sx=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),SE=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),SS=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),SD=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),SO=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),SP=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),SC=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),Sk=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),Sj=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),ST=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),SR=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),SA=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),SM=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),SN=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),SI=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),S$=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),SL=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),SF=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),SB=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),SV=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),SU=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),SW=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),SK=(0,c3.memo)((0,c3.forwardRef)(function(e,t){return(0,fK.jsx)(SG,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),SH=SP,Sz=SN,Sq=(0,c3.memo)((0,c3.forwardRef)(function({pictogram:e,fallback:t,...r},n){let i=(0,c3.useRef)(document.getElementById(e));return(0,c3.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),r=new MutationObserver(t=>{for(let r of t)"childList"===r.type&&(i.current=document.getElementById(e))});return t&&r.observe(t,{childList:!0}),()=>r.disconnect()},[e]),(0,fK.jsx)(dK,{value:i.current,fallback:t,children:(0,fK.jsx)(SG,{ref:n,pictogram:e,pictogramProps:r})})})),SG=(0,c3.memo)((0,c3.forwardRef)(function({pictogram:e,pictogramProps:t},r){let{className:n,size:i}=Object.assign({},{size:92},t);return(i<=26||i>144)&&(console.error(`Invalid size '${i}' specified for ${e}. Defaulting to 92.`),i=92),(0,fK.jsx)("svg",{ref:r,className:fz()("-esm-form-builder__pictograms-module__pictogram___LTPzD",n),height:i,width:i,children:(0,fK.jsx)("use",{href:`#${e}`})})})),SZ=({children:e})=>"tablet"===fb()?(0,fK.jsx)(fG.Wdr,{children:e}):(0,fK.jsx)(fK.Fragment,{children:e}),SY=new ea.Subject,SJ=0;function SQ(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{SY.next({...e,id:SJ++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let SX=new ea.Subject,S0=0;function S1(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!(0,EF.A)(t))?setTimeout(()=>{SX.next({...e,id:S0++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}function S3(e,t=!1){if(t)return!0;let r=S8[e];return!r||!r()}function S4(e,t){let r=Dn.getState()?.workspaceGroup,n=r?.name;n&&e===n&&Da(()=>{let n=Dd(e);n&&(n.setState({},!0),n.subscribe(()=>{})()),"function"==typeof r?.cleanup&&r.cleanup(),Dn.setState(e=>({...e,workspaceGroup:void 0})),"function"==typeof t&&t()},n?e=>e.currentWorkspaceGroup===n:()=>!0)}function S2(e,t){let{name:r,additionalProps:n}=t;c7(r);let i=()=>{De(e.name,{ignoreChanges:!0,onWorkspaceClose:()=>S6(r,n),closeWorkspaceGroup:!1})};S3(e.name)?i():Dl("closing-workspace-launching-new-workspace",i,e.title??e.name)}function S6(e,t){let r=c7(e),n=Dn.getState().workspaceGroup;if(n&&!n.members?.includes(e))return void S4(n.name,()=>{S6(e,t)});let i=Dn.getState().workspaceGroup?.name,o={...r,title:Du(r,t),closeWorkspace:(t={})=>De(e,t),closeWorkspaceWithSavedChanges:t=>De(e,{ignoreChanges:!0,...t}),promptBeforeClosing:t=>{var r,n;return r=e,n=t,void(S8[r]=n)},setTitle:(t,r)=>{o.title=t,o.titleNode=r,Dn.setState(t=>{let r=t.openWorkspaces.map(t=>t.name===e?o:t);return{...t,openWorkspaces:r}})},currentWorkspaceGroup:i,additionalProps:t??{}};function a(e,t){Dn.setState(r=>{let n=[e,...t??r.openWorkspaces],i=Do(e);return{...r,openWorkspaces:n,workspaceWindowState:i}})}i&&Dd(i,t);let s=Dn.getState().openWorkspaces,l=s.findIndex(t=>t.name===e),u=s.find(e=>e.type==o.type);if(0===s.length)a(o);else if(s[0].canHide||0===l)if(l>=0){let t=s[l];a({...t,additionalProps:o.additionalProps,...t.title===Du(t,t.additionalProps)&&{title:Du(o,o.additionalProps)}},s.filter(t=>t.name!=e))}else u?(a(u,Dn.getState().openWorkspaces.filter(e=>e.type!=o.type)),S2(u,{name:e,additionalProps:t})):a(o);else S2(s[0],{name:e,additionalProps:t})}function S5({targetUrl:e,contextKey:t,workspaceName:r,additionalProps:n}){Dt(t),S6(r,n),nX({to:e})}let S8={};function S9(){let e=Dn.getState();Dn.setState({...e,prompt:null})}let S7={ignoreChanges:!1,onWorkspaceClose:()=>{},closeWorkspaceGroup:!0};function De(e,t={}){t={...S7,...t};let r=()=>{let r=Dn.getState();r.openWorkspaces.find(t=>t.name===e);let n=r.openWorkspaces.filter(t=>t.name!=e),i=Dn.getState().workspaceGroup?.name;i&&t.closeWorkspaceGroup&&S4(i),S8[e]=()=>!1,Dn.setState(e=>({...e,prompt:null,openWorkspaces:n,workspaceWindowState:Do(n?.[0])})),t?.onWorkspaceClose?.()};return S3(e,t?.ignoreChanges)?(r(),!0):(Dl("closing-workspace",r,c7(e).title??e),!1)}function Dt(e){Dn.getState().context!=e&&Dn.setState({context:e,openWorkspaces:[],prompt:null})}let Dr={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},Dn=K("workspace",Dr);function Di(e){let t=Dn.getState();Dn.setState({...t,workspaceWindowState:e})}function Do(e){return e?.preferredWindowSize??"normal"}function Da(e=()=>{},t=()=>!0){let r=Dn.getState().openWorkspaces.filter(t).every(({name:e})=>S3(e)),n=()=>{Dc(),e?.()};r?n():Dl("closing-all-workspaces",n)}function Ds(){let{workspaceWindowState:e,openWorkspaces:t,prompt:r,workspaceGroup:n}=da(Dn);return(0,c3.useMemo)(()=>({active:t.length>0,prompt:r,workspaceWindowState:e,workspaces:t,workspaceGroup:n}),[t,e,r,n])}function Dl(e,t=()=>{},r=""){let n;switch(e){case"closing-workspace":n={title:os("unsavedChangesTitleText","Unsaved changes"),body:os("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:()=>{t?.()},confirmText:os("discard","Discard")};break;case"closing-all-workspaces":{let e=Dn.getState().openWorkspaces.filter(({name:e})=>!S3(e)).map(({title:e},t)=>`${t+1}. ${e}`);n={title:os("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:os("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:os("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:e.length})};break}case"closing-workspace-launching-new-workspace":n={title:os("unsavedChangesTitleText","Unsaved changes"),body:os("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:r}),onConfirm:()=>{Dn.setState(e=>({...e,prompt:null})),t?.()},confirmText:os("openAnyway","Open anyway")};break;default:console.error(`Workspace system trying to open unknown prompt type "${e}" in function "showWorkspacePrompts"`),t?.();return}Dn.setState(e=>({...e,prompt:n}))}function Du(e,t){return t?.workspaceTitle??e.title}function Dc(){Dn.setState(Dr)}function Dd(e,t={}){if(!e||"default"===e)return;let r=z(e,{});return t&&r.setState(e=>({...e,...t})),r}let Df="-esm-form-builder__action-menu-button-module__container___Uwne-",Dp="-esm-form-builder__action-menu-button-module__elementContainer___vWkQO",Dh="-esm-form-builder__action-menu-button-module__active___D7Idw";function Dm({getIcon:e,formOpenInTheBackground:t,tagContent:r}){return(0,fK.jsxs)(fK.Fragment,{children:[e({size:16}),t?(0,fK.jsx)("span",{className:"-esm-form-builder__action-menu-button-module__interruptedTag___7undI",children:"!"}):(0,fK.jsx)("span",{className:"-esm-form-builder__action-menu-button-module__countTag___XJRiM",children:r})]})}let Dy=({getIcon:e,label:t,iconDescription:r,handler:n,type:i,tagContent:o})=>{let a=fb(),{workspaces:s,workspaceWindowState:l}=Ds(),u=s?.findIndex(({type:e})=>e===i)??-1,c="hidden"!==l&&0===u,d=u>0||0===u&&"hidden"===l;return"tablet"===a||"phone"===a?(0,fK.jsxs)(fG.$nd,{className:fz()(Df,{[Dh]:c}),iconDescription:r,kind:"ghost",onClick:n,role:"button",tabIndex:0,size:"md",children:[(0,fK.jsx)("span",{className:Dp,children:(0,fK.jsx)(Dm,{formOpenInTheBackground:d,getIcon:e,tagContent:o})}),(0,fK.jsx)("span",{children:t})]}):(0,fK.jsx)(fG.K0,{align:"left","aria-label":r,className:fz()(Df,{[Dh]:c}),enterDelayMs:300,kind:"ghost",label:t,onClick:n,size:"md",children:(0,fK.jsx)("div",{className:Dp,children:(0,fK.jsx)(Dm,{formOpenInTheBackground:d,getIcon:e,tagContent:o})})})};var Dg=r(54535),Db=r(40771),Dv=/[\\^$.*+?()[\]{}|]/g,D_=RegExp(Dv.source);let Dw=function(e){return(e=(0,tm.A)(e))&&D_.test(e)?e.replace(Dv,"\\$&"):e};function Dx({contextKey:e}){let{prompt:t}=Ds();return(0,c3.useEffect)(()=>{RegExp(`/${Dw(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,c3.useEffect)(()=>(Dt(e),()=>{Dt(null)}),[e]),(0,c3.useEffect)(()=>{let t=t=>{let{detail:{cancelNavigation:r,newUrl:n}}=t,i=RegExp(`/${Dw(e)}(/|$)`),o=new URL(n),a=i.test(o.pathname),s=Dn.getState().openWorkspaces.every(({name:e})=>S3(e));a||(s?Dc():(r?.(),Da(()=>{nX({to:n})})))};return window.addEventListener("single-spa:before-routing-event",t),()=>{window.removeEventListener("single-spa:before-routing-event",t)}},[]),null!=t?(0,fK.jsxs)(fG.KXP,{open:!0,onClose:S9,children:[(0,fK.jsx)(fG.rQ0,{title:t.title}),(0,fK.jsx)(fG.cwr,{children:(0,fK.jsx)("p",{className:"-esm-form-builder__workspace-notification-module__messageBody___M3IAD",children:t.body})}),(0,fK.jsxs)(fG.jlY,{children:[(0,fK.jsx)(fG.$nd,{kind:"secondary",onClick:S9,children:t.cancelText??os("cancel")}),(0,fK.jsx)(fG.$nd,{kind:"danger",onClick:t.onConfirm,children:t.confirmText??os("confirm")})]})]}):null}function DE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function DS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?DE(Object(r),!0).forEach(function(t){DO(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DE(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function DD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function DO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DP(e){return(DP=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function DC(e,t){return(DC=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dk(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Dj=function(e){var t=c3.Component;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),t&&DC(a,t);var r,n,i,o=(r=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=DP(a);e=r?Reflect.construct(t,arguments,DP(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 Dk(this)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),DO(Dk(t=o.call(this,e)),"handleRef",function(e){t.el=e}),DO(Dk(t),"addThingToDo",function(e,r){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then(function(){if(!t.unmounted||"unmount"===e)return r.apply(void 0,arguments)}).catch(function(r){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),r&&r.message&&(r.message="During '".concat(e,"', parcel threw an error: ").concat(r.message)),t.props.handleError?t.props.handleError(r):setTimeout(function(){throw r}),r}))}),DO(Dk(t),"getParcelProps",function(){var e=DS(DS({},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 n=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var t,r=e.props.mountParcel||e.mountParcel;if(!r)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(r){t.style[r]=e.props.wrapStyle[r]}),e.props.appendTo.appendChild(t)),e.parcel=r(e.props.config,DS({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 dE&&dE.Consumer?c3.createElement(dE.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):null;var t=dE&&dE.Consumer?c3.createElement(dE.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):void 0;return c3.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}],DD(a.prototype,n),i&&DD(a,i),a}();DO(Dj,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});function DT({workspace:e,additionalPropsFromPage:t}){let[r,n]=(0,c3.useState)(),i=function(e){let[t,r]=(0,c3.useState)({}),[n,i]=(0,c3.useState)(e);return(0,c3.useEffect)(()=>{n!==e&&i(e)},[e]),(0,c3.useEffect)(()=>{let e,t=Dd(n);return t&&(r(t.getState()),e=t.subscribe(r)),()=>{t&&e?.()}},[n]),t}(e.currentWorkspaceGroup);(0,c3.useEffect)(()=>{let t=!0;return e.load().then(e=>{t&&n(e)}),()=>{t=!1}},[e]);let o=(0,c3.useMemo)(()=>e&&{closeWorkspace:e.closeWorkspace,closeWorkspaceWithSavedChanges:e.closeWorkspaceWithSavedChanges,promptBeforeClosing:e.promptBeforeClosing,setTitle:e.setTitle,...t,...i,...e.additionalProps},[e,t,i]);return r?(0,fK.jsx)(Dj,{config:r,mountParcel:cW,...o},e.name):(0,fK.jsx)(fG.OuH,{className:"-esm-form-builder__workspace-module__loader___v7QFg",description:`${os("loading","Loading")} ...`})}let DR=function({isWithinWorkspace:e,name:t,actionMenuProps:r={}}){let[n,i]=(0,c3.useState)(!1),o=(0,c3.useRef)(window.innerHeight),{featureName:a}=(0,c3.useContext)(dr),s=fb();(0,c3.useEffect)(()=>{let e=()=>{i(!fv(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:a}-items-slot`;return(0,fK.jsx)("aside",{className:fz()("-esm-form-builder__action-menu-module__sideRail___Aa96v",{"-esm-form-builder__action-menu-module__withinWorkspace___2bJET":e,"-esm-form-builder__action-menu-module__sideRailHidden___Yb0w9":n,"-esm-form-builder__action-menu-module__sideRailVisible___XIAk7":!n}),children:(0,fK.jsx)("div",{className:"-esm-form-builder__action-menu-module__container___mzfAh",children:(0,fK.jsx)(dy,{className:"-esm-form-builder__action-menu-module__chartExtensions___DiJtm",name:l,state:r})})})};function DA({contextKey:e,overlay:t,showSiderailAndBottomNav:r,additionalWorkspaceProps:n,actionMenuProps:i}){let o=fb(),{workspaces:a,workspaceWindowState:s,workspaceGroup:l}=Ds(),u=l?.name,c=a[0],d="hidden"===s||null==c,f=c?.width??(t?"wider":"narrow"),p=(0,c3.useMemo)(()=>r||u&&!d,[u,d,r]);return dY(!d&&!fv(o)),(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsxs)("div",{className:r?"-esm-form-builder__workspace-module__workspaceContainerWithActionMenu___6x1qS":"-esm-form-builder__workspace-module__workspaceContainerWithoutActionMenu___TJHnt",children:[(0,fK.jsx)("aside",{className:fz()(t?"-esm-form-builder__workspace-module__workspaceOverlayOuterContainer___4y++2":"-esm-form-builder__workspace-module__workspaceWindowSpacer___6kF9R",{"-esm-form-builder__workspace-module__hiddenRelative___qqT-4":d,"-esm-form-builder__workspace-module__narrowWorkspace___MMI1u":"narrow"===f,"-esm-form-builder__workspace-module__widerWorkspace___be-UT":"wider"===f,"-esm-form-builder__workspace-module__extraWideWorkspace___JmWmj":"extra-wide"===f}),children:(0,fK.jsx)("div",{className:fz()("-esm-form-builder__workspace-module__workspaceFixedContainer___TfJP7",{"-esm-form-builder__workspace-module__maximizedWindow___71jv4":"maximized"===s,"-esm-form-builder__workspace-module__hiddenFixed___48wS9":d}),children:a.map((e,t)=>(0,fK.jsx)("div",{className:fz()("-esm-form-builder__workspace-module__workspaceInnerContainer___h3oyO",{"-esm-form-builder__workspace-module__hiddenExtraWorkspace___AP+Vj":0!==t}),children:(0,fK.jsx)(c3.Suspense,{fallback:null,children:(0,fK.jsx)(dT.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName,children:(0,fK.jsx)(DM,{workspaceInstance:e,additionalWorkspaceProps:n})})})},`workspace-container-${e?e.name:`empty-${t}`}`))})}),(0,fK.jsx)(Dx,{contextKey:e})]}),p&&(0,fK.jsx)(DR,{name:u,isWithinWorkspace:!r,actionMenuProps:i})]})}function DM({workspaceInstance:e,additionalWorkspaceProps:t}){let{t:r}=(0,dT.useTranslation)(),n=fb(),{workspaceWindowState:i,workspaceGroup:o}=Ds(),a=o?.name,s="maximized"===i;(0,c3.useEffect)(()=>{let t=r(e.title);t!==e.title&&e.setTitle(t)},[e.title,r,e.setTitle]);let{featureName:l}=(0,c3.useContext)(dr),u=(0,c3.useCallback)(()=>{Di(s?"normal":"maximized")},[s]),{canHide:c=!1,canMaximize:d=!1,currentWorkspaceGroup:f="",closeWorkspace:p}=(0,c3.useMemo)(()=>e??{},[e]),h=(0,c3.useMemo)(()=>({...t,...e?.additionalProps}),[t,e]);return e&&(0,fK.jsxs)(fK.Fragment,{children:[(0,fK.jsxs)(fG.Y9Y,{"aria-label":os("workspaceHeader","Workspace Header"),className:"-esm-form-builder__workspace-module__header___nACZO",children:[!fv(n)&&!c&&(0,fK.jsx)(fG.dJ2,{"aria-label":os("close","Close"),renderMenuIcon:(0,fK.jsx)(pt,{}),onClick:()=>p()}),(0,fK.jsx)(fG.bCw,{prefix:"",children:e.titleNode??r(e.title)}),(0,fK.jsx)("div",{className:"-esm-form-builder__workspace-module__overlayHeaderSpacer___HBnr+"}),(0,fK.jsxs)(fG.wdv,{className:"-esm-form-builder__workspace-module__headerButtons___heP0Q",children:[(0,fK.jsx)(dy,{name:`workspace-header-group-${e.currentWorkspaceGroup}-slot`,state:h}),(0,fK.jsx)(dy,{name:`workspace-header-type-${e.type}-slot`,state:h}),(0,fK.jsx)(dy,{name:`workspace-header-${l}-slot`,state:h}),fv(n)&&(0,fK.jsxs)(fK.Fragment,{children:[(d||s)&&(0,fK.jsx)(fG.V8d,{"aria-label":s?os("minimize","Minimize"):os("maximize","Maximize"),onClick:u,children:s?(0,fK.jsx)(Dg.Xj,{}):(0,fK.jsx)(Dg.hz,{})}),c&&!a?(0,fK.jsx)(fG.V8d,{"aria-label":os("hide","Hide"),onClick:()=>Di("hidden"),children:(0,fK.jsx)(pr,{})}):(0,fK.jsx)(fG.V8d,{"aria-label":os("close","Close"),onClick:()=>p?.(),children:(0,fK.jsx)(p_,{})})]}),"tablet"===n&&c&&(0,fK.jsx)(fG.V8d,{"aria-label":os("close","Close"),onClick:()=>p?.(),children:(0,fK.jsx)(Db.d3,{})})]})]}),(0,fK.jsx)("div",{className:fz()("-esm-form-builder__workspace-module__workspaceContent___oYdxI",{"-esm-form-builder__workspace-module__marginWorkspaceContent___7hwHu":!!f}),children:(0,fK.jsx)(DT,{workspace:e,additionalPropsFromPage:t},e.name)})]})}async function DN(e,t){let{openedGroup:r}=de.getState();if(r){if(r.groupName===e&&DL(r.props,t))return!0;else if(!await DF({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return de.setState(r=>({...r,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function DI(e){let{openedGroup:t,openedWindows:r}=de.getState();if(t){if(r.length>0&&!(e||await DF({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;de.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function D$(e,t=null,r=null,n=null){let i=de.getState();if(!i.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let o=function(e){let{registeredWorkspacesByName:t,registeredWindowsByName:r}=de.getState(),n=t[e];if(n){let t=r[n.window];if(t)return t;throw Error(`No workspace window found with name: ${n.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}(e);if(!o)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:a}=i,{name:s}=o,l=function(e){let{registeredGroupsByName:t,registeredWindowsByName:r}=de.getState(),n=r[e];if(n){let r=t[n.group];if(r)return r;throw Error(`No workspace group found with name: ${n.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}(s);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${o.name} is not registered to a workspace group`);let u=dt(e);if(a&&(a.groupName!==l.name||!DL(a.props,n)))return!!await DF({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(de.setState({...i,openedGroup:{groupName:l.name,props:n},openedWindows:[{windowName:s,openedWorkspaces:[DW(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(u>=0){let n=i.openedWindows[u],o=i.openedGroup?.props??{},a=i.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:c}=n;if(DL(n.props,r)){let d=c.find(t=>t.workspaceName===e);return d&&DL(d.props,t)?((a||u!==i.openedWindows.length-1)&&de.setState(DB.restoreWindow(i,s)),!0):!!await DF({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})&&(de.setState({...i,openedGroup:{groupName:l.name,props:i?.openedGroup?.props??o},openedWindows:[...i.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[DW(e,t)],props:n?.props??r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await DF({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})&&(de.setState({...i,openedGroup:{groupName:l.name,props:o??i?.openedGroup?.props},openedWindows:[...i.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[DW(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(de.setState({...i,openedGroup:{groupName:l.name,props:n??i?.openedGroup?.props??null},openedWindows:[...i.openedWindows,{windowName:s,openedWorkspaces:[DW(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await DF({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:o.name})&&(de.setState({...i,openedGroup:{groupName:l.name,props:n??i?.openedGroup?.props??null},openedWindows:[{windowName:s,openedWorkspaces:[DW(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function DL(e,t){return null==e||null==t||M(e,t)}function DF(e){function t(e,t){let r=[];for(let n=e.openedWorkspaces.length-1;n>=0;n--){let i=e.openedWorkspaces[n];if(i.hasUnsavedChanges&&r.push(i),t&&i.workspaceName===t)break}return r}let{openedWindows:r,workspaceTitleByWorkspaceName:n}=de.getState(),i=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":i=r.flatMap(e=>t(e));break;case"CLOSE_WINDOW":{let n=r.find(t=>t.windowName===e.windowName);if(!n)throw Error(`Window ${e.windowName} not found in opened windows.`);i=t(n);break}case"CLOSE_WORKSPACE":{let n=r.find(t=>t.windowName===e.windowName);if(!n)throw Error(`Window ${e.windowName} not found in opened windows.`);i=t(n,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":i=r.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>t(e))}return 0===i.length?Promise.resolve(!0):new Promise(e=>{let t=EL("workspace2-close-prompt",{size:"sm",onConfirm:()=>{t(),e(!0)},onCancel:()=>{t(),e(!1)},affectedWorkspaceTitles:i.map(e=>n[e.workspaceName])})})}let DB={setWindowMaximized(e,t,r){let n=e.openedWindows.findIndex(e=>e.windowName===t),i=[...e.openedWindows],o={...i[n],maximized:r};return i[n]=o,{...e,openedWindows:i}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let r=e.openedWindows.findIndex(e=>e.windowName===t),n=e.openedWindows[r],i=[...e.openedWindows.filter((e,t)=>t!==r),n];return{...e,openedWindows:i,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let r=dt(t);if(r<0)return e;let n={...e.openedWindows[r]},i=n.openedWorkspaces.findIndex(e=>e.workspaceName===t),o=[...e.openedWindows];n.openedWorkspaces=n.openedWorkspaces.slice(0,i);let a=e.isMostRecentlyOpenedWindowHidden;if(0===n.openedWorkspaces.length){let t=r===e.openedWindows.length-1;o.splice(r,1),t&&o.length>0&&(a=!1)}else o[r]=n;return{...e,openedWindows:o,isMostRecentlyOpenedWindowHidden:a}},openChildWorkspace(e,t,r,n){let i=e.registeredWorkspacesByName[r];if(!i)throw Error(`No workspace named "${r}" registered`);let o=e.registeredWorkspacesByName[t];if(!o)throw Error(`No workspace named "${t}" registered`);if(o.window!==i.window)throw Error(`Child workspace ${r} does not belong to the same workspace window as parent workspace ${t}`);let a=e.openedWindows.findIndex(e=>e.windowName===i.window);if(-1==a)throw Error(`Cannot open child workspace ${r} as window ${i.window} is not opened`);let{openedWorkspaces:s}=e.openedWindows[a],l=s.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${r} 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==a?{...e,openedWorkspaces:[...u,DW(r,n)]}:e)}},setHasUnsavedChanges(e,t,r){let n=dt(t);if(n<0)return e;let i={...e.openedWindows[n]},o=i.openedWorkspaces.findIndex(e=>e.workspaceName===t);if(o<0)return e;i.openedWorkspaces[o]={...i.openedWorkspaces[o],hasUnsavedChanges:r};let a=[...e.openedWindows];return a[n]=i,{...e,openedWindows:a}},setWorkspaceTitle(e,t,r){let n={...e.workspaceTitleByWorkspaceName};return null===r?delete n[t]:n[t]=r,{...e,workspaceTitleByWorkspaceName:n}}},DV=()=>(0,c3.useContext)(dE),DU=()=>Object.keys(de.getState().registeredWorkspacesByName);function DW(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:cQ()}}let DK={workspaceOuterContainer:"-esm-form-builder__workspace2-module__workspaceOuterContainer___DLiCR",narrowWorkspace:"-esm-form-builder__workspace2-module__narrowWorkspace___VL0kF",widerWorkspace:"-esm-form-builder__workspace2-module__widerWorkspace___3QgrA",extraWideWorkspace:"-esm-form-builder__workspace2-module__extraWideWorkspace___s7nnh",workspaceMiddleContainer:"-esm-form-builder__workspace2-module__workspaceMiddleContainer___mTGNN",maximized:"-esm-form-builder__workspace2-module__maximized___-yo9l",hidden:"-esm-form-builder__workspace2-module__hidden___K2ryM",workspaceInnerContainer:"-esm-form-builder__workspace2-module__workspaceInnerContainer___o3zVl",workspaceSpacer:"-esm-form-builder__workspace2-module__workspaceSpacer___N6-ox",loader:"-esm-form-builder__workspace2-module__loader___29hpw",hiddenExtraWorkspace:"-esm-form-builder__workspace2-module__hiddenExtraWorkspace___-W7TY",header:"-esm-form-builder__workspace2-module__header___p0kuD",headerButtons:"-esm-form-builder__workspace2-module__headerButtons___hMydG",workspaceContent:"-esm-form-builder__workspace2-module__workspaceContent___uROr7",overlayHeaderSpacer:"-esm-form-builder__workspace2-module__overlayHeaderSpacer___zdrhx",isActionMenuOpened:"-esm-form-builder__workspace2-module__isActionMenuOpened___Wc1Il",showActionMenu:"-esm-form-builder__workspace2-module__showActionMenu___qCVQ-",marginWorkspaceContent:"-esm-form-builder__workspace2-module__marginWorkspaceContent___A+20C",workspaceContainerWithActionMenu:"-esm-form-builder__workspace2-module__workspaceContainerWithActionMenu___S98dq",workspaceFixedContainer:"-esm-form-builder__workspace2-module__workspaceFixedContainer___c9Uny",workspaceContainerWithoutActionMenu:"-esm-form-builder__workspace2-module__workspaceContainerWithoutActionMenu___u8FbT"},DH=({title:e,children:t,hasUnsavedChanges:r=!1})=>{let n=fb(),{setWindowMaximized:i,hideWindow:o,setHasUnsavedChanges:a,openedWindows:s,openedGroup:l,registeredGroupsByName:u,registeredWindowsByName:c,registeredWorkspacesByName:d,workspaceTitleByWorkspaceName:f,setWorkspaceTitle:p,isMostRecentlyOpenedWindowHidden:h}=ds(de,DB),{workspaceName:m,isRootWorkspace:y,closeWorkspace:g,showActionMenu:b}=DV(),v=dt(m),w=s[v],x=w?.openedWorkspaces.find(e=>e.workspaceName===m);if((0,c3.useEffect)(()=>{x?.hasUnsavedChanges!=r&&a(m,r??!1)},[x?.hasUnsavedChanges,r,m,a]),(0,c3.useEffect)(()=>{f[m]!==e&&p(m,e)},[f,m,e,p]),v<0||null==l||null==x)return null;let E=u[l.groupName];if(!E)throw Error(`Cannot find registered workspace group ${l.groupName}`);let S=d[m].window,D=c[S];if(!D)throw Error(`Cannot find registered workspace window ${S}`);let{icon:O,canMaximize:P}=D,C="closable"===E.persistence,k=!!O&&!C,{maximized:j}=w,T=D?.width??"narrow",R=Object.values(c).some(e=>e.group===l.groupName&&void 0!==e.icon),A=v<s.length-1||h;return(0,fK.jsxs)("div",{className:fz()(DK.workspaceOuterContainer,{[DK.narrowWorkspace]:"narrow"===T,[DK.widerWorkspace]:"wider"===T,[DK.extraWideWorkspace]:"extra-wide"===T,[DK.isActionMenuOpened]:R}),children:[(0,fK.jsx)("div",{className:fz()(DK.workspaceSpacer,{[DK.hidden]:A})}),(0,fK.jsx)("div",{className:fz()(DK.workspaceMiddleContainer,{[DK.maximized]:j,[DK.hidden]:A,[DK.isRootWorkspace]:y,[DK.showActionMenu]:b}),children:(0,fK.jsxs)("div",{className:fz()(DK.workspaceInnerContainer,{[DK.maximized]:j,[DK.hidden]:A,[DK.isRootWorkspace]:y}),children:[(0,fK.jsxs)(fG.Y9Y,{"aria-label":os("workspaceHeader"),className:DK.header,children:[(0,fK.jsx)(fG.bCw,{prefix:"",children:e}),(0,fK.jsx)("div",{className:DK.overlayHeaderSpacer}),(0,fK.jsx)(fG.wdv,{className:DK.headerButtons,children:fv(n)?(0,fK.jsxs)(fK.Fragment,{children:[(P||j)&&(0,fK.jsx)(fG.V8d,{"aria-label":j?os("minimize"):os("maximize"),onClick:()=>i(S,!j),children:j?(0,fK.jsx)(Dg.Xj,{}):(0,fK.jsx)(Dg.hz,{})}),k&&(0,fK.jsx)(fG.V8d,{"aria-label":os("hide"),onClick:()=>o(),children:(0,fK.jsx)(pr,{})}),!C&&(0,fK.jsx)(fG.V8d,{"aria-label":os("close"),onClick:()=>g({closeWindow:!0}),children:(0,fK.jsx)(p_,{})})]}):(0,fK.jsxs)(fK.Fragment,{children:[k&&(0,fK.jsx)(fG.V8d,{"aria-label":os("hide"),onClick:()=>o(),children:(0,fK.jsx)(Db.d3,{})}),(0,fK.jsx)(fG.V8d,{"aria-label":os("close"),onClick:()=>{C?DI():g({closeWindow:!0})},children:(0,fK.jsx)(p_,{})})]})})]}),(0,fK.jsx)("div",{className:fz()(DK.workspaceContent),children:t})]})})]})},Dz="-esm-form-builder__action-menu-button2-module__container___gYRoa",Dq="-esm-form-builder__action-menu-button2-module__elementContainer___vBViO",DG="-esm-form-builder__action-menu-button2-module__active___uRJRA",DZ="-esm-form-builder__action-menu-button2-module__focused___D4VYB";function DY({getIcon:e,hasUnsavedChanges:t,tagContent:r}){return(0,fK.jsxs)(fK.Fragment,{children:[e({size:16}),t?(0,fK.jsx)("span",{className:"-esm-form-builder__action-menu-button2-module__interruptedTag___35fO7",children:"!"}):(0,fK.jsx)("span",{className:"-esm-form-builder__action-menu-button2-module__countTag___l8lfc",children:r})]})}let DJ=({icon:e,label:t,tagContent:r,workspaceToLaunch:n,onBeforeWorkspaceLaunch:i})=>{let o=fb(),{openedWindows:a,restoreWindow:s,hideWindow:l,isMostRecentlyOpenedWindowHidden:u}=ds(de,DB),{extension:c}=(0,c3.useContext)(dr),d=a.findIndex(e=>e.windowName===c?.extensionId),f=a[d],p=null!=f,h=p&&(d<a.length-1||u),m=p&&!h,y=f?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,g=async()=>{if(p)h?s(f.windowName):l();else if(await (i?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:r}=n;D$(e,t,r)}};return"tablet"===o||"phone"===o?(0,fK.jsxs)(fG.$nd,{className:fz()(Dz,{[DG]:p&&!m,[DZ]:m}),iconDescription:t,kind:"ghost",onClick:g,role:"button",tabIndex:0,size:"md",children:[(0,fK.jsx)("span",{className:Dq,children:(0,fK.jsx)(DY,{hasUnsavedChanges:y,getIcon:e,tagContent:r})}),(0,fK.jsx)("span",{children:t})]}):(0,fK.jsx)(fG.K0,{align:"left","aria-label":t,className:fz()(Dz,{[DG]:p&&!m,[DZ]:m}),enterDelayMs:300,kind:"ghost",label:t,onClick:g,size:"md",children:(0,fK.jsx)("div",{className:Dq,children:(0,fK.jsx)(DY,{hasUnsavedChanges:y,getIcon:e,tagContent:r})})})};function DQ(e,t,r){if(null==e)return r;let n=w3(e);if(!n)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),r;let i=[];for(let e of t){let t=w3(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}i.push({canonical:t,original:e})}let o=n;for(;o;){let e=i.find(e=>e.canonical===o);if(e)return e.original;let t=o+"-",r=i.find(e=>e.canonical.startsWith(t));if(r)return r.original;if("ht"===o){o="fr-HT";continue}let n=o.lastIndexOf("-");if(-1===n)break;let a=(o=o.slice(0,n)).lastIndexOf("-");-1!==a&&o.length-a==2&&(o=o.slice(0,a))}return r}function DX(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function D0(e){return!!e&&e.constructor===Object}var D1=r(99589);function D3(e){let[t,r,n]=e.split(".");return`${t}.${r}.${n}`}function D4(e,t){let r=function(e){let t=e.indexOf("-");if(t>=0){let r=D3(e.slice(0,t)),n=e.slice(t+1);return`${r}-${n}`}return D3(e)}(t);return D1.satisfies(r,e,{includePrerelease:!0})}async function D2(e,t={}){let r,{shouldRetry:n,getDelay:i,onError:o}=t;n=n??(e=>e<=5),i=i??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let a=0;do try{return await D6(i(a)),await e()}catch(e){o?.(e,a),r=e}while(n(a++));throw r}async function D6(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}},241(e,t,r){"use strict";r.d(t,{A:()=>n});let n=r(41917).A.Symbol},76912(e,t,r){"use strict";r.d(t,{A:()=>n});let n=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},76335(e,t,r){"use strict";r.d(t,{A:()=>u});var n=r(76912),i=r(241),o=r(20018),a=r(92049),s=i.A?i.A.isConcatSpreadable:void 0;let l=function(e){return(0,a.A)(e)||(0,o.A)(e)||!!(s&&e&&e[s])},u=function e(t,r,i,o,a){var s=-1,u=t.length;for(i||(i=l),a||(a=[]);++s<u;){var c=t[s];r>0&&i(c)?r>1?e(c,r-1,i,o,a):(0,n.A)(a,c):o||(a[a.length]=c)}return a}},18348(e,t,r){"use strict";r.d(t,{A:()=>d});var n=r(241),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n.A?n.A.toStringTag:void 0;let l=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i};var u=Object.prototype.toString,c=n.A?n.A.toStringTag:void 0;let d=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":c&&c in Object(e)?l(e):u.call(e)}},72136(e,t,r){"use strict";r.d(t,{A:()=>n});let n="object"==typeof global&&global&&global.Object===Object&&global},41917(e,t,r){"use strict";r.d(t,{A:()=>o});var n=r(72136),i="object"==typeof self&&self&&self.Object===Object&&self;let o=n.A||i||Function("return this")()},20018(e,t,r){"use strict";r.d(t,{A:()=>u});var n=r(18348),i=r(53098);let o=function(e){return(0,i.A)(e)&&"[object Arguments]"==(0,n.A)(e)};var a=Object.prototype,s=a.hasOwnProperty,l=a.propertyIsEnumerable;let u=o(function(){return arguments}())?o:function(e){return(0,i.A)(e)&&s.call(e,"callee")&&!l.call(e,"callee")}},92049(e,t,r){"use strict";r.d(t,{A:()=>n});let n=Array.isArray},53098(e,t,r){"use strict";r.d(t,{A:()=>n});let n=function(e){return null!=e&&"object"==typeof e}}}]);