@govtechsg/sgds-web-component 3.11.0 → 3.12.0-rc.0

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.
Files changed (69) hide show
  1. package/components/Checkbox/index.umd.min.js +6 -6
  2. package/components/Checkbox/index.umd.min.js.map +1 -1
  3. package/components/ComboBox/index.umd.min.js +240 -240
  4. package/components/ComboBox/index.umd.min.js.map +1 -1
  5. package/components/Datepicker/index.umd.min.js +22 -22
  6. package/components/Datepicker/index.umd.min.js.map +1 -1
  7. package/components/FileUpload/index.umd.min.js +8 -8
  8. package/components/FileUpload/index.umd.min.js.map +1 -1
  9. package/components/Input/index.umd.min.js +14 -14
  10. package/components/Input/index.umd.min.js.map +1 -1
  11. package/components/Input/sgds-input.d.ts +1 -0
  12. package/components/Input/sgds-input.js +1 -4
  13. package/components/Input/sgds-input.js.map +1 -1
  14. package/components/Modal/index.umd.min.js.map +1 -1
  15. package/components/Modal/sgds-modal.d.ts +1 -1
  16. package/components/Modal/sgds-modal.js +1 -1
  17. package/components/Modal/sgds-modal.js.map +1 -1
  18. package/components/QuantityToggle/index.umd.min.js +2 -2
  19. package/components/QuantityToggle/index.umd.min.js.map +1 -1
  20. package/components/Radio/index.umd.min.js +9 -9
  21. package/components/Radio/index.umd.min.js.map +1 -1
  22. package/components/Select/index.umd.min.js +11 -11
  23. package/components/Select/index.umd.min.js.map +1 -1
  24. package/components/Tab/index.umd.min.js.map +1 -1
  25. package/components/Tab/sgds-tab-group.d.ts +2 -2
  26. package/components/Tab/sgds-tab-group.js +2 -2
  27. package/components/Tab/sgds-tab-group.js.map +1 -1
  28. package/components/Textarea/index.umd.min.js +6 -6
  29. package/components/Textarea/index.umd.min.js.map +1 -1
  30. package/components/Textarea/sgds-textarea.d.ts +2 -0
  31. package/components/Textarea/sgds-textarea.js +14 -2
  32. package/components/Textarea/sgds-textarea.js.map +1 -1
  33. package/components/index.umd.min.js +4 -4
  34. package/components/index.umd.min.js.map +1 -1
  35. package/css/fouc.css +2 -2
  36. package/index.umd.min.js +49 -49
  37. package/index.umd.min.js.map +1 -1
  38. package/package.json +1 -1
  39. package/react/components/Input/sgds-input.cjs.js +1 -4
  40. package/react/components/Input/sgds-input.cjs.js.map +1 -1
  41. package/react/components/Input/sgds-input.js +1 -4
  42. package/react/components/Input/sgds-input.js.map +1 -1
  43. package/react/components/Modal/sgds-modal.cjs.js +1 -1
  44. package/react/components/Modal/sgds-modal.cjs.js.map +1 -1
  45. package/react/components/Modal/sgds-modal.js +1 -1
  46. package/react/components/Modal/sgds-modal.js.map +1 -1
  47. package/react/components/Tab/sgds-tab-group.cjs.js +2 -2
  48. package/react/components/Tab/sgds-tab-group.cjs.js.map +1 -1
  49. package/react/components/Tab/sgds-tab-group.js +2 -2
  50. package/react/components/Tab/sgds-tab-group.js.map +1 -1
  51. package/react/components/Textarea/sgds-textarea.cjs.js +14 -2
  52. package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
  53. package/react/components/Textarea/sgds-textarea.js +14 -2
  54. package/react/components/Textarea/sgds-textarea.js.map +1 -1
  55. package/react/index.cjs.js +12 -12
  56. package/react/index.d.ts +2 -2
  57. package/react/index.js +2 -2
  58. package/react/utils/inputValidationController.cjs.js +2 -1
  59. package/react/utils/inputValidationController.cjs.js.map +1 -1
  60. package/react/utils/inputValidationController.js +2 -1
  61. package/react/utils/inputValidationController.js.map +1 -1
  62. package/react/utils/validatorMixin.cjs.js +24 -6
  63. package/react/utils/validatorMixin.cjs.js.map +1 -1
  64. package/react/utils/validatorMixin.js +24 -6
  65. package/react/utils/validatorMixin.js.map +1 -1
  66. package/utils/inputValidationController.js +2 -1
  67. package/utils/inputValidationController.js.map +1 -1
  68. package/utils/validatorMixin.js +24 -6
  69. package/utils/validatorMixin.js.map +1 -1
@@ -1,27 +1,27 @@
1
- !function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";function t(t,e,i,a){var s,n=arguments.length,r=n<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,a);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}function e(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function i(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function a(t,a){const s=e(t);return isNaN(a)?i(t,NaN):a?(s.setDate(s.getDate()+a),s):s}"function"==typeof SuppressedError&&SuppressedError;const s=6048e5;let n={};function r(){return n}function o(t,i){const a=r(),s=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,n=e(t),o=n.getDay(),l=(o<s?7:0)+o-s;return n.setDate(n.getDate()-l),n.setHours(0,0,0,0),n}function l(t){return o(t,{weekStartsOn:1})}function c(t){const a=e(t),s=a.getFullYear(),n=i(t,0);n.setFullYear(s+1,0,4),n.setHours(0,0,0,0);const r=l(n),o=i(t,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const c=l(o);return a.getTime()>=r.getTime()?s+1:a.getTime()>=c.getTime()?s:s-1}function d(t){const i=e(t);return i.setHours(0,0,0,0),i}function h(t){const i=e(t),a=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return a.setUTCFullYear(i.getFullYear()),+t-+a}function u(t){if(!(i=t,i instanceof Date||"object"==typeof i&&"[object Date]"===Object.prototype.toString.call(i)||"number"==typeof t))return!1;var i;const a=e(t);return!isNaN(Number(a))}function p(t){const i=e(t);return+function(t){const i=e(t);return i.setHours(23,59,59,999),i}(i)===+function(t){const i=e(t),a=i.getMonth();return i.setFullYear(i.getFullYear(),a+1,0),i.setHours(23,59,59,999),i}(i)}const g={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function v(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}const f={date:v({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:v({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:v({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},m={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function w(t){return(e,i)=>{let a;if("formatting"===(i?.context?String(i.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,s=i?.width?String(i.width):e;a=t.formattingValues[s]||t.formattingValues[e]}else{const e=t.defaultWidth,s=i?.width?String(i.width):t.defaultWidth;a=t.values[s]||t.values[e]}return a[t.argumentCallback?t.argumentCallback(e):e]}}function y(t){return(e,i={})=>{const a=i.width,s=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],n=e.match(s);if(!n)return null;const r=n[0],o=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(o)?function(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i;return}(o,t=>t.test(r)):function(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i;return}(o,t=>t.test(r));let c;c=t.valueCallback?t.valueCallback(l):l,c=i.valueCallback?i.valueCallback(c):c;return{value:c,rest:e.slice(r.length)}}}var b;const x={code:"en-US",formatDistance:(t,e,i)=>{let a;const s=g[t];return a="string"==typeof s?s:1===e?s.one:s.other.replace("{{count}}",e.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+a:a+" ago":a},formatLong:f,formatRelative:(t,e,i,a)=>m[t],localize:{ordinalNumber:(t,e)=>{const i=Number(t),a=i%100;if(a>20||a<10)switch(a%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:w({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:w({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:w({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:w({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:w({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(b={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const i=t.match(b.matchPattern);if(!i)return null;const a=i[0],s=t.match(b.parsePattern);if(!s)return null;let n=b.valueCallback?b.valueCallback(s[0]):s[0];return n=e.valueCallback?e.valueCallback(n):n,{value:n,rest:t.slice(a.length)}}),era:y({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:y({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:y({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:y({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:y({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function C(t){const a=e(t),s=function(t,e){const i=d(t),a=d(e),s=+i-h(i),n=+a-h(a);return Math.round((s-n)/864e5)}(a,function(t){const a=e(t),s=i(t,0);return s.setFullYear(a.getFullYear(),0,1),s.setHours(0,0,0,0),s}(a));return s+1}function _(t){const a=e(t),n=+l(a)-+function(t){const e=c(t),a=i(t,0);return a.setFullYear(e,0,4),a.setHours(0,0,0,0),l(a)}(a);return Math.round(n/s)+1}function k(t,a){const s=e(t),n=s.getFullYear(),l=r(),c=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,d=i(t,0);d.setFullYear(n+1,0,c),d.setHours(0,0,0,0);const h=o(d,a),u=i(t,0);u.setFullYear(n,0,c),u.setHours(0,0,0,0);const p=o(u,a);return s.getTime()>=h.getTime()?n+1:s.getTime()>=p.getTime()?n:n-1}function M(t,a){const n=e(t),l=+o(n,a)-+function(t,e){const a=r(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,n=k(t,e),l=i(t,0);return l.setFullYear(n,0,s),l.setHours(0,0,0,0),o(l,e)}(n,a);return Math.round(l/s)+1}function Z(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const V={y(t,e){const i=t.getFullYear(),a=i>0?i:1-i;return Z("yy"===e?a%100:a,e.length)},M(t,e){const i=t.getMonth();return"M"===e?String(i+1):Z(i+1,2)},d:(t,e)=>Z(t.getDate(),e.length),a(t,e){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];default:return"am"===i?"a.m.":"p.m."}},h:(t,e)=>Z(t.getHours()%12||12,e.length),H:(t,e)=>Z(t.getHours(),e.length),m:(t,e)=>Z(t.getMinutes(),e.length),s:(t,e)=>Z(t.getSeconds(),e.length),S(t,e){const i=e.length,a=t.getMilliseconds();return Z(Math.trunc(a*Math.pow(10,i-3)),e.length)}},D="midnight",S="noon",A="morning",B="afternoon",E="evening",F="night",H={G:function(t,e,i){const a=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(a,{width:"abbreviated"});case"GGGGG":return i.era(a,{width:"narrow"});default:return i.era(a,{width:"wide"})}},y:function(t,e,i){if("yo"===e){const e=t.getFullYear(),a=e>0?e:1-e;return i.ordinalNumber(a,{unit:"year"})}return V.y(t,e)},Y:function(t,e,i,a){const s=k(t,a),n=s>0?s:1-s;if("YY"===e){return Z(n%100,2)}return"Yo"===e?i.ordinalNumber(n,{unit:"year"}):Z(n,e.length)},R:function(t,e){return Z(c(t),e.length)},u:function(t,e){return Z(t.getFullYear(),e.length)},Q:function(t,e,i){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return Z(a,2);case"Qo":return i.ordinalNumber(a,{unit:"quarter"});case"QQQ":return i.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(a,{width:"narrow",context:"formatting"});default:return i.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,i){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return Z(a,2);case"qo":return i.ordinalNumber(a,{unit:"quarter"});case"qqq":return i.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(a,{width:"narrow",context:"standalone"});default:return i.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,i){const a=t.getMonth();switch(e){case"M":case"MM":return V.M(t,e);case"Mo":return i.ordinalNumber(a+1,{unit:"month"});case"MMM":return i.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(a,{width:"narrow",context:"formatting"});default:return i.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,i){const a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return Z(a+1,2);case"Lo":return i.ordinalNumber(a+1,{unit:"month"});case"LLL":return i.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(a,{width:"narrow",context:"standalone"});default:return i.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,i,a){const s=M(t,a);return"wo"===e?i.ordinalNumber(s,{unit:"week"}):Z(s,e.length)},I:function(t,e,i){const a=_(t);return"Io"===e?i.ordinalNumber(a,{unit:"week"}):Z(a,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getDate(),{unit:"date"}):V.d(t,e)},D:function(t,e,i){const a=C(t);return"Do"===e?i.ordinalNumber(a,{unit:"dayOfYear"}):Z(a,e.length)},E:function(t,e,i){const a=t.getDay();switch(e){case"E":case"EE":case"EEE":return i.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(a,{width:"short",context:"formatting"});default:return i.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,i,a){const s=t.getDay(),n=(s-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(n);case"ee":return Z(n,2);case"eo":return i.ordinalNumber(n,{unit:"day"});case"eee":return i.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(s,{width:"short",context:"formatting"});default:return i.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,i,a){const s=t.getDay(),n=(s-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(n);case"cc":return Z(n,e.length);case"co":return i.ordinalNumber(n,{unit:"day"});case"ccc":return i.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(s,{width:"narrow",context:"standalone"});case"cccccc":return i.day(s,{width:"short",context:"standalone"});default:return i.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,i){const a=t.getDay(),s=0===a?7:a;switch(e){case"i":return String(s);case"ii":return Z(s,e.length);case"io":return i.ordinalNumber(s,{unit:"day"});case"iii":return i.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(a,{width:"short",context:"formatting"});default:return i.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,i){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(a,{width:"narrow",context:"formatting"});default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,i){const a=t.getHours();let s;switch(s=12===a?S:0===a?D:a/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,i){const a=t.getHours();let s;switch(s=a>=17?E:a>=12?B:a>=4?A:F,e){case"B":case"BB":case"BBB":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),i.ordinalNumber(e,{unit:"hour"})}return V.h(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getHours(),{unit:"hour"}):V.H(t,e)},K:function(t,e,i){const a=t.getHours()%12;return"Ko"===e?i.ordinalNumber(a,{unit:"hour"}):Z(a,e.length)},k:function(t,e,i){let a=t.getHours();return 0===a&&(a=24),"ko"===e?i.ordinalNumber(a,{unit:"hour"}):Z(a,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getMinutes(),{unit:"minute"}):V.m(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getSeconds(),{unit:"second"}):V.s(t,e)},S:function(t,e){return V.S(t,e)},X:function(t,e,i){const a=t.getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return T(a);case"XXXX":case"XX":return I(a);default:return I(a,":")}},x:function(t,e,i){const a=t.getTimezoneOffset();switch(e){case"x":return T(a);case"xxxx":case"xx":return I(a);default:return I(a,":")}},O:function(t,e,i){const a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+$(a,":");default:return"GMT"+I(a,":")}},z:function(t,e,i){const a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+$(a,":");default:return"GMT"+I(a,":")}},t:function(t,e,i){return Z(Math.trunc(t.getTime()/1e3),e.length)},T:function(t,e,i){return Z(t.getTime(),e.length)}};function $(t,e=""){const i=t>0?"-":"+",a=Math.abs(t),s=Math.trunc(a/60),n=a%60;return 0===n?i+String(s):i+String(s)+e+Z(n,2)}function T(t,e){if(t%60==0){return(t>0?"-":"+")+Z(Math.abs(t)/60,2)}return I(t,e)}function I(t,e=""){const i=t>0?"-":"+",a=Math.abs(t);return i+Z(Math.trunc(a/60),2)+e+Z(a%60,2)}const P=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},L=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},R={p:L,P:(t,e)=>{const i=t.match(/(P+)(p+)?/)||[],a=i[1],s=i[2];if(!s)return P(t,e);let n;switch(a){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",P(a,e)).replace("{{time}}",L(s,e))}},O=/^D+$/,Y=/^Y+$/,N=["D","DD","YY","YYYY"];function z(t){return O.test(t)}function U(t){return Y.test(t)}function q(t,e,i){const a=function(t,e,i){const a="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,i);if(console.warn(a),N.includes(t))throw new RangeError(a)}const W=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,j=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,G=/^'([^]*?)'?$/,K=/''/g,Q=/[a-zA-Z]/;function X(t,i,a){const s=r(),n=a?.locale??s.locale??x,o=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,l=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,c=e(t);if(!u(c))throw new RangeError("Invalid time value");let d=i.match(j).map(t=>{const e=t[0];if("p"===e||"P"===e){return(0,R[e])(t,n.formatLong)}return t}).join("").match(W).map(t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:J(t)};if(H[e])return{isToken:!0,value:t};if(e.match(Q))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}});n.localize.preprocessor&&(d=n.localize.preprocessor(c,d));const h={firstWeekContainsDate:o,weekStartsOn:l,locale:n};return d.map(e=>{if(!e.isToken)return e.value;const s=e.value;(!a?.useAdditionalWeekYearTokens&&U(s)||!a?.useAdditionalDayOfYearTokens&&z(s))&&q(s,i,String(t));return(0,H[s[0]])(c,s,n.localize,h)}).join("")}function J(t){const e=t.match(G);return e?e[1].replace(K,"'"):t}function tt(t){const a=e(t),s=a.getFullYear(),n=a.getMonth(),r=i(t,0);return r.setFullYear(s,n+1,0),r.setHours(0,0,0,0),r.getDate()}function et(t){const i=e(t),a=i.getMonth();return i.setFullYear(i.getFullYear(),a+1,0),i.setHours(0,0,0,0),i}function it(t,i){const a=e(t),s=e(i);return a.getTime()>s.getTime()}function at(t,i){return+e(t)<+e(i)}function st(t,i){return+e(t)===+e(i)}class nt{subPriority=0;validate(t,e){return!0}}class rt extends nt{constructor(t,e,i,a,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=a,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class ot extends nt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:i(t,function(t,e){const a=e instanceof Date?i(e,0):new e(0);return a.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),a.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),a}(t,Date))}}class lt{run(t,e,i,a){const s=this.parse(t,e,i,a);return s?{setter:new rt(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}const ct=/^(1[0-2]|0?\d)/,dt=/^(3[0-1]|[0-2]?\d)/,ht=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,ut=/^(5[0-3]|[0-4]?\d)/,pt=/^(2[0-3]|[0-1]?\d)/,gt=/^(2[0-4]|[0-1]?\d)/,vt=/^(1[0-1]|0?\d)/,ft=/^(1[0-2]|0?\d)/,mt=/^[0-5]?\d/,wt=/^[0-5]?\d/,yt=/^\d/,bt=/^\d{1,2}/,xt=/^\d{1,3}/,Ct=/^\d{1,4}/,_t=/^-?\d+/,kt=/^-?\d/,Mt=/^-?\d{1,2}/,Zt=/^-?\d{1,3}/,Vt=/^-?\d{1,4}/,Dt=/^([+-])(\d{2})(\d{2})?|Z/,St=/^([+-])(\d{2})(\d{2})|Z/,At=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Bt=/^([+-])(\d{2}):(\d{2})|Z/,Et=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function Ft(t,e){return t?{value:e(t.value),rest:t.rest}:t}function Ht(t,e){const i=e.match(t);return i?{value:parseInt(i[0],10),rest:e.slice(i[0].length)}:null}function $t(t,e){const i=e.match(t);if(!i)return null;if("Z"===i[0])return{value:0,rest:e.slice(1)};return{value:("+"===i[1]?1:-1)*(36e5*(i[2]?parseInt(i[2],10):0)+6e4*(i[3]?parseInt(i[3],10):0)+1e3*(i[5]?parseInt(i[5],10):0)),rest:e.slice(i[0].length)}}function Tt(t){return Ht(_t,t)}function It(t,e){switch(t){case 1:return Ht(yt,e);case 2:return Ht(bt,e);case 3:return Ht(xt,e);case 4:return Ht(Ct,e);default:return Ht(new RegExp("^\\d{1,"+t+"}"),e)}}function Pt(t,e){switch(t){case 1:return Ht(kt,e);case 2:return Ht(Mt,e);case 3:return Ht(Zt,e);case 4:return Ht(Vt,e);default:return Ht(new RegExp("^-?\\d{1,"+t+"}"),e)}}function Lt(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Rt(t,e){const i=e>0,a=i?e:1-e;let s;if(a<=50)s=t||100;else{const e=a+50;s=t+100*Math.trunc(e/100)-(t>=e%100?100:0)}return i?s:1-s}function Ot(t){return t%400==0||t%4==0&&t%100!=0}const Yt=[31,28,31,30,31,30,31,31,30,31,30,31],Nt=[31,29,31,30,31,30,31,31,30,31,30,31];function zt(t,i,s){const n=r(),o=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=e(t),c=l.getDay(),d=7-o;return a(l,i<0||i>6?i-(c+d)%7:((i%7+7)%7+d)%7-(c+d)%7)}function Ut(t,i){const s=e(t),n=function(t){let i=e(t).getDay();return 0===i&&(i=7),i}(s);return a(s,i-n)}const qt={G:new class extends lt{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends lt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const a=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return Ft(It(4,t),a);case"yo":return Ft(i.ordinalNumber(t,{unit:"year"}),a);default:return Ft(It(e.length,t),a)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const a=t.getFullYear();if(i.isTwoDigitYear){const e=Rt(i.year,a);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const s="era"in e&&1!==e.era?1-i.year:i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}},Y:new class extends lt{priority=130;parse(t,e,i){const a=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return Ft(It(4,t),a);case"Yo":return Ft(i.ordinalNumber(t,{unit:"year"}),a);default:return Ft(It(e.length,t),a)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,a){const s=k(t,a);if(i.isTwoDigitYear){const e=Rt(i.year,s);return t.setFullYear(e,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),o(t,a)}const n="era"in e&&1!==e.era?1-i.year:i.year;return t.setFullYear(n,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),o(t,a)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends lt{priority=130;parse(t,e){return Pt("R"===e?4:e.length,t)}set(t,e,a){const s=i(t,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),l(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends lt{priority=130;parse(t,e){return Pt("u"===e?4:e.length,t)}set(t,e,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends lt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return It(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth(3*(i-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends lt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return It(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth(3*(i-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends lt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const a=t=>t-1;switch(e){case"M":return Ft(Ht(ct,t),a);case"MM":return Ft(It(2,t),a);case"Mo":return Ft(i.ordinalNumber(t,{unit:"month"}),a);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}},L:new class extends lt{priority=110;parse(t,e,i){const a=t=>t-1;switch(e){case"L":return Ft(Ht(ct,t),a);case"LL":return Ft(It(2,t),a);case"Lo":return Ft(i.ordinalNumber(t,{unit:"month"}),a);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends lt{priority=100;parse(t,e,i){switch(e){case"w":return Ht(ut,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return It(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,i,a,s){return o(function(t,i,a){const s=e(t),n=M(s,a)-i;return s.setDate(s.getDate()-7*n),s}(t,a,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends lt{priority=100;parse(t,e,i){switch(e){case"I":return Ht(ut,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return It(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,i,a){return l(function(t,i){const a=e(t),s=_(a)-i;return a.setDate(a.getDate()-7*s),a}(t,a))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends lt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return Ht(dt,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return It(e.length,t)}}validate(t,e){const i=Ot(t.getFullYear()),a=t.getMonth();return i?e>=1&&e<=Nt[a]:e>=1&&e<=Yt[a]}set(t,e,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends lt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return Ht(ht,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return It(e.length,t)}}validate(t,e){return Ot(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends lt{priority=90;parse(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,a){return(t=zt(t,i,a)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends lt{priority=90;parse(t,e,i,a){const s=t=>{const e=7*Math.floor((t-1)/7);return(t+a.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return Ft(It(e.length,t),s);case"eo":return Ft(i.ordinalNumber(t,{unit:"day"}),s);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,a){return(t=zt(t,i,a)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends lt{priority=90;parse(t,e,i,a){const s=t=>{const e=7*Math.floor((t-1)/7);return(t+a.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return Ft(It(e.length,t),s);case"co":return Ft(i.ordinalNumber(t,{unit:"day"}),s);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,a){return(t=zt(t,i,a)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends lt{priority=90;parse(t,e,i){const a=t=>0===t?7:t;switch(e){case"i":case"ii":return It(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Ft(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ft(i.day(t,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ft(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),a);default:return Ft(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),a)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return(t=Ut(t,i)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends lt{priority=80;parse(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Lt(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends lt{priority=80;parse(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Lt(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends lt{priority=80;parse(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Lt(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends lt{priority=70;parse(t,e,i){switch(e){case"h":return Ht(ft,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return It(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const a=t.getHours()>=12;return a&&i<12?t.setHours(i+12,0,0,0):a||12!==i?t.setHours(i,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends lt{priority=70;parse(t,e,i){switch(e){case"H":return Ht(pt,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return It(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends lt{priority=70;parse(t,e,i){switch(e){case"K":return Ht(vt,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return It(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends lt{priority=70;parse(t,e,i){switch(e){case"k":return Ht(gt,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return It(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const a=i<=24?i%24:i;return t.setHours(a,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends lt{priority=60;parse(t,e,i){switch(e){case"m":return Ht(mt,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return It(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]},s:new class extends lt{priority=50;parse(t,e,i){switch(e){case"s":return Ht(wt,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return It(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]},S:new class extends lt{priority=30;parse(t,e){return Ft(It(e.length,t),t=>Math.trunc(t*Math.pow(10,3-e.length)))}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]},X:new class extends lt{priority=10;parse(t,e){switch(e){case"X":return $t(Dt,t);case"XX":return $t(St,t);case"XXXX":return $t(At,t);case"XXXXX":return $t(Et,t);default:return $t(Bt,t)}}set(t,e,a){return e.timestampIsSet?t:i(t,t.getTime()-h(t)-a)}incompatibleTokens=["t","T","x"]},x:new class extends lt{priority=10;parse(t,e){switch(e){case"x":return $t(Dt,t);case"xx":return $t(St,t);case"xxxx":return $t(At,t);case"xxxxx":return $t(Et,t);default:return $t(Bt,t)}}set(t,e,a){return e.timestampIsSet?t:i(t,t.getTime()-h(t)-a)}incompatibleTokens=["t","T","X"]},t:new class extends lt{priority=40;parse(t){return Tt(t)}set(t,e,a){return[i(t,1e3*a),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends lt{priority=20;parse(t){return Tt(t)}set(t,e,a){return[i(t,a),{timestampIsSet:!0}]}incompatibleTokens="*"}},Wt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gt=/^'([^]*?)'?$/,Kt=/''/g,Qt=/\S/,Xt=/[a-zA-Z]/;function Jt(t,a,s,n){const o=Object.assign({},r()),l=n?.locale??o.locale??x,c=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,d=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===a)return""===t?e(s):i(s,NaN);const h={firstWeekContainsDate:c,weekStartsOn:d,locale:l},u=[new ot],p=a.match(jt).map(t=>{const e=t[0];if(e in R){return(0,R[e])(t,l.formatLong)}return t}).join("").match(Wt),g=[];for(let e of p){!n?.useAdditionalWeekYearTokens&&U(e)&&q(e,a,t),!n?.useAdditionalDayOfYearTokens&&z(e)&&q(e,a,t);const r=e[0],o=qt[r];if(o){const{incompatibleTokens:a}=o;if(Array.isArray(a)){const t=g.find(t=>a.includes(t.token)||t.token===r);if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${e}\` at the same time`)}else if("*"===o.incompatibleTokens&&g.length>0)throw new RangeError(`The format string mustn't contain \`${e}\` and any other token at the same time`);g.push({token:r,fullToken:e});const n=o.run(t,e,l.match,h);if(!n)return i(s,NaN);u.push(n.setter),t=n.rest}else{if(r.match(Xt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");if("''"===e?e="'":"'"===r&&(e=te(e)),0!==t.indexOf(e))return i(s,NaN);t=t.slice(e.length)}}if(t.length>0&&Qt.test(t))return i(s,NaN);const v=u.map(t=>t.priority).sort((t,e)=>e-t).filter((t,e,i)=>i.indexOf(t)===e).map(t=>u.filter(e=>e.priority===t).sort((t,e)=>e.subPriority-t.subPriority)).map(t=>t[0]);let f=e(s);if(isNaN(f.getTime()))return i(s,NaN);const m={};for(const t of v){if(!t.validate(f,h))return i(s,NaN);const e=t.set(f,m,h);Array.isArray(e)?(f=e[0],Object.assign(m,e[1])):f=e}return i(s,f)}function te(t){return t.match(Gt)[1].replace(Kt,"'")}
1
+ !function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";function t(t,e,i,a){var s,n=arguments.length,r=n<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,a);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}function e(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function i(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function a(t,a){const s=e(t);return isNaN(a)?i(t,NaN):a?(s.setDate(s.getDate()+a),s):s}"function"==typeof SuppressedError&&SuppressedError;const s=6048e5;let n={};function r(){return n}function o(t,i){const a=r(),s=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,n=e(t),o=n.getDay(),l=(o<s?7:0)+o-s;return n.setDate(n.getDate()-l),n.setHours(0,0,0,0),n}function l(t){return o(t,{weekStartsOn:1})}function c(t){const a=e(t),s=a.getFullYear(),n=i(t,0);n.setFullYear(s+1,0,4),n.setHours(0,0,0,0);const r=l(n),o=i(t,0);o.setFullYear(s,0,4),o.setHours(0,0,0,0);const c=l(o);return a.getTime()>=r.getTime()?s+1:a.getTime()>=c.getTime()?s:s-1}function d(t){const i=e(t);return i.setHours(0,0,0,0),i}function h(t){const i=e(t),a=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return a.setUTCFullYear(i.getFullYear()),+t-+a}function u(t){if(!(i=t,i instanceof Date||"object"==typeof i&&"[object Date]"===Object.prototype.toString.call(i)||"number"==typeof t))return!1;var i;const a=e(t);return!isNaN(Number(a))}function p(t){const i=e(t);return+function(t){const i=e(t);return i.setHours(23,59,59,999),i}(i)===+function(t){const i=e(t),a=i.getMonth();return i.setFullYear(i.getFullYear(),a+1,0),i.setHours(23,59,59,999),i}(i)}const g={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function v(t){return(e={})=>{const i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}const f={date:v({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:v({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:v({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},m={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function w(t){return(e,i)=>{let a;if("formatting"===(i?.context?String(i.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,s=i?.width?String(i.width):e;a=t.formattingValues[s]||t.formattingValues[e]}else{const e=t.defaultWidth,s=i?.width?String(i.width):t.defaultWidth;a=t.values[s]||t.values[e]}return a[t.argumentCallback?t.argumentCallback(e):e]}}function y(t){return(e,i={})=>{const a=i.width,s=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],n=e.match(s);if(!n)return null;const r=n[0],o=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(o)?function(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return i;return}(o,t=>t.test(r)):function(t,e){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e(t[i]))return i;return}(o,t=>t.test(r));let c;c=t.valueCallback?t.valueCallback(l):l,c=i.valueCallback?i.valueCallback(c):c;return{value:c,rest:e.slice(r.length)}}}var b;const x={code:"en-US",formatDistance:(t,e,i)=>{let a;const s=g[t];return a="string"==typeof s?s:1===e?s.one:s.other.replace("{{count}}",e.toString()),i?.addSuffix?i.comparison&&i.comparison>0?"in "+a:a+" ago":a},formatLong:f,formatRelative:(t,e,i,a)=>m[t],localize:{ordinalNumber:(t,e)=>{const i=Number(t),a=i%100;if(a>20||a<10)switch(a%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:w({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:w({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:w({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:w({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:w({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(b={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const i=t.match(b.matchPattern);if(!i)return null;const a=i[0],s=t.match(b.parsePattern);if(!s)return null;let n=b.valueCallback?b.valueCallback(s[0]):s[0];return n=e.valueCallback?e.valueCallback(n):n,{value:n,rest:t.slice(a.length)}}),era:y({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:y({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:y({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:y({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:y({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function _(t){const a=e(t),s=function(t,e){const i=d(t),a=d(e),s=+i-h(i),n=+a-h(a);return Math.round((s-n)/864e5)}(a,function(t){const a=e(t),s=i(t,0);return s.setFullYear(a.getFullYear(),0,1),s.setHours(0,0,0,0),s}(a));return s+1}function C(t){const a=e(t),n=+l(a)-+function(t){const e=c(t),a=i(t,0);return a.setFullYear(e,0,4),a.setHours(0,0,0,0),l(a)}(a);return Math.round(n/s)+1}function k(t,a){const s=e(t),n=s.getFullYear(),l=r(),c=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,d=i(t,0);d.setFullYear(n+1,0,c),d.setHours(0,0,0,0);const h=o(d,a),u=i(t,0);u.setFullYear(n,0,c),u.setHours(0,0,0,0);const p=o(u,a);return s.getTime()>=h.getTime()?n+1:s.getTime()>=p.getTime()?n:n-1}function M(t,a){const n=e(t),l=+o(n,a)-+function(t,e){const a=r(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,n=k(t,e),l=i(t,0);return l.setFullYear(n,0,s),l.setHours(0,0,0,0),o(l,e)}(n,a);return Math.round(l/s)+1}function Z(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const V={y(t,e){const i=t.getFullYear(),a=i>0?i:1-i;return Z("yy"===e?a%100:a,e.length)},M(t,e){const i=t.getMonth();return"M"===e?String(i+1):Z(i+1,2)},d:(t,e)=>Z(t.getDate(),e.length),a(t,e){const i=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];default:return"am"===i?"a.m.":"p.m."}},h:(t,e)=>Z(t.getHours()%12||12,e.length),H:(t,e)=>Z(t.getHours(),e.length),m:(t,e)=>Z(t.getMinutes(),e.length),s:(t,e)=>Z(t.getSeconds(),e.length),S(t,e){const i=e.length,a=t.getMilliseconds();return Z(Math.trunc(a*Math.pow(10,i-3)),e.length)}},S="midnight",D="noon",A="morning",B="afternoon",E="evening",F="night",H={G:function(t,e,i){const a=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(a,{width:"abbreviated"});case"GGGGG":return i.era(a,{width:"narrow"});default:return i.era(a,{width:"wide"})}},y:function(t,e,i){if("yo"===e){const e=t.getFullYear(),a=e>0?e:1-e;return i.ordinalNumber(a,{unit:"year"})}return V.y(t,e)},Y:function(t,e,i,a){const s=k(t,a),n=s>0?s:1-s;if("YY"===e){return Z(n%100,2)}return"Yo"===e?i.ordinalNumber(n,{unit:"year"}):Z(n,e.length)},R:function(t,e){return Z(c(t),e.length)},u:function(t,e){return Z(t.getFullYear(),e.length)},Q:function(t,e,i){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return Z(a,2);case"Qo":return i.ordinalNumber(a,{unit:"quarter"});case"QQQ":return i.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(a,{width:"narrow",context:"formatting"});default:return i.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,i){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return Z(a,2);case"qo":return i.ordinalNumber(a,{unit:"quarter"});case"qqq":return i.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(a,{width:"narrow",context:"standalone"});default:return i.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,i){const a=t.getMonth();switch(e){case"M":case"MM":return V.M(t,e);case"Mo":return i.ordinalNumber(a+1,{unit:"month"});case"MMM":return i.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(a,{width:"narrow",context:"formatting"});default:return i.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,i){const a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return Z(a+1,2);case"Lo":return i.ordinalNumber(a+1,{unit:"month"});case"LLL":return i.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(a,{width:"narrow",context:"standalone"});default:return i.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,i,a){const s=M(t,a);return"wo"===e?i.ordinalNumber(s,{unit:"week"}):Z(s,e.length)},I:function(t,e,i){const a=C(t);return"Io"===e?i.ordinalNumber(a,{unit:"week"}):Z(a,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getDate(),{unit:"date"}):V.d(t,e)},D:function(t,e,i){const a=_(t);return"Do"===e?i.ordinalNumber(a,{unit:"dayOfYear"}):Z(a,e.length)},E:function(t,e,i){const a=t.getDay();switch(e){case"E":case"EE":case"EEE":return i.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(a,{width:"short",context:"formatting"});default:return i.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,i,a){const s=t.getDay(),n=(s-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(n);case"ee":return Z(n,2);case"eo":return i.ordinalNumber(n,{unit:"day"});case"eee":return i.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(s,{width:"short",context:"formatting"});default:return i.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,i,a){const s=t.getDay(),n=(s-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(n);case"cc":return Z(n,e.length);case"co":return i.ordinalNumber(n,{unit:"day"});case"ccc":return i.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(s,{width:"narrow",context:"standalone"});case"cccccc":return i.day(s,{width:"short",context:"standalone"});default:return i.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,i){const a=t.getDay(),s=0===a?7:a;switch(e){case"i":return String(s);case"ii":return Z(s,e.length);case"io":return i.ordinalNumber(s,{unit:"day"});case"iii":return i.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(a,{width:"short",context:"formatting"});default:return i.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,i){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(a,{width:"narrow",context:"formatting"});default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,i){const a=t.getHours();let s;switch(s=12===a?D:0===a?S:a/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,i){const a=t.getHours();let s;switch(s=a>=17?E:a>=12?B:a>=4?A:F,e){case"B":case"BB":case"BBB":return i.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(s,{width:"narrow",context:"formatting"});default:return i.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),i.ordinalNumber(e,{unit:"hour"})}return V.h(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getHours(),{unit:"hour"}):V.H(t,e)},K:function(t,e,i){const a=t.getHours()%12;return"Ko"===e?i.ordinalNumber(a,{unit:"hour"}):Z(a,e.length)},k:function(t,e,i){let a=t.getHours();return 0===a&&(a=24),"ko"===e?i.ordinalNumber(a,{unit:"hour"}):Z(a,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getMinutes(),{unit:"minute"}):V.m(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getSeconds(),{unit:"second"}):V.s(t,e)},S:function(t,e){return V.S(t,e)},X:function(t,e,i){const a=t.getTimezoneOffset();if(0===a)return"Z";switch(e){case"X":return T(a);case"XXXX":case"XX":return I(a);default:return I(a,":")}},x:function(t,e,i){const a=t.getTimezoneOffset();switch(e){case"x":return T(a);case"xxxx":case"xx":return I(a);default:return I(a,":")}},O:function(t,e,i){const a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+$(a,":");default:return"GMT"+I(a,":")}},z:function(t,e,i){const a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+$(a,":");default:return"GMT"+I(a,":")}},t:function(t,e,i){return Z(Math.trunc(t.getTime()/1e3),e.length)},T:function(t,e,i){return Z(t.getTime(),e.length)}};function $(t,e=""){const i=t>0?"-":"+",a=Math.abs(t),s=Math.trunc(a/60),n=a%60;return 0===n?i+String(s):i+String(s)+e+Z(n,2)}function T(t,e){if(t%60==0){return(t>0?"-":"+")+Z(Math.abs(t)/60,2)}return I(t,e)}function I(t,e=""){const i=t>0?"-":"+",a=Math.abs(t);return i+Z(Math.trunc(a/60),2)+e+Z(a%60,2)}const P=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},L=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},R={p:L,P:(t,e)=>{const i=t.match(/(P+)(p+)?/)||[],a=i[1],s=i[2];if(!s)return P(t,e);let n;switch(a){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",P(a,e)).replace("{{time}}",L(s,e))}},O=/^D+$/,Y=/^Y+$/,N=["D","DD","YY","YYYY"];function z(t){return O.test(t)}function U(t){return Y.test(t)}function q(t,e,i){const a=function(t,e,i){const a="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${i}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,i);if(console.warn(a),N.includes(t))throw new RangeError(a)}const W=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,j=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,G=/^'([^]*?)'?$/,K=/''/g,Q=/[a-zA-Z]/;function X(t,i,a){const s=r(),n=a?.locale??s.locale??x,o=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,l=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,c=e(t);if(!u(c))throw new RangeError("Invalid time value");let d=i.match(j).map(t=>{const e=t[0];if("p"===e||"P"===e){return(0,R[e])(t,n.formatLong)}return t}).join("").match(W).map(t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:J(t)};if(H[e])return{isToken:!0,value:t};if(e.match(Q))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}});n.localize.preprocessor&&(d=n.localize.preprocessor(c,d));const h={firstWeekContainsDate:o,weekStartsOn:l,locale:n};return d.map(e=>{if(!e.isToken)return e.value;const s=e.value;(!a?.useAdditionalWeekYearTokens&&U(s)||!a?.useAdditionalDayOfYearTokens&&z(s))&&q(s,i,String(t));return(0,H[s[0]])(c,s,n.localize,h)}).join("")}function J(t){const e=t.match(G);return e?e[1].replace(K,"'"):t}function tt(t){const a=e(t),s=a.getFullYear(),n=a.getMonth(),r=i(t,0);return r.setFullYear(s,n+1,0),r.setHours(0,0,0,0),r.getDate()}function et(t){const i=e(t),a=i.getMonth();return i.setFullYear(i.getFullYear(),a+1,0),i.setHours(0,0,0,0),i}function it(t,i){const a=e(t),s=e(i);return a.getTime()>s.getTime()}function at(t,i){return+e(t)<+e(i)}function st(t,i){return+e(t)===+e(i)}class nt{subPriority=0;validate(t,e){return!0}}class rt extends nt{constructor(t,e,i,a,s){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=a,s&&(this.subPriority=s)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class ot extends nt{priority=10;subPriority=-1;set(t,e){return e.timestampIsSet?t:i(t,function(t,e){const a=e instanceof Date?i(e,0):new e(0);return a.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),a.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),a}(t,Date))}}class lt{run(t,e,i,a){const s=this.parse(t,e,i,a);return s?{setter:new rt(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,e,i){return!0}}const ct=/^(1[0-2]|0?\d)/,dt=/^(3[0-1]|[0-2]?\d)/,ht=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,ut=/^(5[0-3]|[0-4]?\d)/,pt=/^(2[0-3]|[0-1]?\d)/,gt=/^(2[0-4]|[0-1]?\d)/,vt=/^(1[0-1]|0?\d)/,ft=/^(1[0-2]|0?\d)/,mt=/^[0-5]?\d/,wt=/^[0-5]?\d/,yt=/^\d/,bt=/^\d{1,2}/,xt=/^\d{1,3}/,_t=/^\d{1,4}/,Ct=/^-?\d+/,kt=/^-?\d/,Mt=/^-?\d{1,2}/,Zt=/^-?\d{1,3}/,Vt=/^-?\d{1,4}/,St=/^([+-])(\d{2})(\d{2})?|Z/,Dt=/^([+-])(\d{2})(\d{2})|Z/,At=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,Bt=/^([+-])(\d{2}):(\d{2})|Z/,Et=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function Ft(t,e){return t?{value:e(t.value),rest:t.rest}:t}function Ht(t,e){const i=e.match(t);return i?{value:parseInt(i[0],10),rest:e.slice(i[0].length)}:null}function $t(t,e){const i=e.match(t);if(!i)return null;if("Z"===i[0])return{value:0,rest:e.slice(1)};return{value:("+"===i[1]?1:-1)*(36e5*(i[2]?parseInt(i[2],10):0)+6e4*(i[3]?parseInt(i[3],10):0)+1e3*(i[5]?parseInt(i[5],10):0)),rest:e.slice(i[0].length)}}function Tt(t){return Ht(Ct,t)}function It(t,e){switch(t){case 1:return Ht(yt,e);case 2:return Ht(bt,e);case 3:return Ht(xt,e);case 4:return Ht(_t,e);default:return Ht(new RegExp("^\\d{1,"+t+"}"),e)}}function Pt(t,e){switch(t){case 1:return Ht(kt,e);case 2:return Ht(Mt,e);case 3:return Ht(Zt,e);case 4:return Ht(Vt,e);default:return Ht(new RegExp("^-?\\d{1,"+t+"}"),e)}}function Lt(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Rt(t,e){const i=e>0,a=i?e:1-e;let s;if(a<=50)s=t||100;else{const e=a+50;s=t+100*Math.trunc(e/100)-(t>=e%100?100:0)}return i?s:1-s}function Ot(t){return t%400==0||t%4==0&&t%100!=0}const Yt=[31,28,31,30,31,30,31,31,30,31,30,31],Nt=[31,29,31,30,31,30,31,31,30,31,30,31];function zt(t,i,s){const n=r(),o=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=e(t),c=l.getDay(),d=7-o;return a(l,i<0||i>6?i-(c+d)%7:((i%7+7)%7+d)%7-(c+d)%7)}function Ut(t,i){const s=e(t),n=function(t){let i=e(t).getDay();return 0===i&&(i=7),i}(s);return a(s,i-n)}const qt={G:new class extends lt{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]},y:new class extends lt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){const a=t=>({year:t,isTwoDigitYear:"yy"===e});switch(e){case"y":return Ft(It(4,t),a);case"yo":return Ft(i.ordinalNumber(t,{unit:"year"}),a);default:return Ft(It(e.length,t),a)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){const a=t.getFullYear();if(i.isTwoDigitYear){const e=Rt(i.year,a);return t.setFullYear(e,0,1),t.setHours(0,0,0,0),t}const s="era"in e&&1!==e.era?1-i.year:i.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}},Y:new class extends lt{priority=130;parse(t,e,i){const a=t=>({year:t,isTwoDigitYear:"YY"===e});switch(e){case"Y":return Ft(It(4,t),a);case"Yo":return Ft(i.ordinalNumber(t,{unit:"year"}),a);default:return Ft(It(e.length,t),a)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,a){const s=k(t,a);if(i.isTwoDigitYear){const e=Rt(i.year,s);return t.setFullYear(e,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),o(t,a)}const n="era"in e&&1!==e.era?1-i.year:i.year;return t.setFullYear(n,0,a.firstWeekContainsDate),t.setHours(0,0,0,0),o(t,a)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends lt{priority=130;parse(t,e){return Pt("R"===e?4:e.length,t)}set(t,e,a){const s=i(t,0);return s.setFullYear(a,0,4),s.setHours(0,0,0,0),l(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends lt{priority=130;parse(t,e){return Pt("u"===e?4:e.length,t)}set(t,e,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends lt{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return It(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth(3*(i-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends lt{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return It(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth(3*(i-1),1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends lt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){const a=t=>t-1;switch(e){case"M":return Ft(Ht(ct,t),a);case"MM":return Ft(It(2,t),a);case"Mo":return Ft(i.ordinalNumber(t,{unit:"month"}),a);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}},L:new class extends lt{priority=110;parse(t,e,i){const a=t=>t-1;switch(e){case"L":return Ft(Ht(ct,t),a);case"LL":return Ft(It(2,t),a);case"Lo":return Ft(i.ordinalNumber(t,{unit:"month"}),a);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends lt{priority=100;parse(t,e,i){switch(e){case"w":return Ht(ut,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return It(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,i,a,s){return o(function(t,i,a){const s=e(t),n=M(s,a)-i;return s.setDate(s.getDate()-7*n),s}(t,a,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends lt{priority=100;parse(t,e,i){switch(e){case"I":return Ht(ut,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return It(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,i,a){return l(function(t,i){const a=e(t),s=C(a)-i;return a.setDate(a.getDate()-7*s),a}(t,a))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends lt{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return Ht(dt,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return It(e.length,t)}}validate(t,e){const i=Ot(t.getFullYear()),a=t.getMonth();return i?e>=1&&e<=Nt[a]:e>=1&&e<=Yt[a]}set(t,e,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends lt{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return Ht(ht,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return It(e.length,t)}}validate(t,e){return Ot(t.getFullYear())?e>=1&&e<=366:e>=1&&e<=365}set(t,e,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends lt{priority=90;parse(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,a){return(t=zt(t,i,a)).setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends lt{priority=90;parse(t,e,i,a){const s=t=>{const e=7*Math.floor((t-1)/7);return(t+a.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return Ft(It(e.length,t),s);case"eo":return Ft(i.ordinalNumber(t,{unit:"day"}),s);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,a){return(t=zt(t,i,a)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends lt{priority=90;parse(t,e,i,a){const s=t=>{const e=7*Math.floor((t-1)/7);return(t+a.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return Ft(It(e.length,t),s);case"co":return Ft(i.ordinalNumber(t,{unit:"day"}),s);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,a){return(t=zt(t,i,a)).setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends lt{priority=90;parse(t,e,i){const a=t=>0===t?7:t;switch(e){case"i":case"ii":return It(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Ft(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),a);case"iiiii":return Ft(i.day(t,{width:"narrow",context:"formatting"}),a);case"iiiiii":return Ft(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),a);default:return Ft(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),a)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return(t=Ut(t,i)).setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends lt{priority=80;parse(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Lt(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends lt{priority=80;parse(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Lt(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends lt{priority=80;parse(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(Lt(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]},h:new class extends lt{priority=70;parse(t,e,i){switch(e){case"h":return Ht(ft,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return It(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){const a=t.getHours()>=12;return a&&i<12?t.setHours(i+12,0,0,0):a||12!==i?t.setHours(i,0,0,0):t.setHours(0,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]},H:new class extends lt{priority=70;parse(t,e,i){switch(e){case"H":return Ht(pt,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return It(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends lt{priority=70;parse(t,e,i){switch(e){case"K":return Ht(vt,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return It(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]},k:new class extends lt{priority=70;parse(t,e,i){switch(e){case"k":return Ht(gt,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return It(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){const a=i<=24?i%24:i;return t.setHours(a,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends lt{priority=60;parse(t,e,i){switch(e){case"m":return Ht(mt,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return It(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]},s:new class extends lt{priority=50;parse(t,e,i){switch(e){case"s":return Ht(wt,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return It(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]},S:new class extends lt{priority=30;parse(t,e){return Ft(It(e.length,t),t=>Math.trunc(t*Math.pow(10,3-e.length)))}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]},X:new class extends lt{priority=10;parse(t,e){switch(e){case"X":return $t(St,t);case"XX":return $t(Dt,t);case"XXXX":return $t(At,t);case"XXXXX":return $t(Et,t);default:return $t(Bt,t)}}set(t,e,a){return e.timestampIsSet?t:i(t,t.getTime()-h(t)-a)}incompatibleTokens=["t","T","x"]},x:new class extends lt{priority=10;parse(t,e){switch(e){case"x":return $t(St,t);case"xx":return $t(Dt,t);case"xxxx":return $t(At,t);case"xxxxx":return $t(Et,t);default:return $t(Bt,t)}}set(t,e,a){return e.timestampIsSet?t:i(t,t.getTime()-h(t)-a)}incompatibleTokens=["t","T","X"]},t:new class extends lt{priority=40;parse(t){return Tt(t)}set(t,e,a){return[i(t,1e3*a),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends lt{priority=20;parse(t){return Tt(t)}set(t,e,a){return[i(t,a),{timestampIsSet:!0}]}incompatibleTokens="*"}},Wt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gt=/^'([^]*?)'?$/,Kt=/''/g,Qt=/\S/,Xt=/[a-zA-Z]/;function Jt(t,a,s,n){const o=Object.assign({},r()),l=n?.locale??o.locale??x,c=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,d=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(""===a)return""===t?e(s):i(s,NaN);const h={firstWeekContainsDate:c,weekStartsOn:d,locale:l},u=[new ot],p=a.match(jt).map(t=>{const e=t[0];if(e in R){return(0,R[e])(t,l.formatLong)}return t}).join("").match(Wt),g=[];for(let e of p){!n?.useAdditionalWeekYearTokens&&U(e)&&q(e,a,t),!n?.useAdditionalDayOfYearTokens&&z(e)&&q(e,a,t);const r=e[0],o=qt[r];if(o){const{incompatibleTokens:a}=o;if(Array.isArray(a)){const t=g.find(t=>a.includes(t.token)||t.token===r);if(t)throw new RangeError(`The format string mustn't contain \`${t.fullToken}\` and \`${e}\` at the same time`)}else if("*"===o.incompatibleTokens&&g.length>0)throw new RangeError(`The format string mustn't contain \`${e}\` and any other token at the same time`);g.push({token:r,fullToken:e});const n=o.run(t,e,l.match,h);if(!n)return i(s,NaN);u.push(n.setter),t=n.rest}else{if(r.match(Xt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");if("''"===e?e="'":"'"===r&&(e=te(e)),0!==t.indexOf(e))return i(s,NaN);t=t.slice(e.length)}}if(t.length>0&&Qt.test(t))return i(s,NaN);const v=u.map(t=>t.priority).sort((t,e)=>e-t).filter((t,e,i)=>i.indexOf(t)===e).map(t=>u.filter(e=>e.priority===t).sort((t,e)=>e.subPriority-t.subPriority)).map(t=>t[0]);let f=e(s);if(isNaN(f.getTime()))return i(s,NaN);const m={};for(const t of v){if(!t.validate(f,h))return i(s,NaN);const e=t.set(f,m,h);Array.isArray(e)?(f=e[0],Object.assign(m,e[1])):f=e}return i(s,f)}function te(t){return t.match(Gt)[1].replace(Kt,"'")}
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const ee=globalThis,ie=ee.ShadowRoot&&(void 0===ee.ShadyCSS||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ae=Symbol(),se=new WeakMap;class ne{constructor(t,e,i){if(this._$cssResult$=!0,i!==ae)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this._strings=e}get styleSheet(){let t=this._styleSheet;const e=this._strings;if(ie&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=se.get(e)),void 0===t&&((this._styleSheet=t=new CSSStyleSheet).replaceSync(this.cssText),i&&se.set(e,t))}return t}toString(){return this.cssText}}const re=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,a)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(i)+t[a+1],t[0]);return new ne(i,t,ae)},oe=t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return new ne("string"==typeof(i=e)?i:String(i),void 0,ae);var i},le=ie?t=>t:t=>t instanceof CSSStyleSheet?oe(t):t,{is:ce,defineProperty:de,getOwnPropertyDescriptor:he,getOwnPropertyNames:ue,getOwnPropertySymbols:pe,getPrototypeOf:ge}=Object,ve=globalThis;let fe;const me=ve.trustedTypes,we=me?me.emptyScript:"",ye=ve.reactiveElementPolyfillSupportDevMode;ve.litIssuedWarnings??=new Set,fe=(t,e)=>{e+=` See https://lit.dev/msg/${t} for more information.`,ve.litIssuedWarnings.has(e)||ve.litIssuedWarnings.has(t)||(console.warn(e),ve.litIssuedWarnings.add(e))},queueMicrotask(()=>{fe("dev-mode","Lit is in dev mode. Not recommended for production!"),ve.ShadyDOM?.inUse&&void 0===ye&&fe("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")});const be=(t,e)=>t,xe={toAttribute(t,e){switch(e){case Boolean:t=t?we:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},Ce=(t,e)=>!ce(t,e),_e={attribute:!0,type:String,converter:xe,reflect:!1,useDefault:!1,hasChanged:Ce};Symbol.metadata??=Symbol("metadata"),ve.litPropertyMetadata??=new WeakMap;class ke extends HTMLElement{static addInitializer(t){this.__prepare(),(this._initializers??=[]).push(t)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(t,e=_e){if(e.state&&(e.attribute=!1),this.__prepare(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol.for(`${String(t)} (@property() cache)`),a=this.getPropertyDescriptor(t,i,e);void 0!==a&&de(this.prototype,t,a)}}static getPropertyDescriptor(t,e,i){const{get:a,set:s}=he(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};if(null==a){if("value"in(he(this.prototype,t)??{}))throw new Error(`Field ${JSON.stringify(String(t))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);fe("reactive-property-without-getter",`Field ${JSON.stringify(String(t))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get:a,set(e){const n=a?.call(this);s?.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_e}static __prepare(){if(this.hasOwnProperty(be("elementProperties")))return;const t=ge(this);t.finalize(),void 0!==t._initializers&&(this._initializers=[...t._initializers]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(be("finalized")))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(be("properties"))){const t=this.properties,e=[...ue(t),...pe(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this.__attributeToPropertyMap=new Map;for(const[t,e]of this.elementProperties){const i=this.__attributeNameForProperty(t,e);void 0!==i&&this.__attributeToPropertyMap.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty("createProperty")&&fe("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"),this.hasOwnProperty("getPropertyDescriptor")&&fe("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(le(t))}else void 0!==t&&e.push(le(t));return e}static __attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise(t=>this.enableUpdating=t),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach(t=>t(this))}addController(t){(this.__controllers??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this.__controllers?.delete(t)}__saveInstanceProperties(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this.__instanceProperties=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(ie)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),a=ee.litNonce;void 0!==a&&e.setAttribute("nonce",a),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this.__controllers?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$attributeToProperty(t,i)}__propertyToAttribute(t,e){const i=this.constructor.elementProperties.get(t),a=this.constructor.__attributeNameForProperty(t,i);if(void 0!==a&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:xe).toAttribute(e,i.type);this.constructor.enabledWarnings.includes("migration")&&void 0===s&&fe("undefined-attribute-value",`The attribute value for the ${t} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=t,null==s?this.removeAttribute(a):this.setAttribute(a,s),this.__reflectingProperty=null}}_$attributeToProperty(t,e){const i=this.constructor,a=i.__attributeToPropertyMap.get(t);if(void 0!==a&&this.__reflectingProperty!==a){const t=i.getPropertyOptions(a),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:xe;this.__reflectingProperty=a;const n=s.fromAttribute(e,t.type);this[a]=n??this.__defaultValues?.get(a)??n,this.__reflectingProperty=null}}requestUpdate(t,e,i,a=!1,s){if(void 0!==t){t instanceof Event&&fe("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()");const n=this.constructor;!1===a&&(s=this[t]),i??=n.getPropertyOptions(t);if(!((i.hasChanged??Ce)(s,e)||i.useDefault&&i.reflect&&s===this.__defaultValues?.get(t)&&!this.hasAttribute(n.__attributeNameForProperty(t,i))))return;this._$changeProperty(t,e,i)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(t,e,{useDefault:i,reflect:a,wrapped:s},n){i&&!(this.__defaultValues??=new Map).has(t)&&(this.__defaultValues.set(t,n??e??this[t]),!0!==s||void 0!==n)||(this._$changedProperties.has(t)||(this.hasUpdated||i||(e=void 0),this._$changedProperties.set(t,e)),!0===a&&this.__reflectingProperty!==t&&(this.__reflectingProperties??=new Set).add(t))}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){const t=this.performUpdate();return this.constructor.enabledWarnings.includes("async-perform-update")&&"function"==typeof t?.then&&fe("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),t}performUpdate(){if(!this.isUpdatePending)return;var t;if(t={kind:"update"},ve.emitLitDebugLogEvents&&ve.dispatchEvent(new CustomEvent("lit-debug",{detail:t})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const t=[...this.constructor.elementProperties.keys()].filter(t=>this.hasOwnProperty(t)&&t in ge(this));if(t.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${t.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[t,e]of this.__instanceProperties)this[t]=e;this.__instanceProperties=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,a=this[e];!0!==t||this._$changedProperties.has(e)||void 0===a||this._$changeProperty(e,void 0,i,a)}}let e=!1;const i=this._$changedProperties;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),this.__controllers?.forEach(t=>t.hostUpdate?.()),this.update(i)):this.__markUpdated()}catch(t){throw e=!1,this.__markUpdated(),t}e&&this._$didUpdate(i)}willUpdate(t){}_$didUpdate(t){this.__controllers?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t),this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update")&&fe("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(t){return!0}update(t){this.__reflectingProperties&&=this.__reflectingProperties.forEach(t=>this.__propertyToAttribute(t,this[t])),this.__markUpdated()}updated(t){}firstUpdated(t){}}ke.elementStyles=[],ke.shadowRootOptions={mode:"open"},ke[be("elementProperties")]=new Map,ke[be("finalized")]=new Map,ye?.({ReactiveElement:ke});{ke.enabledWarnings=["change-in-update","async-perform-update"];const t=function(t){t.hasOwnProperty(be("enabledWarnings"))||(t.enabledWarnings=t.enabledWarnings.slice())};ke.enableWarning=function(e){t(this),this.enabledWarnings.includes(e)||this.enabledWarnings.push(e)},ke.disableWarning=function(e){t(this);const i=this.enabledWarnings.indexOf(e);i>=0&&this.enabledWarnings.splice(i,1)}}(ve.reactiveElementVersions??=[]).push("2.1.2"),ve.reactiveElementVersions.length>1&&queueMicrotask(()=>{fe("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});
6
+ */const ee=globalThis,ie=ee.ShadowRoot&&(void 0===ee.ShadyCSS||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ae=Symbol(),se=new WeakMap;class ne{constructor(t,e,i){if(this._$cssResult$=!0,i!==ae)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this._strings=e}get styleSheet(){let t=this._styleSheet;const e=this._strings;if(ie&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=se.get(e)),void 0===t&&((this._styleSheet=t=new CSSStyleSheet).replaceSync(this.cssText),i&&se.set(e,t))}return t}toString(){return this.cssText}}const re=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,a)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(i)+t[a+1],t[0]);return new ne(i,t,ae)},oe=t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return new ne("string"==typeof(i=e)?i:String(i),void 0,ae);var i},le=ie?t=>t:t=>t instanceof CSSStyleSheet?oe(t):t,{is:ce,defineProperty:de,getOwnPropertyDescriptor:he,getOwnPropertyNames:ue,getOwnPropertySymbols:pe,getPrototypeOf:ge}=Object,ve=globalThis;let fe;const me=ve.trustedTypes,we=me?me.emptyScript:"",ye=ve.reactiveElementPolyfillSupportDevMode;ve.litIssuedWarnings??=new Set,fe=(t,e)=>{e+=` See https://lit.dev/msg/${t} for more information.`,ve.litIssuedWarnings.has(e)||ve.litIssuedWarnings.has(t)||(console.warn(e),ve.litIssuedWarnings.add(e))},queueMicrotask(()=>{fe("dev-mode","Lit is in dev mode. Not recommended for production!"),ve.ShadyDOM?.inUse&&void 0===ye&&fe("polyfill-support-missing","Shadow DOM is being polyfilled via `ShadyDOM` but the `polyfill-support` module has not been loaded.")});const be=(t,e)=>t,xe={toAttribute(t,e){switch(e){case Boolean:t=t?we:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},_e=(t,e)=>!ce(t,e),Ce={attribute:!0,type:String,converter:xe,reflect:!1,useDefault:!1,hasChanged:_e};Symbol.metadata??=Symbol("metadata"),ve.litPropertyMetadata??=new WeakMap;class ke extends HTMLElement{static addInitializer(t){this.__prepare(),(this._initializers??=[]).push(t)}static get observedAttributes(){return this.finalize(),this.__attributeToPropertyMap&&[...this.__attributeToPropertyMap.keys()]}static createProperty(t,e=Ce){if(e.state&&(e.attribute=!1),this.__prepare(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol.for(`${String(t)} (@property() cache)`),a=this.getPropertyDescriptor(t,i,e);void 0!==a&&de(this.prototype,t,a)}}static getPropertyDescriptor(t,e,i){const{get:a,set:s}=he(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};if(null==a){if("value"in(he(this.prototype,t)??{}))throw new Error(`Field ${JSON.stringify(String(t))} on ${this.name} was declared as a reactive property but it's actually declared as a value on the prototype. Usually this is due to using @property or @state on a method.`);fe("reactive-property-without-getter",`Field ${JSON.stringify(String(t))} on ${this.name} was declared as a reactive property but it does not have a getter. This will be an error in a future version of Lit.`)}return{get:a,set(e){const n=a?.call(this);s?.call(this,e),this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ce}static __prepare(){if(this.hasOwnProperty(be("elementProperties")))return;const t=ge(this);t.finalize(),void 0!==t._initializers&&(this._initializers=[...t._initializers]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(be("finalized")))return;if(this.finalized=!0,this.__prepare(),this.hasOwnProperty(be("properties"))){const t=this.properties,e=[...ue(t),...pe(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this.__attributeToPropertyMap=new Map;for(const[t,e]of this.elementProperties){const i=this.__attributeNameForProperty(t,e);void 0!==i&&this.__attributeToPropertyMap.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles),this.hasOwnProperty("createProperty")&&fe("no-override-create-property","Overriding ReactiveElement.createProperty() is deprecated. The override will not be called with standard decorators"),this.hasOwnProperty("getPropertyDescriptor")&&fe("no-override-get-property-descriptor","Overriding ReactiveElement.getPropertyDescriptor() is deprecated. The override will not be called with standard decorators")}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(le(t))}else void 0!==t&&e.push(le(t));return e}static __attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this.__instanceProperties=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.__reflectingProperty=null,this.__initialize()}__initialize(){this.__updatePromise=new Promise(t=>this.enableUpdating=t),this._$changedProperties=new Map,this.__saveInstanceProperties(),this.requestUpdate(),this.constructor._initializers?.forEach(t=>t(this))}addController(t){(this.__controllers??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this.__controllers?.delete(t)}__saveInstanceProperties(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this.__instanceProperties=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(ie)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),a=ee.litNonce;void 0!==a&&e.setAttribute("nonce",a),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this.__controllers?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this.__controllers?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$attributeToProperty(t,i)}__propertyToAttribute(t,e){const i=this.constructor.elementProperties.get(t),a=this.constructor.__attributeNameForProperty(t,i);if(void 0!==a&&!0===i.reflect){const s=(void 0!==i.converter?.toAttribute?i.converter:xe).toAttribute(e,i.type);this.constructor.enabledWarnings.includes("migration")&&void 0===s&&fe("undefined-attribute-value",`The attribute value for the ${t} property is undefined on element ${this.localName}. The attribute will be removed, but in the previous version of \`ReactiveElement\`, the attribute would not have changed.`),this.__reflectingProperty=t,null==s?this.removeAttribute(a):this.setAttribute(a,s),this.__reflectingProperty=null}}_$attributeToProperty(t,e){const i=this.constructor,a=i.__attributeToPropertyMap.get(t);if(void 0!==a&&this.__reflectingProperty!==a){const t=i.getPropertyOptions(a),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:xe;this.__reflectingProperty=a;const n=s.fromAttribute(e,t.type);this[a]=n??this.__defaultValues?.get(a)??n,this.__reflectingProperty=null}}requestUpdate(t,e,i,a=!1,s){if(void 0!==t){t instanceof Event&&fe("","The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()");const n=this.constructor;!1===a&&(s=this[t]),i??=n.getPropertyOptions(t);if(!((i.hasChanged??_e)(s,e)||i.useDefault&&i.reflect&&s===this.__defaultValues?.get(t)&&!this.hasAttribute(n.__attributeNameForProperty(t,i))))return;this._$changeProperty(t,e,i)}!1===this.isUpdatePending&&(this.__updatePromise=this.__enqueueUpdate())}_$changeProperty(t,e,{useDefault:i,reflect:a,wrapped:s},n){i&&!(this.__defaultValues??=new Map).has(t)&&(this.__defaultValues.set(t,n??e??this[t]),!0!==s||void 0!==n)||(this._$changedProperties.has(t)||(this.hasUpdated||i||(e=void 0),this._$changedProperties.set(t,e)),!0===a&&this.__reflectingProperty!==t&&(this.__reflectingProperties??=new Set).add(t))}async __enqueueUpdate(){this.isUpdatePending=!0;try{await this.__updatePromise}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){const t=this.performUpdate();return this.constructor.enabledWarnings.includes("async-perform-update")&&"function"==typeof t?.then&&fe("async-perform-update",`Element ${this.localName} returned a Promise from performUpdate(). This behavior is deprecated and will be removed in a future version of ReactiveElement.`),t}performUpdate(){if(!this.isUpdatePending)return;var t;if(t={kind:"update"},ve.emitLitDebugLogEvents&&ve.dispatchEvent(new CustomEvent("lit-debug",{detail:t})),!this.hasUpdated){this.renderRoot??=this.createRenderRoot();{const t=[...this.constructor.elementProperties.keys()].filter(t=>this.hasOwnProperty(t)&&t in ge(this));if(t.length)throw new Error(`The following properties on element ${this.localName} will not trigger updates as expected because they are set using class fields: ${t.join(", ")}. Native class fields and some compiled output will overwrite accessors used for detecting changes. See https://lit.dev/msg/class-field-shadowing for more information.`)}if(this.__instanceProperties){for(const[t,e]of this.__instanceProperties)this[t]=e;this.__instanceProperties=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,a=this[e];!0!==t||this._$changedProperties.has(e)||void 0===a||this._$changeProperty(e,void 0,i,a)}}let e=!1;const i=this._$changedProperties;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),this.__controllers?.forEach(t=>t.hostUpdate?.()),this.update(i)):this.__markUpdated()}catch(t){throw e=!1,this.__markUpdated(),t}e&&this._$didUpdate(i)}willUpdate(t){}_$didUpdate(t){this.__controllers?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t),this.isUpdatePending&&this.constructor.enabledWarnings.includes("change-in-update")&&fe("change-in-update",`Element ${this.localName} scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is inefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update.`)}__markUpdated(){this._$changedProperties=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.__updatePromise}shouldUpdate(t){return!0}update(t){this.__reflectingProperties&&=this.__reflectingProperties.forEach(t=>this.__propertyToAttribute(t,this[t])),this.__markUpdated()}updated(t){}firstUpdated(t){}}ke.elementStyles=[],ke.shadowRootOptions={mode:"open"},ke[be("elementProperties")]=new Map,ke[be("finalized")]=new Map,ye?.({ReactiveElement:ke});{ke.enabledWarnings=["change-in-update","async-perform-update"];const t=function(t){t.hasOwnProperty(be("enabledWarnings"))||(t.enabledWarnings=t.enabledWarnings.slice())};ke.enableWarning=function(e){t(this),this.enabledWarnings.includes(e)||this.enabledWarnings.push(e)},ke.disableWarning=function(e){t(this);const i=this.enabledWarnings.indexOf(e);i>=0&&this.enabledWarnings.splice(i,1)}}(ve.reactiveElementVersions??=[]).push("2.1.2"),ve.reactiveElementVersions.length>1&&queueMicrotask(()=>{fe("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
11
  */
12
- const Me=globalThis,Ze=t=>{Me.emitLitDebugLogEvents&&Me.dispatchEvent(new CustomEvent("lit-debug",{detail:t}))};let Ve,De=0;Me.litIssuedWarnings??=new Set,Ve=(t,e)=>{e+=t?` See https://lit.dev/msg/${t} for more information.`:"",Me.litIssuedWarnings.has(e)||Me.litIssuedWarnings.has(t)||(console.warn(e),Me.litIssuedWarnings.add(e))},queueMicrotask(()=>{Ve("dev-mode","Lit is in dev mode. Not recommended for production!")});const Se=Me.ShadyDOM?.inUse&&!0===Me.ShadyDOM?.noPatch?Me.ShadyDOM.wrap:t=>t,Ae=Me.trustedTypes,Be=Ae?Ae.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ee=t=>t,Fe=(t,e,i)=>Ee,He=t=>{if(ni!==Fe)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");ni=t},$e=()=>{ni=Fe},Te=(t,e,i)=>ni(t,e,i),Ie="$lit$",Pe=`lit$${Math.random().toFixed(9).slice(2)}$`,Le="?"+Pe,Re=`<${Le}>`,Oe=document,Ye=()=>Oe.createComment(""),Ne=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ze=Array.isArray,Ue="[ \t\n\f\r]",qe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,We=/-->/g,je=/>/g,Ge=new RegExp(`>|${Ue}(?:([^\\s"'>=/]+)(${Ue}*=${Ue}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Ke=/'/g,Qe=/"/g,Xe=/^(?:script|style|textarea|title)$/i,Je=(ti=1,(t,...e)=>(t.some(t=>void 0===t)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),e.some(t=>t?._$litStatic$)&&Ve("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:ti,strings:t,values:e}));var ti;const ei=Symbol.for("lit-noChange"),ii=Symbol.for("lit-nothing"),ai=new WeakMap,si=Oe.createTreeWalker(Oe,129);let ni=Fe;function ri(t,e){if(!ze(t)||!t.hasOwnProperty("raw")){let t="invalid template strings array";throw t="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(t)}return void 0!==Be?Be.createHTML(e):e}class oi{constructor({strings:t,_$litType$:e},i){let a;this.parts=[];let s=0,n=0;const r=t.length-1,o=this.parts,[l,c]=((t,e)=>{const i=t.length-1,a=[];let s,n=2===e?"<svg>":3===e?"<math>":"",r=qe;for(let e=0;e<i;e++){const i=t[e];let o,l,c=-1,d=0;for(;d<i.length&&(r.lastIndex=d,l=r.exec(i),null!==l);)if(d=r.lastIndex,r===qe){if("!--"===l[1])r=We;else if(void 0!==l[1])r=je;else if(void 0!==l[2])Xe.test(l[2])&&(s=new RegExp(`</${l[2]}`,"g")),r=Ge;else if(void 0!==l[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else r===Ge?">"===l[0]?(r=s??qe,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,o=l[1],r=void 0===l[3]?Ge:'"'===l[3]?Qe:Ke):r===Qe||r===Ke?r=Ge:r===We||r===je?r=qe:(r=Ge,s=void 0);console.assert(-1===c||r===Ge||r===Ke||r===Qe,"unexpected parse state B");const h=r===Ge&&t[e+1].startsWith("/>")?" ":"";n+=r===qe?i+Re:c>=0?(a.push(o),i.slice(0,c)+Ie+i.slice(c)+Pe+h):i+Pe+(-2===c?e:h)}return[ri(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),a]})(t,e);if(this.el=oi.createElement(l,i),si.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(a=si.nextNode())&&o.length<r;){if(1===a.nodeType){{const t=a.localName;if(/^(?:textarea|template)$/i.test(t)&&a.innerHTML.includes(Pe)){const e=`Expressions are not supported inside \`${t}\` elements. See https://lit.dev/msg/expression-in-${t} for more information.`;if("template"===t)throw new Error(e);Ve("",e)}}if(a.hasAttributes())for(const t of a.getAttributeNames())if(t.endsWith(Ie)){const e=c[n++],i=a.getAttribute(t).split(Pe),r=/([.?@])?(.*)/.exec(e);o.push({type:1,index:s,name:r[2],strings:i,ctor:"."===r[1]?ui:"?"===r[1]?pi:"@"===r[1]?gi:hi}),a.removeAttribute(t)}else t.startsWith(Pe)&&(o.push({type:6,index:s}),a.removeAttribute(t));if(Xe.test(a.tagName)){const t=a.textContent.split(Pe),e=t.length-1;if(e>0){a.textContent=Ae?Ae.emptyScript:"";for(let i=0;i<e;i++)a.append(t[i],Ye()),si.nextNode(),o.push({type:2,index:++s});a.append(t[e],Ye())}}}else if(8===a.nodeType){if(a.data===Le)o.push({type:2,index:s});else{let t=-1;for(;-1!==(t=a.data.indexOf(Pe,t+1));)o.push({type:7,index:s}),t+=Pe.length-1}}s++}if(c.length!==n)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+t.join("${...}")+"`");Ze&&Ze({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:t})}static createElement(t,e){const i=Oe.createElement("template");return i.innerHTML=t,i}}function li(t,e,i=t,a){if(e===ei)return e;let s=void 0!==a?i.__directives?.[a]:i.__directive;const n=Ne(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$notifyDirectiveConnectionChanged?.(!1),void 0===n?s=void 0:(s=new n(t),s._$initialize(t,i,a)),void 0!==a?(i.__directives??=[])[a]=s:i.__directive=s),void 0!==s&&(e=li(t,s._$resolve(t,e.values),s,a)),e}class ci{constructor(t,e){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){const{el:{content:e},parts:i}=this._$template,a=(t?.creationScope??Oe).importNode(e,!0);si.currentNode=a;let s=si.nextNode(),n=0,r=0,o=i[0];for(;void 0!==o;){if(n===o.index){let e;2===o.type?e=new di(s,s.nextSibling,this,t):1===o.type?e=new o.ctor(s,o.name,o.strings,this,t):6===o.type&&(e=new vi(s,this,t)),this._$parts.push(e),o=i[++r]}n!==o?.index&&(s=si.nextNode(),n++)}return si.currentNode=Oe,a}_update(t){let e=0;for(const i of this._$parts)void 0!==i&&(Ze&&Ze({kind:"set part",part:i,value:t[e],valueIndex:e,values:t,templateInstance:this}),void 0!==i.strings?(i._$setValue(t,i,e),e+=i.strings.length-2):i._$setValue(t[e])),e++}}class di{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(t,e,i,a){this.type=2,this._$committedValue=ii,this._$disconnectableChildren=void 0,this._$startNode=t,this._$endNode=e,this._$parent=i,this.options=a,this.__isConnected=a?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let t=Se(this._$startNode).parentNode;const e=this._$parent;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(t=li(this,t,e),Ne(t))t===ii||null==t||""===t?(this._$committedValue!==ii&&(Ze&&Ze({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=ii):t!==this._$committedValue&&t!==ei&&this._commitText(t);else if(void 0!==t._$litType$)this._commitTemplateResult(t);else if(void 0!==t.nodeType){if(this.options?.host===t)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",t,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(t)}else(t=>ze(t)||"function"==typeof t?.[Symbol.iterator])(t)?this._commitIterable(t):this._commitText(t)}_insert(t){return Se(Se(this._$startNode).parentNode).insertBefore(t,this._$endNode)}_commitNode(t){if(this._$committedValue!==t){if(this._$clear(),ni!==Fe){const t=this._$startNode.parentNode?.nodeName;if("STYLE"===t||"SCRIPT"===t){let e="Forbidden";throw e="STYLE"===t?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(e)}}Ze&&Ze({kind:"commit node",start:this._$startNode,parent:this._$parent,value:t,options:this.options}),this._$committedValue=this._insert(t)}}_commitText(t){if(this._$committedValue!==ii&&Ne(this._$committedValue)){const e=Se(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=Te(e,"data","property")),t=this._textSanitizer(t),Ze&&Ze({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}else{const e=Oe.createTextNode("");this._commitNode(e),void 0===this._textSanitizer&&(this._textSanitizer=Te(e,"data","property")),t=this._textSanitizer(t),Ze&&Ze({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}this._$committedValue=t}_commitTemplateResult(t){const{values:e,_$litType$:i}=t,a="number"==typeof i?this._$getTemplate(t):(void 0===i.el&&(i.el=oi.createElement(ri(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===a)Ze&&Ze({kind:"template updating",template:a,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:e}),this._$committedValue._update(e);else{const t=new ci(a,this),i=t._clone(this.options);Ze&&Ze({kind:"template instantiated",template:a,instance:t,parts:t._$parts,options:this.options,fragment:i,values:e}),t._update(e),Ze&&Ze({kind:"template instantiated and updated",template:a,instance:t,parts:t._$parts,options:this.options,fragment:i,values:e}),this._commitNode(i),this._$committedValue=t}}_$getTemplate(t){let e=ai.get(t.strings);return void 0===e&&ai.set(t.strings,e=new oi(t)),e}_commitIterable(t){ze(this._$committedValue)||(this._$committedValue=[],this._$clear());const e=this._$committedValue;let i,a=0;for(const s of t)a===e.length?e.push(i=new di(this._insert(Ye()),this._insert(Ye()),this,this.options)):i=e[a],i._$setValue(s),a++;a<e.length&&(this._$clear(i&&Se(i._$endNode).nextSibling,a),e.length=a)}_$clear(t=Se(this._$startNode).nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t!==this._$endNode;){const e=Se(t).nextSibling;Se(t).remove(),t=e}}setConnected(t){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=t,this._$notifyConnectionChanged?.(t)}}class hi{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,i,a,s){this.type=1,this._$committedValue=ii,this._$disconnectableChildren=void 0,this.element=t,this.name=e,this._$parent=a,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=ii,this._sanitizer=void 0}_$setValue(t,e=this,i,a){const s=this.strings;let n=!1;if(void 0===s)t=li(this,t,e,0),n=!Ne(t)||t!==this._$committedValue&&t!==ei,n&&(this._$committedValue=t);else{const a=t;let r,o;for(t=s[0],r=0;r<s.length-1;r++)o=li(this,a[i+r],e,r),o===ei&&(o=this._$committedValue[r]),n||=!Ne(o)||o!==this._$committedValue[r],o===ii?t=ii:t!==ii&&(t+=(o??"")+s[r+1]),this._$committedValue[r]=o}n&&!a&&this._commitValue(t)}_commitValue(t){t===ii?Se(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=ni(this.element,this.name,"attribute")),t=this._sanitizer(t??""),Ze&&Ze({kind:"commit attribute",element:this.element,name:this.name,value:t,options:this.options}),Se(this.element).setAttribute(this.name,t??""))}}class ui extends hi{constructor(){super(...arguments),this.type=3}_commitValue(t){void 0===this._sanitizer&&(this._sanitizer=ni(this.element,this.name,"property")),t=this._sanitizer(t),Ze&&Ze({kind:"commit property",element:this.element,name:this.name,value:t,options:this.options}),this.element[this.name]=t===ii?void 0:t}}class pi extends hi{constructor(){super(...arguments),this.type=4}_commitValue(t){Ze&&Ze({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!t||t===ii),options:this.options}),Se(this.element).toggleAttribute(this.name,!!t&&t!==ii)}}class gi extends hi{constructor(t,e,i,a,s){if(super(t,e,i,a,s),this.type=5,void 0!==this.strings)throw new Error(`A \`<${t.localName}>\` has a \`@${e}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(t,e=this){if((t=li(this,t,e,0)??ii)===ei)return;const i=this._$committedValue,a=t===ii&&i!==ii||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==ii&&(i===ii||a);Ze&&Ze({kind:"commit event listener",element:this.element,name:this.name,value:t,options:this.options,removeListener:a,addListener:s,oldListener:i}),a&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,t):this._$committedValue.handleEvent(t)}}class vi{constructor(t,e,i){this.element=t,this.type=6,this._$disconnectableChildren=void 0,this._$parent=e,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){Ze&&Ze({kind:"commit to element binding",element:this.element,value:t,options:this.options}),li(this,t)}}const fi=Me.litHtmlPolyfillSupportDevMode;fi?.(oi,di),(Me.litHtmlVersions??=[]).push("3.3.2"),Me.litHtmlVersions.length>1&&queueMicrotask(()=>{Ve("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const mi=(t,e,i)=>{if(null==e)throw new TypeError(`The container to render into may not be ${e}`);const a=De++,s=i?.renderBefore??e;let n=s._$litPart$;if(Ze&&Ze({kind:"begin render",id:a,value:t,container:e,options:i,part:n}),void 0===n){const t=i?.renderBefore??null;s._$litPart$=n=new di(e.insertBefore(Ye(),t),t,void 0,i??{})}return n._$setValue(t),Ze&&Ze({kind:"end render",id:a,value:t,container:e,options:i,part:n}),n};mi.setSanitizer=He,mi.createSanitizer=Te,mi._testOnlyClearSanitizerFactoryDoNotCallOrElse=$e;
12
+ const Me=globalThis,Ze=t=>{Me.emitLitDebugLogEvents&&Me.dispatchEvent(new CustomEvent("lit-debug",{detail:t}))};let Ve,Se=0;Me.litIssuedWarnings??=new Set,Ve=(t,e)=>{e+=t?` See https://lit.dev/msg/${t} for more information.`:"",Me.litIssuedWarnings.has(e)||Me.litIssuedWarnings.has(t)||(console.warn(e),Me.litIssuedWarnings.add(e))},queueMicrotask(()=>{Ve("dev-mode","Lit is in dev mode. Not recommended for production!")});const De=Me.ShadyDOM?.inUse&&!0===Me.ShadyDOM?.noPatch?Me.ShadyDOM.wrap:t=>t,Ae=Me.trustedTypes,Be=Ae?Ae.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ee=t=>t,Fe=(t,e,i)=>Ee,He=t=>{if(ni!==Fe)throw new Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");ni=t},$e=()=>{ni=Fe},Te=(t,e,i)=>ni(t,e,i),Ie="$lit$",Pe=`lit$${Math.random().toFixed(9).slice(2)}$`,Le="?"+Pe,Re=`<${Le}>`,Oe=document,Ye=()=>Oe.createComment(""),Ne=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ze=Array.isArray,Ue="[ \t\n\f\r]",qe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,We=/-->/g,je=/>/g,Ge=new RegExp(`>|${Ue}(?:([^\\s"'>=/]+)(${Ue}*=${Ue}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Ke=/'/g,Qe=/"/g,Xe=/^(?:script|style|textarea|title)$/i,Je=(ti=1,(t,...e)=>(t.some(t=>void 0===t)&&console.warn("Some template strings are undefined.\nThis is probably caused by illegal octal escape sequences."),e.some(t=>t?._$litStatic$)&&Ve("","Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\nPlease use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions"),{_$litType$:ti,strings:t,values:e}));var ti;const ei=Symbol.for("lit-noChange"),ii=Symbol.for("lit-nothing"),ai=new WeakMap,si=Oe.createTreeWalker(Oe,129);let ni=Fe;function ri(t,e){if(!ze(t)||!t.hasOwnProperty("raw")){let t="invalid template strings array";throw t="\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n ".trim().replace(/\n */g,"\n"),new Error(t)}return void 0!==Be?Be.createHTML(e):e}class oi{constructor({strings:t,_$litType$:e},i){let a;this.parts=[];let s=0,n=0;const r=t.length-1,o=this.parts,[l,c]=((t,e)=>{const i=t.length-1,a=[];let s,n=2===e?"<svg>":3===e?"<math>":"",r=qe;for(let e=0;e<i;e++){const i=t[e];let o,l,c=-1,d=0;for(;d<i.length&&(r.lastIndex=d,l=r.exec(i),null!==l);)if(d=r.lastIndex,r===qe){if("!--"===l[1])r=We;else if(void 0!==l[1])r=je;else if(void 0!==l[2])Xe.test(l[2])&&(s=new RegExp(`</${l[2]}`,"g")),r=Ge;else if(void 0!==l[3])throw new Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else r===Ge?">"===l[0]?(r=s??qe,c=-1):void 0===l[1]?c=-2:(c=r.lastIndex-l[2].length,o=l[1],r=void 0===l[3]?Ge:'"'===l[3]?Qe:Ke):r===Qe||r===Ke?r=Ge:r===We||r===je?r=qe:(r=Ge,s=void 0);console.assert(-1===c||r===Ge||r===Ke||r===Qe,"unexpected parse state B");const h=r===Ge&&t[e+1].startsWith("/>")?" ":"";n+=r===qe?i+Re:c>=0?(a.push(o),i.slice(0,c)+Ie+i.slice(c)+Pe+h):i+Pe+(-2===c?e:h)}return[ri(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),a]})(t,e);if(this.el=oi.createElement(l,i),si.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(a=si.nextNode())&&o.length<r;){if(1===a.nodeType){{const t=a.localName;if(/^(?:textarea|template)$/i.test(t)&&a.innerHTML.includes(Pe)){const e=`Expressions are not supported inside \`${t}\` elements. See https://lit.dev/msg/expression-in-${t} for more information.`;if("template"===t)throw new Error(e);Ve("",e)}}if(a.hasAttributes())for(const t of a.getAttributeNames())if(t.endsWith(Ie)){const e=c[n++],i=a.getAttribute(t).split(Pe),r=/([.?@])?(.*)/.exec(e);o.push({type:1,index:s,name:r[2],strings:i,ctor:"."===r[1]?ui:"?"===r[1]?pi:"@"===r[1]?gi:hi}),a.removeAttribute(t)}else t.startsWith(Pe)&&(o.push({type:6,index:s}),a.removeAttribute(t));if(Xe.test(a.tagName)){const t=a.textContent.split(Pe),e=t.length-1;if(e>0){a.textContent=Ae?Ae.emptyScript:"";for(let i=0;i<e;i++)a.append(t[i],Ye()),si.nextNode(),o.push({type:2,index:++s});a.append(t[e],Ye())}}}else if(8===a.nodeType){if(a.data===Le)o.push({type:2,index:s});else{let t=-1;for(;-1!==(t=a.data.indexOf(Pe,t+1));)o.push({type:7,index:s}),t+=Pe.length-1}}s++}if(c.length!==n)throw new Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+t.join("${...}")+"`");Ze&&Ze({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:t})}static createElement(t,e){const i=Oe.createElement("template");return i.innerHTML=t,i}}function li(t,e,i=t,a){if(e===ei)return e;let s=void 0!==a?i.__directives?.[a]:i.__directive;const n=Ne(e)?void 0:e._$litDirective$;return s?.constructor!==n&&(s?._$notifyDirectiveConnectionChanged?.(!1),void 0===n?s=void 0:(s=new n(t),s._$initialize(t,i,a)),void 0!==a?(i.__directives??=[])[a]=s:i.__directive=s),void 0!==s&&(e=li(t,s._$resolve(t,e.values),s,a)),e}class ci{constructor(t,e){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=t,this._$parent=e}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(t){const{el:{content:e},parts:i}=this._$template,a=(t?.creationScope??Oe).importNode(e,!0);si.currentNode=a;let s=si.nextNode(),n=0,r=0,o=i[0];for(;void 0!==o;){if(n===o.index){let e;2===o.type?e=new di(s,s.nextSibling,this,t):1===o.type?e=new o.ctor(s,o.name,o.strings,this,t):6===o.type&&(e=new vi(s,this,t)),this._$parts.push(e),o=i[++r]}n!==o?.index&&(s=si.nextNode(),n++)}return si.currentNode=Oe,a}_update(t){let e=0;for(const i of this._$parts)void 0!==i&&(Ze&&Ze({kind:"set part",part:i,value:t[e],valueIndex:e,values:t,templateInstance:this}),void 0!==i.strings?(i._$setValue(t,i,e),e+=i.strings.length-2):i._$setValue(t[e])),e++}}class di{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(t,e,i,a){this.type=2,this._$committedValue=ii,this._$disconnectableChildren=void 0,this._$startNode=t,this._$endNode=e,this._$parent=i,this.options=a,this.__isConnected=a?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let t=De(this._$startNode).parentNode;const e=this._$parent;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(t,e=this){if(null===this.parentNode)throw new Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(t=li(this,t,e),Ne(t))t===ii||null==t||""===t?(this._$committedValue!==ii&&(Ze&&Ze({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear()),this._$committedValue=ii):t!==this._$committedValue&&t!==ei&&this._commitText(t);else if(void 0!==t._$litType$)this._commitTemplateResult(t);else if(void 0!==t.nodeType){if(this.options?.host===t)return this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),void console.warn("Attempted to render the template host",t,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");this._commitNode(t)}else(t=>ze(t)||"function"==typeof t?.[Symbol.iterator])(t)?this._commitIterable(t):this._commitText(t)}_insert(t){return De(De(this._$startNode).parentNode).insertBefore(t,this._$endNode)}_commitNode(t){if(this._$committedValue!==t){if(this._$clear(),ni!==Fe){const t=this._$startNode.parentNode?.nodeName;if("STYLE"===t||"SCRIPT"===t){let e="Forbidden";throw e="STYLE"===t?"Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.":"Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.",new Error(e)}}Ze&&Ze({kind:"commit node",start:this._$startNode,parent:this._$parent,value:t,options:this.options}),this._$committedValue=this._insert(t)}}_commitText(t){if(this._$committedValue!==ii&&Ne(this._$committedValue)){const e=De(this._$startNode).nextSibling;void 0===this._textSanitizer&&(this._textSanitizer=Te(e,"data","property")),t=this._textSanitizer(t),Ze&&Ze({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}else{const e=Oe.createTextNode("");this._commitNode(e),void 0===this._textSanitizer&&(this._textSanitizer=Te(e,"data","property")),t=this._textSanitizer(t),Ze&&Ze({kind:"commit text",node:e,value:t,options:this.options}),e.data=t}this._$committedValue=t}_commitTemplateResult(t){const{values:e,_$litType$:i}=t,a="number"==typeof i?this._$getTemplate(t):(void 0===i.el&&(i.el=oi.createElement(ri(i.h,i.h[0]),this.options)),i);if(this._$committedValue?._$template===a)Ze&&Ze({kind:"template updating",template:a,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:e}),this._$committedValue._update(e);else{const t=new ci(a,this),i=t._clone(this.options);Ze&&Ze({kind:"template instantiated",template:a,instance:t,parts:t._$parts,options:this.options,fragment:i,values:e}),t._update(e),Ze&&Ze({kind:"template instantiated and updated",template:a,instance:t,parts:t._$parts,options:this.options,fragment:i,values:e}),this._commitNode(i),this._$committedValue=t}}_$getTemplate(t){let e=ai.get(t.strings);return void 0===e&&ai.set(t.strings,e=new oi(t)),e}_commitIterable(t){ze(this._$committedValue)||(this._$committedValue=[],this._$clear());const e=this._$committedValue;let i,a=0;for(const s of t)a===e.length?e.push(i=new di(this._insert(Ye()),this._insert(Ye()),this,this.options)):i=e[a],i._$setValue(s),a++;a<e.length&&(this._$clear(i&&De(i._$endNode).nextSibling,a),e.length=a)}_$clear(t=De(this._$startNode).nextSibling,e){for(this._$notifyConnectionChanged?.(!1,!0,e);t!==this._$endNode;){const e=De(t).nextSibling;De(t).remove(),t=e}}setConnected(t){if(void 0!==this._$parent)throw new Error("part.setConnected() may only be called on a RootPart returned from render().");this.__isConnected=t,this._$notifyConnectionChanged?.(t)}}class hi{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(t,e,i,a,s){this.type=1,this._$committedValue=ii,this._$disconnectableChildren=void 0,this.element=t,this.name=e,this._$parent=a,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$committedValue=new Array(i.length-1).fill(new String),this.strings=i):this._$committedValue=ii,this._sanitizer=void 0}_$setValue(t,e=this,i,a){const s=this.strings;let n=!1;if(void 0===s)t=li(this,t,e,0),n=!Ne(t)||t!==this._$committedValue&&t!==ei,n&&(this._$committedValue=t);else{const a=t;let r,o;for(t=s[0],r=0;r<s.length-1;r++)o=li(this,a[i+r],e,r),o===ei&&(o=this._$committedValue[r]),n||=!Ne(o)||o!==this._$committedValue[r],o===ii?t=ii:t!==ii&&(t+=(o??"")+s[r+1]),this._$committedValue[r]=o}n&&!a&&this._commitValue(t)}_commitValue(t){t===ii?De(this.element).removeAttribute(this.name):(void 0===this._sanitizer&&(this._sanitizer=ni(this.element,this.name,"attribute")),t=this._sanitizer(t??""),Ze&&Ze({kind:"commit attribute",element:this.element,name:this.name,value:t,options:this.options}),De(this.element).setAttribute(this.name,t??""))}}class ui extends hi{constructor(){super(...arguments),this.type=3}_commitValue(t){void 0===this._sanitizer&&(this._sanitizer=ni(this.element,this.name,"property")),t=this._sanitizer(t),Ze&&Ze({kind:"commit property",element:this.element,name:this.name,value:t,options:this.options}),this.element[this.name]=t===ii?void 0:t}}class pi extends hi{constructor(){super(...arguments),this.type=4}_commitValue(t){Ze&&Ze({kind:"commit boolean attribute",element:this.element,name:this.name,value:!(!t||t===ii),options:this.options}),De(this.element).toggleAttribute(this.name,!!t&&t!==ii)}}class gi extends hi{constructor(t,e,i,a,s){if(super(t,e,i,a,s),this.type=5,void 0!==this.strings)throw new Error(`A \`<${t.localName}>\` has a \`@${e}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(t,e=this){if((t=li(this,t,e,0)??ii)===ei)return;const i=this._$committedValue,a=t===ii&&i!==ii||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,s=t!==ii&&(i===ii||a);Ze&&Ze({kind:"commit event listener",element:this.element,name:this.name,value:t,options:this.options,removeListener:a,addListener:s,oldListener:i}),a&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,t),this._$committedValue=t}handleEvent(t){"function"==typeof this._$committedValue?this._$committedValue.call(this.options?.host??this.element,t):this._$committedValue.handleEvent(t)}}class vi{constructor(t,e,i){this.element=t,this.type=6,this._$disconnectableChildren=void 0,this._$parent=e,this.options=i}get _$isConnected(){return this._$parent._$isConnected}_$setValue(t){Ze&&Ze({kind:"commit to element binding",element:this.element,value:t,options:this.options}),li(this,t)}}const fi=Me.litHtmlPolyfillSupportDevMode;fi?.(oi,di),(Me.litHtmlVersions??=[]).push("3.3.2"),Me.litHtmlVersions.length>1&&queueMicrotask(()=>{Ve("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});const mi=(t,e,i)=>{if(null==e)throw new TypeError(`The container to render into may not be ${e}`);const a=Se++,s=i?.renderBefore??e;let n=s._$litPart$;if(Ze&&Ze({kind:"begin render",id:a,value:t,container:e,options:i,part:n}),void 0===n){const t=i?.renderBefore??null;s._$litPart$=n=new di(e.insertBefore(Ye(),t),t,void 0,i??{})}return n._$setValue(t),Ze&&Ze({kind:"end render",id:a,value:t,container:e,options:i,part:n}),n};mi.setSanitizer=He,mi.createSanitizer=Te,mi._testOnlyClearSanitizerFactoryDoNotCallOrElse=$e;
13
13
  /**
14
14
  * @license
15
15
  * Copyright 2017 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- const wi=globalThis;let yi;wi.litIssuedWarnings??=new Set,yi=(t,e)=>{e+=` See https://lit.dev/msg/${t} for more information.`,wi.litIssuedWarnings.has(e)||wi.litIssuedWarnings.has(t)||(console.warn(e),wi.litIssuedWarnings.add(e))};class bi extends ke{constructor(){super(...arguments),this.renderOptions={host:this},this.__childPart=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.__childPart=mi(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.__childPart?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.__childPart?.setConnected(!1)}render(){return ei}}var xi;bi._$litElement$=!0,bi[(xi="finalized",xi)]=!0,wi.litElementHydrateSupport?.({LitElement:bi});const Ci=wi.litElementPolyfillSupportDevMode;
18
+ const wi=globalThis;let yi;wi.litIssuedWarnings??=new Set,yi=(t,e)=>{e+=` See https://lit.dev/msg/${t} for more information.`,wi.litIssuedWarnings.has(e)||wi.litIssuedWarnings.has(t)||(console.warn(e),wi.litIssuedWarnings.add(e))};class bi extends ke{constructor(){super(...arguments),this.renderOptions={host:this},this.__childPart=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this.__childPart=mi(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.__childPart?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.__childPart?.setConnected(!1)}render(){return ei}}var xi;bi._$litElement$=!0,bi[(xi="finalized",xi)]=!0,wi.litElementHydrateSupport?.({LitElement:bi});const _i=wi.litElementPolyfillSupportDevMode;
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
23
  */
24
- let _i;Ci?.({LitElement:bi}),(wi.litElementVersions??=[]).push("4.2.2"),wi.litElementVersions.length>1&&queueMicrotask(()=>{yi("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")}),globalThis.litIssuedWarnings??=new Set,_i=(t,e)=>{e+=` See https://lit.dev/msg/${t} for more information.`,globalThis.litIssuedWarnings.has(e)||globalThis.litIssuedWarnings.has(t)||(console.warn(e),globalThis.litIssuedWarnings.add(e))};const ki={attribute:!0,type:String,converter:xe,reflect:!1,hasChanged:Ce},Mi=(t=ki,e,i)=>{const{kind:a,metadata:s}=i;null==s&&_i("missing-class-metadata",`The class ${e} is missing decorator metadata. This could mean that you're using a compiler that supports decorators but doesn't support decorator metadata, such as TypeScript 5.1. Please update your compiler.`);let n=globalThis.litPropertyMetadata.get(s);if(void 0===n&&globalThis.litPropertyMetadata.set(s,n=new Map),"setter"===a&&((t=Object.create(t)).wrapped=!0),n.set(i.name,t),"accessor"===a){const{name:a}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(a,s,t,!0,i)},init(e){return void 0!==e&&this._$changeProperty(a,void 0,t,e),e}}}if("setter"===a){const{name:a}=i;return function(i){const s=this[a];e.call(this,i),this.requestUpdate(a,s,t,!0,i)}}throw new Error(`Unsupported decorator location: ${a}`)};function Zi(t){return(e,i)=>"object"==typeof i?Mi(t,e,i):((t,e,i)=>{const a=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),a?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}
24
+ let Ci;_i?.({LitElement:bi}),(wi.litElementVersions??=[]).push("4.2.2"),wi.litElementVersions.length>1&&queueMicrotask(()=>{yi("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")}),globalThis.litIssuedWarnings??=new Set,Ci=(t,e)=>{e+=` See https://lit.dev/msg/${t} for more information.`,globalThis.litIssuedWarnings.has(e)||globalThis.litIssuedWarnings.has(t)||(console.warn(e),globalThis.litIssuedWarnings.add(e))};const ki={attribute:!0,type:String,converter:xe,reflect:!1,hasChanged:_e},Mi=(t=ki,e,i)=>{const{kind:a,metadata:s}=i;null==s&&Ci("missing-class-metadata",`The class ${e} is missing decorator metadata. This could mean that you're using a compiler that supports decorators but doesn't support decorator metadata, such as TypeScript 5.1. Please update your compiler.`);let n=globalThis.litPropertyMetadata.get(s);if(void 0===n&&globalThis.litPropertyMetadata.set(s,n=new Map),"setter"===a&&((t=Object.create(t)).wrapped=!0),n.set(i.name,t),"accessor"===a){const{name:a}=i;return{set(i){const s=e.get.call(this);e.set.call(this,i),this.requestUpdate(a,s,t,!0,i)},init(e){return void 0!==e&&this._$changeProperty(a,void 0,t,e),e}}}if("setter"===a){const{name:a}=i;return function(i){const s=this[a];e.call(this,i),this.requestUpdate(a,s,t,!0,i)}}throw new Error(`Unsupported decorator location: ${a}`)};function Zi(t){return(e,i)=>"object"==typeof i?Mi(t,e,i):((t,e,i)=>{const a=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),a?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}
25
25
  /**
26
26
  * @license
27
27
  * Copyright 2017 Google LLC
@@ -31,22 +31,22 @@ let _i;Ci?.({LitElement:bi}),(wi.litElementVersions??=[]).push("4.2.2"),wi.litEl
31
31
  * @license
32
32
  * Copyright 2017 Google LLC
33
33
  * SPDX-License-Identifier: BSD-3-Clause
34
- */const Di=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);
34
+ */const Si=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);
35
35
  /**
36
36
  * @license
37
37
  * Copyright 2017 Google LLC
38
38
  * SPDX-License-Identifier: BSD-3-Clause
39
- */let Si;function Ai(t,e){return(i,a,s)=>{const n=i=>{const s=i.renderRoot?.querySelector(t)??null;if(null===s&&e&&!i.hasUpdated){const e="object"==typeof a?a.name:a;Si("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${t}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return s};if(e){const{get:t,set:e}="object"==typeof a?i:s??(()=>{const t=Symbol(`${String(a)} (@query() cache)`);return{get(){return this[t]},set(e){this[t]=e}}})();return Di(i,a,{get(){let i=t.call(this);return void 0===i&&(i=n(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return Di(i,a,{get(){return n(this)}})}}
39
+ */let Di;function Ai(t,e){return(i,a,s)=>{const n=i=>{const s=i.renderRoot?.querySelector(t)??null;if(null===s&&e&&!i.hasUpdated){const e="object"==typeof a?a.name:a;Di("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${t}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return s};if(e){const{get:t,set:e}="object"==typeof a?i:s??(()=>{const t=Symbol(`${String(a)} (@query() cache)`);return{get(){return this[t]},set(e){this[t]=e}}})();return Si(i,a,{get(){let i=t.call(this);return void 0===i&&(i=n(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return Si(i,a,{get(){return n(this)}})}}
40
40
  /**
41
41
  * @license
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
- */function Bi(t){return(e,i)=>Di(e,i,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(t)??null}})}
44
+ */function Bi(t){return(e,i)=>Si(e,i,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(t)??null}})}
45
45
  /**
46
46
  * @license
47
47
  * Copyright 2017 Google LLC
48
48
  * SPDX-License-Identifier: BSD-3-Clause
49
- */globalThis.litIssuedWarnings??=new Set,Si=(t,e)=>{e+=t?` See https://lit.dev/msg/${t} for more information.`:"",globalThis.litIssuedWarnings.has(e)||globalThis.litIssuedWarnings.has(t)||(console.warn(e),globalThis.litIssuedWarnings.add(e))};const Ei=1,Fi=2,Hi=3,$i=4,Ti=t=>(...e)=>({_$litDirective$:t,values:e});class Ii{constructor(t){}get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,i){this.__part=t,this._$parent=e,this.__attributeIndex=i}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
49
+ */globalThis.litIssuedWarnings??=new Set,Di=(t,e)=>{e+=t?` See https://lit.dev/msg/${t} for more information.`:"",globalThis.litIssuedWarnings.has(e)||globalThis.litIssuedWarnings.has(t)||(console.warn(e),globalThis.litIssuedWarnings.add(e))};const Ei=1,Fi=2,Hi=3,$i=4,Ti=t=>(...e)=>({_$litDirective$:t,values:e});class Ii{constructor(t){}get _$isConnected(){return this._$parent._$isConnected}_$initialize(t,e,i){this.__part=t,this._$parent=e,this.__attributeIndex=i}_$resolve(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
50
50
  /**
51
51
  * @license
52
52
  * Copyright 2020 Google LLC
@@ -67,7 +67,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
67
67
  * @license
68
68
  * Copyright 2020 Google LLC
69
69
  * SPDX-License-Identifier: BSD-3-Clause
70
- */const ji=()=>new Gi;class Gi{}const Ki=new WeakMap;const Qi=Ti(class extends Wi{render(t){return ii}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),ii}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=Ki.get(e);void 0===i&&(i=new WeakMap,Ki.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?Ki.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Xi=Math.min,Ji=Math.max,ta=Math.round,ea=Math.floor,ia=t=>({x:t,y:t}),aa={left:"right",right:"left",bottom:"top",top:"bottom"},sa={start:"end",end:"start"};function na(t,e,i){return Ji(t,Xi(e,i))}function ra(t,e){return"function"==typeof t?t(e):t}function oa(t){return t.split("-")[0]}function la(t){return t.split("-")[1]}function ca(t){return"x"===t?"y":"x"}function da(t){return"y"===t?"height":"width"}const ha=new Set(["top","bottom"]);function ua(t){return ha.has(oa(t))?"y":"x"}function pa(t){return ca(ua(t))}function ga(t,e,i){void 0===i&&(i=!1);const a=la(t),s=pa(t),n=da(s);let r="x"===s?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top";return e.reference[n]>e.floating[n]&&(r=xa(r)),[r,xa(r)]}function va(t){return t.replace(/start|end/g,t=>sa[t])}const fa=["left","right"],ma=["right","left"],wa=["top","bottom"],ya=["bottom","top"];function ba(t,e,i,a){const s=la(t);let n=function(t,e,i){switch(t){case"top":case"bottom":return i?e?ma:fa:e?fa:ma;case"left":case"right":return e?wa:ya;default:return[]}}(oa(t),"start"===i,a);return s&&(n=n.map(t=>t+"-"+s),e&&(n=n.concat(n.map(va)))),n}function xa(t){return t.replace(/left|right|bottom|top/g,t=>aa[t])}function Ca(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function _a(t){const{x:e,y:i,width:a,height:s}=t;return{width:a,height:s,top:i,left:e,right:e+a,bottom:i+s,x:e,y:i}}function ka(t,e,i){let{reference:a,floating:s}=t;const n=ua(e),r=pa(e),o=da(r),l=oa(e),c="y"===n,d=a.x+a.width/2-s.width/2,h=a.y+a.height/2-s.height/2,u=a[o]/2-s[o]/2;let p;switch(l){case"top":p={x:d,y:a.y-s.height};break;case"bottom":p={x:d,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:h};break;case"left":p={x:a.x-s.width,y:h};break;default:p={x:a.x,y:a.y}}switch(la(e)){case"start":p[r]-=u*(i&&c?-1:1);break;case"end":p[r]+=u*(i&&c?-1:1)}return p}async function Ma(t,e){var i;void 0===e&&(e={});const{x:a,y:s,platform:n,rects:r,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=ra(e,t),g=Ca(p),v=o[u?"floating"===h?"reference":"floating":h],f=_a(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(v)))||i?v:v.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),m="floating"===h?{x:a,y:s,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==n.getOffsetParent?void 0:n.getOffsetParent(o.floating)),y=await(null==n.isElement?void 0:n.isElement(w))&&await(null==n.getScale?void 0:n.getScale(w))||{x:1,y:1},b=_a(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:m,offsetParent:w,strategy:l}):m);return{top:(f.top-b.top+g.top)/y.y,bottom:(b.bottom-f.bottom+g.bottom)/y.y,left:(f.left-b.left+g.left)/y.x,right:(b.right-f.right+g.right)/y.x}}const Za=new Set(["left","top"]);function Va(){return"undefined"!=typeof window}function Da(t){return Ba(t)?(t.nodeName||"").toLowerCase():"#document"}function Sa(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Aa(t){var e;return null==(e=(Ba(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Ba(t){return!!Va()&&(t instanceof Node||t instanceof Sa(t).Node)}function Ea(t){return!!Va()&&(t instanceof Element||t instanceof Sa(t).Element)}function Fa(t){return!!Va()&&(t instanceof HTMLElement||t instanceof Sa(t).HTMLElement)}function Ha(t){return!(!Va()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Sa(t).ShadowRoot)}const $a=new Set(["inline","contents"]);function Ta(t){const{overflow:e,overflowX:i,overflowY:a,display:s}=ja(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+i)&&!$a.has(s)}const Ia=new Set(["table","td","th"]);function Pa(t){return Ia.has(Da(t))}const La=[":popover-open",":modal"];function Ra(t){return La.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const Oa=["transform","translate","scale","rotate","perspective"],Ya=["transform","translate","scale","rotate","perspective","filter"],Na=["paint","layout","strict","content"];function za(t){const e=Ua(),i=Ea(t)?ja(t):t;return Oa.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||Ya.some(t=>(i.willChange||"").includes(t))||Na.some(t=>(i.contain||"").includes(t))}function Ua(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const qa=new Set(["html","body","#document"]);function Wa(t){return qa.has(Da(t))}function ja(t){return Sa(t).getComputedStyle(t)}function Ga(t){return Ea(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ka(t){if("html"===Da(t))return t;const e=t.assignedSlot||t.parentNode||Ha(t)&&t.host||Aa(t);return Ha(e)?e.host:e}function Qa(t){const e=Ka(t);return Wa(e)?t.ownerDocument?t.ownerDocument.body:t.body:Fa(e)&&Ta(e)?e:Qa(e)}function Xa(t,e,i){var a;void 0===e&&(e=[]),void 0===i&&(i=!0);const s=Qa(t),n=s===(null==(a=t.ownerDocument)?void 0:a.body),r=Sa(s);if(n){const t=Ja(r);return e.concat(r,r.visualViewport||[],Ta(s)?s:[],t&&i?Xa(t):[])}return e.concat(s,Xa(s,[],i))}function Ja(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ts(t){const e=ja(t);let i=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const s=Fa(t),n=s?t.offsetWidth:i,r=s?t.offsetHeight:a,o=ta(i)!==n||ta(a)!==r;return o&&(i=n,a=r),{width:i,height:a,$:o}}function es(t){return Ea(t)?t:t.contextElement}function is(t){const e=es(t);if(!Fa(e))return ia(1);const i=e.getBoundingClientRect(),{width:a,height:s,$:n}=ts(e);let r=(n?ta(i.width):i.width)/a,o=(n?ta(i.height):i.height)/s;return r&&Number.isFinite(r)||(r=1),o&&Number.isFinite(o)||(o=1),{x:r,y:o}}const as=ia(0);function ss(t){const e=Sa(t);return Ua()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:as}function ns(t,e,i,a){void 0===e&&(e=!1),void 0===i&&(i=!1);const s=t.getBoundingClientRect(),n=es(t);let r=ia(1);e&&(a?Ea(a)&&(r=is(a)):r=is(t));const o=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Sa(t))&&e}(n,i,a)?ss(n):ia(0);let l=(s.left+o.x)/r.x,c=(s.top+o.y)/r.y,d=s.width/r.x,h=s.height/r.y;if(n){const t=Sa(n),e=a&&Ea(a)?Sa(a):a;let i=t,s=Ja(i);for(;s&&a&&e!==i;){const t=is(s),e=s.getBoundingClientRect(),a=ja(s),n=e.left+(s.clientLeft+parseFloat(a.paddingLeft))*t.x,r=e.top+(s.clientTop+parseFloat(a.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,h*=t.y,l+=n,c+=r,i=Sa(s),s=Ja(i)}}return _a({width:d,height:h,x:l,y:c})}function rs(t,e){const i=Ga(t).scrollLeft;return e?e.left+i:ns(Aa(t)).left+i}function os(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-rs(t,i),y:i.top+e.scrollTop}}const ls=new Set(["absolute","fixed"]);function cs(t,e,i){let a;if("viewport"===e)a=function(t,e){const i=Sa(t),a=Aa(t),s=i.visualViewport;let n=a.clientWidth,r=a.clientHeight,o=0,l=0;if(s){n=s.width,r=s.height;const t=Ua();(!t||t&&"fixed"===e)&&(o=s.offsetLeft,l=s.offsetTop)}const c=rs(a);if(c<=0){const t=a.ownerDocument,e=t.body,i=getComputedStyle(e),s="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(a.clientWidth-e.clientWidth-s);r<=25&&(n-=r)}else c<=25&&(n+=c);return{width:n,height:r,x:o,y:l}}(t,i);else if("document"===e)a=function(t){const e=Aa(t),i=Ga(t),a=t.ownerDocument.body,s=Ji(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),n=Ji(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let r=-i.scrollLeft+rs(t);const o=-i.scrollTop;return"rtl"===ja(a).direction&&(r+=Ji(e.clientWidth,a.clientWidth)-s),{width:s,height:n,x:r,y:o}}(Aa(t));else if(Ea(e))a=function(t,e){const i=ns(t,!0,"fixed"===e),a=i.top+t.clientTop,s=i.left+t.clientLeft,n=Fa(t)?is(t):ia(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:s*n.x,y:a*n.y}}(e,i);else{const i=ss(t);a={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return _a(a)}function ds(t,e){const i=Ka(t);return!(i===e||!Ea(i)||Wa(i))&&("fixed"===ja(i).position||ds(i,e))}function hs(t,e,i){const a=Fa(e),s=Aa(e),n="fixed"===i,r=ns(t,!0,n,e);let o={scrollLeft:0,scrollTop:0};const l=ia(0);function c(){l.x=rs(s)}if(a||!a&&!n)if(("body"!==Da(e)||Ta(s))&&(o=Ga(e)),a){const t=ns(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else s&&c();n&&!a&&s&&c();const d=!s||a||n?ia(0):os(s,o);return{x:r.left+o.scrollLeft-l.x-d.x,y:r.top+o.scrollTop-l.y-d.y,width:r.width,height:r.height}}function us(t){return"static"===ja(t).position}function ps(t,e){if(!Fa(t)||"fixed"===ja(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Aa(t)===i&&(i=i.ownerDocument.body),i}function gs(t,e){const i=Sa(t);if(Ra(t))return i;if(!Fa(t)){let e=Ka(t);for(;e&&!Wa(e);){if(Ea(e)&&!us(e))return e;e=Ka(e)}return i}let a=ps(t,e);for(;a&&Pa(a)&&us(a);)a=ps(a,e);return a&&Wa(a)&&us(a)&&!za(a)?i:a||function(t){let e=Ka(t);for(;Fa(e)&&!Wa(e);){if(za(e))return e;if(Ra(e))return null;e=Ka(e)}return null}(t)||i}const vs={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:a,strategy:s}=t;const n="fixed"===s,r=Aa(a),o=!!e&&Ra(e.floating);if(a===r||o&&n)return i;let l={scrollLeft:0,scrollTop:0},c=ia(1);const d=ia(0),h=Fa(a);if((h||!h&&!n)&&(("body"!==Da(a)||Ta(r))&&(l=Ga(a)),Fa(a))){const t=ns(a);c=is(a),d.x=t.x+a.clientLeft,d.y=t.y+a.clientTop}const u=!r||h||n?ia(0):os(r,l);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x+u.x,y:i.y*c.y-l.scrollTop*c.y+d.y+u.y}},getDocumentElement:Aa,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:a,strategy:s}=t;const n=[..."clippingAncestors"===i?Ra(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let a=Xa(t,[],!1).filter(t=>Ea(t)&&"body"!==Da(t)),s=null;const n="fixed"===ja(t).position;let r=n?Ka(t):t;for(;Ea(r)&&!Wa(r);){const e=ja(r),i=za(r);i||"fixed"!==e.position||(s=null),(n?!i&&!s:!i&&"static"===e.position&&s&&ls.has(s.position)||Ta(r)&&!i&&ds(t,r))?a=a.filter(t=>t!==r):s=e,r=Ka(r)}return e.set(t,a),a}(e,this._c):[].concat(i),a],r=n[0],o=n.reduce((t,i)=>{const a=cs(e,i,s);return t.top=Ji(a.top,t.top),t.right=Xi(a.right,t.right),t.bottom=Xi(a.bottom,t.bottom),t.left=Ji(a.left,t.left),t},cs(e,r,s));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:gs,getElementRects:async function(t){const e=this.getOffsetParent||gs,i=this.getDimensions,a=await i(t.floating);return{reference:hs(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=ts(t);return{width:e,height:i}},getScale:is,isElement:Ea,isRTL:function(t){return"rtl"===ja(t).direction}};function fs(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ms(t,e,i,a){void 0===a&&(a={});const{ancestorScroll:s=!0,ancestorResize:n=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=es(t),d=s||n?[...c?Xa(c):[],...Xa(e)]:[];d.forEach(t=>{s&&t.addEventListener("scroll",i,{passive:!0}),n&&t.addEventListener("resize",i)});const h=c&&o?function(t,e){let i,a=null;const s=Aa(t);function n(){var t;clearTimeout(i),null==(t=a)||t.disconnect(),a=null}return function r(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),n();const c=t.getBoundingClientRect(),{left:d,top:h,width:u,height:p}=c;if(o||e(),!u||!p)return;const g={rootMargin:-ea(h)+"px "+-ea(s.clientWidth-(d+u))+"px "+-ea(s.clientHeight-(h+p))+"px "+-ea(d)+"px",threshold:Ji(0,Xi(1,l))||1};let v=!0;function f(e){const a=e[0].intersectionRatio;if(a!==l){if(!v)return r();a?r(!1,a):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==a||fs(c,t.getBoundingClientRect())||r(),v=!1}try{a=new IntersectionObserver(f,{...g,root:s.ownerDocument})}catch(t){a=new IntersectionObserver(f,g)}a.observe(t)}(!0),n}(c,i):null;let u,p=-1,g=null;r&&(g=new ResizeObserver(t=>{let[a]=t;a&&a.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=g)||t.observe(e)})),i()}),c&&!l&&g.observe(c),g.observe(e));let v=l?ns(t):null;return l&&function e(){const a=ns(t);v&&!fs(v,a)&&i();v=a,u=requestAnimationFrame(e)}(),i(),()=>{var t;d.forEach(t=>{s&&t.removeEventListener("scroll",i),n&&t.removeEventListener("resize",i)}),null==h||h(),null==(t=g)||t.disconnect(),g=null,l&&cancelAnimationFrame(u)}}const ws=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,a;const{x:s,y:n,placement:r,middlewareData:o}=e,l=await async function(t,e){const{placement:i,platform:a,elements:s}=t,n=await(null==a.isRTL?void 0:a.isRTL(s.floating)),r=oa(i),o=la(i),l="y"===ua(i),c=Za.has(r)?-1:1,d=n&&l?-1:1,h=ra(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:g}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&"number"==typeof g&&(p="end"===o?-1*g:g),l?{x:p*d,y:u*c}:{x:u*c,y:p*d}}(e,t);return r===(null==(i=o.offset)?void 0:i.placement)&&null!=(a=o.arrow)&&a.alignmentOffset?{}:{x:s+l.x,y:n+l.y,data:{...l,placement:r}}}}},ys=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:a,placement:s}=e,{mainAxis:n=!0,crossAxis:r=!1,limiter:o={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=ra(t,e),c={x:i,y:a},d=await Ma(e,l),h=ua(oa(s)),u=ca(h);let p=c[u],g=c[h];if(n){const t="y"===u?"bottom":"right";p=na(p+d["y"===u?"top":"left"],p,p-d[t])}if(r){const t="y"===h?"bottom":"right";g=na(g+d["y"===h?"top":"left"],g,g-d[t])}const v=o.fn({...e,[u]:p,[h]:g});return{...v,data:{x:v.x-i,y:v.y-a,enabled:{[u]:n,[h]:r}}}}}},bs=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,a;const{placement:s,middlewareData:n,rects:r,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...f}=ra(t,e);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const m=oa(s),w=ua(o),y=oa(o)===o,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=u||(y||!v?[xa(o)]:function(t){const e=xa(t);return[va(t),e,va(e)]}(o)),C="none"!==g;!u&&C&&x.push(...ba(o,v,g,b));const _=[o,...x],k=await Ma(e,f),M=[];let Z=(null==(a=n.flip)?void 0:a.overflows)||[];if(d&&M.push(k[m]),h){const t=ga(s,r,b);M.push(k[t[0]],k[t[1]])}if(Z=[...Z,{placement:s,overflows:M}],!M.every(t=>t<=0)){var V,D;const t=((null==(V=n.flip)?void 0:V.index)||0)+1,e=_[t];if(e){if(!("alignment"===h&&w!==ua(e))||Z.every(t=>ua(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:Z},reset:{placement:e}}}let i=null==(D=Z.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:D.placement;if(!i)switch(p){case"bestFit":{var S;const t=null==(S=Z.filter(t=>{if(C){const e=ua(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:S[0];t&&(i=t);break}case"initialPlacement":i=o}if(s!==i)return{reset:{placement:i}}}return{}}}},xs=(t,e,i)=>{const a=new Map,s={platform:vs,...i},n={...s.platform,_c:a};return(async(t,e,i)=>{const{placement:a="bottom",strategy:s="absolute",middleware:n=[],platform:r}=i,o=n.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=ka(c,a,l),u=a,p={},g=0;for(let i=0;i<o.length;i++){const{name:n,fn:v}=o[i],{x:f,y:m,data:w,reset:y}=await v({x:d,y:h,initialPlacement:a,placement:u,strategy:s,middlewareData:p,rects:c,platform:r,elements:{reference:t,floating:e}});d=null!=f?f:d,h=null!=m?m:h,p={...p,[n]:{...p[n],...w}},y&&g<=50&&(g++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:s}):y.rects),({x:d,y:h}=ka(c,u,l))),i=-1)}return{x:d,y:h,placement:u,strategy:s,middlewareData:p}})(t,e,{...s,platform:n})};var Cs=re`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class _s extends bi{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(a){customElements.define(t,class extends e{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}function ks(t="",e=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${t}-${e}`}_s.styles=[Cs],_s.dependencies={},t([Zi({type:Boolean,reflect:!0})],_s.prototype,"ssr",void 0);class Ms extends _s{constructor(){super(...arguments),this.myDropdown=ji(),this.dropdownMenuId=ks("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=ji(),this._handleClickOutOfElement=t=>{this.menuIsOpen&&(t.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(t){super.firstUpdated(t),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=ms(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition())))}hideMenu(t){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:t}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(t){if(!this.readonly)switch(t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(t,e){const i=t=>{var e;return(null==t?void 0:t.name)||(null===(e=null==t?void 0:t.constructor)||void 0===e?void 0:e.name)},a=e.map(i),s=t.map(t=>{const s=i(t),n=a.indexOf(s);return-1!==n?e[n]:t}).concat(e.filter(e=>!t.some(t=>i(t)===i(e))));return s}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let t="bottom-start";switch(this.drop){case"up":t=this.menuAlignRight?"top-end":"top-start";break;case"right":t="right-start";break;case"left":t="left-start";break;case"down":t=this.menuAlignRight?"bottom-end":"bottom-start";break;default:t="bottom-start"}const e=[ws(8),this.noFlip?void 0:bs(),ys()].filter(Boolean);let i=e;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(e,this.floatingOpts.middleware.filter(Boolean)));const a=Object.assign(Object.assign({strategy:"fixed",placement:t},this.floatingOpts),{middleware:i}),{x:s,y:n,strategy:r,placement:o}=await xs(this.myDropdown.value,this.menuRef.value,a);this.menuRef.value.setAttribute("data-placement",o),Object.assign(this.menuRef.value.style,{position:r,left:`${s}px`,top:`${n}px`})}}t([Zi({type:Boolean,state:!0})],Ms.prototype,"noFlip",void 0),t([Zi({type:Boolean,reflect:!0,state:!0})],Ms.prototype,"menuAlignRight",void 0),t([Zi({type:String,reflect:!0,state:!0})],Ms.prototype,"drop",void 0),t([Zi({type:Object})],Ms.prototype,"floatingOpts",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"menuIsOpen",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"disabled",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"readonly",void 0);const Zs={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:"dd/MM/yyyy"},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:"MM/dd/yyyy"},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:"yyyy/MM/dd"}},Vs=t=>{const e=t.getMonth(),i=t.getFullYear(),a=t.getDate(),s=new Date(i,e+1),n=tt(s);return p(t)&&n<a?et(s):new Date(i,e+1,a)},Ds=t=>{const e=t.getMonth(),i=t.getFullYear(),a=t.getDate(),s=new Date(i,e-1),n=tt(s);return p(t)&&n<a?et(s):new Date(i,e-1,a)},Ss=t=>{const e=new Date(t);return e.setHours(12),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e};function As(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,a)=>{const{update:s}=e;if(t in e){const n=t;e.update=function(t){if(t.has(n)){const e=t.get(n),s=this[n];e!==s&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[a](e,s))}s.call(this,t)}}}}
70
+ */const ji=()=>new Gi;class Gi{}const Ki=new WeakMap;const Qi=Ti(class extends Wi{render(t){return ii}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),ii}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=Ki.get(e);void 0===i&&(i=new WeakMap,Ki.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?Ki.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Xi=Math.min,Ji=Math.max,ta=Math.round,ea=Math.floor,ia=t=>({x:t,y:t}),aa={left:"right",right:"left",bottom:"top",top:"bottom"},sa={start:"end",end:"start"};function na(t,e,i){return Ji(t,Xi(e,i))}function ra(t,e){return"function"==typeof t?t(e):t}function oa(t){return t.split("-")[0]}function la(t){return t.split("-")[1]}function ca(t){return"x"===t?"y":"x"}function da(t){return"y"===t?"height":"width"}const ha=new Set(["top","bottom"]);function ua(t){return ha.has(oa(t))?"y":"x"}function pa(t){return ca(ua(t))}function ga(t,e,i){void 0===i&&(i=!1);const a=la(t),s=pa(t),n=da(s);let r="x"===s?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top";return e.reference[n]>e.floating[n]&&(r=xa(r)),[r,xa(r)]}function va(t){return t.replace(/start|end/g,t=>sa[t])}const fa=["left","right"],ma=["right","left"],wa=["top","bottom"],ya=["bottom","top"];function ba(t,e,i,a){const s=la(t);let n=function(t,e,i){switch(t){case"top":case"bottom":return i?e?ma:fa:e?fa:ma;case"left":case"right":return e?wa:ya;default:return[]}}(oa(t),"start"===i,a);return s&&(n=n.map(t=>t+"-"+s),e&&(n=n.concat(n.map(va)))),n}function xa(t){return t.replace(/left|right|bottom|top/g,t=>aa[t])}function _a(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Ca(t){const{x:e,y:i,width:a,height:s}=t;return{width:a,height:s,top:i,left:e,right:e+a,bottom:i+s,x:e,y:i}}function ka(t,e,i){let{reference:a,floating:s}=t;const n=ua(e),r=pa(e),o=da(r),l=oa(e),c="y"===n,d=a.x+a.width/2-s.width/2,h=a.y+a.height/2-s.height/2,u=a[o]/2-s[o]/2;let p;switch(l){case"top":p={x:d,y:a.y-s.height};break;case"bottom":p={x:d,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:h};break;case"left":p={x:a.x-s.width,y:h};break;default:p={x:a.x,y:a.y}}switch(la(e)){case"start":p[r]-=u*(i&&c?-1:1);break;case"end":p[r]+=u*(i&&c?-1:1)}return p}async function Ma(t,e){var i;void 0===e&&(e={});const{x:a,y:s,platform:n,rects:r,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=ra(e,t),g=_a(p),v=o[u?"floating"===h?"reference":"floating":h],f=Ca(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(v)))||i?v:v.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),m="floating"===h?{x:a,y:s,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==n.getOffsetParent?void 0:n.getOffsetParent(o.floating)),y=await(null==n.isElement?void 0:n.isElement(w))&&await(null==n.getScale?void 0:n.getScale(w))||{x:1,y:1},b=Ca(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:m,offsetParent:w,strategy:l}):m);return{top:(f.top-b.top+g.top)/y.y,bottom:(b.bottom-f.bottom+g.bottom)/y.y,left:(f.left-b.left+g.left)/y.x,right:(b.right-f.right+g.right)/y.x}}const Za=new Set(["left","top"]);function Va(){return"undefined"!=typeof window}function Sa(t){return Ba(t)?(t.nodeName||"").toLowerCase():"#document"}function Da(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Aa(t){var e;return null==(e=(Ba(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Ba(t){return!!Va()&&(t instanceof Node||t instanceof Da(t).Node)}function Ea(t){return!!Va()&&(t instanceof Element||t instanceof Da(t).Element)}function Fa(t){return!!Va()&&(t instanceof HTMLElement||t instanceof Da(t).HTMLElement)}function Ha(t){return!(!Va()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Da(t).ShadowRoot)}const $a=new Set(["inline","contents"]);function Ta(t){const{overflow:e,overflowX:i,overflowY:a,display:s}=ja(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+i)&&!$a.has(s)}const Ia=new Set(["table","td","th"]);function Pa(t){return Ia.has(Sa(t))}const La=[":popover-open",":modal"];function Ra(t){return La.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const Oa=["transform","translate","scale","rotate","perspective"],Ya=["transform","translate","scale","rotate","perspective","filter"],Na=["paint","layout","strict","content"];function za(t){const e=Ua(),i=Ea(t)?ja(t):t;return Oa.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||Ya.some(t=>(i.willChange||"").includes(t))||Na.some(t=>(i.contain||"").includes(t))}function Ua(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const qa=new Set(["html","body","#document"]);function Wa(t){return qa.has(Sa(t))}function ja(t){return Da(t).getComputedStyle(t)}function Ga(t){return Ea(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ka(t){if("html"===Sa(t))return t;const e=t.assignedSlot||t.parentNode||Ha(t)&&t.host||Aa(t);return Ha(e)?e.host:e}function Qa(t){const e=Ka(t);return Wa(e)?t.ownerDocument?t.ownerDocument.body:t.body:Fa(e)&&Ta(e)?e:Qa(e)}function Xa(t,e,i){var a;void 0===e&&(e=[]),void 0===i&&(i=!0);const s=Qa(t),n=s===(null==(a=t.ownerDocument)?void 0:a.body),r=Da(s);if(n){const t=Ja(r);return e.concat(r,r.visualViewport||[],Ta(s)?s:[],t&&i?Xa(t):[])}return e.concat(s,Xa(s,[],i))}function Ja(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ts(t){const e=ja(t);let i=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const s=Fa(t),n=s?t.offsetWidth:i,r=s?t.offsetHeight:a,o=ta(i)!==n||ta(a)!==r;return o&&(i=n,a=r),{width:i,height:a,$:o}}function es(t){return Ea(t)?t:t.contextElement}function is(t){const e=es(t);if(!Fa(e))return ia(1);const i=e.getBoundingClientRect(),{width:a,height:s,$:n}=ts(e);let r=(n?ta(i.width):i.width)/a,o=(n?ta(i.height):i.height)/s;return r&&Number.isFinite(r)||(r=1),o&&Number.isFinite(o)||(o=1),{x:r,y:o}}const as=ia(0);function ss(t){const e=Da(t);return Ua()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:as}function ns(t,e,i,a){void 0===e&&(e=!1),void 0===i&&(i=!1);const s=t.getBoundingClientRect(),n=es(t);let r=ia(1);e&&(a?Ea(a)&&(r=is(a)):r=is(t));const o=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Da(t))&&e}(n,i,a)?ss(n):ia(0);let l=(s.left+o.x)/r.x,c=(s.top+o.y)/r.y,d=s.width/r.x,h=s.height/r.y;if(n){const t=Da(n),e=a&&Ea(a)?Da(a):a;let i=t,s=Ja(i);for(;s&&a&&e!==i;){const t=is(s),e=s.getBoundingClientRect(),a=ja(s),n=e.left+(s.clientLeft+parseFloat(a.paddingLeft))*t.x,r=e.top+(s.clientTop+parseFloat(a.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,h*=t.y,l+=n,c+=r,i=Da(s),s=Ja(i)}}return Ca({width:d,height:h,x:l,y:c})}function rs(t,e){const i=Ga(t).scrollLeft;return e?e.left+i:ns(Aa(t)).left+i}function os(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-rs(t,i),y:i.top+e.scrollTop}}const ls=new Set(["absolute","fixed"]);function cs(t,e,i){let a;if("viewport"===e)a=function(t,e){const i=Da(t),a=Aa(t),s=i.visualViewport;let n=a.clientWidth,r=a.clientHeight,o=0,l=0;if(s){n=s.width,r=s.height;const t=Ua();(!t||t&&"fixed"===e)&&(o=s.offsetLeft,l=s.offsetTop)}const c=rs(a);if(c<=0){const t=a.ownerDocument,e=t.body,i=getComputedStyle(e),s="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(a.clientWidth-e.clientWidth-s);r<=25&&(n-=r)}else c<=25&&(n+=c);return{width:n,height:r,x:o,y:l}}(t,i);else if("document"===e)a=function(t){const e=Aa(t),i=Ga(t),a=t.ownerDocument.body,s=Ji(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),n=Ji(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let r=-i.scrollLeft+rs(t);const o=-i.scrollTop;return"rtl"===ja(a).direction&&(r+=Ji(e.clientWidth,a.clientWidth)-s),{width:s,height:n,x:r,y:o}}(Aa(t));else if(Ea(e))a=function(t,e){const i=ns(t,!0,"fixed"===e),a=i.top+t.clientTop,s=i.left+t.clientLeft,n=Fa(t)?is(t):ia(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:s*n.x,y:a*n.y}}(e,i);else{const i=ss(t);a={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ca(a)}function ds(t,e){const i=Ka(t);return!(i===e||!Ea(i)||Wa(i))&&("fixed"===ja(i).position||ds(i,e))}function hs(t,e,i){const a=Fa(e),s=Aa(e),n="fixed"===i,r=ns(t,!0,n,e);let o={scrollLeft:0,scrollTop:0};const l=ia(0);function c(){l.x=rs(s)}if(a||!a&&!n)if(("body"!==Sa(e)||Ta(s))&&(o=Ga(e)),a){const t=ns(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else s&&c();n&&!a&&s&&c();const d=!s||a||n?ia(0):os(s,o);return{x:r.left+o.scrollLeft-l.x-d.x,y:r.top+o.scrollTop-l.y-d.y,width:r.width,height:r.height}}function us(t){return"static"===ja(t).position}function ps(t,e){if(!Fa(t)||"fixed"===ja(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Aa(t)===i&&(i=i.ownerDocument.body),i}function gs(t,e){const i=Da(t);if(Ra(t))return i;if(!Fa(t)){let e=Ka(t);for(;e&&!Wa(e);){if(Ea(e)&&!us(e))return e;e=Ka(e)}return i}let a=ps(t,e);for(;a&&Pa(a)&&us(a);)a=ps(a,e);return a&&Wa(a)&&us(a)&&!za(a)?i:a||function(t){let e=Ka(t);for(;Fa(e)&&!Wa(e);){if(za(e))return e;if(Ra(e))return null;e=Ka(e)}return null}(t)||i}const vs={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:a,strategy:s}=t;const n="fixed"===s,r=Aa(a),o=!!e&&Ra(e.floating);if(a===r||o&&n)return i;let l={scrollLeft:0,scrollTop:0},c=ia(1);const d=ia(0),h=Fa(a);if((h||!h&&!n)&&(("body"!==Sa(a)||Ta(r))&&(l=Ga(a)),Fa(a))){const t=ns(a);c=is(a),d.x=t.x+a.clientLeft,d.y=t.y+a.clientTop}const u=!r||h||n?ia(0):os(r,l);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x+u.x,y:i.y*c.y-l.scrollTop*c.y+d.y+u.y}},getDocumentElement:Aa,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:a,strategy:s}=t;const n=[..."clippingAncestors"===i?Ra(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let a=Xa(t,[],!1).filter(t=>Ea(t)&&"body"!==Sa(t)),s=null;const n="fixed"===ja(t).position;let r=n?Ka(t):t;for(;Ea(r)&&!Wa(r);){const e=ja(r),i=za(r);i||"fixed"!==e.position||(s=null),(n?!i&&!s:!i&&"static"===e.position&&s&&ls.has(s.position)||Ta(r)&&!i&&ds(t,r))?a=a.filter(t=>t!==r):s=e,r=Ka(r)}return e.set(t,a),a}(e,this._c):[].concat(i),a],r=n[0],o=n.reduce((t,i)=>{const a=cs(e,i,s);return t.top=Ji(a.top,t.top),t.right=Xi(a.right,t.right),t.bottom=Xi(a.bottom,t.bottom),t.left=Ji(a.left,t.left),t},cs(e,r,s));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:gs,getElementRects:async function(t){const e=this.getOffsetParent||gs,i=this.getDimensions,a=await i(t.floating);return{reference:hs(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=ts(t);return{width:e,height:i}},getScale:is,isElement:Ea,isRTL:function(t){return"rtl"===ja(t).direction}};function fs(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ms(t,e,i,a){void 0===a&&(a={});const{ancestorScroll:s=!0,ancestorResize:n=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=es(t),d=s||n?[...c?Xa(c):[],...Xa(e)]:[];d.forEach(t=>{s&&t.addEventListener("scroll",i,{passive:!0}),n&&t.addEventListener("resize",i)});const h=c&&o?function(t,e){let i,a=null;const s=Aa(t);function n(){var t;clearTimeout(i),null==(t=a)||t.disconnect(),a=null}return function r(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),n();const c=t.getBoundingClientRect(),{left:d,top:h,width:u,height:p}=c;if(o||e(),!u||!p)return;const g={rootMargin:-ea(h)+"px "+-ea(s.clientWidth-(d+u))+"px "+-ea(s.clientHeight-(h+p))+"px "+-ea(d)+"px",threshold:Ji(0,Xi(1,l))||1};let v=!0;function f(e){const a=e[0].intersectionRatio;if(a!==l){if(!v)return r();a?r(!1,a):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==a||fs(c,t.getBoundingClientRect())||r(),v=!1}try{a=new IntersectionObserver(f,{...g,root:s.ownerDocument})}catch(t){a=new IntersectionObserver(f,g)}a.observe(t)}(!0),n}(c,i):null;let u,p=-1,g=null;r&&(g=new ResizeObserver(t=>{let[a]=t;a&&a.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=g)||t.observe(e)})),i()}),c&&!l&&g.observe(c),g.observe(e));let v=l?ns(t):null;return l&&function e(){const a=ns(t);v&&!fs(v,a)&&i();v=a,u=requestAnimationFrame(e)}(),i(),()=>{var t;d.forEach(t=>{s&&t.removeEventListener("scroll",i),n&&t.removeEventListener("resize",i)}),null==h||h(),null==(t=g)||t.disconnect(),g=null,l&&cancelAnimationFrame(u)}}const ws=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,a;const{x:s,y:n,placement:r,middlewareData:o}=e,l=await async function(t,e){const{placement:i,platform:a,elements:s}=t,n=await(null==a.isRTL?void 0:a.isRTL(s.floating)),r=oa(i),o=la(i),l="y"===ua(i),c=Za.has(r)?-1:1,d=n&&l?-1:1,h=ra(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:g}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&"number"==typeof g&&(p="end"===o?-1*g:g),l?{x:p*d,y:u*c}:{x:u*c,y:p*d}}(e,t);return r===(null==(i=o.offset)?void 0:i.placement)&&null!=(a=o.arrow)&&a.alignmentOffset?{}:{x:s+l.x,y:n+l.y,data:{...l,placement:r}}}}},ys=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:a,placement:s}=e,{mainAxis:n=!0,crossAxis:r=!1,limiter:o={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=ra(t,e),c={x:i,y:a},d=await Ma(e,l),h=ua(oa(s)),u=ca(h);let p=c[u],g=c[h];if(n){const t="y"===u?"bottom":"right";p=na(p+d["y"===u?"top":"left"],p,p-d[t])}if(r){const t="y"===h?"bottom":"right";g=na(g+d["y"===h?"top":"left"],g,g-d[t])}const v=o.fn({...e,[u]:p,[h]:g});return{...v,data:{x:v.x-i,y:v.y-a,enabled:{[u]:n,[h]:r}}}}}},bs=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,a;const{placement:s,middlewareData:n,rects:r,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...f}=ra(t,e);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const m=oa(s),w=ua(o),y=oa(o)===o,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=u||(y||!v?[xa(o)]:function(t){const e=xa(t);return[va(t),e,va(e)]}(o)),_="none"!==g;!u&&_&&x.push(...ba(o,v,g,b));const C=[o,...x],k=await Ma(e,f),M=[];let Z=(null==(a=n.flip)?void 0:a.overflows)||[];if(d&&M.push(k[m]),h){const t=ga(s,r,b);M.push(k[t[0]],k[t[1]])}if(Z=[...Z,{placement:s,overflows:M}],!M.every(t=>t<=0)){var V,S;const t=((null==(V=n.flip)?void 0:V.index)||0)+1,e=C[t];if(e){if(!("alignment"===h&&w!==ua(e))||Z.every(t=>ua(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:Z},reset:{placement:e}}}let i=null==(S=Z.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:S.placement;if(!i)switch(p){case"bestFit":{var D;const t=null==(D=Z.filter(t=>{if(_){const e=ua(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:D[0];t&&(i=t);break}case"initialPlacement":i=o}if(s!==i)return{reset:{placement:i}}}return{}}}},xs=(t,e,i)=>{const a=new Map,s={platform:vs,...i},n={...s.platform,_c:a};return(async(t,e,i)=>{const{placement:a="bottom",strategy:s="absolute",middleware:n=[],platform:r}=i,o=n.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=ka(c,a,l),u=a,p={},g=0;for(let i=0;i<o.length;i++){const{name:n,fn:v}=o[i],{x:f,y:m,data:w,reset:y}=await v({x:d,y:h,initialPlacement:a,placement:u,strategy:s,middlewareData:p,rects:c,platform:r,elements:{reference:t,floating:e}});d=null!=f?f:d,h=null!=m?m:h,p={...p,[n]:{...p[n],...w}},y&&g<=50&&(g++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:s}):y.rects),({x:d,y:h}=ka(c,u,l))),i=-1)}return{x:d,y:h,placement:u,strategy:s,middlewareData:p}})(t,e,{...s,platform:n})};var _s=re`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Cs extends bi{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(a){customElements.define(t,class extends e{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}function ks(t="",e=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${t}-${e}`}Cs.styles=[_s],Cs.dependencies={},t([Zi({type:Boolean,reflect:!0})],Cs.prototype,"ssr",void 0);class Ms extends Cs{constructor(){super(...arguments),this.myDropdown=ji(),this.dropdownMenuId=ks("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=ji(),this._handleClickOutOfElement=t=>{this.menuIsOpen&&(t.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(t){super.firstUpdated(t),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=ms(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition())))}hideMenu(t){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:t}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(t){if(!this.readonly)switch(t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(t,e){const i=t=>{var e;return(null==t?void 0:t.name)||(null===(e=null==t?void 0:t.constructor)||void 0===e?void 0:e.name)},a=e.map(i),s=t.map(t=>{const s=i(t),n=a.indexOf(s);return-1!==n?e[n]:t}).concat(e.filter(e=>!t.some(t=>i(t)===i(e))));return s}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let t="bottom-start";switch(this.drop){case"up":t=this.menuAlignRight?"top-end":"top-start";break;case"right":t="right-start";break;case"left":t="left-start";break;case"down":t=this.menuAlignRight?"bottom-end":"bottom-start";break;default:t="bottom-start"}const e=[ws(8),this.noFlip?void 0:bs(),ys()].filter(Boolean);let i=e;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(e,this.floatingOpts.middleware.filter(Boolean)));const a=Object.assign(Object.assign({strategy:"fixed",placement:t},this.floatingOpts),{middleware:i}),{x:s,y:n,strategy:r,placement:o}=await xs(this.myDropdown.value,this.menuRef.value,a);this.menuRef.value.setAttribute("data-placement",o),Object.assign(this.menuRef.value.style,{position:r,left:`${s}px`,top:`${n}px`})}}t([Zi({type:Boolean,state:!0})],Ms.prototype,"noFlip",void 0),t([Zi({type:Boolean,reflect:!0,state:!0})],Ms.prototype,"menuAlignRight",void 0),t([Zi({type:String,reflect:!0,state:!0})],Ms.prototype,"drop",void 0),t([Zi({type:Object})],Ms.prototype,"floatingOpts",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"menuIsOpen",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"disabled",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"readonly",void 0);const Zs={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:"dd/MM/yyyy"},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:"MM/dd/yyyy"},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:"yyyy/MM/dd"}},Vs=t=>{const e=t.getMonth(),i=t.getFullYear(),a=t.getDate(),s=new Date(i,e+1),n=tt(s);return p(t)&&n<a?et(s):new Date(i,e+1,a)},Ss=t=>{const e=t.getMonth(),i=t.getFullYear(),a=t.getDate(),s=new Date(i,e-1),n=tt(s);return p(t)&&n<a?et(s):new Date(i,e-1,a)},Ds=t=>{const e=new Date(t);return e.setHours(12),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e};function As(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,a)=>{const{update:s}=e;if(t in e){const n=t;e.update=function(t){if(t.has(n)){const e=t.get(n),s=this[n];e!==s&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[a](e,s))}s.call(this,t)}}}}
71
71
  /**
72
72
  * @license
73
73
  * Copyright 2018 Google LLC
@@ -77,7 +77,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
77
77
  * @license
78
78
  * Copyright 2018 Google LLC
79
79
  * SPDX-License-Identifier: BSD-3-Clause
80
- */var Ps,Ls=re`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-color:var(--sgds-color-fixed-light);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md);--btn-opacity:var(--sgds-opacity-100,1)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=brand]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-border-width:var(--sgds-border-width-1)}:host([variant=outline][tone=brand]){--btn-border-color:var(--sgds-primary-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-color:var(--sgds-primary-color-default);--btn-hover-bg:var(--sgds-primary-bg-translucent)}:host([variant=ghost][tone=brand]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=primary][tone=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline][tone=danger]){--btn-border-color:var(--sgds-danger-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=ghost][tone=danger]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=primary][tone=fixed-light]){--btn-bg:var(--sgds-surface-fixed-light);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 0%,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 100%),var(--sgds-surface-fixed-light,#fff);--btn-color:var(--sgds-color-fixed-dark)}:host([variant=outline][tone=fixed-light]){--btn-border-color:var(--sgds-border-color-fixed-light);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost][tone=fixed-light]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=neutral]){--btn-bg:var(--sgds-surface-inverse);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-surface-inverse);--btn-color:var(--sgds-color-inverse)}:host([variant=outline][tone=neutral]){--btn-border-color:var(--sgds-border-color-emphasis);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost][tone=neutral]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-20);height:var(--sgds-dimension-56);line-height:var(--sgds-line-height-32);min-width:var(--sgds-dimension-112);padding:var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-14);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-20);min-width:var(--sgds-dimension-80);padding:var(--sgds-padding-none) var(--sgds-padding-md)}:host([size=xs]) .btn{font-size:var(--sgds-font-size-12);height:var(--sgds-dimension-32);line-height:var(--sgds-line-height-16);min-width:var(--sgds-dimension-64);padding:var(--sgds-padding-none) var(--sgds-padding-sm)}.btn{align-items:center;background-color:var(--btn-bg);border:1px solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-16);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-24);min-width:var(--sgds-dimension-96);opacity:var(--btn-opacity);padding:var(--sgds-padding-none) var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn.active,.btn:hover{background:var(--btn-hover-bg)}.btn:focus,.btn:focus-visible{background:var(--btn-hover-bg);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-40)}.btn.loading{cursor:default}.btn slot::slotted(*){color:var(--btn-color)}`;class Rs extends _s{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.active=!1,this.disabled=!1,this.target="_self"}focus(t){this.button.focus(t)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation()}_handleKeydown(t){if("Enter"===t.key&&this.loading)return t.preventDefault(),void t.stopPropagation()}_assignSpinnerSize(t){return"xs"===t||"sm"===t?"xs":"md"===t||"lg"===t?"sm":void 0}_assignSpinnerTone(t,e){return"fixed-light"===t&&"primary"===e?"fixed-dark":"neutral"===t&&"primary"===e?"inverse":"fixed-light"===t||"primary"===e?"fixed-light":"neutral"!==t||"outline"!==e&&"ghost"!==e?"brand":"neutral"}}Rs.styles=[..._s.styles,Ls],t([Ai(".btn")],Rs.prototype,"button",void 0),t([Zi({reflect:!0})],Rs.prototype,"variant",void 0),t([Zi({reflect:!0})],Rs.prototype,"tone",void 0),t([Zi({reflect:!0})],Rs.prototype,"size",void 0),t([Zi({type:Boolean,reflect:!0})],Rs.prototype,"active",void 0),t([Zi({type:Boolean,reflect:!0})],Rs.prototype,"disabled",void 0),t([Zi({type:String,reflect:!0})],Rs.prototype,"href",void 0),t([Zi({type:String,reflect:!0})],Rs.prototype,"target",void 0),t([Zi({type:String,reflect:!0})],Rs.prototype,"download",void 0),t([Zi({type:String})],Rs.prototype,"ariaLabel",void 0),t([Zi({type:Boolean})],Rs.prototype,"loading",void 0);class Os{constructor(t,...e){this.slotNames=[],(this.host=t).addController(this),this.slotNames=e,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some(t=>{var e;if(t.nodeType===t.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim()))return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("sl-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){var t;null===(t=this.host.shadowRoot)||void 0===t||t.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){var t;null===(t=this.host.shadowRoot)||void 0===t||t.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(t){const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()}}class Ys{constructor(t,e){(this.host=t).addController(this),this.options=Object.assign({form:t=>t.closest("form")},e)}hostConnected(){this.form=this.options.form(this.host)}hostDisconnected(){this.form&&(this.form=void 0)}doAction(t,e){if(this.form){const i=document.createElement("button");i.type=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",e&&["formaction","formmethod","formnovalidate","formtarget"].forEach(t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t))}),this.form.append(i),i.click(),i.remove()}}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}}var Ns=re`::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}`,zs=re`:host{display:inline-block}:host([fullWidth]),:host([fullWidth]) .btn{width:100%}:host([fullWidth]) .btn.has-left-icon{justify-content:flex-start}:host([fullWidth]) .btn.has-right-icon{justify-content:space-between}:host([fullWidth]) .btn.has-left-icon.has-right-icon{justify-content:center}.btn span{padding:0 var(--sgds-padding-2-xs)}.btn.no-icon{gap:var(--sgds-gap-none)}.loading{cursor:default}`;class Us extends Rs{constructor(){super(...arguments),this.formSubmitController=new Ys(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");return e.getElementById(i)}return t.closest("form")}}),this.type="button",this.fullWidth=!1,this.hasLeftIconSlot=!1,this.hasRightIconSlot=!1,this.hasSlotController=new Os(this,"leftIcon","rightIcon"),this._clickHandler=()=>{"submit"===this.type&&this.formSubmitController.submit(this),"reset"===this.type&&this.formSubmitController.reset(this)}}updated(){this.hasLeftIconSlot||(this.hasLeftIconSlot=this.hasSlotController.test("leftIcon")),this.hasRightIconSlot||(this.hasRightIconSlot=this.hasSlotController.test("rightIcon"))}_handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}render(){const t=this.href,e=t?$s`a`:$s`button`,i=!this.hasLeftIconSlot&&!this.hasRightIconSlot;return Is`
80
+ */var Ps,Ls=re`:host{--btn-font-weight:var(--sgds-font-weight-regular);--btn-color:var(--sgds-color-fixed-light);--btn-bg:var(--sgds-primary-surface-default);--btn-hover-bg:var(--sgds-primary-surface-emphasis);--btn-border-radius:var(--sgds-border-radius-md);--btn-opacity:var(--sgds-opacity-100,1)}:host([variant=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=brand]){--btn-bg:var(--sgds-primary-surface-default);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline]){--btn-border-width:var(--sgds-border-width-1)}:host([variant=outline][tone=brand]){--btn-border-color:var(--sgds-primary-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-color:var(--sgds-primary-color-default);--btn-hover-bg:var(--sgds-primary-bg-translucent)}:host([variant=ghost][tone=brand]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-primary-surface-translucent);--btn-color:var(--sgds-primary-color-default)}:host([variant=primary][tone=danger]){--btn-bg:var(--sgds-danger-surface-default);--btn-hover-bg:var(--sgds-danger-surface-emphasis);--btn-color:var(--sgds-color-fixed-light)}:host([variant=outline][tone=danger]){--btn-border-color:var(--sgds-danger-border-color-default);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=ghost][tone=danger]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-danger-surface-translucent);--btn-color:var(--sgds-danger-color-default)}:host([variant=primary][tone=fixed-light]){--btn-bg:var(--sgds-surface-fixed-light);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 0%,var(--sgds-bg-translucent-fixed-dark,hsla(0,0%,5%,.2)) 100%),var(--sgds-surface-fixed-light,#fff);--btn-color:var(--sgds-color-fixed-dark)}:host([variant=outline][tone=fixed-light]){--btn-border-color:var(--sgds-border-color-fixed-light);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=ghost][tone=fixed-light]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-fixed-dark) 0%,var(--sgds-bg-translucent-fixed-dark) 100%),var(--sgds-bg-transparent);--btn-color:var(--sgds-color-fixed-light)}:host([variant=primary][tone=neutral]){--btn-bg:var(--sgds-surface-inverse);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-surface-inverse);--btn-color:var(--sgds-color-inverse)}:host([variant=outline][tone=neutral]){--btn-border-color:var(--sgds-border-color-emphasis);--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:linear-gradient(0deg,var(--sgds-bg-translucent-inverse) 0%,var(--sgds-bg-translucent-inverse) 100%),var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost][tone=neutral]){--btn-bg:var(--sgds-bg-transparent);--btn-hover-bg:var(--sgds-bg-translucent-subtle);--btn-color:var(--sgds-color-default)}:host([variant=ghost]) .btn,:host([variant=outline]) .btn,:host([variant=primary]) .btn{color:var(--btn-color)}:host([variant=outline]) .btn{border:var(--btn-border-width) solid var(--btn-border-color)}:host([size=lg]) .btn{font-size:var(--sgds-font-size-20);height:var(--sgds-dimension-56);line-height:var(--sgds-line-height-32);min-width:var(--sgds-dimension-112);padding:var(--sgds-padding-none) var(--sgds-padding-xl)}:host([size=sm]) .btn{font-size:var(--sgds-font-size-14);height:var(--sgds-dimension-40);line-height:var(--sgds-line-height-20);min-width:var(--sgds-dimension-80);padding:var(--sgds-padding-none) var(--sgds-padding-md)}:host([size=xs]) .btn{font-size:var(--sgds-font-size-12);height:var(--sgds-dimension-32);line-height:var(--sgds-line-height-16);min-width:var(--sgds-dimension-64);padding:var(--sgds-padding-none) var(--sgds-padding-sm)}.btn{align-items:center;background-color:var(--btn-bg);border:1px solid var(--sgds-border-color-transparent);border-radius:var(--btn-border-radius);color:var(--sgds-color-fixed-light);cursor:pointer;display:inline-flex;font-size:var(--sgds-font-size-16);font-weight:var(--btn-font-weight);gap:var(--sgds-gap-2-xs);height:var(--sgds-dimension-48);justify-content:center;line-height:var(--sgds-line-height-24);min-width:var(--sgds-dimension-96);opacity:var(--btn-opacity);padding:var(--sgds-padding-none) var(--sgds-padding-lg);text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;user-select:none;vertical-align:middle;white-space:nowrap;width:inherit}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn.active,.btn:hover{background:var(--btn-hover-bg)}.btn:focus,.btn:focus-visible{background:var(--btn-hover-bg);border-color:transparent;outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}.btn.disabled,.btn:disabled{color:var(--btn-color);cursor:not-allowed;opacity:var(--sgds-opacity-40)}.btn.loading{cursor:default}.btn slot::slotted(*){color:var(--btn-color)}`;class Rs extends Cs{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.active=!1,this.disabled=!1,this.target="_self"}focus(t){this.button.focus(t)}click(){this.button.click()}blur(){this.button.blur()}_handleBlur(){this.emit("sgds-blur")}_handleFocus(){this.emit("sgds-focus")}_handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation()}_handleKeydown(t){if("Enter"===t.key&&this.loading)return t.preventDefault(),void t.stopPropagation()}_assignSpinnerSize(t){return"xs"===t||"sm"===t?"xs":"md"===t||"lg"===t?"sm":void 0}_assignSpinnerTone(t,e){return"fixed-light"===t&&"primary"===e?"fixed-dark":"neutral"===t&&"primary"===e?"inverse":"fixed-light"===t||"primary"===e?"fixed-light":"neutral"!==t||"outline"!==e&&"ghost"!==e?"brand":"neutral"}}Rs.styles=[...Cs.styles,Ls],t([Ai(".btn")],Rs.prototype,"button",void 0),t([Zi({reflect:!0})],Rs.prototype,"variant",void 0),t([Zi({reflect:!0})],Rs.prototype,"tone",void 0),t([Zi({reflect:!0})],Rs.prototype,"size",void 0),t([Zi({type:Boolean,reflect:!0})],Rs.prototype,"active",void 0),t([Zi({type:Boolean,reflect:!0})],Rs.prototype,"disabled",void 0),t([Zi({type:String,reflect:!0})],Rs.prototype,"href",void 0),t([Zi({type:String,reflect:!0})],Rs.prototype,"target",void 0),t([Zi({type:String,reflect:!0})],Rs.prototype,"download",void 0),t([Zi({type:String})],Rs.prototype,"ariaLabel",void 0),t([Zi({type:Boolean})],Rs.prototype,"loading",void 0);class Os{constructor(t,...e){this.slotNames=[],(this.host=t).addController(this),this.slotNames=e,this.handleSlotChange=this.handleSlotChange.bind(this)}hasDefaultSlot(){return[...this.host.childNodes].some(t=>{var e;if(t.nodeType===t.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim()))return!0;if(t.nodeType===t.ELEMENT_NODE){const e=t;if("sl-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(t){return null!==this.host.querySelector(`:scope > [slot="${t}"]`)}test(t){return"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){var t;null===(t=this.host.shadowRoot)||void 0===t||t.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){var t;null===(t=this.host.shadowRoot)||void 0===t||t.removeEventListener("slotchange",this.handleSlotChange)}handleSlotChange(t){const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()}}class Ys{constructor(t,e){(this.host=t).addController(this),this.options=Object.assign({form:t=>t.closest("form")},e)}hostConnected(){this.form=this.options.form(this.host)}hostDisconnected(){this.form&&(this.form=void 0)}doAction(t,e){if(this.form){const i=document.createElement("button");i.type=t,i.style.position="absolute",i.style.width="0",i.style.height="0",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",e&&["formaction","formmethod","formnovalidate","formtarget"].forEach(t=>{e.hasAttribute(t)&&i.setAttribute(t,e.getAttribute(t))}),this.form.append(i),i.click(),i.remove()}}reset(t){this.doAction("reset",t)}submit(t){this.doAction("submit",t)}}var Ns=re`::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}`,zs=re`:host{display:inline-block}:host([fullWidth]),:host([fullWidth]) .btn{width:100%}:host([fullWidth]) .btn.has-left-icon{justify-content:flex-start}:host([fullWidth]) .btn.has-right-icon{justify-content:space-between}:host([fullWidth]) .btn.has-left-icon.has-right-icon{justify-content:center}.btn span{padding:0 var(--sgds-padding-2-xs)}.btn.no-icon{gap:var(--sgds-gap-none)}.loading{cursor:default}`;class Us extends Rs{constructor(){super(...arguments),this.formSubmitController=new Ys(this,{form:t=>{if(t.hasAttribute("form")){const e=t.getRootNode(),i=t.getAttribute("form");return e.getElementById(i)}return t.closest("form")}}),this.type="button",this.fullWidth=!1,this.hasLeftIconSlot=!1,this.hasRightIconSlot=!1,this.hasSlotController=new Os(this,"leftIcon","rightIcon"),this._clickHandler=()=>{"submit"===this.type&&this.formSubmitController.submit(this),"reset"===this.type&&this.formSubmitController.reset(this)}}updated(){this.hasLeftIconSlot||(this.hasLeftIconSlot=this.hasSlotController.test("leftIcon")),this.hasRightIconSlot||(this.hasRightIconSlot=this.hasSlotController.test("rightIcon"))}_handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();this.removeEventListener("click",this._clickHandler),this.addEventListener("click",this._clickHandler)}render(){const t=this.href,e=t?$s`a`:$s`button`,i=!this.hasLeftIconSlot&&!this.hasRightIconSlot;return Is`
81
81
  <${e}
82
82
  class="btn ${Bs({disabled:this.disabled,active:this.active,"has-left-icon":this.hasLeftIconSlot,"has-right-icon":this.hasRightIconSlot,"no-icon":i,loading:this.loading})}"
83
83
  ?disabled=${Es(t?void 0:this.disabled)}
@@ -103,7 +103,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
103
103
  <slot name="rightIcon"></slot>`}
104
104
 
105
105
  </${e}>
106
- `}}Us.styles=[...Rs.styles,Ns,zs],t([Zi({type:String,reflect:!0})],Us.prototype,"type",void 0),t([Zi({type:String,reflect:!0})],Us.prototype,"form",void 0),t([Zi({type:String,reflect:!0,attribute:"formaction"})],Us.prototype,"formAction",void 0),t([Zi({type:String,reflect:!0,attribute:"formmethod"})],Us.prototype,"formMethod",void 0),t([Zi({attribute:"formnovalidate",type:Boolean,reflect:!0})],Us.prototype,"formNoValidate",void 0),t([Zi({type:String,reflect:!0,attribute:"formtarget"})],Us.prototype,"formTarget",void 0),t([Zi({type:Boolean,reflect:!0})],Us.prototype,"fullWidth",void 0),t([Zi({type:Boolean})],Us.prototype,"hasLeftIconSlot",void 0),t([Zi({type:Boolean})],Us.prototype,"hasRightIconSlot",void 0);var qs=re`:host([menuisopen]) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1050}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,Ws=re`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);line-height:var(--sgds-line-height-20);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-20);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;const js=new Date,Gs={ArrowUp:{days:-7,months:-3,years:-3},ArrowDown:{days:7,months:3,years:3},ArrowRight:{days:1,months:1,years:1},ArrowLeft:{days:-1,months:-1,years:-1}};class Ks extends _s{constructor(){super(...arguments),this.selectedDate=[],this.mode="single"}focusOnCalendar(t){t.blur(),this._focusOnCalendarCell()}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyPress),this.addEventListener("blur",t=>t.stopPropagation())}updated(){3===this.focusedTabIndex&&this._focusOnCalendarCell()}_updateFocusedDate(){this.focusedDate=Ss(this.displayDate),this.focusedDate.getFullYear()<1900&&this.focusedDate.setFullYear(1900)}_setFocusedDate(t){const e=this.focusedDate.getDate(),i=this.focusedDate.getMonth(),a=this.focusedDate.getFullYear();switch(this.view){case"days":{const s=Ss(new Date(a,i,e+t));(it(s,new Date(0,0,1,12))||st(s,new Date(0,0,1,12)))&&(this.focusedDate=s);break}case"months":{const s=Ss(new Date(a,i+t,e));(it(s,new Date(0,0,1,12))||st(s,new Date(0,0,1,12)))&&(this.focusedDate=s);break}case"years":{const s=Ss(new Date(a+t,i,e));s.getFullYear()>=1900&&(this.focusedDate=s);break}}}_handleEnterDateKeyboard(t){const e=t.composedPath()[0];if(!e.classList.contains("disabled"))switch(this.view){case"days":this._onClickDay(t);break;case"months":{const{month:t}=e.dataset;this._onClickMonth(parseInt(t));break}case"years":{const{year:t}=e.dataset;this._onClickYear(parseInt(t))}}}_handleKeyPress(t){if("Enter"===t.key)return t.preventDefault(),void this._handleEnterDateKeyboard(t);if("Tab"===t.key){const t=this._getFocusedTarget();return void(3!==this.focusedTabIndex&&t.blur())}if(t.key.includes("Arrow")){t.preventDefault(),this._blurCalendarCell();const e=Gs[t.key][this.view];this._setFocusedDate(e),this._focusOnCalendarCell()}}_generateIncrementDates(){const t=Ss(this.selectedDate[0]);if(this.selectedDate.length<2)return[t];const e=Ss(this.selectedDate[1]),i=[];if(t.getTime()<e.getTime())for(let a=t;a<=e;a.setDate(a.getDate()+1))i.push(new Date(a));else for(let a=e;a<=t;a.setDate(a.getDate()+1))i.push(new Date(a));return i}_onClickDay(t){const{day:e,date:i}=t.composedPath()[0].dataset,a=new Date(this.displayDate);if(a.setDate(parseInt(e)),"click"===t.type&&(this.focusedDate=Ss(new Date(i))),"single"===this.mode)this.selectedDate=[a],this.emit("sgds-selectdates",{detail:this.selectedDate});else if("range"===this.mode){const t=[...this.selectedDate];0!==t.length&&2!==t.length||(t.length=0),t.push(a),this.selectedDate=t,this.emit("sgds-selectdates",{detail:this.selectedDate})}const s=this.minDate?Ss(new Date(this.minDate)):null,n=this.maxDate?Ss(new Date(this.maxDate)):null,r=Ss(a);(s&&r<s||n&&r>n)&&(t.stopPropagation(),t.preventDefault())}_onClickMonth(t,e=this.focusedDate.getFullYear()){const i=new Date(this.displayDate);this.view="days",i.setMonth(t),i.setFullYear(e),this.displayDate=i,this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectmonth",{detail:this.displayDate})}_onClickYear(t){const e=new Date(this.displayDate);e.setFullYear(t),this.displayDate=e,this.view="months",this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectyear",{detail:this.displayDate})}_getFocusedTarget(){const t={days:`td[data-date="${this.focusedDate.toISOString()}"]`,months:`button[data-month="${this.focusedDate.getMonth()}"][data-year="${this.focusedDate.getFullYear()}"]`,years:`button[data-year="${this.focusedDate.getFullYear()}"]`}[this.view];return this.shadowRoot.querySelector(`${t}`)}_blurCalendarCell(){const t=this._getFocusedTarget();t.setAttribute("tabindex","-1"),t.blur()}_focusOnCalendarCell(){const t=this._getFocusedTarget();t?(t.setAttribute("tabindex","3"),t.focus(),this.emit("sgds-update-focus",{detail:this.focusedDate})):this.emit("sgds-change-calendar",{detail:this.focusedDate})}_generateDays(){const t=this.selectedDate.map(t=>Ss(t)),e=this._generateIncrementDates(),i=this.minDate?Ss(new Date(this.minDate)):null,a=this.maxDate?Ss(new Date(this.maxDate)):null,s=this.displayDate.getFullYear(),n=this.displayDate.getMonth(),r=new Date(s,n,1).getDay();let o=Ks.daysInMonth[n];1===n&&(s%4==0&&s%100!=0||s%400==0)&&(o=29);const l=[];let c=1;for(let d=0;d<9;d++){const h=[];for(let l=0;l<=6;l++)if(c<=o&&(d>0||l>=r)){const r=new Date(s,n,c,12,0,0,0),o=r.toISOString(),d=i&&Date.parse(o)<Date.parse(i.toISOString()),u=a&&Date.parse(o)>Date.parse(a.toISOString()),p=d||u?void 0:this._onClickDay,g=js.getMonth()===this.displayDate.getMonth(),v=js.getFullYear()===this.displayDate.getFullYear(),f=js.getDate()===c,m=t.length>0&&e.some(t=>Date.parse(o)===Date.parse(t.toISOString())),w=t.length>0&&e[0].toISOString()===o,y=t.length>1&&e[e.length-1].toISOString()===o,b=""+(f&&g&&v?"Today's date, ":"")+X(r,"PPPP");h.push(Je`<td
106
+ `}}Us.styles=[...Rs.styles,Ns,zs],t([Zi({type:String,reflect:!0})],Us.prototype,"type",void 0),t([Zi({type:String,reflect:!0})],Us.prototype,"form",void 0),t([Zi({type:String,reflect:!0,attribute:"formaction"})],Us.prototype,"formAction",void 0),t([Zi({type:String,reflect:!0,attribute:"formmethod"})],Us.prototype,"formMethod",void 0),t([Zi({attribute:"formnovalidate",type:Boolean,reflect:!0})],Us.prototype,"formNoValidate",void 0),t([Zi({type:String,reflect:!0,attribute:"formtarget"})],Us.prototype,"formTarget",void 0),t([Zi({type:Boolean,reflect:!0})],Us.prototype,"fullWidth",void 0),t([Zi({type:Boolean})],Us.prototype,"hasLeftIconSlot",void 0),t([Zi({type:Boolean})],Us.prototype,"hasRightIconSlot",void 0);var qs=re`:host([menuisopen]) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1050}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,Ws=re`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);line-height:var(--sgds-line-height-20);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-20);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;const js=new Date,Gs={ArrowUp:{days:-7,months:-3,years:-3},ArrowDown:{days:7,months:3,years:3},ArrowRight:{days:1,months:1,years:1},ArrowLeft:{days:-1,months:-1,years:-1}};class Ks extends Cs{constructor(){super(...arguments),this.selectedDate=[],this.mode="single"}focusOnCalendar(t){t.blur(),this._focusOnCalendarCell()}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyPress),this.addEventListener("blur",t=>t.stopPropagation())}updated(){3===this.focusedTabIndex&&this._focusOnCalendarCell()}_updateFocusedDate(){this.focusedDate=Ds(this.displayDate),this.focusedDate.getFullYear()<1900&&this.focusedDate.setFullYear(1900)}_setFocusedDate(t){const e=this.focusedDate.getDate(),i=this.focusedDate.getMonth(),a=this.focusedDate.getFullYear();switch(this.view){case"days":{const s=Ds(new Date(a,i,e+t));(it(s,new Date(0,0,1,12))||st(s,new Date(0,0,1,12)))&&(this.focusedDate=s);break}case"months":{const s=Ds(new Date(a,i+t,e));(it(s,new Date(0,0,1,12))||st(s,new Date(0,0,1,12)))&&(this.focusedDate=s);break}case"years":{const s=Ds(new Date(a+t,i,e));s.getFullYear()>=1900&&(this.focusedDate=s);break}}}_handleEnterDateKeyboard(t){const e=t.composedPath()[0];if(!e.classList.contains("disabled"))switch(this.view){case"days":this._onClickDay(t);break;case"months":{const{month:t}=e.dataset;this._onClickMonth(parseInt(t));break}case"years":{const{year:t}=e.dataset;this._onClickYear(parseInt(t))}}}_handleKeyPress(t){if("Enter"===t.key)return t.preventDefault(),void this._handleEnterDateKeyboard(t);if("Tab"===t.key){const t=this._getFocusedTarget();return void(3!==this.focusedTabIndex&&t.blur())}if(t.key.includes("Arrow")){t.preventDefault(),this._blurCalendarCell();const e=Gs[t.key][this.view];this._setFocusedDate(e),this._focusOnCalendarCell()}}_generateIncrementDates(){const t=Ds(this.selectedDate[0]);if(this.selectedDate.length<2)return[t];const e=Ds(this.selectedDate[1]),i=[];if(t.getTime()<e.getTime())for(let a=t;a<=e;a.setDate(a.getDate()+1))i.push(new Date(a));else for(let a=e;a<=t;a.setDate(a.getDate()+1))i.push(new Date(a));return i}_onClickDay(t){const{day:e,date:i}=t.composedPath()[0].dataset,a=new Date(this.displayDate);if(a.setDate(parseInt(e)),"click"===t.type&&(this.focusedDate=Ds(new Date(i))),"single"===this.mode)this.selectedDate=[a],this.emit("sgds-selectdates",{detail:this.selectedDate});else if("range"===this.mode){const t=[...this.selectedDate];0!==t.length&&2!==t.length||(t.length=0),t.push(a),this.selectedDate=t,this.emit("sgds-selectdates",{detail:this.selectedDate})}const s=this.minDate?Ds(new Date(this.minDate)):null,n=this.maxDate?Ds(new Date(this.maxDate)):null,r=Ds(a);(s&&r<s||n&&r>n)&&(t.stopPropagation(),t.preventDefault())}_onClickMonth(t,e=this.focusedDate.getFullYear()){const i=new Date(this.displayDate);this.view="days",i.setMonth(t),i.setFullYear(e),this.displayDate=i,this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectmonth",{detail:this.displayDate})}_onClickYear(t){const e=new Date(this.displayDate);e.setFullYear(t),this.displayDate=e,this.view="months",this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectyear",{detail:this.displayDate})}_getFocusedTarget(){const t={days:`td[data-date="${this.focusedDate.toISOString()}"]`,months:`button[data-month="${this.focusedDate.getMonth()}"][data-year="${this.focusedDate.getFullYear()}"]`,years:`button[data-year="${this.focusedDate.getFullYear()}"]`}[this.view];return this.shadowRoot.querySelector(`${t}`)}_blurCalendarCell(){const t=this._getFocusedTarget();t.setAttribute("tabindex","-1"),t.blur()}_focusOnCalendarCell(){const t=this._getFocusedTarget();t?(t.setAttribute("tabindex","3"),t.focus(),this.emit("sgds-update-focus",{detail:this.focusedDate})):this.emit("sgds-change-calendar",{detail:this.focusedDate})}_generateDays(){const t=this.selectedDate.map(t=>Ds(t)),e=this._generateIncrementDates(),i=this.minDate?Ds(new Date(this.minDate)):null,a=this.maxDate?Ds(new Date(this.maxDate)):null,s=this.displayDate.getFullYear(),n=this.displayDate.getMonth(),r=new Date(s,n,1).getDay();let o=Ks.daysInMonth[n];1===n&&(s%4==0&&s%100!=0||s%400==0)&&(o=29);const l=[];let c=1;for(let d=0;d<9;d++){const h=[];for(let l=0;l<=6;l++)if(c<=o&&(d>0||l>=r)){const r=new Date(s,n,c,12,0,0,0),o=r.toISOString(),d=i&&Date.parse(o)<Date.parse(i.toISOString()),u=a&&Date.parse(o)>Date.parse(a.toISOString()),p=d||u?void 0:this._onClickDay,g=js.getMonth()===this.displayDate.getMonth(),v=js.getFullYear()===this.displayDate.getFullYear(),f=js.getDate()===c,m=t.length>0&&e.some(t=>Date.parse(o)===Date.parse(t.toISOString())),w=t.length>0&&e[0].toISOString()===o,y=t.length>1&&e[e.length-1].toISOString()===o,b=""+(f&&g&&v?"Today's date, ":"")+X(r,"PPPP");h.push(Je`<td
107
107
  key=${l}
108
108
  data-date=${o}
109
109
  data-day=${c}
@@ -131,9 +131,9 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
131
131
  ${l}
132
132
  </tbody>
133
133
  </table>
134
- `}_generateMonths(){const t=this._generateIncrementDates(),e=t.map(t=>Ss(new Date(t.getFullYear(),t.getMonth())).getTime()),i=this.displayDate.getFullYear();return Je`
134
+ `}_generateMonths(){const t=this._generateIncrementDates(),e=t.map(t=>Ds(new Date(t.getFullYear(),t.getMonth())).getTime()),i=this.displayDate.getFullYear();return Je`
135
135
  <div class="monthpicker">
136
- ${Ks.MONTHVIEW_LABELS.map((a,s)=>{const n=s===js.getMonth()&&i===js.getFullYear(),r=Ss(new Date(i,s)).getTime(),o=t[0].getMonth()===s,l=t[0].getFullYear()===i,c=t[t.length-1].getMonth()===s,d=t[t.length-1].getFullYear()===i,h=n?`Current month ${a} ${i}`:`${a} ${i}`;return Je` <button
136
+ ${Ks.MONTHVIEW_LABELS.map((a,s)=>{const n=s===js.getMonth()&&i===js.getFullYear(),r=Ds(new Date(i,s)).getTime(),o=t[0].getMonth()===s,l=t[0].getFullYear()===i,c=t[t.length-1].getMonth()===s,d=t[t.length-1].getFullYear()===i,h=n?`Current month ${a} ${i}`:`${a} ${i}`;return Je` <button
137
137
  class=${Bs({active:e.includes(r),today:n,month:!0,"selected-ends":o&&l||c&&d})}
138
138
  @click=${()=>this._onClickMonth(s)}
139
139
  data-month=${s}
@@ -2377,9 +2377,9 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
2377
2377
  clip-rule="evenodd"
2378
2378
  />
2379
2379
  </svg>
2380
- `};var gn=re`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class vn extends _s{constructor(){super(...arguments),this.size="lg"}_getIconByName(t){if(!t)return;const e=pn[t];if(e)return e;console.warn(`Icon not found: ${t}`)}render(){const t=this._getIconByName(this.name);return t||ii}}vn.styles=[..._s.styles,gn],t([Zi({type:String,reflect:!0})],vn.prototype,"name",void 0),t([Zi({type:String,reflect:!0})],vn.prototype,"size",void 0);var fn=re`:host{--sgds-spinner-bg:var(--sgds-primary-surface-default);display:inline-flex}:host([variant=neutral]){--sgds-spinner-bg:var(--sgds-neutral-surface-default)}:host([tone=neutral]){--sgds-spinner-bg:var(--sgds-surface-inverse)}:host([tone=inverse]){--sgds-spinner-bg:var(--sgds-surface-default)}:host([tone=fixed-light]){--sgds-spinner-bg:var(--sgds-surface-fixed-light)}:host([tone=fixed-dark]){--sgds-spinner-bg:var(--sgds-surface-fixed-dark)}.spinner-wrapper{align-items:center;display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs)}.spinner-wrapper.horizontal{flex-direction:row}.spinner{--border-thickness:4px;animation:spinner .75s linear infinite;border:var(--border-thickness) solid var(--sgds-bg-translucent);border-radius:50%;border-right:var(--border-thickness) solid var(--sgds-spinner-bg);color:var(--sgds-spinner-color);display:inline-flex;height:var(--sgds-dimension-32);width:var(--sgds-dimension-32)}.spinner-xs{--border-thickness:2px;height:var(--sgds-dimension-16);width:var(--sgds-dimension-16)}.spinner-sm{--border-thickness:3px;height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.spinner-lg{--border-thickness:6px;height:var(--sgds-dimension-48);width:var(--sgds-dimension-48)}.spinner-xl{--border-thickness:8px;height:var(--sgds-dimension-64);width:var(--sgds-dimension-64)}.spinner-label{color:var(--sgds-neutral-color-default);font-size:var(--sgds-font-size-14)}@media (prefers-reduced-motion:reduce){.spinner{animation-duration:1.5s}}
2380
+ `};var gn=re`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class vn extends Cs{constructor(){super(...arguments),this.size="lg"}_getIconByName(t){if(!t)return;const e=pn[t];if(e)return e;console.warn(`Icon not found: ${t}`)}render(){const t=this._getIconByName(this.name);return t||ii}}vn.styles=[...Cs.styles,gn],t([Zi({type:String,reflect:!0})],vn.prototype,"name",void 0),t([Zi({type:String,reflect:!0})],vn.prototype,"size",void 0);var fn=re`:host{--sgds-spinner-bg:var(--sgds-primary-surface-default);display:inline-flex}:host([variant=neutral]){--sgds-spinner-bg:var(--sgds-neutral-surface-default)}:host([tone=neutral]){--sgds-spinner-bg:var(--sgds-surface-inverse)}:host([tone=inverse]){--sgds-spinner-bg:var(--sgds-surface-default)}:host([tone=fixed-light]){--sgds-spinner-bg:var(--sgds-surface-fixed-light)}:host([tone=fixed-dark]){--sgds-spinner-bg:var(--sgds-surface-fixed-dark)}.spinner-wrapper{align-items:center;display:flex;flex-direction:column;gap:var(--sgds-gap-2-xs)}.spinner-wrapper.horizontal{flex-direction:row}.spinner{--border-thickness:4px;animation:spinner .75s linear infinite;border:var(--border-thickness) solid var(--sgds-bg-translucent);border-radius:50%;border-right:var(--border-thickness) solid var(--sgds-spinner-bg);color:var(--sgds-spinner-color);display:inline-flex;height:var(--sgds-dimension-32);width:var(--sgds-dimension-32)}.spinner-xs{--border-thickness:2px;height:var(--sgds-dimension-16);width:var(--sgds-dimension-16)}.spinner-sm{--border-thickness:3px;height:var(--sgds-dimension-24);width:var(--sgds-dimension-24)}.spinner-lg{--border-thickness:6px;height:var(--sgds-dimension-48);width:var(--sgds-dimension-48)}.spinner-xl{--border-thickness:8px;height:var(--sgds-dimension-64);width:var(--sgds-dimension-64)}.spinner-label{color:var(--sgds-neutral-color-default);font-size:var(--sgds-font-size-14)}@media (prefers-reduced-motion:reduce){.spinner{animation-duration:1.5s}}
2381
2381
 
2382
- /*! CSS Used keyframes */@keyframes spinner{to{transform:rotate(1turn)}}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`,mn=re`.text-primary{color:var(--sgds-primary-rgb)!important}.text-secondary{color:var(--sgds-secondary-rgb)!important}.text-success{color:var(--sgds-success-rgb)!important}.text-info{color:var(--sgds-info-rgb)!important}.text-warning{color:var(--sgds-warning-rgb)!important}.text-danger{color:var(--sgds-danger-rgb)!important}.text-light{color:var(--sgds-light-rgb)!important}.text-dark{color:var(--sgds-dark-rgb)!important}.text-muted{color:var(--sgds-secondary-color)!important}`;class wn extends _s{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.orientation="vertical"}render(){return Is`
2382
+ /*! CSS Used keyframes */@keyframes spinner{to{transform:rotate(1turn)}}.sr-only{clip:rect(0,0,0,0);border:0;height:1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`,mn=re`.text-primary{color:var(--sgds-primary-rgb)!important}.text-secondary{color:var(--sgds-secondary-rgb)!important}.text-success{color:var(--sgds-success-rgb)!important}.text-info{color:var(--sgds-info-rgb)!important}.text-warning{color:var(--sgds-warning-rgb)!important}.text-danger{color:var(--sgds-danger-rgb)!important}.text-light{color:var(--sgds-light-rgb)!important}.text-dark{color:var(--sgds-dark-rgb)!important}.text-muted{color:var(--sgds-secondary-color)!important}`;class wn extends Cs{constructor(){super(...arguments),this.variant="primary",this.tone="brand",this.size="md",this.orientation="vertical"}render(){return Is`
2383
2383
  <div
2384
2384
  class="spinner-wrapper ${Bs({horizontal:"horizontal"===this.orientation})}"
2385
2385
  >
@@ -2391,7 +2391,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
2391
2391
  </div>
2392
2392
  ${this.label?Is`<span class="spinner-label">${this.label}</span>`:ii}
2393
2393
  </div>
2394
- `}}wn.styles=[..._s.styles,mn,fn],t([Zi({type:String,reflect:!0})],wn.prototype,"variant",void 0),t([Zi({type:String,reflect:!0})],wn.prototype,"tone",void 0),t([Zi({type:String,reflect:!0})],wn.prototype,"size",void 0),t([Zi({reflect:!0,type:String})],wn.prototype,"label",void 0),t([Zi({type:String,reflect:!0})],wn.prototype,"orientation",void 0);var yn=re`:host{display:inline-block}.btn.btn-icon{display:flex;height:var(--sgds-dimension-48,56px);min-width:unset;padding:0;width:var(--sgds-dimension-48,56px)}.btn.btn-icon.btn-lg{height:var(--sgds-dimension-56);min-width:unset;padding:0;width:var(--sgds-dimension-56)}.btn.btn-icon.btn-sm{height:var(--sgds-dimension-40);min-width:unset;padding:0;width:var(--sgds-dimension-40)}.btn.btn-icon.btn-xs{height:var(--sgds-dimension-32);min-width:unset;padding:0;width:var(--sgds-dimension-32)}`;class bn extends Rs{_assignIconSize(t){return"xs"===t?"sm":"sm"===t?"md":"md"===t?"lg":"lg"===t?"xl":void 0}render(){const t=this.href,e=t?$s`a`:$s`button`;return Is`
2394
+ `}}wn.styles=[...Cs.styles,mn,fn],t([Zi({type:String,reflect:!0})],wn.prototype,"variant",void 0),t([Zi({type:String,reflect:!0})],wn.prototype,"tone",void 0),t([Zi({type:String,reflect:!0})],wn.prototype,"size",void 0),t([Zi({reflect:!0,type:String})],wn.prototype,"label",void 0),t([Zi({type:String,reflect:!0})],wn.prototype,"orientation",void 0);var yn=re`:host{display:inline-block}.btn.btn-icon{display:flex;height:var(--sgds-dimension-48,56px);min-width:unset;padding:0;width:var(--sgds-dimension-48,56px)}.btn.btn-icon.btn-lg{height:var(--sgds-dimension-56);min-width:unset;padding:0;width:var(--sgds-dimension-56)}.btn.btn-icon.btn-sm{height:var(--sgds-dimension-40);min-width:unset;padding:0;width:var(--sgds-dimension-40)}.btn.btn-icon.btn-xs{height:var(--sgds-dimension-32);min-width:unset;padding:0;width:var(--sgds-dimension-32)}`;class bn extends Rs{_assignIconSize(t){return"xs"===t?"sm":"sm"===t?"md":"md"===t?"lg":"lg"===t?"xl":void 0}render(){const t=this.href,e=t?$s`a`:$s`button`;return Is`
2395
2395
  <${e}
2396
2396
  class="btn btn-icon${Bs({disabled:this.disabled,active:this.active,[`btn-${this.variant}`]:this.variant,[`btn-${this.size}`]:this.size,loading:this.loading})}"
2397
2397
  ?disabled=${Es(t?void 0:this.disabled)}
@@ -2417,7 +2417,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
2417
2417
  size=${Es(this._assignIconSize(this.size))}
2418
2418
  ></sgds-icon>`}
2419
2419
  </${e}>
2420
- `}}bn.styles=[...Rs.styles,yn],bn.dependencies={"sgds-icon":vn,"sgds-spinner":wn},t([Zi({type:String,reflect:!0})],bn.prototype,"name",void 0);var xn=re`.datepicker-header{display:flex;gap:var(--sgds-form-gap-md)}sgds-button{--btn-font-weight:var(--sgds-font-weight-semibold)}`;class Cn extends _s{constructor(){super(...arguments),this.selectedDate=[]}_handleFocusedTabIndexChange(){let t;switch(this.focusedTabIndex){case 0:t=this.shadowRoot.querySelector("sgds-icon-button[name='arrow-left']");break;case 1:t=this.shadowRoot.querySelector("sgds-button");break;case 2:t=this.shadowRoot.querySelector("sgds-icon-button[name='arrow-right']");break;default:return}t.focus()}_changeView(){switch(this.view){case"days":this.view="months";break;case"months":this.view="years"}this.emit("sgds-view",{detail:this.view})}renderHeader(t=this.displayDate,e=this.view){if("months"===e)return t.getFullYear();if("years"===e){const e=(new Date).getFullYear(),i=t.getFullYear(),a=(i-e)%12,s=a<0?12+a:a;return`${i-s} - ${i-s+12-1}`}return`${_n[t.getMonth()]} ${t.getFullYear()}`}_renderHeaderTemplate(){return Je`${this.renderHeader()}`}handleClickPrevious(){const{view:t,displayDate:e,focusedDate:i}=this;let a=new Date(e);"months"===t?a.setFullYear(a.getFullYear()-1):"years"===this.view?a.setFullYear(a.getFullYear()-12):a=i.getDate()!==e.getDate()?Ds(i):Ds(a),this.displayDate=a,this.emit("sgds-change-calendar",{detail:this.displayDate})}_handleClickNext(){const{view:t,displayDate:e,focusedDate:i}=this;let a=new Date(e);"months"===t?a.setFullYear(a.getFullYear()+1):"years"===this.view?a.setFullYear(a.getFullYear()+12):a=i.getDate()!==e.getDate()?Vs(i):Vs(a),this.displayDate=a,this.emit("sgds-change-calendar",{detail:this.displayDate})}_removeCaret(){const t=this.displayDate.getFullYear(),e=this.displayDate.getMonth(),i=new Date(t,e);return"months"===this.view?t<=1900:"years"===this.view?t<1904:st(i,new Date(0,0,1))||at(i,new Date(0,0,1))}_ariaLabelForNextBtn(){return{days:"Show next month",months:"Show next year",years:"Show next 12 years"}[this.view]}_ariaLabelForPrevBtn(){return{days:"Show previous month",months:"Show previous year",years:"Show previous 12 years"}[this.view]}_ariaLabelForHeaderBtn(){const t={days:`Current view is days, click to show months in ${this.displayDate.getFullYear()}`,months:`Current view is months, click to show years between ${this.renderHeader(this.displayDate,"years")}`,years:"Current view is years"};return`${this.renderHeader()}. ${t[this.view]}`}render(){return Je`
2420
+ `}}bn.styles=[...Rs.styles,yn],bn.dependencies={"sgds-icon":vn,"sgds-spinner":wn},t([Zi({type:String,reflect:!0})],bn.prototype,"name",void 0);var xn=re`.datepicker-header{display:flex;gap:var(--sgds-form-gap-md)}sgds-button{--btn-font-weight:var(--sgds-font-weight-semibold)}`;class _n extends Cs{constructor(){super(...arguments),this.selectedDate=[]}_handleFocusedTabIndexChange(){let t;switch(this.focusedTabIndex){case 0:t=this.shadowRoot.querySelector("sgds-icon-button[name='arrow-left']");break;case 1:t=this.shadowRoot.querySelector("sgds-button");break;case 2:t=this.shadowRoot.querySelector("sgds-icon-button[name='arrow-right']");break;default:return}t.focus()}_changeView(){switch(this.view){case"days":this.view="months";break;case"months":this.view="years"}this.emit("sgds-view",{detail:this.view})}renderHeader(t=this.displayDate,e=this.view){if("months"===e)return t.getFullYear();if("years"===e){const e=(new Date).getFullYear(),i=t.getFullYear(),a=(i-e)%12,s=a<0?12+a:a;return`${i-s} - ${i-s+12-1}`}return`${Cn[t.getMonth()]} ${t.getFullYear()}`}_renderHeaderTemplate(){return Je`${this.renderHeader()}`}handleClickPrevious(){const{view:t,displayDate:e,focusedDate:i}=this;let a=new Date(e);"months"===t?a.setFullYear(a.getFullYear()-1):"years"===this.view?a.setFullYear(a.getFullYear()-12):a=i.getDate()!==e.getDate()?Ss(i):Ss(a),this.displayDate=a,this.emit("sgds-change-calendar",{detail:this.displayDate})}_handleClickNext(){const{view:t,displayDate:e,focusedDate:i}=this;let a=new Date(e);"months"===t?a.setFullYear(a.getFullYear()+1):"years"===this.view?a.setFullYear(a.getFullYear()+12):a=i.getDate()!==e.getDate()?Vs(i):Vs(a),this.displayDate=a,this.emit("sgds-change-calendar",{detail:this.displayDate})}_removeCaret(){const t=this.displayDate.getFullYear(),e=this.displayDate.getMonth(),i=new Date(t,e);return"months"===this.view?t<=1900:"years"===this.view?t<1904:st(i,new Date(0,0,1))||at(i,new Date(0,0,1))}_ariaLabelForNextBtn(){return{days:"Show next month",months:"Show next year",years:"Show next 12 years"}[this.view]}_ariaLabelForPrevBtn(){return{days:"Show previous month",months:"Show previous year",years:"Show previous 12 years"}[this.view]}_ariaLabelForHeaderBtn(){const t={days:`Current view is days, click to show months in ${this.displayDate.getFullYear()}`,months:`Current view is months, click to show years between ${this.renderHeader(this.displayDate,"years")}`,years:"Current view is years"};return`${this.renderHeader()}. ${t[this.view]}`}render(){return Je`
2421
2421
  <div class="datepicker-header dropdown-header" role="heading">
2422
2422
  <sgds-icon-button
2423
2423
  name="arrow-left"
@@ -2448,7 +2448,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
2448
2448
  >
2449
2449
  </sgds-icon-button>
2450
2450
  </div>
2451
- `}}Cn.styles=[xn],Cn.dependencies={"sgds-icon":vn,"sgds-icon-button":bn,"sgds-button":Us},t([Zi({attribute:!1})],Cn.prototype,"displayDate",void 0),t([Zi({attribute:!1})],Cn.prototype,"focusedDate",void 0),t([Zi({attribute:!1})],Cn.prototype,"selectedDate",void 0),t([Zi()],Cn.prototype,"view",void 0),t([Zi()],Cn.prototype,"focusedTabIndex",void 0),t([As("focusedTabIndex",{waitUntilFirstUpdate:!0})],Cn.prototype,"_handleFocusedTabIndexChange",null);const _n=["January","February","March","April","May","June","July","August","September","October","November","December"];function kn(t){return"string"==typeof t||t instanceof String}function Mn(t){var e;return"object"==typeof t&&null!=t&&"Object"===(null==t||null==(e=t.constructor)?void 0:e.name)}function Zn(t,e){return Array.isArray(e)?Zn(t,(t,i)=>e.includes(i)):Object.entries(t).reduce((t,i)=>{let[a,s]=i;return e(s,a)&&(t[a]=s),t},{})}const Vn="NONE",Dn="LEFT",Sn="FORCE_LEFT",An="RIGHT",Bn="FORCE_RIGHT";function En(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Fn(t,e){if(e===t)return!0;const i=Array.isArray(e),a=Array.isArray(t);let s;if(i&&a){if(e.length!=t.length)return!1;for(s=0;s<e.length;s++)if(!Fn(e[s],t[s]))return!1;return!0}if(i!=a)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const i=e instanceof Date,a=t instanceof Date;if(i&&a)return e.getTime()==t.getTime();if(i!=a)return!1;const n=e instanceof RegExp,r=t instanceof RegExp;if(n&&r)return e.toString()==t.toString();if(n!=r)return!1;const o=Object.keys(e);for(s=0;s<o.length;s++)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=0;s<o.length;s++)if(!Fn(t[o[s]],e[o[s]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}class Hn{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Vn:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?Dn:An}}function $n(t,e){return new $n.InputMask(t,e)}function Tn(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?$n.MaskedRegExp:kn(t)?$n.MaskedPattern:t===Date?$n.MaskedDate:t===Number?$n.MaskedNumber:Array.isArray(t)||t===Array?$n.MaskedDynamic:$n.Masked&&t.prototype instanceof $n.Masked?t:$n.Masked&&t instanceof $n.Masked?t.constructor:t instanceof Function?$n.MaskedFunction:(console.warn("Mask not found for mask",t),$n.Masked)}function In(t){if(!t)throw new Error("Options in not defined");if($n.Masked){if(t.prototype instanceof $n.Masked)return{mask:t};const{mask:e,...i}=t instanceof $n.Masked?{mask:t}:Mn(t)&&t.mask instanceof $n.Masked?t:{};if(e){const t=e.mask;return{...Zn(e,(t,e)=>!e.startsWith("_")),mask:e.constructor,_mask:t,...i}}}return Mn(t)?{...t}:{mask:t}}function Pn(t){if($n.Masked&&t instanceof $n.Masked)return t;const e=In(t),i=Tn(e.mask);if(!i)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===i&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new i(e)}$n.createMask=Pn;class Ln{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}$n.MaskElement=Ln;class Rn extends Ln{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,i;return null!=(t=null==(e=(i=this.input).getRootNode)?void 0:e.call(i))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}$n.HTMLMaskElement=Rn;class On extends Rn{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}$n.HTMLMaskElement=Rn;class Yn extends Rn{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,a=e&&e.focusOffset;return null==a||null==i||i<a?i:a}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,a=e&&e.focusOffset;return null==a||null==i||i>a?i:a}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,t),i.setEnd(this.input.lastChild||this.input,e);const a=this.rootElement,s=a.getSelection&&a.getSelection();s&&(s.removeAllRanges(),s.addRange(i))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}$n.HTMLContenteditableMaskElement=Yn;class Nn{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Nn.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Nn.MAX_LENGTH=100;$n.InputMask=class{constructor(t,e){this.el=t instanceof Ln?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new Yn(t):new On(t),this.masked=Pn(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Nn,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return null==t||(null==(e=this.masked)?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof $n.Masked)&&this.masked.constructor===Tn(t))return void this.masked.updateOptions({mask:t});const e=t instanceof $n.Masked?t:Pn({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const i=this._listeners[t];i&&i.forEach(t=>t(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,i=this.masked.value,a=this.masked.rawInputValue,s=this.displayValue,n=this.unmaskedValue!==e||this.value!==i||this._rawInputValue!==a;this._unmaskedValue=e,this._value=i,this._rawInputValue=a,this.el.value!==s&&(this.el.value=s),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),n&&this._fireChangeEvents(),this._historyChanging||!n&&!this.history.isEmpty||this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...i}=t,a=!this.maskEquals(e),s=this.masked.optionsIsChanged(i);a&&(this.mask=e),s&&this.masked.updateOptions(i),(a||s)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Dn))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const i=this._listeners[t].indexOf(e);return i>=0&&this._listeners[t].splice(i,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Hn({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,a=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,s=i===this.masked.rawInputValue?e.removeDirection:Vn;let n=this.masked.nearestInputPos(e.startChangePos+a,s);s!==Vn&&(n=this.masked.nearestInputPos(n,Vn)),this.updateControl(n),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class zn{static normalize(t){return Array.isArray(t)?t:[t,new zn]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}$n.ChangeDetails=zn;class Un{constructor(t,e,i){void 0===t&&(t=""),void 0===e&&(e=0),this.value=t,this.from=e,this.stop=i}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class qn{constructor(t){this._value="",this._update({...qn.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){void 0===e&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new Un(this.extractInput(t,e),t)}appendTail(t){return kn(t)&&(t=new Un(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new zn({inserted:t,rawInserted:t})):new zn}_appendChar(t,e,i){void 0===e&&(e={});const a=this.state;let s;if([t,s]=this.doPrepareChar(t,e),t&&(s=s.aggregate(this._appendCharRaw(t,e)),!s.rawInserted&&"pad"===this.autofix)){const i=this.state;this.state=a;let n=this.pad(e);const r=this._appendCharRaw(t,e);n=n.aggregate(r),r.rawInserted||n.equals(s)?s=n:this.state=i}if(s.inserted){let t,n=!1!==this.doValidate(e);if(n&&null!=i){const e=this.state;if(!0===this.overwrite){t=i.state;for(let t=0;t<s.rawInserted.length;++t)i.unshift(this.displayValue.length-s.tailShift)}let a=this.appendTail(i);if(n=a.rawInserted.length===i.toString().length,!(n&&a.inserted||"shift"!==this.overwrite)){this.state=e,t=i.state;for(let t=0;t<s.rawInserted.length;++t)i.shift();a=this.appendTail(i),n=a.rawInserted.length===i.toString().length}n&&a.inserted&&(this.state=e)}n||(s=new zn,this.state=a,i&&t&&(i.state=t))}return s}_appendPlaceholder(){return new zn}_appendEager(){return new zn}append(t,e,i){if(!kn(t))throw new Error("value should be string");const a=kn(i)?new Un(String(i)):i;let s;null!=e&&e.tail&&(e._beforeTailState=this.state),[t,s]=this.doPrepare(t,e);for(let i=0;i<t.length;++i){const n=this._appendChar(t[i],e,a);if(!n.rawInserted&&!this.doSkipInvalid(t[i],e,a))break;s.aggregate(n)}return(!0===this.eager||"append"===this.eager)&&null!=e&&e.input&&t&&s.aggregate(this._appendEager()),null!=a&&(s.tailShift+=this.appendTail(a).tailShift),s}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new zn}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,i=this.value,a=t();return this.rawInputValue=e,this.value&&this.value!==i&&0===i.indexOf(this.value)&&(this.append(i.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,i=t(this);return this.state=e,delete this._isolated,i}doSkipInvalid(t,e,i){return Boolean(this.skipInvalid)}doPrepare(t,e){return void 0===e&&(e={}),zn.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return void 0===e&&(e={}),zn.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,i,a,s){void 0===i&&(i=""),void 0===a&&(a=Vn),void 0===s&&(s={input:!0});const n=t+e,r=this.extractTail(n),o=!0===this.eager||"remove"===this.eager;let l;o&&(a=function(t){switch(t){case Dn:return Sn;case An:return Bn;default:return t}}(a),l=this.extractInput(0,n,{raw:!0}));let c=t;const d=new zn;if(a!==Vn&&(c=this.nearestInputPos(t,e>1&&0!==t&&!o?Vn:a),d.tailShift=c-t),d.aggregate(this.remove(c)),o&&a!==Vn&&l===this.rawInputValue)if(a===Sn){let t;for(;l===this.rawInputValue&&(t=this.displayValue.length);)d.aggregate(new zn({tailShift:-1})).aggregate(this.remove(t-1))}else a===Bn&&r.unshift();return d.aggregate(this.append(i,s,r))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Fn(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||qn.EMPTY_VALUES.includes(t)&&qn.EMPTY_VALUES.includes(e)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}pad(t){return new zn}}qn.DEFAULTS={skipInvalid:!0},qn.EMPTY_VALUES=[void 0,null,""],$n.Masked=qn;class Wn{constructor(t,e){void 0===t&&(t=[]),void 0===e&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=kn(t)?new Un(String(t)):t;const e=this.chunks[this.chunks.length-1],i=e&&(e.stop===t.stop||null==t.stop)&&t.from===e.from+e.toString().length;if(t instanceof Un)i?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof Wn){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof $n.MaskedPattern)){return new Un(this.toString()).appendTo(t)}const e=new zn;for(let i=0;i<this.chunks.length;++i){const a=this.chunks[i],s=t._mapPosToBlock(t.displayValue.length),n=a.stop;let r;if(null!=n&&(!s||s.index<=n)&&((a instanceof Wn||t._stops.indexOf(n)>=0)&&e.aggregate(t._appendPlaceholder(n)),r=a instanceof Wn&&t._blocks[n]),r){const i=r.appendTail(a);e.aggregate(i);const s=a.toString().slice(i.rawInserted.length);s&&e.aggregate(t.append(s,{tail:!0}))}else e.aggregate(t.append(a.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...i}=t;Object.assign(this,i),this.chunks=e.map(t=>{const e="chunks"in t?new Wn:new Un;return e.state=t,e})}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const e=null!=t?t-this.from:t;let i=0;for(;i<this.chunks.length;){const t=this.chunks[i],a=t.unshift(e);if(t.toString()){if(!a)break;++i}else this.chunks.splice(i,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],i=e.shift();if(e.toString()){if(!i)break;--t}else this.chunks.splice(t,1);if(i)return i}return""}}class jn{constructor(t,e){this.masked=t,this._log=[];const{offset:i,index:a}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(e=this.block)?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,Sn),0!==this.offset||void 0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Dn),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Dn),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,Bn),this.offset!==this.block.value.length||void 0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Vn),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Vn),!0})}}class Gn{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new zn}nearestInputPos(t,e){void 0===e&&(e=Vn);const i=this._value.length;switch(e){case Dn:case Sn:return 0;default:return i}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),void 0===i&&(i={}),i.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new zn;const i=!0===this.eager||"append"===this.eager,a=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!i)&&!e.tail,s=new zn({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(e.raw||e.input),s}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new zn;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Un("")}appendTail(t){return kn(t)&&(t=new Un(String(t))),t.appendTo(this)}append(t,e,i){const a=this._appendChar(t[0],e);return null!=i&&(a.tailShift+=this.appendTail(i).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class Kn{constructor(t){const{parent:e,isOptional:i,placeholderChar:a,displayChar:s,lazy:n,eager:r,...o}=t;this.masked=Pn(o),Object.assign(this,{parent:e,isOptional:i,placeholderChar:a,displayChar:s,lazy:n,eager:r})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),0===t&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new zn}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new zn;const i=this.masked.state;let a=this.masked._appendChar(t,this.currentMaskFlags(e));return a.inserted&&!1===this.doValidate(e)&&(a=new zn,this.masked.state=i),a.inserted||this.isOptional||this.lazy||e.input||(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=Boolean(a.inserted),a}append(t,e,i){return this.masked.append(t,this.currentMaskFlags(e),i)}_appendPlaceholder(){return this.isFilled||this.isOptional?new zn:(this.isFilled=!0,new zn({inserted:this.placeholderChar}))}_appendEager(){return new zn}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.masked.extractInput(t,e,i)}nearestInputPos(t,e){void 0===e&&(e=Vn);const i=this.value.length,a=Math.min(Math.max(t,0),i);switch(e){case Dn:case Sn:return this.isComplete?a:0;case An:case Bn:return this.isComplete?a:i;default:return a}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(null==t||null==(e=t._beforeTailState)?void 0:e.masked)||(null==t?void 0:t._beforeTailState)}}pad(t){return new zn}}Kn.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};$n.MaskedRegExp=class extends qn{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=t=>t.search(e)>=0),super._update(t)}};class Qn extends qn{constructor(t){super({...Qn.DEFAULTS,...t,definitions:Object.assign({},Kn.DEFAULT_DEFINITIONS,null==t?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let i=!1,a=!1;for(let s=0;s<e.length;++s){if(this.blocks){const t=e.slice(s),i=Object.keys(this.blocks).filter(e=>0===t.indexOf(e));i.sort((t,e)=>e.length-t.length);const a=i[0];if(a){const{expose:t,repeat:e,...i}=In(this.blocks[a]),n={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...i,repeat:e,parent:this},r=null!=e?new $n.RepeatBlock(n):Pn(n);r&&(this._blocks.push(r),t&&(this.exposeBlock=r),this._maskedBlocks[a]||(this._maskedBlocks[a]=[]),this._maskedBlocks[a].push(this._blocks.length-1)),s+=a.length-1;continue}}let n=e[s],r=n in t;if(n===Qn.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===n||"}"===n){i=!i;continue}if("["===n||"]"===n){a=!a;continue}if(n===Qn.ESCAPE_CHAR){if(++s,n=e[s],!n)break;r=!1}const o=r?new Kn({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...In(t[n]),parent:this}):new Gn({char:n,eager:this.eager,isUnmasking:i});this._blocks.push(o)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t)return void this.reset();const{_blocks:e,...i}=t;this._blocks.forEach((t,i)=>t.state=e[i]),super.state=i}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new zn;let i=null==(t=this._mapPosToBlock(this.displayValue.length))?void 0:t.index;if(null==i)return e;this._blocks[i].isFilled&&++i;for(let t=i;t<this._blocks.length;++t){const i=this._blocks[t]._appendEager();if(!i.inserted)break;e.aggregate(i)}return e}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._mapPosToBlock(this.displayValue.length),a=new zn;if(!i)return a;for(let n,r=i.index;n=this._blocks[r];++r){var s;const i=n._appendChar(t,{...e,_beforeTailState:null==(s=e._beforeTailState)||null==(s=s._blocks)?void 0:s[r]});if(a.aggregate(i),i.consumed)break}return a}extractTail(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=new Wn;return t===e||this._forEachBlocksInRange(t,e,(t,e,a,s)=>{const n=t.extractTail(a,s);n.stop=this._findStopBefore(e),n.from=this._blockStartPos(e),n instanceof Wn&&(n.blockIndex=e),i.extend(n)}),i}extractInput(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),void 0===i&&(i={}),t===e)return"";let a="";return this._forEachBlocksInRange(t,e,(t,e,s,n)=>{a+=t.extractInput(s,n,i)}),a}_findStopBefore(t){let e;for(let i=0;i<this._stops.length;++i){const a=this._stops[i];if(!(a<=t))break;e=a}return e}_appendPlaceholder(t){const e=new zn;if(this.lazy&&null==t)return e;const i=this._mapPosToBlock(this.displayValue.length);if(!i)return e;const a=i.index,s=null!=t?t:this._blocks.length;return this._blocks.slice(a,s).forEach(i=>{var a;i.lazy&&null==t||e.aggregate(i._appendPlaceholder(null==(a=i._blocks)?void 0:a.length))}),e}_mapPosToBlock(t){let e="";for(let i=0;i<this._blocks.length;++i){const a=this._blocks[i],s=e.length;if(e+=a.displayValue,t<=e.length)return{index:i,offset:t-s}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((t,e)=>t+e.displayValue.length,0)}_forEachBlocksInRange(t,e,i){void 0===e&&(e=this.displayValue.length);const a=this._mapPosToBlock(t);if(a){const t=this._mapPosToBlock(e),s=t&&a.index===t.index,n=a.offset,r=t&&s?t.offset:this._blocks[a.index].displayValue.length;if(i(this._blocks[a.index],a.index,n,r),t&&!s){for(let e=a.index+1;e<t.index;++e)i(this._blocks[e],e,0,this._blocks[e].displayValue.length);i(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._forEachBlocksInRange(t,e,(t,e,a,s)=>{i.aggregate(t.remove(a,s))}),i}nearestInputPos(t,e){if(void 0===e&&(e=Vn),!this._blocks.length)return 0;const i=new jn(this,t);if(e===Vn)return i.pushRightBeforeInput()?i.pos:(i.popState(),i.pushLeftBeforeInput()?i.pos:this.displayValue.length);if(e===Dn||e===Sn){if(e===Dn){if(i.pushRightBeforeFilled(),i.ok&&i.pos===t)return t;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),e===Dn){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=t)return i.pos;if(i.popState(),i.ok&&i.pos<=t)return i.pos;i.popState()}return i.ok?i.pos:e===Sn?0:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:0))}return e===An||e===Bn?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:e===Bn?this.displayValue.length:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:this.nearestInputPos(t,Dn)))):t}totalInputPositions(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);let i=0;return this._forEachBlocksInRange(t,e,(t,e,a,s)=>{i+=t.totalInputPositions(a,s)}),i}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(t=>this._blocks[t]):[]}pad(t){const e=new zn;return this._forEachBlocksInRange(0,this.displayValue.length,i=>e.aggregate(i.pad(t))),e}}Qn.DEFAULTS={...qn.DEFAULTS,lazy:!0,placeholderChar:"_"},Qn.STOP_CHAR="`",Qn.ESCAPE_CHAR="\\",Qn.InputDefinition=Kn,Qn.FixedDefinition=Gn,$n.MaskedPattern=Qn;class Xn extends Qn{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:i=this.from||0,maxLength:a=this.maxLength||0,autofix:s=this.autofix,...n}=t;this.to=e,this.from=i,this.maxLength=Math.max(String(e).length,a),this.autofix=s;const r=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0");let l=0;for(;l<o.length&&o[l]===r[l];)++l;n.mask=o.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(n)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let e="",i="";const[,a,s]=t.match(/^(\D*)(\d*)(\D*)/)||[];return s&&(e="0".repeat(a.length)+s,i="9".repeat(a.length)+s),e=e.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[e,i]}doPrepareChar(t,e){let i;return void 0===e&&(e={}),[t,i]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(i.skip=!this.isComplete),[t,i]}_appendCharRaw(t,e){if(void 0===e&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const i=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[s,n]=this.boundaries(this.value+t);return Number(n)<this.from?super._appendCharRaw(i[this.value.length],e):Number(s)>this.to?!e.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(i[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(a[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(e);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const e=new zn;if(this.value.length===this.maxLength)return e;const i=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let i=0;i<a;++i)e.aggregate(super._appendCharRaw("0",t));i.split("").forEach(t=>this._appendCharRaw(t))}return e}}$n.MaskedRange=Xn;class Jn extends Qn{static extractPatternOptions(t){const{mask:e,pattern:i,...a}=t;return{...a,mask:kn(e)?e:i}}constructor(t){super(Jn.extractPatternOptions({...Jn.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:i,blocks:a,...s}={...Jn.DEFAULTS,...t},n=Object.assign({},Jn.GET_DEFAULT_BLOCKS());t.min&&(n.Y.from=t.min.getFullYear()),t.max&&(n.Y.to=t.max.getFullYear()),t.min&&t.max&&n.Y.from===n.Y.to&&(n.m.from=t.min.getMonth()+1,n.m.to=t.max.getMonth()+1,n.m.from===n.m.to&&(n.d.from=t.min.getDate(),n.d.to=t.max.getDate())),Object.assign(n,this.blocks,a),super._update({...s,mask:kn(e)?e:i,blocks:n})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(Jn.extractPatternOptions(t))}}Jn.GET_DEFAULT_BLOCKS=()=>({d:{mask:Xn,from:1,to:31,maxLength:2},m:{mask:Xn,from:1,to:12,maxLength:2},Y:{mask:Xn,from:1900,to:9999}}),Jn.DEFAULTS={...Qn.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:(t,e)=>{const[i,a,s]=t.split(".").map(Number);return new Date(s,a-1,i)}},$n.MaskedDate=Jn;class tr extends qn{constructor(t){super({...tr.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(t=>{const{expose:e,...i}=In(t),a=Pn({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return e&&(this.exposeMask=a),a}):[])}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._applyDispatch(t,e);return this.currentMask&&i.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),i}_applyDispatch(t,e,i){void 0===t&&(t=""),void 0===e&&(e={}),void 0===i&&(i="");const a=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,s=this.rawInputValue,n=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:s,r=s.slice(n.length),o=this.currentMask,l=new zn,c=null==o?void 0:o.state;return this.currentMask=this.doDispatch(t,{...e},i),this.currentMask&&(this.currentMask!==o?(this.currentMask.reset(),n&&(this.currentMask.append(n,{raw:!0}),l.tailShift=this.currentMask.value.length-a.length),r&&(l.tailShift+=this.currentMask.append(r,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),l}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new zn;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,i;return{...t,_beforeTailState:(null==(e=t._beforeTailState)?void 0:e.currentMaskRef)===this.currentMask&&(null==(i=t._beforeTailState)?void 0:i.currentMask)||t._beforeTailState}}doDispatch(t,e,i){return void 0===e&&(e={}),void 0===i&&(i=""),this.dispatch(t,this,e,i)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){void 0===e&&(e={});let[i,a]=super.doPrepare(t,e);if(this.currentMask){let t;[i,t]=super.doPrepare(i,this.currentMaskFlags(e)),a=a.aggregate(t)}return[i,a]}doPrepareChar(t,e){void 0===e&&(e={});let[i,a]=super.doPrepareChar(t,e);if(this.currentMask){let t;[i,t]=super.doPrepareChar(i,this.currentMaskFlags(e)),a=a.aggregate(t)}return[i,a]}reset(){var t;null==(t=this.currentMask)||t.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isComplete)}get isFilled(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isFilled)}remove(t,e){const i=new zn;return this.currentMask&&i.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),i}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:null==(t=this.currentMask)?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:i,currentMask:a,...s}=t;e&&this.compiledMasks.forEach((t,i)=>t.state=e[i]),null!=i&&(this.currentMask=i,this.currentMask.state=a),super.state=s}extractInput(t,e,i){return this.currentMask?this.currentMask.extractInput(t,e,i):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,i)=>{if(!t[i])return;const{mask:a,...s}=t[i];return Fn(e,s)&&e.maskEquals(a)}):super.maskEquals(t)}typedValueEquals(t){var e;return Boolean(null==(e=this.currentMask)?void 0:e.typedValueEquals(t))}}tr.DEFAULTS={...qn.DEFAULTS,dispatch:(t,e,i,a)=>{if(!e.compiledMasks.length)return;const s=e.rawInputValue,n=e.compiledMasks.map((n,r)=>{const o=e.currentMask===n,l=o?n.displayValue.length:n.nearestInputPos(n.displayValue.length,Sn);return n.rawInputValue!==s?(n.reset(),n.append(s,{raw:!0})):o||n.remove(l),n.append(t,e.currentMaskFlags(i)),n.appendTail(a),{index:r,weight:n.rawInputValue.length,totalInputPositions:n.totalInputPositions(0,Math.max(l,n.nearestInputPos(n.displayValue.length,Sn)))}});return n.sort((t,e)=>e.weight-t.weight||e.totalInputPositions-t.totalInputPositions),e.compiledMasks[n[0].index]}},$n.MaskedDynamic=tr;class er extends Qn{constructor(t){super({...er.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...i}=t;if(e){const t=e.map(t=>t.length),a=Math.min(...t),s=Math.max(...t)-a;i.mask="*".repeat(a),s&&(i.mask+="["+"*".repeat(s)+"]"),this.enum=e}super._update(i)}_appendCharRaw(t,e){void 0===e&&(e={});const i=Math.min(this.nearestInputPos(0,Bn),this.value.length),a=this.enum.filter(e=>this.matchValue(e,this.unmaskedValue+t,i));if(a.length){1===a.length&&this._forEachBlocksInRange(0,this.value.length,(t,i)=>{const s=a[0][i];i>=this.value.length||s===t.value||(t.reset(),t._appendChar(s,e))});const t=super._appendCharRaw(a[0][this.value.length],e);return 1===a.length&&a[0].slice(this.unmaskedValue.length).split("").forEach(e=>t.aggregate(super._appendCharRaw(e))),t}return new zn({skip:!this.isComplete})}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new Un("",t)}remove(t,e){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),t===e)return new zn;const i=Math.min(super.nearestInputPos(0,Bn),this.value.length);let a;for(a=t;a>=0;--a){if(this.enum.filter(t=>this.matchValue(t,this.value.slice(i,a),i)).length>1)break}const s=super.remove(a,e);return s.tailShift+=a-t,s}get isComplete(){return this.enum.indexOf(this.value)>=0}}er.DEFAULTS={...Qn.DEFAULTS,matchValue:(t,e,i)=>t.indexOf(e,i)===i},$n.MaskedEnum=er;var ir;$n.MaskedFunction=class extends qn{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class ar extends qn{constructor(t){super({...ar.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+En(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(En).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(En(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){void 0===e&&(e={});const[i,a]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!i&&(a.skip=!0),!i||this.allowPositive||this.value||"-"===i||a.aggregate(this._appendChar("-")),[i,a]}_separatorsCount(t,e){void 0===e&&(e=!1);let i=0;for(let a=0;a<t;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++i,e&&(t+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,i))}_appendCharRaw(t,e){void 0===e&&(e={});const i=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);const s=this._value;this._value+=t;const n=this.number;let r,o=!isNaN(n),l=!1;if(o){let t;null!=this.min&&this.min<0&&this.number<this.min&&(t=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(t=this.max),null!=t&&(this.autofix?(this._value=this.format(t,this).replace(ar.UNMASKED_RADIX,this.radix),l||(l=s===this._value&&!e.tail)):o=!1),o&&(o=Boolean(this._value.match(this._numberRegExp)))}o?r=new zn({inserted:this._value.slice(s.length),rawInserted:l?"":t,skip:l}):(this._value=s,r=new zn),this._value=this._insertThousandsSeparators(this._value);const c=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(c);return r.tailShift+=(d-a)*this.thousandsSeparator.length,r}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,i=this.value.indexOf(this.thousandsSeparator,e);if(i<=t)return i}return-1}_adjustRangeWithSeparators(t,e){const i=this._findSeparatorAround(t);i>=0&&(t=i);const a=this._findSeparatorAround(e);return a>=0&&(e=a+this.thousandsSeparator.length),[t,e]}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const i=this.value.slice(0,t),a=this.value.slice(e),s=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+a));const n=this._separatorsCountFromSlice(i);return new zn({tailShift:(n-s)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case Vn:case Dn:case Sn:{const i=this._findSeparatorAround(t-1);if(i>=0){const a=i+this.thousandsSeparator.length;if(t<a||this.value.length<=a||e===Sn)return i}break}case An:case Bn:{const e=this._findSeparatorAround(t);if(e>=0)return e+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(t,e,i,a)=>e+a),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,i){void 0===e&&(e={});const a=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===ar.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,i)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ar.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ar.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ar.EMPTY_VALUES.includes(t)&&ar.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}ir=ar,ar.UNMASKED_RADIX=".",ar.EMPTY_VALUES=[...qn.EMPTY_VALUES,0],ar.DEFAULTS={...qn.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[ir.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},$n.MaskedNumber=ar;const sr={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function nr(t,e,i){void 0===e&&(e=sr.MASKED),void 0===i&&(i=sr.MASKED);const a=Pn(t);return t=>a.runIsolated(a=>(a[e]=t,a[i]))}$n.PIPE_TYPE=sr,$n.createPipe=nr,$n.pipe=function(t,e,i,a){return nr(e,i,a)(t)};$n.RepeatBlock=class extends Qn{get repeatFrom(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?t:0}get repeatTo(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,i,a;const{repeat:s,...n}=In(t);this._blockOpts=Object.assign({},this._blockOpts,n);const r=Pn(this._blockOpts);this.repeat=null!=(e=null!=(i=null!=s?s:r.repeat)?i:this.repeat)?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(a=this._blocks)?void 0:a.length)||0,this.repeatFrom)),blocks:{m:r},eager:r.eager,overwrite:r.overwrite,skipInvalid:r.skipInvalid,lazy:r.lazy,placeholderChar:r.placeholderChar,displayChar:r.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(Pn(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,e){void 0===e&&(e={});const i=new zn;for(let o,l,c=null!=(a=null==(s=this._mapPosToBlock(this.displayValue.length))?void 0:s.index)?a:Math.max(this._blocks.length-1,0);o=null!=(n=this._blocks[c])?n:l=!l&&this._allocateBlock(c);++c){var a,s,n,r;const d=o._appendChar(t,{...e,_beforeTailState:null==(r=e._beforeTailState)||null==(r=r._blocks)?void 0:r[c]});if(d.skip&&l){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(i.aggregate(d),d.consumed)break}return i}_trimEmptyTail(t,e){var i,a;void 0===t&&(t=0);const s=Math.max((null==(i=this._mapPosToBlock(t))?void 0:i.index)||0,this.repeatFrom,0);let n;null!=e&&(n=null==(a=this._mapPosToBlock(e))?void 0:a.index),null==n&&(n=this._blocks.length-1);let r=0;for(let t=n;s<=t&&!this._blocks[t].unmaskedValue;--t,++r);r&&(this._blocks.splice(n-r+1,r),this.mask=this.mask.slice(r))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._trimEmptyTail(t,e),i}totalInputPositions(t,e){return void 0===t&&(t=0),null==e&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=$n}catch{}var rr=re`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,or=re`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,lr=re`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,cr=re`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;class dr extends _s{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=ks("input"),this._labelId=ks("label")}setInvalid(t){this.invalid=t,t?this.emit("sgds-invalid"):this.emit("sgds-valid")}}dr.styles=[..._s.styles,rr,or,lr,cr],t([Zi({reflect:!0})],dr.prototype,"label",void 0),t([Zi({reflect:!0})],dr.prototype,"hintText",void 0),t([Zi({reflect:!0})],dr.prototype,"name",void 0),t([Zi({type:Boolean,reflect:!0})],dr.prototype,"disabled",void 0),t([Zi({type:Boolean,reflect:!0})],dr.prototype,"invalid",void 0);var hr=re`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-16);line-height:var(--sgds-line-height-24);outline:none;padding:0}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const ur=(t="value")=>(e,i)=>{const a=e.constructor,s=a.prototype.attributeChangedCallback;a.prototype.attributeChangedCallback=function(e,n,r){var o;const l=a.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t).toLowerCase()){const e=l.converter||xe,a=("function"==typeof e?e:null!==(o=null==e?void 0:e.fromAttribute)&&void 0!==o?o:xe.fromAttribute)(r,l.type);this[t]!==a&&(this[i]=a)}s.call(this,e,n,r)}};class pr{constructor(t,e){(this.host=t).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(t,e)=>{t.invalid=e},value:t=>t.value,input:t=>t.input},e)}hostConnected(){this.host.addEventListener("invalid",t=>this.handleInvalid(t))}hostDisconnected(){this.host.removeEventListener("invalid",t=>this.handleInvalid(t))}handleInvalid(t){t.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(t){const e=t.target;this.options.setInvalid(this.host,!1),this.validateInput(e)}handleChange(t){const e=t.target;this.validateInput(e),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(t,e,i){return this._internals.setValidity(t,e,i)}setFormValue(){const t=this.options.value(this.host);this._internals.setFormValue(t)}validateInput(t){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const e=t.validity;if(e.valid)this._internals.setValidity({});else for(const i in e)e[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},t.validationMessage,t))}}const gr=e=>{class i extends e{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var t;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(t=this.inputValidationController)&&void 0!==t||(this.inputValidationController=new pr(this))}async firstUpdated(t){super.firstUpdated(t),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||(this._mixinSetFormValue(),this._mixinValidate(this.input))}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(t){this._mixinSetFormValue(),this.inputValidationController.handleChange(t)}_mixinHandleInputChange(t){this._mixinSetFormValue(),this.inputValidationController.handleInput(t)}_mixinResetValidity(t){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(t),this._isTouched&&(this._isTouched=!1)}_mixinValidate(t){this.inputValidationController.validateInput(t)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(t,e,i){return this.inputValidationController.setValidity(t,e,i)}_mixinShouldSkipSgdsValidation(){const t=this.closest("form");return(null==t?void 0:t.noValidate)||this.noValidate}}return i.formAssociated=!0,t([Bi("sgds-input")],i.prototype,"sgdsInput",void 0),t([Bi("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var vr=re`:host{--input-border-radius:var(--sgds-form-border-radius-md)}:host(.quantity-toggle) input::-webkit-inner-spin-button{appearance:none;margin:0}:host(.quantity-toggle) input{text-align:center}.form-control-prefix,.form-control-suffix{color:var(--sgds-form-color-subtle);display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs)}.form-control-group.quantity-toggle{padding:0}sgds-icon[role=button]{cursor:pointer}sgds-icon[role=button]:focus,sgds-icon[role=button]:focus-visible{outline:var(--sgds-form-outline-focus)}.form-control-row{align-items:center;display:flex;gap:var(--sgds-gap-sm)}`;class fr extends(gr(dr)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(t){this.input.focus(t)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(t,e,i){return this._mixinSetValidity(t,e,i)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const t=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||t.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(t){this.value=this.input.value;const e=this.emit("sgds-change",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||super._mixinHandleChange(t)}_handleInputChange(t){this.value=this.input.value;const e=this.emit("sgds-input",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||super._mixinHandleInputChange(t)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){const t="both"===this.hasFeedback||"style"===this.hasFeedback;return Is`
2451
+ `}}_n.styles=[xn],_n.dependencies={"sgds-icon":vn,"sgds-icon-button":bn,"sgds-button":Us},t([Zi({attribute:!1})],_n.prototype,"displayDate",void 0),t([Zi({attribute:!1})],_n.prototype,"focusedDate",void 0),t([Zi({attribute:!1})],_n.prototype,"selectedDate",void 0),t([Zi()],_n.prototype,"view",void 0),t([Zi()],_n.prototype,"focusedTabIndex",void 0),t([As("focusedTabIndex",{waitUntilFirstUpdate:!0})],_n.prototype,"_handleFocusedTabIndexChange",null);const Cn=["January","February","March","April","May","June","July","August","September","October","November","December"];function kn(t){return"string"==typeof t||t instanceof String}function Mn(t){var e;return"object"==typeof t&&null!=t&&"Object"===(null==t||null==(e=t.constructor)?void 0:e.name)}function Zn(t,e){return Array.isArray(e)?Zn(t,(t,i)=>e.includes(i)):Object.entries(t).reduce((t,i)=>{let[a,s]=i;return e(s,a)&&(t[a]=s),t},{})}const Vn="NONE",Sn="LEFT",Dn="FORCE_LEFT",An="RIGHT",Bn="FORCE_RIGHT";function En(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Fn(t,e){if(e===t)return!0;const i=Array.isArray(e),a=Array.isArray(t);let s;if(i&&a){if(e.length!=t.length)return!1;for(s=0;s<e.length;s++)if(!Fn(e[s],t[s]))return!1;return!0}if(i!=a)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const i=e instanceof Date,a=t instanceof Date;if(i&&a)return e.getTime()==t.getTime();if(i!=a)return!1;const n=e instanceof RegExp,r=t instanceof RegExp;if(n&&r)return e.toString()==t.toString();if(n!=r)return!1;const o=Object.keys(e);for(s=0;s<o.length;s++)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=0;s<o.length;s++)if(!Fn(t[o[s]],e[o[s]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}class Hn{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Vn:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?Sn:An}}function $n(t,e){return new $n.InputMask(t,e)}function Tn(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?$n.MaskedRegExp:kn(t)?$n.MaskedPattern:t===Date?$n.MaskedDate:t===Number?$n.MaskedNumber:Array.isArray(t)||t===Array?$n.MaskedDynamic:$n.Masked&&t.prototype instanceof $n.Masked?t:$n.Masked&&t instanceof $n.Masked?t.constructor:t instanceof Function?$n.MaskedFunction:(console.warn("Mask not found for mask",t),$n.Masked)}function In(t){if(!t)throw new Error("Options in not defined");if($n.Masked){if(t.prototype instanceof $n.Masked)return{mask:t};const{mask:e,...i}=t instanceof $n.Masked?{mask:t}:Mn(t)&&t.mask instanceof $n.Masked?t:{};if(e){const t=e.mask;return{...Zn(e,(t,e)=>!e.startsWith("_")),mask:e.constructor,_mask:t,...i}}}return Mn(t)?{...t}:{mask:t}}function Pn(t){if($n.Masked&&t instanceof $n.Masked)return t;const e=In(t),i=Tn(e.mask);if(!i)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===i&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new i(e)}$n.createMask=Pn;class Ln{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}$n.MaskElement=Ln;class Rn extends Ln{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,i;return null!=(t=null==(e=(i=this.input).getRootNode)?void 0:e.call(i))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}$n.HTMLMaskElement=Rn;class On extends Rn{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}$n.HTMLMaskElement=Rn;class Yn extends Rn{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,a=e&&e.focusOffset;return null==a||null==i||i<a?i:a}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,a=e&&e.focusOffset;return null==a||null==i||i>a?i:a}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,t),i.setEnd(this.input.lastChild||this.input,e);const a=this.rootElement,s=a.getSelection&&a.getSelection();s&&(s.removeAllRanges(),s.addRange(i))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}$n.HTMLContenteditableMaskElement=Yn;class Nn{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Nn.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Nn.MAX_LENGTH=100;$n.InputMask=class{constructor(t,e){this.el=t instanceof Ln?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new Yn(t):new On(t),this.masked=Pn(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Nn,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return null==t||(null==(e=this.masked)?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof $n.Masked)&&this.masked.constructor===Tn(t))return void this.masked.updateOptions({mask:t});const e=t instanceof $n.Masked?t:Pn({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const i=this._listeners[t];i&&i.forEach(t=>t(e))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,i=this.masked.value,a=this.masked.rawInputValue,s=this.displayValue,n=this.unmaskedValue!==e||this.value!==i||this._rawInputValue!==a;this._unmaskedValue=e,this._value=i,this._rawInputValue=a,this.el.value!==s&&(this.el.value=s),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),n&&this._fireChangeEvents(),this._historyChanging||!n&&!this.history.isEmpty||this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...i}=t,a=!this.maskEquals(e),s=this.masked.optionsIsChanged(i);a&&(this.mask=e),s&&this.masked.updateOptions(i),(a||s)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Sn))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const i=this._listeners[t].indexOf(e);return i>=0&&this._listeners[t].splice(i,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Hn({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,a=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,s=i===this.masked.rawInputValue?e.removeDirection:Vn;let n=this.masked.nearestInputPos(e.startChangePos+a,s);s!==Vn&&(n=this.masked.nearestInputPos(n,Vn)),this.updateControl(n),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class zn{static normalize(t){return Array.isArray(t)?t:[t,new zn]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}$n.ChangeDetails=zn;class Un{constructor(t,e,i){void 0===t&&(t=""),void 0===e&&(e=0),this.value=t,this.from=e,this.stop=i}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class qn{constructor(t){this._value="",this._update({...qn.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){void 0===e&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new Un(this.extractInput(t,e),t)}appendTail(t){return kn(t)&&(t=new Un(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new zn({inserted:t,rawInserted:t})):new zn}_appendChar(t,e,i){void 0===e&&(e={});const a=this.state;let s;if([t,s]=this.doPrepareChar(t,e),t&&(s=s.aggregate(this._appendCharRaw(t,e)),!s.rawInserted&&"pad"===this.autofix)){const i=this.state;this.state=a;let n=this.pad(e);const r=this._appendCharRaw(t,e);n=n.aggregate(r),r.rawInserted||n.equals(s)?s=n:this.state=i}if(s.inserted){let t,n=!1!==this.doValidate(e);if(n&&null!=i){const e=this.state;if(!0===this.overwrite){t=i.state;for(let t=0;t<s.rawInserted.length;++t)i.unshift(this.displayValue.length-s.tailShift)}let a=this.appendTail(i);if(n=a.rawInserted.length===i.toString().length,!(n&&a.inserted||"shift"!==this.overwrite)){this.state=e,t=i.state;for(let t=0;t<s.rawInserted.length;++t)i.shift();a=this.appendTail(i),n=a.rawInserted.length===i.toString().length}n&&a.inserted&&(this.state=e)}n||(s=new zn,this.state=a,i&&t&&(i.state=t))}return s}_appendPlaceholder(){return new zn}_appendEager(){return new zn}append(t,e,i){if(!kn(t))throw new Error("value should be string");const a=kn(i)?new Un(String(i)):i;let s;null!=e&&e.tail&&(e._beforeTailState=this.state),[t,s]=this.doPrepare(t,e);for(let i=0;i<t.length;++i){const n=this._appendChar(t[i],e,a);if(!n.rawInserted&&!this.doSkipInvalid(t[i],e,a))break;s.aggregate(n)}return(!0===this.eager||"append"===this.eager)&&null!=e&&e.input&&t&&s.aggregate(this._appendEager()),null!=a&&(s.tailShift+=this.appendTail(a).tailShift),s}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new zn}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,i=this.value,a=t();return this.rawInputValue=e,this.value&&this.value!==i&&0===i.indexOf(this.value)&&(this.append(i.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,i=t(this);return this.state=e,delete this._isolated,i}doSkipInvalid(t,e,i){return Boolean(this.skipInvalid)}doPrepare(t,e){return void 0===e&&(e={}),zn.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return void 0===e&&(e={}),zn.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,i,a,s){void 0===i&&(i=""),void 0===a&&(a=Vn),void 0===s&&(s={input:!0});const n=t+e,r=this.extractTail(n),o=!0===this.eager||"remove"===this.eager;let l;o&&(a=function(t){switch(t){case Sn:return Dn;case An:return Bn;default:return t}}(a),l=this.extractInput(0,n,{raw:!0}));let c=t;const d=new zn;if(a!==Vn&&(c=this.nearestInputPos(t,e>1&&0!==t&&!o?Vn:a),d.tailShift=c-t),d.aggregate(this.remove(c)),o&&a!==Vn&&l===this.rawInputValue)if(a===Dn){let t;for(;l===this.rawInputValue&&(t=this.displayValue.length);)d.aggregate(new zn({tailShift:-1})).aggregate(this.remove(t-1))}else a===Bn&&r.unshift();return d.aggregate(this.append(i,s,r))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Fn(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||qn.EMPTY_VALUES.includes(t)&&qn.EMPTY_VALUES.includes(e)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}pad(t){return new zn}}qn.DEFAULTS={skipInvalid:!0},qn.EMPTY_VALUES=[void 0,null,""],$n.Masked=qn;class Wn{constructor(t,e){void 0===t&&(t=[]),void 0===e&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=kn(t)?new Un(String(t)):t;const e=this.chunks[this.chunks.length-1],i=e&&(e.stop===t.stop||null==t.stop)&&t.from===e.from+e.toString().length;if(t instanceof Un)i?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof Wn){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof $n.MaskedPattern)){return new Un(this.toString()).appendTo(t)}const e=new zn;for(let i=0;i<this.chunks.length;++i){const a=this.chunks[i],s=t._mapPosToBlock(t.displayValue.length),n=a.stop;let r;if(null!=n&&(!s||s.index<=n)&&((a instanceof Wn||t._stops.indexOf(n)>=0)&&e.aggregate(t._appendPlaceholder(n)),r=a instanceof Wn&&t._blocks[n]),r){const i=r.appendTail(a);e.aggregate(i);const s=a.toString().slice(i.rawInserted.length);s&&e.aggregate(t.append(s,{tail:!0}))}else e.aggregate(t.append(a.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map(t=>t.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...i}=t;Object.assign(this,i),this.chunks=e.map(t=>{const e="chunks"in t?new Wn:new Un;return e.state=t,e})}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const e=null!=t?t-this.from:t;let i=0;for(;i<this.chunks.length;){const t=this.chunks[i],a=t.unshift(e);if(t.toString()){if(!a)break;++i}else this.chunks.splice(i,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],i=e.shift();if(e.toString()){if(!i)break;--t}else this.chunks.splice(t,1);if(i)return i}return""}}class jn{constructor(t,e){this.masked=t,this._log=[];const{offset:i,index:a}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(e=this.block)?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,Dn),0!==this.offset||void 0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Sn),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Sn),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,Bn),this.offset!==this.block.value.length||void 0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Vn),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Vn),!0})}}class Gn{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new zn}nearestInputPos(t,e){void 0===e&&(e=Vn);const i=this._value.length;switch(e){case Sn:case Dn:return 0;default:return i}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),void 0===i&&(i={}),i.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new zn;const i=!0===this.eager||"append"===this.eager,a=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!i)&&!e.tail,s=new zn({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(e.raw||e.input),s}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new zn;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new Un("")}appendTail(t){return kn(t)&&(t=new Un(String(t))),t.appendTo(this)}append(t,e,i){const a=this._appendChar(t[0],e);return null!=i&&(a.tailShift+=this.appendTail(i).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class Kn{constructor(t){const{parent:e,isOptional:i,placeholderChar:a,displayChar:s,lazy:n,eager:r,...o}=t;this.masked=Pn(o),Object.assign(this,{parent:e,isOptional:i,placeholderChar:a,displayChar:s,lazy:n,eager:r})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),0===t&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new zn}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new zn;const i=this.masked.state;let a=this.masked._appendChar(t,this.currentMaskFlags(e));return a.inserted&&!1===this.doValidate(e)&&(a=new zn,this.masked.state=i),a.inserted||this.isOptional||this.lazy||e.input||(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=Boolean(a.inserted),a}append(t,e,i){return this.masked.append(t,this.currentMaskFlags(e),i)}_appendPlaceholder(){return this.isFilled||this.isOptional?new zn:(this.isFilled=!0,new zn({inserted:this.placeholderChar}))}_appendEager(){return new zn}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.masked.extractInput(t,e,i)}nearestInputPos(t,e){void 0===e&&(e=Vn);const i=this.value.length,a=Math.min(Math.max(t,0),i);switch(e){case Sn:case Dn:return this.isComplete?a:0;case An:case Bn:return this.isComplete?a:i;default:return a}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(null==t||null==(e=t._beforeTailState)?void 0:e.masked)||(null==t?void 0:t._beforeTailState)}}pad(t){return new zn}}Kn.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};$n.MaskedRegExp=class extends qn{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=t=>t.search(e)>=0),super._update(t)}};class Qn extends qn{constructor(t){super({...Qn.DEFAULTS,...t,definitions:Object.assign({},Kn.DEFAULT_DEFINITIONS,null==t?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let i=!1,a=!1;for(let s=0;s<e.length;++s){if(this.blocks){const t=e.slice(s),i=Object.keys(this.blocks).filter(e=>0===t.indexOf(e));i.sort((t,e)=>e.length-t.length);const a=i[0];if(a){const{expose:t,repeat:e,...i}=In(this.blocks[a]),n={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...i,repeat:e,parent:this},r=null!=e?new $n.RepeatBlock(n):Pn(n);r&&(this._blocks.push(r),t&&(this.exposeBlock=r),this._maskedBlocks[a]||(this._maskedBlocks[a]=[]),this._maskedBlocks[a].push(this._blocks.length-1)),s+=a.length-1;continue}}let n=e[s],r=n in t;if(n===Qn.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===n||"}"===n){i=!i;continue}if("["===n||"]"===n){a=!a;continue}if(n===Qn.ESCAPE_CHAR){if(++s,n=e[s],!n)break;r=!1}const o=r?new Kn({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...In(t[n]),parent:this}):new Gn({char:n,eager:this.eager,isUnmasking:i});this._blocks.push(o)}}get state(){return{...super.state,_blocks:this._blocks.map(t=>t.state)}}set state(t){if(!t)return void this.reset();const{_blocks:e,...i}=t;this._blocks.forEach((t,i)=>t.state=e[i]),super.state=i}reset(){super.reset(),this._blocks.forEach(t=>t.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(t=>t.isComplete)}get isFilled(){return this._blocks.every(t=>t.isFilled)}get isFixed(){return this._blocks.every(t=>t.isFixed)}get isOptional(){return this._blocks.every(t=>t.isOptional)}doCommit(){this._blocks.forEach(t=>t.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((t,e)=>t+e.unmaskedValue,"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((t,e)=>t+e.value,"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce((t,e)=>t+e.displayValue,"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new zn;let i=null==(t=this._mapPosToBlock(this.displayValue.length))?void 0:t.index;if(null==i)return e;this._blocks[i].isFilled&&++i;for(let t=i;t<this._blocks.length;++t){const i=this._blocks[t]._appendEager();if(!i.inserted)break;e.aggregate(i)}return e}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._mapPosToBlock(this.displayValue.length),a=new zn;if(!i)return a;for(let n,r=i.index;n=this._blocks[r];++r){var s;const i=n._appendChar(t,{...e,_beforeTailState:null==(s=e._beforeTailState)||null==(s=s._blocks)?void 0:s[r]});if(a.aggregate(i),i.consumed)break}return a}extractTail(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=new Wn;return t===e||this._forEachBlocksInRange(t,e,(t,e,a,s)=>{const n=t.extractTail(a,s);n.stop=this._findStopBefore(e),n.from=this._blockStartPos(e),n instanceof Wn&&(n.blockIndex=e),i.extend(n)}),i}extractInput(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),void 0===i&&(i={}),t===e)return"";let a="";return this._forEachBlocksInRange(t,e,(t,e,s,n)=>{a+=t.extractInput(s,n,i)}),a}_findStopBefore(t){let e;for(let i=0;i<this._stops.length;++i){const a=this._stops[i];if(!(a<=t))break;e=a}return e}_appendPlaceholder(t){const e=new zn;if(this.lazy&&null==t)return e;const i=this._mapPosToBlock(this.displayValue.length);if(!i)return e;const a=i.index,s=null!=t?t:this._blocks.length;return this._blocks.slice(a,s).forEach(i=>{var a;i.lazy&&null==t||e.aggregate(i._appendPlaceholder(null==(a=i._blocks)?void 0:a.length))}),e}_mapPosToBlock(t){let e="";for(let i=0;i<this._blocks.length;++i){const a=this._blocks[i],s=e.length;if(e+=a.displayValue,t<=e.length)return{index:i,offset:t-s}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce((t,e)=>t+e.displayValue.length,0)}_forEachBlocksInRange(t,e,i){void 0===e&&(e=this.displayValue.length);const a=this._mapPosToBlock(t);if(a){const t=this._mapPosToBlock(e),s=t&&a.index===t.index,n=a.offset,r=t&&s?t.offset:this._blocks[a.index].displayValue.length;if(i(this._blocks[a.index],a.index,n,r),t&&!s){for(let e=a.index+1;e<t.index;++e)i(this._blocks[e],e,0,this._blocks[e].displayValue.length);i(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._forEachBlocksInRange(t,e,(t,e,a,s)=>{i.aggregate(t.remove(a,s))}),i}nearestInputPos(t,e){if(void 0===e&&(e=Vn),!this._blocks.length)return 0;const i=new jn(this,t);if(e===Vn)return i.pushRightBeforeInput()?i.pos:(i.popState(),i.pushLeftBeforeInput()?i.pos:this.displayValue.length);if(e===Sn||e===Dn){if(e===Sn){if(i.pushRightBeforeFilled(),i.ok&&i.pos===t)return t;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),e===Sn){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=t)return i.pos;if(i.popState(),i.ok&&i.pos<=t)return i.pos;i.popState()}return i.ok?i.pos:e===Dn?0:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:0))}return e===An||e===Bn?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:e===Bn?this.displayValue.length:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:this.nearestInputPos(t,Sn)))):t}totalInputPositions(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);let i=0;return this._forEachBlocksInRange(t,e,(t,e,a,s)=>{i+=t.totalInputPositions(a,s)}),i}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map(t=>this._blocks[t]):[]}pad(t){const e=new zn;return this._forEachBlocksInRange(0,this.displayValue.length,i=>e.aggregate(i.pad(t))),e}}Qn.DEFAULTS={...qn.DEFAULTS,lazy:!0,placeholderChar:"_"},Qn.STOP_CHAR="`",Qn.ESCAPE_CHAR="\\",Qn.InputDefinition=Kn,Qn.FixedDefinition=Gn,$n.MaskedPattern=Qn;class Xn extends Qn{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:i=this.from||0,maxLength:a=this.maxLength||0,autofix:s=this.autofix,...n}=t;this.to=e,this.from=i,this.maxLength=Math.max(String(e).length,a),this.autofix=s;const r=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0");let l=0;for(;l<o.length&&o[l]===r[l];)++l;n.mask=o.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(n)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let e="",i="";const[,a,s]=t.match(/^(\D*)(\d*)(\D*)/)||[];return s&&(e="0".repeat(a.length)+s,i="9".repeat(a.length)+s),e=e.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[e,i]}doPrepareChar(t,e){let i;return void 0===e&&(e={}),[t,i]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(i.skip=!this.isComplete),[t,i]}_appendCharRaw(t,e){if(void 0===e&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const i=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[s,n]=this.boundaries(this.value+t);return Number(n)<this.from?super._appendCharRaw(i[this.value.length],e):Number(s)>this.to?!e.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(i[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(a[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[i,a]=this.boundaries(e);return this.from<=Number(a)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const e=new zn;if(this.value.length===this.maxLength)return e;const i=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let i=0;i<a;++i)e.aggregate(super._appendCharRaw("0",t));i.split("").forEach(t=>this._appendCharRaw(t))}return e}}$n.MaskedRange=Xn;class Jn extends Qn{static extractPatternOptions(t){const{mask:e,pattern:i,...a}=t;return{...a,mask:kn(e)?e:i}}constructor(t){super(Jn.extractPatternOptions({...Jn.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:i,blocks:a,...s}={...Jn.DEFAULTS,...t},n=Object.assign({},Jn.GET_DEFAULT_BLOCKS());t.min&&(n.Y.from=t.min.getFullYear()),t.max&&(n.Y.to=t.max.getFullYear()),t.min&&t.max&&n.Y.from===n.Y.to&&(n.m.from=t.min.getMonth()+1,n.m.to=t.max.getMonth()+1,n.m.from===n.m.to&&(n.d.from=t.min.getDate(),n.d.to=t.max.getDate())),Object.assign(n,this.blocks,a),super._update({...s,mask:kn(e)?e:i,blocks:n})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(Jn.extractPatternOptions(t))}}Jn.GET_DEFAULT_BLOCKS=()=>({d:{mask:Xn,from:1,to:31,maxLength:2},m:{mask:Xn,from:1,to:12,maxLength:2},Y:{mask:Xn,from:1900,to:9999}}),Jn.DEFAULTS={...Qn.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:(t,e)=>{const[i,a,s]=t.split(".").map(Number);return new Date(s,a-1,i)}},$n.MaskedDate=Jn;class tr extends qn{constructor(t){super({...tr.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map(t=>{const{expose:e,...i}=In(t),a=Pn({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return e&&(this.exposeMask=a),a}):[])}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._applyDispatch(t,e);return this.currentMask&&i.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),i}_applyDispatch(t,e,i){void 0===t&&(t=""),void 0===e&&(e={}),void 0===i&&(i="");const a=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,s=this.rawInputValue,n=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:s,r=s.slice(n.length),o=this.currentMask,l=new zn,c=null==o?void 0:o.state;return this.currentMask=this.doDispatch(t,{...e},i),this.currentMask&&(this.currentMask!==o?(this.currentMask.reset(),n&&(this.currentMask.append(n,{raw:!0}),l.tailShift=this.currentMask.value.length-a.length),r&&(l.tailShift+=this.currentMask.append(r,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),l}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new zn;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,i;return{...t,_beforeTailState:(null==(e=t._beforeTailState)?void 0:e.currentMaskRef)===this.currentMask&&(null==(i=t._beforeTailState)?void 0:i.currentMask)||t._beforeTailState}}doDispatch(t,e,i){return void 0===e&&(e={}),void 0===i&&(i=""),this.dispatch(t,this,e,i)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){void 0===e&&(e={});let[i,a]=super.doPrepare(t,e);if(this.currentMask){let t;[i,t]=super.doPrepare(i,this.currentMaskFlags(e)),a=a.aggregate(t)}return[i,a]}doPrepareChar(t,e){void 0===e&&(e={});let[i,a]=super.doPrepareChar(t,e);if(this.currentMask){let t;[i,t]=super.doPrepareChar(i,this.currentMaskFlags(e)),a=a.aggregate(t)}return[i,a]}reset(){var t;null==(t=this.currentMask)||t.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isComplete)}get isFilled(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isFilled)}remove(t,e){const i=new zn;return this.currentMask&&i.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),i}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:null==(t=this.currentMask)?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:i,currentMask:a,...s}=t;e&&this.compiledMasks.forEach((t,i)=>t.state=e[i]),null!=i&&(this.currentMask=i,this.currentMask.state=a),super.state=s}extractInput(t,e,i){return this.currentMask?this.currentMask.extractInput(t,e,i):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every((e,i)=>{if(!t[i])return;const{mask:a,...s}=t[i];return Fn(e,s)&&e.maskEquals(a)}):super.maskEquals(t)}typedValueEquals(t){var e;return Boolean(null==(e=this.currentMask)?void 0:e.typedValueEquals(t))}}tr.DEFAULTS={...qn.DEFAULTS,dispatch:(t,e,i,a)=>{if(!e.compiledMasks.length)return;const s=e.rawInputValue,n=e.compiledMasks.map((n,r)=>{const o=e.currentMask===n,l=o?n.displayValue.length:n.nearestInputPos(n.displayValue.length,Dn);return n.rawInputValue!==s?(n.reset(),n.append(s,{raw:!0})):o||n.remove(l),n.append(t,e.currentMaskFlags(i)),n.appendTail(a),{index:r,weight:n.rawInputValue.length,totalInputPositions:n.totalInputPositions(0,Math.max(l,n.nearestInputPos(n.displayValue.length,Dn)))}});return n.sort((t,e)=>e.weight-t.weight||e.totalInputPositions-t.totalInputPositions),e.compiledMasks[n[0].index]}},$n.MaskedDynamic=tr;class er extends Qn{constructor(t){super({...er.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...i}=t;if(e){const t=e.map(t=>t.length),a=Math.min(...t),s=Math.max(...t)-a;i.mask="*".repeat(a),s&&(i.mask+="["+"*".repeat(s)+"]"),this.enum=e}super._update(i)}_appendCharRaw(t,e){void 0===e&&(e={});const i=Math.min(this.nearestInputPos(0,Bn),this.value.length),a=this.enum.filter(e=>this.matchValue(e,this.unmaskedValue+t,i));if(a.length){1===a.length&&this._forEachBlocksInRange(0,this.value.length,(t,i)=>{const s=a[0][i];i>=this.value.length||s===t.value||(t.reset(),t._appendChar(s,e))});const t=super._appendCharRaw(a[0][this.value.length],e);return 1===a.length&&a[0].slice(this.unmaskedValue.length).split("").forEach(e=>t.aggregate(super._appendCharRaw(e))),t}return new zn({skip:!this.isComplete})}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new Un("",t)}remove(t,e){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),t===e)return new zn;const i=Math.min(super.nearestInputPos(0,Bn),this.value.length);let a;for(a=t;a>=0;--a){if(this.enum.filter(t=>this.matchValue(t,this.value.slice(i,a),i)).length>1)break}const s=super.remove(a,e);return s.tailShift+=a-t,s}get isComplete(){return this.enum.indexOf(this.value)>=0}}er.DEFAULTS={...Qn.DEFAULTS,matchValue:(t,e,i)=>t.indexOf(e,i)===i},$n.MaskedEnum=er;var ir;$n.MaskedFunction=class extends qn{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class ar extends qn{constructor(t){super({...ar.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+En(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(En).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(En(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){void 0===e&&(e={});const[i,a]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!i&&(a.skip=!0),!i||this.allowPositive||this.value||"-"===i||a.aggregate(this._appendChar("-")),[i,a]}_separatorsCount(t,e){void 0===e&&(e=!1);let i=0;for(let a=0;a<t;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++i,e&&(t+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,i))}_appendCharRaw(t,e){void 0===e&&(e={});const i=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);const s=this._value;this._value+=t;const n=this.number;let r,o=!isNaN(n),l=!1;if(o){let t;null!=this.min&&this.min<0&&this.number<this.min&&(t=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(t=this.max),null!=t&&(this.autofix?(this._value=this.format(t,this).replace(ar.UNMASKED_RADIX,this.radix),l||(l=s===this._value&&!e.tail)):o=!1),o&&(o=Boolean(this._value.match(this._numberRegExp)))}o?r=new zn({inserted:this._value.slice(s.length),rawInserted:l?"":t,skip:l}):(this._value=s,r=new zn),this._value=this._insertThousandsSeparators(this._value);const c=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(c);return r.tailShift+=(d-a)*this.thousandsSeparator.length,r}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,i=this.value.indexOf(this.thousandsSeparator,e);if(i<=t)return i}return-1}_adjustRangeWithSeparators(t,e){const i=this._findSeparatorAround(t);i>=0&&(t=i);const a=this._findSeparatorAround(e);return a>=0&&(e=a+this.thousandsSeparator.length),[t,e]}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const i=this.value.slice(0,t),a=this.value.slice(e),s=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+a));const n=this._separatorsCountFromSlice(i);return new zn({tailShift:(n-s)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case Vn:case Sn:case Dn:{const i=this._findSeparatorAround(t-1);if(i>=0){const a=i+this.thousandsSeparator.length;if(t<a||this.value.length<=a||e===Dn)return i}break}case An:case Bn:{const e=this._findSeparatorAround(t);if(e>=0)return e+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(t,e,i,a)=>e+a),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,i){void 0===e&&(e={});const a=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===ar.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,i)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ar.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ar.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ar.EMPTY_VALUES.includes(t)&&ar.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}ir=ar,ar.UNMASKED_RADIX=".",ar.EMPTY_VALUES=[...qn.EMPTY_VALUES,0],ar.DEFAULTS={...qn.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[ir.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},$n.MaskedNumber=ar;const sr={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function nr(t,e,i){void 0===e&&(e=sr.MASKED),void 0===i&&(i=sr.MASKED);const a=Pn(t);return t=>a.runIsolated(a=>(a[e]=t,a[i]))}$n.PIPE_TYPE=sr,$n.createPipe=nr,$n.pipe=function(t,e,i,a){return nr(e,i,a)(t)};$n.RepeatBlock=class extends Qn{get repeatFrom(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?t:0}get repeatTo(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,i,a;const{repeat:s,...n}=In(t);this._blockOpts=Object.assign({},this._blockOpts,n);const r=Pn(this._blockOpts);this.repeat=null!=(e=null!=(i=null!=s?s:r.repeat)?i:this.repeat)?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(a=this._blocks)?void 0:a.length)||0,this.repeatFrom)),blocks:{m:r},eager:r.eager,overwrite:r.overwrite,skipInvalid:r.skipInvalid,lazy:r.lazy,placeholderChar:r.placeholderChar,displayChar:r.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(Pn(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,e){void 0===e&&(e={});const i=new zn;for(let o,l,c=null!=(a=null==(s=this._mapPosToBlock(this.displayValue.length))?void 0:s.index)?a:Math.max(this._blocks.length-1,0);o=null!=(n=this._blocks[c])?n:l=!l&&this._allocateBlock(c);++c){var a,s,n,r;const d=o._appendChar(t,{...e,_beforeTailState:null==(r=e._beforeTailState)||null==(r=r._blocks)?void 0:r[c]});if(d.skip&&l){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(i.aggregate(d),d.consumed)break}return i}_trimEmptyTail(t,e){var i,a;void 0===t&&(t=0);const s=Math.max((null==(i=this._mapPosToBlock(t))?void 0:i.index)||0,this.repeatFrom,0);let n;null!=e&&(n=null==(a=this._mapPosToBlock(e))?void 0:a.index),null==n&&(n=this._blocks.length-1);let r=0;for(let t=n;s<=t&&!this._blocks[t].unmaskedValue;--t,++r);r&&(this._blocks.splice(n-r+1,r),this.mask=this.mask.slice(r))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._trimEmptyTail(t,e),i}totalInputPositions(t,e){return void 0===t&&(t=0),null==e&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=$n}catch{}var rr=re`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,or=re`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,lr=re`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,cr=re`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;class dr extends Cs{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=ks("input"),this._labelId=ks("label")}setInvalid(t){this.invalid=t,t?this.emit("sgds-invalid"):this.emit("sgds-valid")}}dr.styles=[...Cs.styles,rr,or,lr,cr],t([Zi({reflect:!0})],dr.prototype,"label",void 0),t([Zi({reflect:!0})],dr.prototype,"hintText",void 0),t([Zi({reflect:!0})],dr.prototype,"name",void 0),t([Zi({type:Boolean,reflect:!0})],dr.prototype,"disabled",void 0),t([Zi({type:Boolean,reflect:!0})],dr.prototype,"invalid",void 0);var hr=re`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-16);line-height:var(--sgds-line-height-24);outline:none;padding:0}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const ur=(t="value")=>(e,i)=>{const a=e.constructor,s=a.prototype.attributeChangedCallback;a.prototype.attributeChangedCallback=function(e,n,r){var o;const l=a.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t).toLowerCase()){const e=l.converter||xe,a=("function"==typeof e?e:null!==(o=null==e?void 0:e.fromAttribute)&&void 0!==o?o:xe.fromAttribute)(r,l.type);this[t]!==a&&(this[i]=a)}s.call(this,e,n,r)}};class pr{constructor(t,e){(this.host=t).addController(this),this._internals=t._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(t,e)=>{t.invalid=e},value:t=>t.value,input:t=>t.input},e)}hostConnected(){this.host.addEventListener("invalid",t=>this.handleInvalid(t))}hostDisconnected(){this.host.removeEventListener("invalid",t=>this.handleInvalid(t))}handleInvalid(t){t.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(t){const e=t.target;this.options.setInvalid(this.host,!1),this.validateInput(e)}handleChange(t){const e=t.target;this.validateInput(e),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(t,e,i){return this._internals.setValidity(t,e,i)}setFormValue(){const t=this.options.value(this.host);this._internals.setFormValue(t)}validateInput(t){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const e=t.validity;if(e.valid)this._internals.setValidity({});else for(const i in e)e[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},t.validationMessage,t))}}const gr=e=>{class i extends e{constructor(...t){super(...t),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var t;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(t=this.inputValidationController)&&void 0!==t||(this.inputValidationController=new pr(this))}async firstUpdated(t){super.firstUpdated(t),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(t){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(t)}_mixinHandleInputChange(t){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(t)}_mixinResetValidity(t){this._mixinShouldSkipSgdsValidation()||(this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(t),this._isTouched&&(this._isTouched=!1))}_mixinValidate(t){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(t)}_mixinSetFormValue(){const t=this.value;this._internals.setFormValue(t)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(t,e,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(t,e,i)}_mixinShouldSkipSgdsValidation(){const t=this.closest("form");return(null==t?void 0:t.noValidate)||this.noValidate}}return i.formAssociated=!0,t([Bi("sgds-input")],i.prototype,"sgdsInput",void 0),t([Bi("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var vr=re`:host{--input-border-radius:var(--sgds-form-border-radius-md)}:host(.quantity-toggle) input::-webkit-inner-spin-button{appearance:none;margin:0}:host(.quantity-toggle) input{text-align:center}.form-control-prefix,.form-control-suffix{color:var(--sgds-form-color-subtle);display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs)}.form-control-group.quantity-toggle{padding:0}sgds-icon[role=button]{cursor:pointer}sgds-icon[role=button]:focus,sgds-icon[role=button]:focus-visible{outline:var(--sgds-form-outline-focus)}.form-control-row{align-items:center;display:flex;gap:var(--sgds-gap-sm)}`;class fr extends(gr(dr)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(t){this.input.focus(t)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(t,e,i){return this._mixinSetValidity(t,e,i)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const t=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||t.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(t){this.value=this.input.value;this.emit("sgds-change",{cancelable:!0}).defaultPrevented||super._mixinHandleChange(t)}_handleInputChange(t){this.value=this.input.value;this.emit("sgds-input",{cancelable:!0}).defaultPrevented||super._mixinHandleInputChange(t)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){const t="both"===this.hasFeedback||"style"===this.hasFeedback;return Is`
2452
2452
  <div
2453
2453
  class="form-control-group ${Bs({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&t})}"
2454
2454
  @click=${this._handleClick}
@@ -2516,7 +2516,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
2516
2516
  </div>
2517
2517
  ${this._renderFeedback()}
2518
2518
  </div>
2519
- `}}fr.styles=[...dr.styles,hr,cr,vr],fr.dependencies={"sgds-spinner":wn,"sgds-icon":vn},t([Zi({reflect:!0})],fr.prototype,"type",void 0),t([Zi({type:String})],fr.prototype,"prefix",void 0),t([Zi({type:String})],fr.prototype,"suffix",void 0),t([Zi({type:Number,reflect:!0})],fr.prototype,"minlength",void 0),t([Zi({type:Number,reflect:!0})],fr.prototype,"maxlength",void 0),t([Zi()],fr.prototype,"min",void 0),t([Zi()],fr.prototype,"max",void 0),t([Zi({type:String,reflect:!0})],fr.prototype,"placeholder",void 0),t([Zi({type:String})],fr.prototype,"pattern",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"autofocus",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"readonly",void 0),t([Zi()],fr.prototype,"step",void 0),t([Zi({type:String,reflect:!0})],fr.prototype,"hasFeedback",void 0),t([Zi({type:String,reflect:!0})],fr.prototype,"invalidFeedback",void 0),t([ur()],fr.prototype,"defaultValue",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"valid",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"loading",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"required",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"noValidate",void 0),t([Zi({reflect:!0})],fr.prototype,"value",void 0),t([Vi()],fr.prototype,"_isTouched",void 0),t([Vi()],fr.prototype,"_showPassword",void 0),t([As("_isTouched",{waitUntilFirstUpdate:!0})],fr.prototype,"_handleIsTouched",null),t([As("disabled",{waitUntilFirstUpdate:!0})],fr.prototype,"_handleDisabledChange",null);var mr=re`.datepicker-input-container{display:flex;flex-direction:row;width:-webkit-fill-available;width:-moz-available}.datepicker-input-container .form-control-group{border-right:0}.calendar-btn{all:unset}`;class wr extends fr{constructor(){super(),this.dateFormat="DD/MM/YYYY",this.mode="single",this._validateInput=async()=>{const t=this.mask.value.split(" - ").filter(t=>t!==this.dateFormat),e=t.map(t=>Ss(Jt(t,Zs[this.dateFormat].fnsPattern,new Date))),i=e.filter(t=>!u(t)||at(t,new Date(0,0,1))||at(t,Ss(new Date(this.minDate)))||it(t,Ss(new Date(this.maxDate))));return i.length>0||"range"===this.mode&&1===e.length?(this.setInvalid(!0),this.emit("sgds-invalid-input")):0===i.length&&e.length>0?(this.setInvalid(!1),this.emit("sgds-selectdates-input",{detail:e})):0===e.length&&0===i.length?(this.setInvalid(!1),this.emit("sgds-empty-input")):void 0},this.type="text",this._handleBlur=()=>null}async _handleChange(t){this.value=this.input.value,this.emit("sgds-change"),super._mixinHandleChange(t),await this._validateInput()}async firstUpdated(t){super.firstUpdated(t),this._applyInputMask(this.dateFormat)}async _applyInputMask(t){const e=await this.shadowInput,i="single"===this.mode?Zs[t].imPattern:Zs[t].imRangePattern,a={mask:i,pattern:i,eager:!0,overwrite:!0,parse:function(e){return e.split(" - ").map(e=>Jt(e,Zs[t].fnsPattern,new Date))},format:function(t){return t.map(t=>{let e,i="";const a=t.getDate(),s=t.getMonth()+1;return a<10&&(e="0"+a),s<10&&(i="0"+s),[e,i,t.getFullYear()].join("/")}).join(" - ")},lazy:!1,blocks:{d:{mask:$n.MaskedRange,placeholderChar:"D",from:0,to:9,maxLength:1},m:{mask:$n.MaskedRange,placeholderChar:"M",from:0,to:9,maxLength:1},y:{mask:$n.MaskedRange,placeholderChar:"Y",from:0,to:9,maxLength:1},D:{mask:$n.MaskedRange,placeholderChar:"D",from:0,to:9,maxLength:1},M:{mask:$n.MaskedRange,placeholderChar:"M",from:0,to:9,maxLength:1},Y:{mask:$n.MaskedRange,placeholderChar:"Y",from:0,to:9,maxLength:1}}};this.mask=$n(e,a),this.mask.on("accept",()=>{this.value=this.mask.masked.value,this.emit("sgds-mask-input-change",{detail:this.value})}),this.mask.on("complete",this._validateInput)}updateMaskValue(){var t;null===(t=this.mask)||void 0===t||t.updateValue()}destroyInputMask(){var t;null===(t=this.mask)||void 0===t||t.destroy()}async applyInputMask(){return await this._applyInputMask(this.dateFormat)}async focus(){return(await this.shadowInput).focus()}render(){return Je`
2519
+ `}}fr.styles=[...dr.styles,hr,cr,vr],fr.dependencies={"sgds-spinner":wn,"sgds-icon":vn},t([Zi({reflect:!0})],fr.prototype,"type",void 0),t([Zi({type:String})],fr.prototype,"prefix",void 0),t([Zi({type:String})],fr.prototype,"suffix",void 0),t([Zi({type:Number,reflect:!0})],fr.prototype,"minlength",void 0),t([Zi({type:Number,reflect:!0})],fr.prototype,"maxlength",void 0),t([Zi()],fr.prototype,"min",void 0),t([Zi()],fr.prototype,"max",void 0),t([Zi({type:String,reflect:!0})],fr.prototype,"placeholder",void 0),t([Zi({type:String})],fr.prototype,"pattern",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"autofocus",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"readonly",void 0),t([Zi()],fr.prototype,"step",void 0),t([Zi({type:String,reflect:!0})],fr.prototype,"hasFeedback",void 0),t([Zi({type:String,reflect:!0})],fr.prototype,"invalidFeedback",void 0),t([ur()],fr.prototype,"defaultValue",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"valid",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"loading",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"required",void 0),t([Zi({type:Boolean,reflect:!0})],fr.prototype,"noValidate",void 0),t([Zi({reflect:!0})],fr.prototype,"value",void 0),t([Vi()],fr.prototype,"_isTouched",void 0),t([Vi()],fr.prototype,"_showPassword",void 0),t([As("_isTouched",{waitUntilFirstUpdate:!0})],fr.prototype,"_handleIsTouched",null),t([As("disabled",{waitUntilFirstUpdate:!0})],fr.prototype,"_handleDisabledChange",null);var mr=re`.datepicker-input-container{display:flex;flex-direction:row;width:-webkit-fill-available;width:-moz-available}.datepicker-input-container .form-control-group{border-right:0}.calendar-btn{all:unset}`;class wr extends fr{constructor(){super(),this.dateFormat="DD/MM/YYYY",this.mode="single",this._validateInput=async()=>{const t=this.mask.value.split(" - ").filter(t=>t!==this.dateFormat),e=t.map(t=>Ds(Jt(t,Zs[this.dateFormat].fnsPattern,new Date))),i=e.filter(t=>!u(t)||at(t,new Date(0,0,1))||at(t,Ds(new Date(this.minDate)))||it(t,Ds(new Date(this.maxDate))));return i.length>0||"range"===this.mode&&1===e.length?(this.setInvalid(!0),this.emit("sgds-invalid-input")):0===i.length&&e.length>0?(this.setInvalid(!1),this.emit("sgds-selectdates-input",{detail:e})):0===e.length&&0===i.length?(this.setInvalid(!1),this.emit("sgds-empty-input")):void 0},this.type="text",this._handleBlur=()=>null}async _handleChange(t){this.value=this.input.value,this.emit("sgds-change"),super._mixinHandleChange(t),await this._validateInput()}async firstUpdated(t){super.firstUpdated(t),this._applyInputMask(this.dateFormat)}async _applyInputMask(t){const e=await this.shadowInput,i="single"===this.mode?Zs[t].imPattern:Zs[t].imRangePattern,a={mask:i,pattern:i,eager:!0,overwrite:!0,parse:function(e){return e.split(" - ").map(e=>Jt(e,Zs[t].fnsPattern,new Date))},format:function(t){return t.map(t=>{let e,i="";const a=t.getDate(),s=t.getMonth()+1;return a<10&&(e="0"+a),s<10&&(i="0"+s),[e,i,t.getFullYear()].join("/")}).join(" - ")},lazy:!1,blocks:{d:{mask:$n.MaskedRange,placeholderChar:"D",from:0,to:9,maxLength:1},m:{mask:$n.MaskedRange,placeholderChar:"M",from:0,to:9,maxLength:1},y:{mask:$n.MaskedRange,placeholderChar:"Y",from:0,to:9,maxLength:1},D:{mask:$n.MaskedRange,placeholderChar:"D",from:0,to:9,maxLength:1},M:{mask:$n.MaskedRange,placeholderChar:"M",from:0,to:9,maxLength:1},Y:{mask:$n.MaskedRange,placeholderChar:"Y",from:0,to:9,maxLength:1}}};this.mask=$n(e,a),this.mask.on("accept",()=>{this.value=this.mask.masked.value,this.emit("sgds-mask-input-change",{detail:this.value})}),this.mask.on("complete",this._validateInput)}updateMaskValue(){var t;null===(t=this.mask)||void 0===t||t.updateValue()}destroyInputMask(){var t;null===(t=this.mask)||void 0===t||t.destroy()}async applyInputMask(){return await this._applyInputMask(this.dateFormat)}async focus(){return(await this.shadowInput).focus()}render(){return Je`
2520
2520
  <div
2521
2521
  class="form-control-container ${Bs({disabled:this.disabled})}"
2522
2522
  >
@@ -2527,7 +2527,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
2527
2527
  </div>
2528
2528
  ${this._renderFeedback()}
2529
2529
  </div>
2530
- `}}wr.styles=[...fr.styles,mr],t([Zi({type:String})],wr.prototype,"minDate",void 0),t([Zi({type:String})],wr.prototype,"maxDate",void 0),t([Zi({type:String,reflect:!0})],wr.prototype,"mode",void 0),t([Bi("input")],wr.prototype,"shadowInput",void 0);var yr,br,xr=re`:host{--datepicker-theme-color:var(--sgds-primary);--datepicker-hover-bg:var(--sgds-primary-100);--datepicker-bg:#fff;--datepicker-close-btn-bg:var(--datepicker-theme-color);--datepicker-close-btn-hover-bg:var(--sgds-primary-700);--datepicker-close-btn-color:#fff;--datepicker-selected-date-bg:var(--sgds-primary);--datepicker-selected-date-color:#fff;font-size:var(--sgds-font-size-14)}:host([menuisopen]) .dropdown-menu{background-color:var(--sgds-form-surface-default);display:flex;flex-direction:column;gap:var(--sgds-form-gap-sm);overflow:unset;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x);width:var(--sgds-dimension-320)}.dropdown{display:flex;height:100%}sgds-datepicker-input{--input-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.datepicker-container{display:flex}.calendar-btn:not(.with-hint-text){align-self:center}.calendar-btn:not(.with-hint-text).with-label{align-self:end;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}.calendar-btn.with-hint-text.with-label{align-self:center;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}`;class Cr extends(gr(Ms)){constructor(){super(),this.required=!1,this.disabled=!1,this.value="",this.initialValue=[],this.dateFormat="DD/MM/YYYY",this.minDate="",this.maxDate="",this.mode="single",this.hasFeedback=!1,this.label="",this.hintText="",this.noFlip=!1,this.drop="down",this.defaultValue="",this.invalid=!1,this.view="days",this.selectedDateRange=[],this.focusedTabIndex=3,this.initialDisplayDate=new Date,this._makeInputValueString=(t,e,i)=>{if(!t&&!e)return this.value;const a=t=>X(t,Zs[i].fnsPattern);switch(this.mode){case"single":t&&(this.value=a(t));break;case"range":t&&e&&(this.value=`${a(t)} - ${a(e)}`),t&&!e&&(this.value=`${a(t)} - ${this.dateFormat}`)}return this.value},this._dialogAriaLabels={days:"Choose date",months:"Choose month",years:"Choose year"},this.floatingOpts={placement:"bottom-end"}}isValueEmpty(){return""===this.value||"DD/MM/YYYY"===this.value||"DD/MM/YYYY - DD/MM/YYYY"===this.value}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}async connectedCallback(){if(super.connectedCallback(),this.addEventListener("sgds-view",this._handleViewChanged),this.addEventListener("sgds-change-calendar",this._handleDateChanged),this.addEventListener("sgds-update-focus",this._handleFocusDateChanged),this.addEventListener("sgds-selectmonth",this._handleSelectMonth),this.addEventListener("sgds-selectyear",this._handleSelectYear),this.addEventListener("sgds-selectdates",this._handleSelectDatesAndClose),this.addEventListener("sgds-selectdates-input",this._handleSelectDatesInput),this.addEventListener("sgds-empty-input",this._handleEmptyInput),this.addEventListener("keydown",this._handleTab),this.addEventListener("sgds-hide",this._handleCloseMenu),this.addEventListener("sgds-show",this._handleOpenMenu),this.addEventListener("blur",this._mixinCheckValidity),this.initialValue=this.value?this.value.split(" - ").map(t=>t.trim()):this.initialValue,this.initialDisplayDate=this.displayDate||new Date,this.initialValue&&this.initialValue.length>0){const t=new RegExp(this._getDateFormatRegex()),e=this.initialValue.filter(e=>!t.test(e));if(e.length>0)return console.error("Invalid date format in initialValue:",e);{const t=this.initialValue.map(t=>Ss(Jt(t,Zs[this.dateFormat].fnsPattern,new Date)));this._handleSelectDates(t)}}else this.displayDate=this.initialDisplayDate}async firstUpdated(t){if(super.firstUpdated(t),this.menuIsOpen){const t=await this.datepickerInputAsync;this.showMenu();(await this.calendar).focusOnCalendar(t)}}_getDateFormatRegex(){return this.dateFormat.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace("MM","\\d{2}").replace("DD","\\d{2}").replace("YYYY","\\d{4}").replace("/","\\/")}_handleTab(t){if(!this.menuIsOpen)return;const e=Array(4);t.shiftKey&&"Tab"===t.key?(t.preventDefault(),this.focusedTabIndex=(this.focusedTabIndex-1+e.length)%e.length):"Tab"===t.key&&(t.preventDefault(),this.focusedTabIndex=(this.focusedTabIndex+1+e.length)%e.length)}_handleValueChange(){this.emit("sgds-change-date")}async _handleCloseMenu(){if((await this.datepickerInputAsync).focus(),0===this.selectedDateRange.length)this.displayDate=this.initialDisplayDate;else{const t=this.selectedDateRange.length;this.displayDate=this.selectedDateRange[t-1];(await this.calendar)._updateFocusedDate()}}async _handleOpenMenu(){const t=await this.calendar,e=await this.datepickerInputAsync;t.focusOnCalendar(e)}_handleSelectDatesInput(t){this._handleSelectDates(t.detail)}async _handleSelectDates(t){t.sort((t,e)=>t.getTime()-e.getTime()),this.displayDate=t[0],this.focusedDate=t[0],this.selectedDateRange=t;const e=this._makeInputValueString(this.selectedDateRange[0],this.selectedDateRange[1],this.dateFormat);this.value=e;(await this.datepickerInputAsync).updateMaskValue(),this._manageInternalsValid()}async _handleSelectDatesAndClose(t){await this._handleSelectDates(t.detail),("range"===this.mode&&2===this.selectedDateRange.length||"single"===this.mode&&1===this.selectedDateRange.length)&&this.hideMenu()}_handleViewChanged(t){this.view=t.detail}_handleDateChanged(t){this.displayDate=t.detail}_handleFocusDateChanged(t){this.focusedDate=t.detail}_handleSelectMonth(t){this.displayDate=t.detail}_handleSelectYear(t){this.displayDate=t.detail}async _handleInvalidInput(){this.selectedDateRange=[],this.displayDate=this.initialDisplayDate,this.invalid=!0,this._manageInternalsBadInput()}async _handleEmptyInput(){this.required&&this._manageEmptyInput()}async _resetDatepicker(t=""){this.displayDate=this.initialDisplayDate,this.selectedDateRange=[],this.value=t,this.view="days";const e=await this.datepickerInputAsync;e.setInvalid(!1),e.destroyInputMask(),await e.applyInputMask(),this._mixinResetValidity(e),this.isValueEmpty()&&this._handleEmptyInput()}_manageInternalsBadInput(){this._mixinSetValidity({badInput:!0},"Invalid date input",this.datepickerInput)}_manageEmptyInput(){this._mixinSetValidity({valueMissing:!0},"Please fill in this field",this.datepickerInput)}_manageInternalsValid(){this._mixinSetValidity({}),this.invalid=this.datepickerInput.invalid=!1,this._mixinSetFormValue()}async _mixinResetFormControl(){this._resetDatepicker(this.defaultValue)}async _handleInputMaskChange(t){this.value=t.detail,this.isValueEmpty()&&this._resetDatepicker()}render(){return Je`
2530
+ `}}wr.styles=[...fr.styles,mr],t([Zi({type:String})],wr.prototype,"minDate",void 0),t([Zi({type:String})],wr.prototype,"maxDate",void 0),t([Zi({type:String,reflect:!0})],wr.prototype,"mode",void 0),t([Bi("input")],wr.prototype,"shadowInput",void 0);var yr,br,xr=re`:host{--datepicker-theme-color:var(--sgds-primary);--datepicker-hover-bg:var(--sgds-primary-100);--datepicker-bg:#fff;--datepicker-close-btn-bg:var(--datepicker-theme-color);--datepicker-close-btn-hover-bg:var(--sgds-primary-700);--datepicker-close-btn-color:#fff;--datepicker-selected-date-bg:var(--sgds-primary);--datepicker-selected-date-color:#fff;font-size:var(--sgds-font-size-14)}:host([menuisopen]) .dropdown-menu{background-color:var(--sgds-form-surface-default);display:flex;flex-direction:column;gap:var(--sgds-form-gap-sm);overflow:unset;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x);width:var(--sgds-dimension-320)}.dropdown{display:flex;height:100%}sgds-datepicker-input{--input-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.datepicker-container{display:flex}.calendar-btn:not(.with-hint-text){align-self:center}.calendar-btn:not(.with-hint-text).with-label{align-self:end;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}.calendar-btn.with-hint-text.with-label{align-self:center;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}`;class _r extends(gr(Ms)){constructor(){super(),this.required=!1,this.disabled=!1,this.value="",this.initialValue=[],this.dateFormat="DD/MM/YYYY",this.minDate="",this.maxDate="",this.mode="single",this.hasFeedback=!1,this.label="",this.hintText="",this.noFlip=!1,this.drop="down",this.defaultValue="",this.invalid=!1,this.view="days",this.selectedDateRange=[],this.focusedTabIndex=3,this.initialDisplayDate=new Date,this._makeInputValueString=(t,e,i)=>{if(!t&&!e)return this.value;const a=t=>X(t,Zs[i].fnsPattern);switch(this.mode){case"single":t&&(this.value=a(t));break;case"range":t&&e&&(this.value=`${a(t)} - ${a(e)}`),t&&!e&&(this.value=`${a(t)} - ${this.dateFormat}`)}return this.value},this._dialogAriaLabels={days:"Choose date",months:"Choose month",years:"Choose year"},this.floatingOpts={placement:"bottom-end"}}isValueEmpty(){return""===this.value||"DD/MM/YYYY"===this.value||"DD/MM/YYYY - DD/MM/YYYY"===this.value}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}async connectedCallback(){if(super.connectedCallback(),this.addEventListener("sgds-view",this._handleViewChanged),this.addEventListener("sgds-change-calendar",this._handleDateChanged),this.addEventListener("sgds-update-focus",this._handleFocusDateChanged),this.addEventListener("sgds-selectmonth",this._handleSelectMonth),this.addEventListener("sgds-selectyear",this._handleSelectYear),this.addEventListener("sgds-selectdates",this._handleSelectDatesAndClose),this.addEventListener("sgds-selectdates-input",this._handleSelectDatesInput),this.addEventListener("sgds-empty-input",this._handleEmptyInput),this.addEventListener("keydown",this._handleTab),this.addEventListener("sgds-hide",this._handleCloseMenu),this.addEventListener("sgds-show",this._handleOpenMenu),this.addEventListener("blur",this._mixinCheckValidity),this.initialValue=this.value?this.value.split(" - ").map(t=>t.trim()):this.initialValue,this.initialDisplayDate=this.displayDate||new Date,this.initialValue&&this.initialValue.length>0){const t=new RegExp(this._getDateFormatRegex()),e=this.initialValue.filter(e=>!t.test(e));if(e.length>0)return console.error("Invalid date format in initialValue:",e);{const t=this.initialValue.map(t=>Ds(Jt(t,Zs[this.dateFormat].fnsPattern,new Date)));this._handleSelectDates(t)}}else this.displayDate=this.initialDisplayDate}async firstUpdated(t){if(super.firstUpdated(t),this.menuIsOpen){const t=await this.datepickerInputAsync;this.showMenu();(await this.calendar).focusOnCalendar(t)}}_getDateFormatRegex(){return this.dateFormat.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace("MM","\\d{2}").replace("DD","\\d{2}").replace("YYYY","\\d{4}").replace("/","\\/")}_handleTab(t){if(!this.menuIsOpen)return;const e=Array(4);t.shiftKey&&"Tab"===t.key?(t.preventDefault(),this.focusedTabIndex=(this.focusedTabIndex-1+e.length)%e.length):"Tab"===t.key&&(t.preventDefault(),this.focusedTabIndex=(this.focusedTabIndex+1+e.length)%e.length)}_handleValueChange(){this.emit("sgds-change-date")}async _handleCloseMenu(){if((await this.datepickerInputAsync).focus(),0===this.selectedDateRange.length)this.displayDate=this.initialDisplayDate;else{const t=this.selectedDateRange.length;this.displayDate=this.selectedDateRange[t-1];(await this.calendar)._updateFocusedDate()}}async _handleOpenMenu(){const t=await this.calendar,e=await this.datepickerInputAsync;t.focusOnCalendar(e)}_handleSelectDatesInput(t){this._handleSelectDates(t.detail)}async _handleSelectDates(t){t.sort((t,e)=>t.getTime()-e.getTime()),this.displayDate=t[0],this.focusedDate=t[0],this.selectedDateRange=t;const e=this._makeInputValueString(this.selectedDateRange[0],this.selectedDateRange[1],this.dateFormat);this.value=e;(await this.datepickerInputAsync).updateMaskValue(),this._manageInternalsValid()}async _handleSelectDatesAndClose(t){await this._handleSelectDates(t.detail),("range"===this.mode&&2===this.selectedDateRange.length||"single"===this.mode&&1===this.selectedDateRange.length)&&this.hideMenu()}_handleViewChanged(t){this.view=t.detail}_handleDateChanged(t){this.displayDate=t.detail}_handleFocusDateChanged(t){this.focusedDate=t.detail}_handleSelectMonth(t){this.displayDate=t.detail}_handleSelectYear(t){this.displayDate=t.detail}async _handleInvalidInput(){this.selectedDateRange=[],this.displayDate=this.initialDisplayDate,this.invalid=!0,this._manageInternalsBadInput()}async _handleEmptyInput(){this.required&&this._manageEmptyInput()}async _resetDatepicker(t=""){this.displayDate=this.initialDisplayDate,this.selectedDateRange=[],this.value=t,this.view="days";const e=await this.datepickerInputAsync;e.setInvalid(!1),e.destroyInputMask(),await e.applyInputMask(),this._mixinResetValidity(e),this.isValueEmpty()&&this._handleEmptyInput()}_manageInternalsBadInput(){this._mixinSetValidity({badInput:!0},"Invalid date input",this.datepickerInput)}_manageEmptyInput(){this._mixinSetValidity({valueMissing:!0},"Please fill in this field",this.datepickerInput)}_manageInternalsValid(){this._mixinSetValidity({}),this.invalid=this.datepickerInput.invalid=!1,this._mixinSetFormValue()}async _mixinResetFormControl(){this._resetDatepicker(this.defaultValue)}async _handleInputMaskChange(t){this.value=t.detail,this.isValueEmpty()&&this._resetDatepicker()}render(){return Je`
2531
2531
  <div class="datepicker-container">
2532
2532
  <sgds-datepicker-input
2533
2533
  .value=${Ri(this.value)}
@@ -2589,5 +2589,5 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
2589
2589
  ></sgds-datepicker-calendar>
2590
2590
  </ul>
2591
2591
  </div>
2592
- `}}Cr.styles=[...Ms.styles,qs,xr],Cr.dependencies={"sgds-datepicker-input":wr,"sgds-datepicker-calendar":Ks,"sgds-datepicker-header":Cn,"sgds-button":Us,"sgds-icon-button":bn},t([Zi({type:Boolean,reflect:!0})],Cr.prototype,"required",void 0),t([Zi({reflect:!0})],Cr.prototype,"name",void 0),t([Zi({type:Boolean,reflect:!0})],Cr.prototype,"disabled",void 0),t([Zi({type:String,reflect:!0})],Cr.prototype,"value",void 0),t([Zi({type:Array,reflect:!0})],Cr.prototype,"initialValue",void 0),t([Zi({type:String})],Cr.prototype,"minDate",void 0),t([Zi({type:String})],Cr.prototype,"maxDate",void 0),t([Zi({type:String,reflect:!0})],Cr.prototype,"mode",void 0),t([Zi({type:String,reflect:!0})],Cr.prototype,"invalidFeedback",void 0),t([Zi({type:Boolean,reflect:!0})],Cr.prototype,"hasFeedback",void 0),t([Zi({reflect:!0})],Cr.prototype,"label",void 0),t([Zi({reflect:!0})],Cr.prototype,"hintText",void 0),t([Zi({type:Boolean,reflect:!0,state:!1})],Cr.prototype,"noFlip",void 0),t([Zi({type:String,reflect:!0,state:!1})],Cr.prototype,"drop",void 0),t([Zi({attribute:!1})],Cr.prototype,"displayDate",void 0),t([ur()],Cr.prototype,"defaultValue",void 0),t([Vi()],Cr.prototype,"invalid",void 0),t([Vi()],Cr.prototype,"view",void 0),t([Vi()],Cr.prototype,"selectedDateRange",void 0),t([Vi()],Cr.prototype,"focusedDate",void 0),t([Vi()],Cr.prototype,"focusedTabIndex",void 0),t([Bi("sgds-datepicker-calendar")],Cr.prototype,"calendar",void 0),t([Bi("sgds-datepicker-input")],Cr.prototype,"datepickerInputAsync",void 0),t([Ai("sgds-datepicker-input")],Cr.prototype,"datepickerInput",void 0),t([As("value",{waitUntilFirstUpdate:!0})],Cr.prototype,"_handleValueChange",null),yr="sgds-datepicker",br=Cr,customElements.get(yr)||customElements.define(yr,br)});
2592
+ `}}_r.styles=[...Ms.styles,qs,xr],_r.dependencies={"sgds-datepicker-input":wr,"sgds-datepicker-calendar":Ks,"sgds-datepicker-header":_n,"sgds-button":Us,"sgds-icon-button":bn},t([Zi({type:Boolean,reflect:!0})],_r.prototype,"required",void 0),t([Zi({reflect:!0})],_r.prototype,"name",void 0),t([Zi({type:Boolean,reflect:!0})],_r.prototype,"disabled",void 0),t([Zi({type:String,reflect:!0})],_r.prototype,"value",void 0),t([Zi({type:Array,reflect:!0})],_r.prototype,"initialValue",void 0),t([Zi({type:String})],_r.prototype,"minDate",void 0),t([Zi({type:String})],_r.prototype,"maxDate",void 0),t([Zi({type:String,reflect:!0})],_r.prototype,"mode",void 0),t([Zi({type:String,reflect:!0})],_r.prototype,"invalidFeedback",void 0),t([Zi({type:Boolean,reflect:!0})],_r.prototype,"hasFeedback",void 0),t([Zi({reflect:!0})],_r.prototype,"label",void 0),t([Zi({reflect:!0})],_r.prototype,"hintText",void 0),t([Zi({type:Boolean,reflect:!0,state:!1})],_r.prototype,"noFlip",void 0),t([Zi({type:String,reflect:!0,state:!1})],_r.prototype,"drop",void 0),t([Zi({attribute:!1})],_r.prototype,"displayDate",void 0),t([ur()],_r.prototype,"defaultValue",void 0),t([Vi()],_r.prototype,"invalid",void 0),t([Vi()],_r.prototype,"view",void 0),t([Vi()],_r.prototype,"selectedDateRange",void 0),t([Vi()],_r.prototype,"focusedDate",void 0),t([Vi()],_r.prototype,"focusedTabIndex",void 0),t([Bi("sgds-datepicker-calendar")],_r.prototype,"calendar",void 0),t([Bi("sgds-datepicker-input")],_r.prototype,"datepickerInputAsync",void 0),t([Ai("sgds-datepicker-input")],_r.prototype,"datepickerInput",void 0),t([As("value",{waitUntilFirstUpdate:!0})],_r.prototype,"_handleValueChange",null),yr="sgds-datepicker",br=_r,customElements.get(yr)||customElements.define(yr,br)});
2593
2593
  //# sourceMappingURL=index.umd.min.js.map