@opencitylabs/formio-custom-components 0.6.9 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.iife.js +4 -4
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +173 -173
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -30,10 +30,10 @@ if(data.calendarId && data.api_url){
|
|
|
30
30
|
data.overlaps_validation = -1; document.querySelector("input[name^='data[overlaps_validation]']").value = -1;
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
}`,validateOn:`change`,validate:{customMessage:`Vi sono sovrapposizioni negli orari di apertura`,custom:`if (document.querySelector("input[name^='data[overlaps_validation]']").value === '0') {valid=true} else {valid = 'Sovrapposizione';}`},key:`overlaps_validation`,attributes:{readonly:`true`},required:!0,type:`number`,input:!0,weight:1},{label:`Precisione minima (minuti)`,defaultValue:1,required:!0,inputFormat:`plain`,key:`range_step`,type:`number`,input:!0,weight:1}];function N(...e){return i.Components.baseEditForm([{key:`display`,components:te}],...e)}function P(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function F(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function I(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?R(s,e=>e.test(o)):L(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function L(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function R(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ne(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var z=365.2425,B=3600*24;B*7,B*z/12*3;var re=Symbol.for(`constructDateFrom`);function ie(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&re in e?e[re](t):e instanceof Date?new e.constructor(t):new Date(t)}function ae(e,...t){let n=ie.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}var oe={};function se(){return oe}function ce(e,t){return ie(t||e,e)}function le(e,t){let n=se(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=ce(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function ue(e,t,n){let[r,i]=ae(n?.in,e,t);return+le(r,n)==+le(i,n)}var de={lessThanXSeconds:{standalone:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`},withPreposition:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`}},xSeconds:{standalone:{one:`1 Sekunde`,other:`{{count}} Sekunden`},withPreposition:{one:`1 Sekunde`,other:`{{count}} Sekunden`}},halfAMinute:{standalone:`eine halbe Minute`,withPreposition:`einer halben Minute`},lessThanXMinutes:{standalone:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`},withPreposition:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`}},xMinutes:{standalone:{one:`1 Minute`,other:`{{count}} Minuten`},withPreposition:{one:`1 Minute`,other:`{{count}} Minuten`}},aboutXHours:{standalone:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`},withPreposition:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`}},xHours:{standalone:{one:`1 Stunde`,other:`{{count}} Stunden`},withPreposition:{one:`1 Stunde`,other:`{{count}} Stunden`}},xDays:{standalone:{one:`1 Tag`,other:`{{count}} Tage`},withPreposition:{one:`1 Tag`,other:`{{count}} Tagen`}},aboutXWeeks:{standalone:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`},withPreposition:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`}},xWeeks:{standalone:{one:`1 Woche`,other:`{{count}} Wochen`},withPreposition:{one:`1 Woche`,other:`{{count}} Wochen`}},aboutXMonths:{standalone:{one:`etwa 1 Monat`,other:`etwa {{count}} Monate`},withPreposition:{one:`etwa 1 Monat`,other:`etwa {{count}} Monaten`}},xMonths:{standalone:{one:`1 Monat`,other:`{{count}} Monate`},withPreposition:{one:`1 Monat`,other:`{{count}} Monaten`}},aboutXYears:{standalone:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahre`},withPreposition:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahren`}},xYears:{standalone:{one:`1 Jahr`,other:`{{count}} Jahre`},withPreposition:{one:`1 Jahr`,other:`{{count}} Jahren`}},overXYears:{standalone:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahre`},withPreposition:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahren`}},almostXYears:{standalone:{one:`fast 1 Jahr`,other:`fast {{count}} Jahre`},withPreposition:{one:`fast 1 Jahr`,other:`fast {{count}} Jahren`}}},fe=(e,t,n)=>{let r,i=n?.addSuffix?de[e].withPreposition:de[e].standalone;return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:`vor `+r:r},pe={date:P({formats:{full:`EEEE, do MMMM y`,long:`do MMMM y`,medium:`do MMM y`,short:`dd.MM.y`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} 'um' {{time}}`,long:`{{date}} 'um' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},me={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},V=(e,t,n,r)=>me[e],he={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},ge={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},_e={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],wide:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`]},ve={narrow:_e.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:_e.wide},ye={code:`de`,formatDistance:fe,formatLong:pe,formatRelative:V,localize:{ordinalNumber:e=>Number(e)+`.`,era:F({values:he,defaultWidth:`wide`}),quarter:F({values:ge,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({values:_e,formattingValues:ve,defaultWidth:`wide`}),day:F({values:{narrow:[`S`,`M`,`D`,`M`,`D`,`F`,`S`],short:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],abbreviated:[`So.`,`Mo.`,`Di.`,`Mi.`,`Do.`,`Fr.`,`Sa.`],wide:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`]},defaultWidth:`wide`}),dayPeriod:F({values:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachm.`,evening:`Abend`,night:`Nacht`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachm.`,evening:`abends`,night:`nachts`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:ne({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:I({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:`any`}),quarter:I({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:I({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/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:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:I({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:I({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:`wide`,parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},be={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`}},xe=(e,t,n)=>{let r,i=be[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},Se={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},H=(e,t,n,r)=>Se[e],Ce={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:F({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:F({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({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:F({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:F({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`})},we={ordinalNumber:ne({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:I({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:I({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:e=>e+1}),month:I({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:I({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:I({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`})},Te={code:`en-GB`,formatDistance:xe,formatLong:{date:P({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:H,localize:Ce,match:we,options:{weekStartsOn:1,firstWeekContainsDate:4}},Ee={lessThanXSeconds:{one:`meno di un secondo`,other:`meno di {{count}} secondi`},xSeconds:{one:`un secondo`,other:`{{count}} secondi`},halfAMinute:`alcuni secondi`,lessThanXMinutes:{one:`meno di un minuto`,other:`meno di {{count}} minuti`},xMinutes:{one:`un minuto`,other:`{{count}} minuti`},aboutXHours:{one:`circa un'ora`,other:`circa {{count}} ore`},xHours:{one:`un'ora`,other:`{{count}} ore`},xDays:{one:`un giorno`,other:`{{count}} giorni`},aboutXWeeks:{one:`circa una settimana`,other:`circa {{count}} settimane`},xWeeks:{one:`una settimana`,other:`{{count}} settimane`},aboutXMonths:{one:`circa un mese`,other:`circa {{count}} mesi`},xMonths:{one:`un mese`,other:`{{count}} mesi`},aboutXYears:{one:`circa un anno`,other:`circa {{count}} anni`},xYears:{one:`un anno`,other:`{{count}} anni`},overXYears:{one:`più di un anno`,other:`più di {{count}} anni`},almostXYears:{one:`quasi un anno`,other:`quasi {{count}} anni`}},De=(e,t,n)=>{let r,i=Ee[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`tra `+r:r+` fa`:r},Oe={date:P({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} {{time}}`,long:`{{date}} {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},ke=[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`];function Ae(e){switch(e){case 0:return`'domenica scorsa alle' p`;default:return`'`+ke[e]+` scorso alle' p`}}function je(e){return`'`+ke[e]+` alle' p`}function Me(e){switch(e){case 0:return`'domenica prossima alle' p`;default:return`'`+ke[e]+` prossimo alle' p`}}var Ne={lastWeek:(e,t,n)=>{let r=e.getDay();return ue(e,t,n)?je(r):Ae(r)},yesterday:`'ieri alle' p`,today:`'oggi alle' p`,tomorrow:`'domani alle' p`,nextWeek:(e,t,n)=>{let r=e.getDay();return ue(e,t,n)?je(r):Me(r)},other:`P`},Pe={code:`it`,formatDistance:De,formatLong:Oe,formatRelative:(e,t,n,r)=>{let i=Ne[e];return typeof i==`function`?i(t,n,r):i},localize:{ordinalNumber:(e,t)=>{let n=Number(e);return String(n)},era:F({values:{narrow:[`aC`,`dC`],abbreviated:[`a.C.`,`d.C.`],wide:[`avanti Cristo`,`dopo Cristo`]},defaultWidth:`wide`}),quarter:F({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({values:{narrow:[`G`,`F`,`M`,`A`,`M`,`G`,`L`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`gen`,`feb`,`mar`,`apr`,`mag`,`giu`,`lug`,`ago`,`set`,`ott`,`nov`,`dic`],wide:[`gennaio`,`febbraio`,`marzo`,`aprile`,`maggio`,`giugno`,`luglio`,`agosto`,`settembre`,`ottobre`,`novembre`,`dicembre`]},defaultWidth:`wide`}),day:F({values:{narrow:[`D`,`L`,`M`,`M`,`G`,`V`,`S`],short:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],abbreviated:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],wide:[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`]},defaultWidth:`wide`}),dayPeriod:F({values:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:ne({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:I({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:`any`}),quarter:I({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:I({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:I({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:`any`}),dayPeriod:I({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Fe=E(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.moment=r()})(e,(function(){"use strict";var e;function n(){return e.apply(null,arguments)}function r(t){e=t}function i(e){return e instanceof Array||Object.prototype.toString.call(e)===`[object Array]`}function a(e){return e!=null&&Object.prototype.toString.call(e)===`[object Object]`}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;for(var t in e)if(o(e,t))return!1;return!0}function c(e){return e===void 0}function l(e){return typeof e==`number`||Object.prototype.toString.call(e)===`[object Number]`}function u(e){return e instanceof Date||Object.prototype.toString.call(e)===`[object Date]`}function d(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function f(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,`toString`)&&(e.toString=t.toString),o(t,`valueOf`)&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Qn(e,t,n,r,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return e._pf??=m(),e._pf}var ee=Array.prototype.some?Array.prototype.some:function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function g(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=h(e),n=ee.call(t.parsedDateParts,function(e){return e!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function _(e){var t=p(NaN);return e==null?h(t).userInvalidated=!0:f(h(t),e),t}var v=n.momentProperties=[],y=!1;function b(e,t){var n,r,i,a=v.length;if(c(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),c(t._i)||(e._i=t._i),c(t._f)||(e._f=t._f),c(t._l)||(e._l=t._l),c(t._strict)||(e._strict=t._strict),c(t._tzm)||(e._tzm=t._tzm),c(t._isUTC)||(e._isUTC=t._isUTC),c(t._offset)||(e._offset=t._offset),c(t._pf)||(e._pf=h(t)),c(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=v[n],i=t[r],c(i)||(e[r]=i);return e}function x(e){b(this,e),this._d=new Date(e._d==null?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),y===!1&&(y=!0,n.updateOffset(this),y=!1)}function S(e){return e instanceof x||e!=null&&e._isAMomentObject!=null}function C(e){n.suppressDeprecationWarnings===!1&&typeof console<`u`&&console.warn&&console.warn(`Deprecation warning: `+e)}function w(e,t){var r=!0;return f(function(){if(n.deprecationHandler!=null&&n.deprecationHandler(null,e),r){var i=[],a,s,c,l=arguments.length;for(s=0;s<l;s++){if(a=``,typeof arguments[s]==`object`){for(c in a+=`
|
|
33
|
+
}`,validateOn:`change`,validate:{customMessage:`Vi sono sovrapposizioni negli orari di apertura`,custom:`if (document.querySelector("input[name^='data[overlaps_validation]']").value === '0') {valid=true} else {valid = 'Sovrapposizione';}`},key:`overlaps_validation`,attributes:{readonly:`true`},required:!0,type:`number`,input:!0,weight:1},{label:`Precisione minima (minuti)`,defaultValue:1,required:!0,inputFormat:`plain`,key:`range_step`,type:`number`,input:!0,weight:1}];function N(...e){return i.Components.baseEditForm([{key:`display`,components:te}],...e)}function P(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function F(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function I(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?R(s,e=>e.test(o)):L(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function L(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function R(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ne(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var re=365.2425,z=3600*24;z*7,z*re/12*3;var ie=Symbol.for(`constructDateFrom`);function ae(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&ie in e?e[ie](t):e instanceof Date?new e.constructor(t):new Date(t)}function oe(e,...t){let n=ae.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}var se={};function ce(){return se}function le(e,t){return ae(t||e,e)}function ue(e,t){let n=ce(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=le(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function de(e,t,n){let[r,i]=oe(n?.in,e,t);return+ue(r,n)==+ue(i,n)}var fe={lessThanXSeconds:{standalone:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`},withPreposition:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`}},xSeconds:{standalone:{one:`1 Sekunde`,other:`{{count}} Sekunden`},withPreposition:{one:`1 Sekunde`,other:`{{count}} Sekunden`}},halfAMinute:{standalone:`eine halbe Minute`,withPreposition:`einer halben Minute`},lessThanXMinutes:{standalone:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`},withPreposition:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`}},xMinutes:{standalone:{one:`1 Minute`,other:`{{count}} Minuten`},withPreposition:{one:`1 Minute`,other:`{{count}} Minuten`}},aboutXHours:{standalone:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`},withPreposition:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`}},xHours:{standalone:{one:`1 Stunde`,other:`{{count}} Stunden`},withPreposition:{one:`1 Stunde`,other:`{{count}} Stunden`}},xDays:{standalone:{one:`1 Tag`,other:`{{count}} Tage`},withPreposition:{one:`1 Tag`,other:`{{count}} Tagen`}},aboutXWeeks:{standalone:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`},withPreposition:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`}},xWeeks:{standalone:{one:`1 Woche`,other:`{{count}} Wochen`},withPreposition:{one:`1 Woche`,other:`{{count}} Wochen`}},aboutXMonths:{standalone:{one:`etwa 1 Monat`,other:`etwa {{count}} Monate`},withPreposition:{one:`etwa 1 Monat`,other:`etwa {{count}} Monaten`}},xMonths:{standalone:{one:`1 Monat`,other:`{{count}} Monate`},withPreposition:{one:`1 Monat`,other:`{{count}} Monaten`}},aboutXYears:{standalone:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahre`},withPreposition:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahren`}},xYears:{standalone:{one:`1 Jahr`,other:`{{count}} Jahre`},withPreposition:{one:`1 Jahr`,other:`{{count}} Jahren`}},overXYears:{standalone:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahre`},withPreposition:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahren`}},almostXYears:{standalone:{one:`fast 1 Jahr`,other:`fast {{count}} Jahre`},withPreposition:{one:`fast 1 Jahr`,other:`fast {{count}} Jahren`}}},pe=(e,t,n)=>{let r,i=n?.addSuffix?fe[e].withPreposition:fe[e].standalone;return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:`vor `+r:r},me={date:P({formats:{full:`EEEE, do MMMM y`,long:`do MMMM y`,medium:`do MMM y`,short:`dd.MM.y`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} 'um' {{time}}`,long:`{{date}} 'um' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},he={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},B=(e,t,n,r)=>he[e],ge={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},_e={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},ve={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],wide:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`]},ye={narrow:ve.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:ve.wide},V={code:`de`,formatDistance:pe,formatLong:me,formatRelative:B,localize:{ordinalNumber:e=>Number(e)+`.`,era:F({values:ge,defaultWidth:`wide`}),quarter:F({values:_e,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({values:ve,formattingValues:ye,defaultWidth:`wide`}),day:F({values:{narrow:[`S`,`M`,`D`,`M`,`D`,`F`,`S`],short:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],abbreviated:[`So.`,`Mo.`,`Di.`,`Mi.`,`Do.`,`Fr.`,`Sa.`],wide:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`]},defaultWidth:`wide`}),dayPeriod:F({values:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachm.`,evening:`Abend`,night:`Nacht`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachm.`,evening:`abends`,night:`nachts`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:ne({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:I({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:`any`}),quarter:I({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:I({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/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:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:I({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:I({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:`wide`,parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},be={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`}},xe=(e,t,n)=>{let r,i=be[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},Se={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},H=(e,t,n,r)=>Se[e],Ce={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:F({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:F({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({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:F({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:F({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`})},we={ordinalNumber:ne({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:I({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:I({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:e=>e+1}),month:I({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:I({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:I({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`})},Te={code:`en-GB`,formatDistance:xe,formatLong:{date:P({formats:{full:`EEEE, d MMMM yyyy`,long:`d MMMM yyyy`,medium:`d MMM yyyy`,short:`dd/MM/yyyy`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:H,localize:Ce,match:we,options:{weekStartsOn:1,firstWeekContainsDate:4}},Ee={lessThanXSeconds:{one:`meno di un secondo`,other:`meno di {{count}} secondi`},xSeconds:{one:`un secondo`,other:`{{count}} secondi`},halfAMinute:`alcuni secondi`,lessThanXMinutes:{one:`meno di un minuto`,other:`meno di {{count}} minuti`},xMinutes:{one:`un minuto`,other:`{{count}} minuti`},aboutXHours:{one:`circa un'ora`,other:`circa {{count}} ore`},xHours:{one:`un'ora`,other:`{{count}} ore`},xDays:{one:`un giorno`,other:`{{count}} giorni`},aboutXWeeks:{one:`circa una settimana`,other:`circa {{count}} settimane`},xWeeks:{one:`una settimana`,other:`{{count}} settimane`},aboutXMonths:{one:`circa un mese`,other:`circa {{count}} mesi`},xMonths:{one:`un mese`,other:`{{count}} mesi`},aboutXYears:{one:`circa un anno`,other:`circa {{count}} anni`},xYears:{one:`un anno`,other:`{{count}} anni`},overXYears:{one:`più di un anno`,other:`più di {{count}} anni`},almostXYears:{one:`quasi un anno`,other:`quasi {{count}} anni`}},De=(e,t,n)=>{let r,i=Ee[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`tra `+r:r+` fa`:r},Oe={date:P({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:P({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:P({formats:{full:`{{date}} {{time}}`,long:`{{date}} {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},ke=[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`];function Ae(e){switch(e){case 0:return`'domenica scorsa alle' p`;default:return`'`+ke[e]+` scorso alle' p`}}function je(e){return`'`+ke[e]+` alle' p`}function Me(e){switch(e){case 0:return`'domenica prossima alle' p`;default:return`'`+ke[e]+` prossimo alle' p`}}var Ne={lastWeek:(e,t,n)=>{let r=e.getDay();return de(e,t,n)?je(r):Ae(r)},yesterday:`'ieri alle' p`,today:`'oggi alle' p`,tomorrow:`'domani alle' p`,nextWeek:(e,t,n)=>{let r=e.getDay();return de(e,t,n)?je(r):Me(r)},other:`P`},Pe={code:`it`,formatDistance:De,formatLong:Oe,formatRelative:(e,t,n,r)=>{let i=Ne[e];return typeof i==`function`?i(t,n,r):i},localize:{ordinalNumber:(e,t)=>{let n=Number(e);return String(n)},era:F({values:{narrow:[`aC`,`dC`],abbreviated:[`a.C.`,`d.C.`],wide:[`avanti Cristo`,`dopo Cristo`]},defaultWidth:`wide`}),quarter:F({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:F({values:{narrow:[`G`,`F`,`M`,`A`,`M`,`G`,`L`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`gen`,`feb`,`mar`,`apr`,`mag`,`giu`,`lug`,`ago`,`set`,`ott`,`nov`,`dic`],wide:[`gennaio`,`febbraio`,`marzo`,`aprile`,`maggio`,`giugno`,`luglio`,`agosto`,`settembre`,`ottobre`,`novembre`,`dicembre`]},defaultWidth:`wide`}),day:F({values:{narrow:[`D`,`L`,`M`,`M`,`G`,`V`,`S`],short:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],abbreviated:[`dom`,`lun`,`mar`,`mer`,`gio`,`ven`,`sab`],wide:[`domenica`,`lunedì`,`martedì`,`mercoledì`,`giovedì`,`venerdì`,`sabato`]},defaultWidth:`wide`}),dayPeriod:F({values:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`mattina`,afternoon:`pomeriggio`,evening:`sera`,night:`notte`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`m.`,pm:`p.`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},abbreviated:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`},wide:{am:`AM`,pm:`PM`,midnight:`mezzanotte`,noon:`mezzogiorno`,morning:`di mattina`,afternoon:`del pomeriggio`,evening:`di sera`,night:`di notte`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:ne({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:I({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:`any`}),quarter:I({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:I({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:I({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:`any`}),dayPeriod:I({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Fe=E(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.moment=r()})(e,(function(){"use strict";var e;function n(){return e.apply(null,arguments)}function r(t){e=t}function i(e){return e instanceof Array||Object.prototype.toString.call(e)===`[object Array]`}function a(e){return e!=null&&Object.prototype.toString.call(e)===`[object Object]`}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;for(var t in e)if(o(e,t))return!1;return!0}function c(e){return e===void 0}function l(e){return typeof e==`number`||Object.prototype.toString.call(e)===`[object Number]`}function u(e){return e instanceof Date||Object.prototype.toString.call(e)===`[object Date]`}function d(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function f(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,`toString`)&&(e.toString=t.toString),o(t,`valueOf`)&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Qn(e,t,n,r,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return e._pf??=m(),e._pf}var ee=Array.prototype.some?Array.prototype.some:function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function g(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=h(e),n=ee.call(t.parsedDateParts,function(e){return e!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function _(e){var t=p(NaN);return e==null?h(t).userInvalidated=!0:f(h(t),e),t}var v=n.momentProperties=[],y=!1;function b(e,t){var n,r,i,a=v.length;if(c(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),c(t._i)||(e._i=t._i),c(t._f)||(e._f=t._f),c(t._l)||(e._l=t._l),c(t._strict)||(e._strict=t._strict),c(t._tzm)||(e._tzm=t._tzm),c(t._isUTC)||(e._isUTC=t._isUTC),c(t._offset)||(e._offset=t._offset),c(t._pf)||(e._pf=h(t)),c(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=v[n],i=t[r],c(i)||(e[r]=i);return e}function x(e){b(this,e),this._d=new Date(e._d==null?NaN:e._d.getTime()),this.isValid()||(this._d=new Date(NaN)),y===!1&&(y=!0,n.updateOffset(this),y=!1)}function S(e){return e instanceof x||e!=null&&e._isAMomentObject!=null}function C(e){n.suppressDeprecationWarnings===!1&&typeof console<`u`&&console.warn&&console.warn(`Deprecation warning: `+e)}function w(e,t){var r=!0;return f(function(){if(n.deprecationHandler!=null&&n.deprecationHandler(null,e),r){var i=[],a,s,c,l=arguments.length;for(s=0;s<l;s++){if(a=``,typeof arguments[s]==`object`){for(c in a+=`
|
|
34
34
|
[`+s+`] `,arguments[0])o(arguments[0],c)&&(a+=c+`: `+arguments[0][c]+`, `);a=a.slice(0,-2)}else a=arguments[s];i.push(a)}C(e+`
|
|
35
35
|
Arguments: `+Array.prototype.slice.call(i).join(``)+`
|
|
36
|
-
`+Error().stack),r=!1}return t.apply(this,arguments)},t)}var T={};function E(e,t){n.deprecationHandler!=null&&n.deprecationHandler(e,t),T[e]||(C(t),T[e]=!0)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;function D(e){return typeof Function<`u`&&e instanceof Function||Object.prototype.toString.call(e)===`[object Function]`}function O(e){var t,n;for(n in e)o(e,n)&&(t=e[n],D(t)?this[n]=t:this[`_`+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+`|\\d{1,2}`)}function k(e,t){var n=f({},e),r;for(r in t)o(t,r)&&(a(e[r])&&a(t[r])?(n[r]={},f(n[r],e[r]),f(n[r],t[r])):t[r]==null?delete n[r]:n[r]=t[r]);for(r in e)o(e,r)&&!o(t,r)&&a(e[r])&&(n[r]=f({},n[r]));return n}function A(e){e!=null&&this.set(e)}var j=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)o(e,t)&&n.push(t);return n},M={sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`};function te(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return D(r)?r.call(t,n):r}function N(e,t,n){var r=``+Math.abs(e),i=t-r.length;return(e>=0?n?`+`:``:`-`)+(10**Math.max(0,i)).toString().substr(1)+r}var P=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},L={};function R(e,t,n,r){var i=r;typeof r==`string`&&(i=function(){return this[r]()}),e&&(L[e]=i),t&&(L[t[0]]=function(){return N(i.apply(this,arguments),t[1],t[2])}),n&&(L[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function ne(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,``):e.replace(/\\/g,``)}function z(e){var t=e.match(P),n,r;for(n=0,r=t.length;n<r;n++)L[t[n]]?t[n]=L[t[n]]:t[n]=ne(t[n]);return function(n){var i=``,a;for(a=0;a<r;a++)i+=D(t[a])?t[a].call(n,e):t[a];return i}}function B(e,t){return e.isValid()?(t=re(t,e.localeData()),I[t]=I[t]||z(t),I[t](e)):e.localeData().invalidDate()}function re(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(F.lastIndex=0;n>=0&&F.test(e);)e=e.replace(F,r),F.lastIndex=0,--n;return e}var ie={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};function ae(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(P).map(function(e){return e===`MMMM`||e===`MM`||e===`DD`||e===`dddd`?e.slice(1):e}).join(``),this._longDateFormat[e])}var oe=`Invalid date`;function se(){return this._invalidDate}var ce=`%d`,le=/\d{1,2}/;function ue(e){return this._ordinal.replace(`%d`,e)}var de={future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,w:`a week`,ww:`%d weeks`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function fe(e,t,n,r){var i=this._relativeTime[n];return D(i)?i(e,t,n,r):i.replace(/%d/i,e)}function pe(e,t){var n=this._relativeTime[e>0?`future`:`past`];return D(n)?n(t):n.replace(/%s/i,t)}var me={D:`date`,dates:`date`,date:`date`,d:`day`,days:`day`,day:`day`,e:`weekday`,weekdays:`weekday`,weekday:`weekday`,E:`isoWeekday`,isoweekdays:`isoWeekday`,isoweekday:`isoWeekday`,DDD:`dayOfYear`,dayofyears:`dayOfYear`,dayofyear:`dayOfYear`,h:`hour`,hours:`hour`,hour:`hour`,ms:`millisecond`,milliseconds:`millisecond`,millisecond:`millisecond`,m:`minute`,minutes:`minute`,minute:`minute`,M:`month`,months:`month`,month:`month`,Q:`quarter`,quarters:`quarter`,quarter:`quarter`,s:`second`,seconds:`second`,second:`second`,gg:`weekYear`,weekyears:`weekYear`,weekyear:`weekYear`,GG:`isoWeekYear`,isoweekyears:`isoWeekYear`,isoweekyear:`isoWeekYear`,w:`week`,weeks:`week`,week:`week`,W:`isoWeek`,isoweeks:`isoWeek`,isoweek:`isoWeek`,y:`year`,years:`year`,year:`year`};function V(e){return typeof e==`string`?me[e]||me[e.toLowerCase()]:void 0}function he(e){var t={},n,r;for(r in e)o(e,r)&&(n=V(r),n&&(t[n]=e[r]));return t}var ge={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function _e(e){var t=[],n;for(n in e)o(e,n)&&t.push({unit:n,priority:ge[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}var ve=/\d/,ye=/\d\d/,be=/\d{3}/,xe=/\d{4}/,Se=/[+-]?\d{6}/,H=/\d\d?/,Ce=/\d\d\d\d?/,we=/\d\d\d\d\d\d?/,Te=/\d{1,3}/,Ee=/\d{1,4}/,De=/[+-]?\d{1,6}/,Oe=/\d+/,ke=/[+-]?\d+/,Ae=/Z|[+-]\d\d:?\d\d/gi,je=/Z|[+-]\d\d(?::?\d\d)?/gi,Me=/[+-]?\d+(\.\d{1,3})?/,Ne=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Pe=/^[1-9]\d?/,Fe=/^([1-9]\d|\d)/,Ie={};function U(e,t,n){Ie[e]=D(t)?t:function(e,r){return e&&n?n:t}}function Le(e,t){return o(Ie,e)?Ie[e](t._strict,t._locale):new RegExp(Re(e))}function Re(e){return ze(e.replace(`\\`,``).replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i}))}function ze(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)}function Be(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function W(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=Be(t)),n}var Ve={};function G(e,t){var n,r=t,i;for(typeof e==`string`&&(e=[e]),l(t)&&(r=function(e,n){n[t]=W(e)}),i=e.length,n=0;n<i;n++)Ve[e[n]]=r}function He(e,t){G(e,function(e,n,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function Ue(e,t,n){t!=null&&o(Ve,e)&&Ve[e](t,n._a,n,e)}function We(e){return e%4==0&&e%100!=0||e%400==0}var K=0,Ge=1,Ke=2,q=3,qe=4,Je=5,Ye=6,Xe=7,Ze=8;R(`Y`,0,0,function(){var e=this.year();return e<=9999?N(e,4):`+`+e}),R(0,[`YY`,2],0,function(){return this.year()%100}),R(0,[`YYYY`,4],0,`year`),R(0,[`YYYYY`,5],0,`year`),R(0,[`YYYYYY`,6,!0],0,`year`),U(`Y`,ke),U(`YY`,H,ye),U(`YYYY`,Ee,xe),U(`YYYYY`,De,Se),U(`YYYYYY`,De,Se),G([`YYYYY`,`YYYYYY`],K),G(`YYYY`,function(e,t){t[K]=e.length===2?n.parseTwoDigitYear(e):W(e)}),G(`YY`,function(e,t){t[K]=n.parseTwoDigitYear(e)}),G(`Y`,function(e,t){t[K]=parseInt(e,10)});function Qe(e){return We(e)?366:365}n.parseTwoDigitYear=function(e){return W(e)+(W(e)>68?1900:2e3)};var $e=tt(`FullYear`,!0);function et(){return We(this.year())}function tt(e,t){return function(r){return r==null?nt(this,e):(rt(this,e,r),n.updateOffset(this,t),this)}}function nt(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case`Milliseconds`:return r?n.getUTCMilliseconds():n.getMilliseconds();case`Seconds`:return r?n.getUTCSeconds():n.getSeconds();case`Minutes`:return r?n.getUTCMinutes():n.getMinutes();case`Hours`:return r?n.getUTCHours():n.getHours();case`Date`:return r?n.getUTCDate():n.getDate();case`Day`:return r?n.getUTCDay():n.getDay();case`Month`:return r?n.getUTCMonth():n.getMonth();case`FullYear`:return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function rt(e,t,n){var r,i,a,o,s;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case`Milliseconds`:i?r.setUTCMilliseconds(n):r.setMilliseconds(n);return;case`Seconds`:i?r.setUTCSeconds(n):r.setSeconds(n);return;case`Minutes`:i?r.setUTCMinutes(n):r.setMinutes(n);return;case`Hours`:i?r.setUTCHours(n):r.setHours(n);return;case`Date`:i?r.setUTCDate(n):r.setDate(n);return;case`FullYear`:break;default:return}a=n,o=e.month(),s=e.date(),s=s===29&&o===1&&!We(a)?28:s,i?r.setUTCFullYear(a,o,s):r.setFullYear(a,o,s)}}function it(e){return e=V(e),D(this[e])?this[e]():this}function at(e,t){if(typeof e==`object`){e=he(e);var n=_e(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=V(e),D(this[e]))return this[e](t);return this}function ot(e,t){return(e%t+t)%t}var J=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function st(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ot(t,12);return e+=(t-n)/12,n===1?We(e)?29:28:31-n%7%2}R(`M`,[`MM`,2],`Mo`,function(){return this.month()+1}),R(`MMM`,0,0,function(e){return this.localeData().monthsShort(this,e)}),R(`MMMM`,0,0,function(e){return this.localeData().months(this,e)}),U(`M`,H,Pe),U(`MM`,H,ye),U(`MMM`,function(e,t){return t.monthsShortRegex(e)}),U(`MMMM`,function(e,t){return t.monthsRegex(e)}),G([`M`,`MM`],function(e,t){t[Ge]=W(e)-1}),G([`MMM`,`MMMM`],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i==null?h(n).invalidMonth=e:t[Ge]=i});var ct=`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),lt=`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),ut=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,dt=Ne,ft=Ne;function pt(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ut).test(t)?`format`:`standalone`][e.month()]:i(this._months)?this._months:this._months.standalone}function mt(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ut.test(t)?`format`:`standalone`][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ht(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,``).toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,``).toLocaleLowerCase();return n?t===`MMM`?(i=J.call(this._shortMonthsParse,o),i===-1?null:i):(i=J.call(this._longMonthsParse,o),i===-1?null:i):t===`MMM`?(i=J.call(this._shortMonthsParse,o),i===-1?(i=J.call(this._longMonthsParse,o),i===-1?null:i):i):(i=J.call(this._longMonthsParse,o),i===-1?(i=J.call(this._shortMonthsParse,o),i===-1?null:i):i)}function gt(e,t,n){var r,i,a;if(this._monthsParseExact)return ht.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if(i=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=RegExp(`^`+this.months(i,``).replace(`.`,``)+`$`,`i`),this._shortMonthsParse[r]=RegExp(`^`+this.monthsShort(i,``).replace(`.`,``)+`$`,`i`)),!n&&!this._monthsParse[r]&&(a=`^`+this.months(i,``)+`|^`+this.monthsShort(i,``),this._monthsParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`MMMM`&&this._longMonthsParse[r].test(e)||n&&t===`MMM`&&this._shortMonthsParse[r].test(e)||!n&&this._monthsParse[r].test(e))return r}function _t(e,t){if(!e.isValid())return e;if(typeof t==`string`){if(/^\d+$/.test(t))t=W(t);else if(t=e.localeData().monthsParse(t),!l(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,st(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function vt(e){return e==null?nt(this,`Month`):(_t(this,e),n.updateOffset(this,!0),this)}function yt(){return st(this.year(),this.month())}function bt(e){return this._monthsParseExact?(o(this,`_monthsRegex`)||St.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,`_monthsShortRegex`)||(this._monthsShortRegex=dt),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function xt(e){return this._monthsParseExact?(o(this,`_monthsRegex`)||St.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,`_monthsRegex`)||(this._monthsRegex=ft),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function St(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i,a,o,s;for(i=0;i<12;i++)a=p([2e3,i]),o=ze(this.monthsShort(a,``)),s=ze(this.months(a,``)),t.push(o),n.push(s),r.push(s),r.push(o);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._monthsShortStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function Ct(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function wt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Tt(e,t,n){var r=7+t-n;return-((7+wt(e,0,r).getUTCDay()-t)%7)+r-1}function Et(e,t,n,r,i){var a=(7+n-r)%7,o=Tt(e,r,i),s=1+7*(t-1)+a+o,c,l;return s<=0?(c=e-1,l=Qe(c)+s):s>Qe(e)?(c=e+1,l=s-Qe(e)):(c=e,l=s),{year:c,dayOfYear:l}}function Dt(e,t,n){var r=Tt(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,o;return i<1?(o=e.year()-1,a=i+Ot(o,t,n)):i>Ot(e.year(),t,n)?(a=i-Ot(e.year(),t,n),o=e.year()+1):(o=e.year(),a=i),{week:a,year:o}}function Ot(e,t,n){var r=Tt(e,t,n),i=Tt(e+1,t,n);return(Qe(e)-r+i)/7}R(`w`,[`ww`,2],`wo`,`week`),R(`W`,[`WW`,2],`Wo`,`isoWeek`),U(`w`,H,Pe),U(`ww`,H,ye),U(`W`,H,Pe),U(`WW`,H,ye),He([`w`,`ww`,`W`,`WW`],function(e,t,n,r){t[r.substr(0,1)]=W(e)});function kt(e){return Dt(e,this._week.dow,this._week.doy).week}var At={dow:0,doy:6};function jt(){return this._week.dow}function Mt(){return this._week.doy}function Nt(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,`d`)}function Pt(e){var t=Dt(this,1,4).week;return e==null?t:this.add((e-t)*7,`d`)}R(`d`,0,`do`,`day`),R(`dd`,0,0,function(e){return this.localeData().weekdaysMin(this,e)}),R(`ddd`,0,0,function(e){return this.localeData().weekdaysShort(this,e)}),R(`dddd`,0,0,function(e){return this.localeData().weekdays(this,e)}),R(`e`,0,0,`weekday`),R(`E`,0,0,`isoWeekday`),U(`d`,H),U(`e`,H),U(`E`,H),U(`dd`,function(e,t){return t.weekdaysMinRegex(e)}),U(`ddd`,function(e,t){return t.weekdaysShortRegex(e)}),U(`dddd`,function(e,t){return t.weekdaysRegex(e)}),He([`dd`,`ddd`,`dddd`],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i==null?h(n).invalidWeekday=e:t.d=i}),He([`d`,`e`,`E`],function(e,t,n,r){t[r]=W(e)});function Ft(e,t){return typeof e==`string`?isNaN(e)?(e=t.weekdaysParse(e),typeof e==`number`?e:null):parseInt(e,10):e}function It(e,t){return typeof e==`string`?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Lt(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Rt=`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),zt=`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),Bt=`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),Vt=Ne,Ht=Ne,Ut=Ne;function Wt(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?`format`:`standalone`];return e===!0?Lt(n,this._week.dow):e?n[e.day()]:n}function Gt(e){return e===!0?Lt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Kt(e){return e===!0?Lt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function qt(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,``).toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,``).toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,``).toLocaleLowerCase();return n?t===`dddd`?(i=J.call(this._weekdaysParse,o),i===-1?null:i):t===`ddd`?(i=J.call(this._shortWeekdaysParse,o),i===-1?null:i):(i=J.call(this._minWeekdaysParse,o),i===-1?null:i):t===`dddd`?(i=J.call(this._weekdaysParse,o),i!==-1||(i=J.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=J.call(this._minWeekdaysParse,o),i===-1?null:i)):t===`ddd`?(i=J.call(this._shortWeekdaysParse,o),i!==-1||(i=J.call(this._weekdaysParse,o),i!==-1)?i:(i=J.call(this._minWeekdaysParse,o),i===-1?null:i)):(i=J.call(this._minWeekdaysParse,o),i!==-1||(i=J.call(this._weekdaysParse,o),i!==-1)?i:(i=J.call(this._shortWeekdaysParse,o),i===-1?null:i))}function Jt(e,t,n){var r,i,a;if(this._weekdaysParseExact)return qt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=RegExp(`^`+this.weekdays(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._shortWeekdaysParse[r]=RegExp(`^`+this.weekdaysShort(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._minWeekdaysParse[r]=RegExp(`^`+this.weekdaysMin(i,``).replace(`.`,`\\.?`)+`$`,`i`)),this._weekdaysParse[r]||(a=`^`+this.weekdays(i,``)+`|^`+this.weekdaysShort(i,``)+`|^`+this.weekdaysMin(i,``),this._weekdaysParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`dddd`&&this._fullWeekdaysParse[r].test(e)||n&&t===`ddd`&&this._shortWeekdaysParse[r].test(e)||n&&t===`dd`&&this._minWeekdaysParse[r].test(e)||!n&&this._weekdaysParse[r].test(e))return r}function Yt(e){if(!this.isValid())return e==null?NaN:this;var t=nt(this,`Day`);return e==null?t:(e=Ft(e,this.localeData()),this.add(e-t,`d`))}function Xt(e){if(!this.isValid())return e==null?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,`d`)}function Zt(e){if(!this.isValid())return e==null?NaN:this;if(e!=null){var t=It(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Qt(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,`_weekdaysRegex`)||(this._weekdaysRegex=Vt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function $t(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,`_weekdaysShortRegex`)||(this._weekdaysShortRegex=Ht),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function en(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,`_weekdaysMinRegex`)||(this._weekdaysMinRegex=Ut),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function tn(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i=[],a,o,s,c,l;for(a=0;a<7;a++)o=p([2e3,1]).day(a),s=ze(this.weekdaysMin(o,``)),c=ze(this.weekdaysShort(o,``)),l=ze(this.weekdays(o,``)),t.push(s),n.push(c),r.push(l),i.push(s),i.push(c),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=RegExp(`^(`+i.join(`|`)+`)`,`i`),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._weekdaysShortStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._weekdaysMinStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function nn(){return this.hours()%12||12}function rn(){return this.hours()||24}R(`H`,[`HH`,2],0,`hour`),R(`h`,[`hh`,2],0,nn),R(`k`,[`kk`,2],0,rn),R(`hmm`,0,0,function(){return``+nn.apply(this)+N(this.minutes(),2)}),R(`hmmss`,0,0,function(){return``+nn.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)}),R(`Hmm`,0,0,function(){return``+this.hours()+N(this.minutes(),2)}),R(`Hmmss`,0,0,function(){return``+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)});function an(e,t){R(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}an(`a`,!0),an(`A`,!1);function on(e,t){return t._meridiemParse}U(`a`,on),U(`A`,on),U(`H`,H,Fe),U(`h`,H,Pe),U(`k`,H,Pe),U(`HH`,H,ye),U(`hh`,H,ye),U(`kk`,H,ye),U(`hmm`,Ce),U(`hmmss`,we),U(`Hmm`,Ce),U(`Hmmss`,we),G([`H`,`HH`],q),G([`k`,`kk`],function(e,t,n){var r=W(e);t[q]=r===24?0:r}),G([`a`,`A`],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),G([`h`,`hh`],function(e,t,n){t[q]=W(e),h(n).bigHour=!0}),G(`hmm`,function(e,t,n){var r=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r)),h(n).bigHour=!0}),G(`hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r,2)),t[Je]=W(e.substr(i)),h(n).bigHour=!0}),G(`Hmm`,function(e,t,n){var r=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r))}),G(`Hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r,2)),t[Je]=W(e.substr(i))});function sn(e){return(e+``).toLowerCase().charAt(0)===`p`}var cn=/[ap]\.?m?\.?/i,ln=tt(`Hours`,!0);function un(e,t,n){return e>11?n?`pm`:`PM`:n?`am`:`AM`}var dn={calendar:M,longDateFormat:ie,invalidDate:oe,ordinal:ce,dayOfMonthOrdinalParse:le,relativeTime:de,months:ct,monthsShort:lt,week:At,weekdays:Rt,weekdaysMin:Bt,weekdaysShort:zt,meridiemParse:cn},Y={},fn={},pn;function mn(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function hn(e){return e&&e.toLowerCase().replace(`_`,`-`)}function gn(e){for(var t=0,n,r,i,a;t<e.length;){for(a=hn(e[t]).split(`-`),n=a.length,r=hn(e[t+1]),r=r?r.split(`-`):null;n>0;){if(i=vn(a.slice(0,n).join(`-`)),i)return i;if(r&&r.length>=n&&mn(a,r)>=n-1)break;n--}t++}return pn}function _n(e){return!!(e&&e.match(`^[^/\\\\]*$`))}function vn(e){var n=null,r;if(Y[e]===void 0&&t!==void 0&&t&&t.exports&&_n(e))try{n=pn._abbr,r=require,r(`./locale/`+e),yn(n)}catch{Y[e]=null}return Y[e]}function yn(e,t){var n;return e&&(n=c(t)?Sn(e):bn(e,t),n?pn=n:typeof console<`u`&&console.warn&&console.warn(`Locale `+e+` not found. Did you forget to load it?`)),pn._abbr}function bn(e,t){if(t!==null){var n,r=dn;if(t.abbr=e,Y[e]!=null)E(`defineLocaleOverride`,`use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.`),r=Y[e]._config;else if(t.parentLocale!=null)if(Y[t.parentLocale]!=null)r=Y[t.parentLocale]._config;else if(n=vn(t.parentLocale),n!=null)r=n._config;else return fn[t.parentLocale]||(fn[t.parentLocale]=[]),fn[t.parentLocale].push({name:e,config:t}),null;return Y[e]=new A(k(r,t)),fn[e]&&fn[e].forEach(function(e){bn(e.name,e.config)}),yn(e),Y[e]}else return delete Y[e],null}function xn(e,t){if(t!=null){var n,r,i=dn;Y[e]!=null&&Y[e].parentLocale!=null?Y[e].set(k(Y[e]._config,t)):(r=vn(e),r!=null&&(i=r._config),t=k(i,t),r??(t.abbr=e),n=new A(t),n.parentLocale=Y[e],Y[e]=n),yn(e)}else Y[e]!=null&&(Y[e].parentLocale==null?Y[e]!=null&&delete Y[e]:(Y[e]=Y[e].parentLocale,e===yn()&&yn(e)));return Y[e]}function Sn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return pn;if(!i(e)){if(t=vn(e),t)return t;e=[e]}return gn(e)}function Cn(){return j(Y)}function wn(e){var t,n=e._a;return n&&h(e).overflow===-2&&(t=n[Ge]<0||n[Ge]>11?Ge:n[Ke]<1||n[Ke]>st(n[K],n[Ge])?Ke:n[q]<0||n[q]>24||n[q]===24&&(n[qe]!==0||n[Je]!==0||n[Ye]!==0)?q:n[qe]<0||n[qe]>59?qe:n[Je]<0||n[Je]>59?Je:n[Ye]<0||n[Ye]>999?Ye:-1,h(e)._overflowDayOfYear&&(t<K||t>Ke)&&(t=Ke),h(e)._overflowWeeks&&t===-1&&(t=Xe),h(e)._overflowWeekday&&t===-1&&(t=Ze),h(e).overflow=t),e}var Tn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,En=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dn=/Z|[+-]\d\d(?::?\d\d)?/,On=[[`YYYYYY-MM-DD`,/[+-]\d{6}-\d\d-\d\d/],[`YYYY-MM-DD`,/\d{4}-\d\d-\d\d/],[`GGGG-[W]WW-E`,/\d{4}-W\d\d-\d/],[`GGGG-[W]WW`,/\d{4}-W\d\d/,!1],[`YYYY-DDD`,/\d{4}-\d{3}/],[`YYYY-MM`,/\d{4}-\d\d/,!1],[`YYYYYYMMDD`,/[+-]\d{10}/],[`YYYYMMDD`,/\d{8}/],[`GGGG[W]WWE`,/\d{4}W\d{3}/],[`GGGG[W]WW`,/\d{4}W\d{2}/,!1],[`YYYYDDD`,/\d{7}/],[`YYYYMM`,/\d{6}/,!1],[`YYYY`,/\d{4}/,!1]],kn=[[`HH:mm:ss.SSSS`,/\d\d:\d\d:\d\d\.\d+/],[`HH:mm:ss,SSSS`,/\d\d:\d\d:\d\d,\d+/],[`HH:mm:ss`,/\d\d:\d\d:\d\d/],[`HH:mm`,/\d\d:\d\d/],[`HHmmss.SSSS`,/\d\d\d\d\d\d\.\d+/],[`HHmmss,SSSS`,/\d\d\d\d\d\d,\d+/],[`HHmmss`,/\d\d\d\d\d\d/],[`HHmm`,/\d\d\d\d/],[`HH`,/\d\d/]],An=/^\/?Date\((-?\d+)/i,jn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Mn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Nn(e){var t,n,r=e._i,i=Tn.exec(r)||En.exec(r),a,o,s,c,l=On.length,u=kn.length;if(i){for(h(e).iso=!0,t=0,n=l;t<n;t++)if(On[t][1].exec(i[1])){o=On[t][0],a=On[t][2]!==!1;break}if(o==null){e._isValid=!1;return}if(i[3]){for(t=0,n=u;t<n;t++)if(kn[t][1].exec(i[3])){s=(i[2]||` `)+kn[t][0];break}if(s==null){e._isValid=!1;return}}if(!a&&s!=null){e._isValid=!1;return}if(i[4])if(Dn.exec(i[4]))c=`Z`;else{e._isValid=!1;return}e._f=o+(s||``)+(c||``),Gn(e)}else e._isValid=!1}function Pn(e,t,n,r,i,a){var o=[Fn(e),lt.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&o.push(parseInt(a,10)),o}function Fn(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function In(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).replace(/^\s\s*/,``).replace(/\s\s*$/,``)}function Ln(e,t,n){return e&&zt.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay()?(h(n).weekdayMismatch=!0,n._isValid=!1,!1):!0}function Rn(e,t,n){if(e)return Mn[e];if(t)return 0;var r=parseInt(n,10),i=r%100;return(r-i)/100*60+i}function zn(e){var t=jn.exec(In(e._i)),n;if(t){if(n=Pn(t[4],t[3],t[2],t[5],t[6],t[7]),!Ln(t[1],n,e))return;e._a=n,e._tzm=Rn(t[8],t[9],t[10]),e._d=wt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function Bn(e){var t=An.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Nn(e),e._isValid===!1)delete e._isValid;else return;if(zn(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:n.createFromInputFallback(e)}n.createFromInputFallback=w(`value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.`,function(e){e._d=new Date(e._i+(e._useUTC?` UTC`:``))});function Vn(e,t,n){return e??t??n}function Hn(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Un(e){var t,n,r=[],i,a,o;if(!e._d){for(i=Hn(e),e._w&&e._a[Ke]==null&&e._a[Ge]==null&&Wn(e),e._dayOfYear!=null&&(o=Vn(e._a[K],i[K]),(e._dayOfYear>Qe(o)||e._dayOfYear===0)&&(h(e)._overflowDayOfYear=!0),n=wt(o,0,e._dayOfYear),e._a[Ge]=n.getUTCMonth(),e._a[Ke]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[q]===24&&e._a[qe]===0&&e._a[Je]===0&&e._a[Ye]===0&&(e._nextDay=!0,e._a[q]=0),e._d=(e._useUTC?wt:Ct).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[q]=24),e._w&&e._w.d!==void 0&&e._w.d!==a&&(h(e).weekdayMismatch=!0)}}function Wn(e){var t=e._w,n,r,i,a,o,s,c,l;t.GG!=null||t.W!=null||t.E!=null?(a=1,o=4,n=Vn(t.GG,e._a[K],Dt(X(),1,4).year),r=Vn(t.W,1),i=Vn(t.E,1),(i<1||i>7)&&(c=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,l=Dt(X(),a,o),n=Vn(t.gg,e._a[K],l.year),r=Vn(t.w,l.week),t.d==null?t.e==null?i=a:(i=t.e+a,(t.e<0||t.e>6)&&(c=!0)):(i=t.d,(i<0||i>6)&&(c=!0))),r<1||r>Ot(n,a,o)?h(e)._overflowWeeks=!0:c==null?(s=Et(n,r,i,a,o),e._a[K]=s.year,e._dayOfYear=s.dayOfYear):h(e)._overflowWeekday=!0}n.ISO_8601=function(){},n.RFC_2822=function(){};function Gn(e){if(e._f===n.ISO_8601){Nn(e);return}if(e._f===n.RFC_2822){zn(e);return}e._a=[],h(e).empty=!0;var t=``+e._i,r,i,a,o,s,c=t.length,l=0,u,d;for(a=re(e._f,e._locale).match(P)||[],d=a.length,r=0;r<d;r++)o=a[r],i=(t.match(Le(o,e))||[])[0],i&&(s=t.substr(0,t.indexOf(i)),s.length>0&&h(e).unusedInput.push(s),t=t.slice(t.indexOf(i)+i.length),l+=i.length),L[o]?(i?h(e).empty=!1:h(e).unusedTokens.push(o),Ue(o,i,e)):e._strict&&!i&&h(e).unusedTokens.push(o);h(e).charsLeftOver=c-l,t.length>0&&h(e).unusedInput.push(t),e._a[q]<=12&&h(e).bigHour===!0&&e._a[q]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[q]=Kn(e._locale,e._a[q],e._meridiem),u=h(e).era,u!==null&&(e._a[K]=e._locale.erasConvertYear(u,e._a[K])),Un(e),wn(e)}function Kn(e,t,n){var r;return n==null?t:e.meridiemHour==null?e.isPM==null?t:(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0),t):e.meridiemHour(t,n)}function qn(e){var t,n,r,i,a,o,s=!1,c=e._f.length;if(c===0){h(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<c;i++)a=0,o=!1,t=b({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Gn(t),g(t)&&(o=!0),a+=h(t).charsLeftOver,a+=h(t).unusedTokens.length*10,h(t).score=a,s?a<r&&(r=a,n=t):(r==null||a<r||o)&&(r=a,n=t,o&&(s=!0));f(e,n||t)}function Jn(e){if(!e._d){var t=he(e._i),n=t.day===void 0?t.date:t.day;e._a=d([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Un(e)}}function Yn(e){var t=new x(wn(Xn(e)));return t._nextDay&&=(t.add(1,`d`),void 0),t}function Xn(e){var t=e._i,n=e._f;return e._locale=e._locale||Sn(e._l),t===null||n===void 0&&t===``?_({nullInput:!0}):(typeof t==`string`&&(e._i=t=e._locale.preparse(t)),S(t)?new x(wn(t)):(u(t)?e._d=t:i(n)?qn(e):n?Gn(e):Zn(e),g(e)||(e._d=null),e))}function Zn(e){var t=e._i;c(t)?e._d=new Date(n.now()):u(t)?e._d=new Date(t.valueOf()):typeof t==`string`?Bn(e):i(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),Un(e)):a(t)?Jn(e):l(t)?e._d=new Date(t):n.createFromInputFallback(e)}function Qn(e,t,n,r,o){var c={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(a(e)&&s(e)||i(e)&&e.length===0)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=o,c._l=n,c._i=e,c._f=t,c._strict=r,Yn(c)}function X(e,t,n,r){return Qn(e,t,n,r,!1)}var $n=w(`moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=X.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:_()}),er=w(`moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=X.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:_()});function tr(e,t){var n,r;if(t.length===1&&i(t[0])&&(t=t[0]),!t.length)return X();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function nr(){return tr(`isBefore`,[].slice.call(arguments,0))}function rr(){return tr(`isAfter`,[].slice.call(arguments,0))}var ir=function(){return Date.now?Date.now():+new Date},ar=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`,`millisecond`];function or(e){var t,n=!1,r,i=ar.length;for(t in e)if(o(e,t)&&!(J.call(ar,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[ar[r]]){if(n)return!1;parseFloat(e[ar[r]])!==W(e[ar[r]])&&(n=!0)}return!0}function sr(){return this._isValid}function cr(){return jr(NaN)}function lr(e){var t=he(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,s=t.hour||0,c=t.minute||0,l=t.second||0,u=t.millisecond||0;this._isValid=or(t),this._milliseconds=+u+l*1e3+c*6e4+s*1e3*60*60,this._days=+o+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=Sn(),this._bubble()}function ur(e){return e instanceof lr}function dr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function fr(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,o;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&W(e[o])!==W(t[o]))&&a++;return a+i}function pr(e,t){R(e,0,0,function(){var e=this.utcOffset(),n=`+`;return e<0&&(e=-e,n=`-`),n+N(~~(e/60),2)+t+N(~~e%60,2)})}pr(`Z`,`:`),pr(`ZZ`,``),U(`Z`,je),U(`ZZ`,je),G([`Z`,`ZZ`],function(e,t,n){n._useUTC=!0,n._tzm=hr(je,e)});var mr=/([\+\-]|\d\d)/gi;function hr(e,t){var n=(t||``).match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+``).match(mr)||[`-`,0,0],a=+(i[1]*60)+W(i[2]),a===0?0:i[0]===`+`?a:-a)}function gr(e,t){var r,i;return t._isUTC?(r=t.clone(),i=(S(e)||u(e)?e.valueOf():X(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+i),n.updateOffset(r,!1),r):X(e).local()}function _r(e){return-Math.round(e._d.getTimezoneOffset())}n.updateOffset=function(){};function vr(e,t,r){var i=this._offset||0,a;if(!this.isValid())return e==null?NaN:this;if(e!=null){if(typeof e==`string`){if(e=hr(je,e),e===null)return this}else Math.abs(e)<16&&!r&&(e*=60);return!this._isUTC&&t&&(a=_r(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,`m`),i!==e&&(!t||this._changeInProgress?Ir(this,jr(e-i,`m`),1,!1):this._changeInProgress||=(this._changeInProgress=!0,n.updateOffset(this,!0),null)),this}else return this._isUTC?i:_r(this)}function yr(e,t){return e==null?-this.utcOffset():(typeof e!=`string`&&(e=-e),this.utcOffset(e,t),this)}function br(e){return this.utcOffset(0,e)}function xr(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(_r(this),`m`)),this}function Sr(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i==`string`){var e=hr(Ae,this._i);e==null?this.utcOffset(0,!0):this.utcOffset(e)}return this}function Cr(e){return this.isValid()?(e=e?X(e).utcOffset():0,(this.utcOffset()-e)%60==0):!1}function wr(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Tr(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e={},t;return b(e,this),e=Xn(e),e._a?(t=e._isUTC?p(e._a):X(e._a),this._isDSTShifted=this.isValid()&&fr(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Er(){return this.isValid()?!this._isUTC:!1}function Dr(){return this.isValid()?this._isUTC:!1}function Or(){return this.isValid()?this._isUTC&&this._offset===0:!1}var kr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ar=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jr(e,t){var n=e,r=null,i,a,s;return ur(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=kr.exec(e))?(i=r[1]===`-`?-1:1,n={y:0,d:W(r[Ke])*i,h:W(r[q])*i,m:W(r[qe])*i,s:W(r[Je])*i,ms:W(dr(r[Ye]*1e3))*i}):(r=Ar.exec(e))?(i=r[1]===`-`?-1:1,n={y:Mr(r[2],i),M:Mr(r[3],i),w:Mr(r[4],i),d:Mr(r[5],i),h:Mr(r[6],i),m:Mr(r[7],i),s:Mr(r[8],i)}):n==null?n={}:typeof n==`object`&&(`from`in n||`to`in n)&&(s=Pr(X(n.from),X(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),a=new lr(n),ur(e)&&o(e,`_locale`)&&(a._locale=e._locale),ur(e)&&o(e,`_isValid`)&&(a._isValid=e._isValid),a}jr.fn=lr.prototype,jr.invalid=cr;function Mr(e,t){var n=e&&parseFloat(e.replace(`,`,`.`));return(isNaN(n)?0:n)*t}function Nr(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,`M`).isAfter(t)&&--n.months,n.milliseconds=t-+e.clone().add(n.months,`M`),n}function Pr(e,t){var n;return e.isValid()&&t.isValid()?(t=gr(t,e),e.isBefore(t)?n=Nr(e,t):(n=Nr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Fr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(E(t,`moment().`+t+`(period, number) is deprecated. Please use moment().`+t+`(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.`),a=n,n=r,r=a),i=jr(n,r),Ir(this,i,e),this}}function Ir(e,t,r,i){var a=t._milliseconds,o=dr(t._days),s=dr(t._months);e.isValid()&&(i??=!0,s&&_t(e,nt(e,`Month`)+s*r),o&&rt(e,`Date`,nt(e,`Date`)+o*r),a&&e._d.setTime(e._d.valueOf()+a*r),i&&n.updateOffset(e,o||s))}var Lr=Fr(1,`add`),Rr=Fr(-1,`subtract`);function zr(e){return typeof e==`string`||e instanceof String}function Br(e){return S(e)||u(e)||zr(e)||l(e)||Hr(e)||Vr(e)||e==null}function Vr(e){var t=a(e)&&!s(e),n=!1,r=[`years`,`year`,`y`,`months`,`month`,`M`,`days`,`day`,`d`,`dates`,`date`,`D`,`hours`,`hour`,`h`,`minutes`,`minute`,`m`,`seconds`,`second`,`s`,`milliseconds`,`millisecond`,`ms`],i,c,l=r.length;for(i=0;i<l;i+=1)c=r[i],n||=o(e,c);return t&&n}function Hr(e){var t=i(e),n=!1;return t&&(n=e.filter(function(t){return!l(t)&&zr(e)}).length===0),t&&n}function Ur(e){var t=a(e)&&!s(e),n=!1,r=[`sameDay`,`nextDay`,`lastDay`,`nextWeek`,`lastWeek`,`sameElse`],i,c;for(i=0;i<r.length;i+=1)c=r[i],n||=o(e,c);return t&&n}function Wr(e,t){var n=e.diff(t,`days`,!0);return n<-6?`sameElse`:n<-1?`lastWeek`:n<0?`lastDay`:n<1?`sameDay`:n<2?`nextDay`:n<7?`nextWeek`:`sameElse`}function Gr(e,t){arguments.length===1&&(arguments[0]?Br(arguments[0])?(e=arguments[0],t=void 0):Ur(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var r=e||X(),i=gr(r,this).startOf(`day`),a=n.calendarFormat(this,i)||`sameElse`,o=t&&(D(t[a])?t[a].call(this,r):t[a]);return this.format(o||this.localeData().calendar(a,this,X(r)))}function Kr(){return new x(this)}function qr(e,t){var n=S(e)?e:X(e);return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Jr(e,t){var n=S(e)?e:X(e);return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Yr(e,t,n,r){var i=S(e)?e:X(e),a=S(t)?t:X(t);return this.isValid()&&i.isValid()&&a.isValid()?(r||=`()`,(r[0]===`(`?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===`)`?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Xr(e,t){var n=S(e)?e:X(e),r;return this.isValid()&&n.isValid()?(t=V(t)||`millisecond`,t===`millisecond`?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Zr(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Qr(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function $r(e,t,n){var r,i,a;if(!this.isValid()||(r=gr(e,this),!r.isValid()))return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=V(t),t){case`year`:a=ei(this,r)/12;break;case`month`:a=ei(this,r);break;case`quarter`:a=ei(this,r)/3;break;case`second`:a=(this-r)/1e3;break;case`minute`:a=(this-r)/6e4;break;case`hour`:a=(this-r)/36e5;break;case`day`:a=(this-r-i)/864e5;break;case`week`:a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:Be(a)}function ei(e,t){if(e.date()<t.date())return-ei(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,`months`),i,a;return t-r<0?(i=e.clone().add(n-1,`months`),a=(t-r)/(r-i)):(i=e.clone().add(n+1,`months`),a=(t-r)/(i-r)),-(n+a)||0}n.defaultFormat=`YYYY-MM-DDTHH:mm:ssZ`,n.defaultFormatUtc=`YYYY-MM-DDTHH:mm:ss[Z]`;function ti(){return this.clone().locale(`en`).format(`ddd MMM DD YYYY HH:mm:ss [GMT]ZZ`)}function ni(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?B(n,t?`YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYYYY-MM-DD[T]HH:mm:ss.SSSZ`):D(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace(`Z`,B(n,`Z`)):B(n,t?`YYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYY-MM-DD[T]HH:mm:ss.SSSZ`)}function ri(){if(!this.isValid())return`moment.invalid(/* `+this._i+` */)`;var e=`moment`,t=``,n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?`moment.utc`:`moment.parseZone`,t=`Z`),n=`[`+e+`("]`,r=0<=this.year()&&this.year()<=9999?`YYYY`:`YYYYYY`,i=`-MM-DD[T]HH:mm:ss.SSS`,a=t+`[")]`,this.format(n+r+i+a)}function ii(e){e||=this.isUtc()?n.defaultFormatUtc:n.defaultFormat;var t=B(this,e);return this.localeData().postformat(t)}function ai(e,t){return this.isValid()&&(S(e)&&e.isValid()||X(e).isValid())?jr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oi(e){return this.from(X(),e)}function si(e,t){return this.isValid()&&(S(e)&&e.isValid()||X(e).isValid())?jr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ci(e){return this.to(X(),e)}function li(e){var t;return e===void 0?this._locale._abbr:(t=Sn(e),t!=null&&(this._locale=t),this)}var ui=w(`moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.`,function(e){return e===void 0?this.localeData():this.locale(e)});function di(){return this._locale}var fi=1e3,pi=60*fi,mi=60*pi,hi=146097*24*mi;function gi(e,t){return(e%t+t)%t}function _i(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-hi:new Date(e,t,n).valueOf()}function vi(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hi:Date.UTC(e,t,n)}function yi(e){var t,r;if(e=V(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(r=this._isUTC?vi:_i,e){case`year`:t=r(this.year(),0,1);break;case`quarter`:t=r(this.year(),this.month()-this.month()%3,1);break;case`month`:t=r(this.year(),this.month(),1);break;case`week`:t=r(this.year(),this.month(),this.date()-this.weekday());break;case`isoWeek`:t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case`day`:case`date`:t=r(this.year(),this.month(),this.date());break;case`hour`:t=this._d.valueOf(),t-=gi(t+(this._isUTC?0:this.utcOffset()*pi),mi);break;case`minute`:t=this._d.valueOf(),t-=gi(t,pi);break;case`second`:t=this._d.valueOf(),t-=gi(t,fi);break}return this._d.setTime(t),n.updateOffset(this,!0),this}function bi(e){var t,r;if(e=V(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(r=this._isUTC?vi:_i,e){case`year`:t=r(this.year()+1,0,1)-1;break;case`quarter`:t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case`month`:t=r(this.year(),this.month()+1,1)-1;break;case`week`:t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case`isoWeek`:t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case`day`:case`date`:t=r(this.year(),this.month(),this.date()+1)-1;break;case`hour`:t=this._d.valueOf(),t+=mi-gi(t+(this._isUTC?0:this.utcOffset()*pi),mi)-1;break;case`minute`:t=this._d.valueOf(),t+=pi-gi(t,pi)-1;break;case`second`:t=this._d.valueOf(),t+=fi-gi(t,fi)-1;break}return this._d.setTime(t),n.updateOffset(this,!0),this}function xi(){return this._d.valueOf()-(this._offset||0)*6e4}function Si(){return Math.floor(this.valueOf()/1e3)}function Ci(){return new Date(this.valueOf())}function wi(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ti(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ei(){return this.isValid()?this.toISOString():null}function Di(){return g(this)}function Oi(){return f({},h(this))}function ki(){return h(this).overflow}function Ai(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}R(`N`,0,0,`eraAbbr`),R(`NN`,0,0,`eraAbbr`),R(`NNN`,0,0,`eraAbbr`),R(`NNNN`,0,0,`eraName`),R(`NNNNN`,0,0,`eraNarrow`),R(`y`,[`y`,1],`yo`,`eraYear`),R(`y`,[`yy`,2],0,`eraYear`),R(`y`,[`yyy`,3],0,`eraYear`),R(`y`,[`yyyy`,4],0,`eraYear`),U(`N`,Vi),U(`NN`,Vi),U(`NNN`,Vi),U(`NNNN`,Hi),U(`NNNNN`,Ui),G([`N`,`NN`,`NNN`,`NNNN`,`NNNNN`],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?h(n).era=i:h(n).invalidEra=e}),U(`y`,Oe),U(`yy`,Oe),U(`yyy`,Oe),U(`yyyy`,Oe),U(`yo`,Wi),G([`y`,`yy`,`yyy`,`yyyy`],K),G([`yo`],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[K]=n._locale.eraYearOrdinalParse(e,i):t[K]=parseInt(e,10)});function ji(e,t){var r,i,a,o=this._eras||Sn(`en`)._eras;for(r=0,i=o.length;r<i;++r){switch(typeof o[r].since){case`string`:a=n(o[r].since).startOf(`day`),o[r].since=a.valueOf();break}switch(typeof o[r].until){case`undefined`:o[r].until=1/0;break;case`string`:a=n(o[r].until).startOf(`day`).valueOf(),o[r].until=a.valueOf();break}}return o}function Mi(e,t,n){var r,i,a=this.eras(),o,s,c;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(o=a[r].name.toUpperCase(),s=a[r].abbr.toUpperCase(),c=a[r].narrow.toUpperCase(),n)switch(t){case`N`:case`NN`:case`NNN`:if(s===e)return a[r];break;case`NNNN`:if(o===e)return a[r];break;case`NNNNN`:if(c===e)return a[r];break}else if([o,s,c].indexOf(e)>=0)return a[r]}function Ni(e,t){var r=e.since<=e.until?1:-1;return t===void 0?n(e.since).year():n(e.since).year()+(t-e.offset)*r}function Pi(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return``}function Fi(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return``}function Ii(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return``}function Li(){var e,t,r,i,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(r=a[e].since<=a[e].until?1:-1,i=this.clone().startOf(`day`).valueOf(),a[e].since<=i&&i<=a[e].until||a[e].until<=i&&i<=a[e].since)return(this.year()-n(a[e].since).year())*r+a[e].offset;return this.year()}function Ri(e){return o(this,`_erasNameRegex`)||Gi.call(this),e?this._erasNameRegex:this._erasRegex}function zi(e){return o(this,`_erasAbbrRegex`)||Gi.call(this),e?this._erasAbbrRegex:this._erasRegex}function Bi(e){return o(this,`_erasNarrowRegex`)||Gi.call(this),e?this._erasNarrowRegex:this._erasRegex}function Vi(e,t){return t.erasAbbrRegex(e)}function Hi(e,t){return t.erasNameRegex(e)}function Ui(e,t){return t.erasNarrowRegex(e)}function Wi(e,t){return t._eraYearOrdinalRegex||Oe}function Gi(){var e=[],t=[],n=[],r=[],i,a,o,s,c,l=this.eras();for(i=0,a=l.length;i<a;++i)o=ze(l[i].name),s=ze(l[i].abbr),c=ze(l[i].narrow),t.push(o),e.push(s),n.push(c),r.push(o),r.push(s),r.push(c);this._erasRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._erasNameRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`),this._erasAbbrRegex=RegExp(`^(`+e.join(`|`)+`)`,`i`),this._erasNarrowRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`)}R(0,[`gg`,2],0,function(){return this.weekYear()%100}),R(0,[`GG`,2],0,function(){return this.isoWeekYear()%100});function Ki(e,t){R(0,[e,e.length],0,t)}Ki(`gggg`,`weekYear`),Ki(`ggggg`,`weekYear`),Ki(`GGGG`,`isoWeekYear`),Ki(`GGGGG`,`isoWeekYear`),U(`G`,ke),U(`g`,ke),U(`GG`,H,ye),U(`gg`,H,ye),U(`GGGG`,Ee,xe),U(`gggg`,Ee,xe),U(`GGGGG`,De,Se),U(`ggggg`,De,Se),He([`gggg`,`ggggg`,`GGGG`,`GGGGG`],function(e,t,n,r){t[r.substr(0,2)]=W(e)}),He([`gg`,`GG`],function(e,t,r,i){t[i]=n.parseTwoDigitYear(e)});function qi(e){return $i.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Ji(e){return $i.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Yi(){return Ot(this.year(),1,4)}function Xi(){return Ot(this.isoWeekYear(),1,4)}function Zi(){var e=this.localeData()._week;return Ot(this.year(),e.dow,e.doy)}function Qi(){var e=this.localeData()._week;return Ot(this.weekYear(),e.dow,e.doy)}function $i(e,t,n,r,i){var a;return e==null?Dt(this,r,i).year:(a=Ot(e,r,i),t>a&&(t=a),ea.call(this,e,t,n,r,i))}function ea(e,t,n,r,i){var a=Et(e,t,n,r,i),o=wt(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}R(`Q`,0,`Qo`,`quarter`),U(`Q`,ve),G(`Q`,function(e,t){t[Ge]=(W(e)-1)*3});function ta(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}R(`D`,[`DD`,2],`Do`,`date`),U(`D`,H,Pe),U(`DD`,H,ye),U(`Do`,function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),G([`D`,`DD`],Ke),G(`Do`,function(e,t){t[Ke]=W(e.match(H)[0])});var na=tt(`Date`,!0);R(`DDD`,[`DDDD`,3],`DDDo`,`dayOfYear`),U(`DDD`,Te),U(`DDDD`,be),G([`DDD`,`DDDD`],function(e,t,n){n._dayOfYear=W(e)});function ra(e){var t=Math.round((this.clone().startOf(`day`)-this.clone().startOf(`year`))/864e5)+1;return e==null?t:this.add(e-t,`d`)}R(`m`,[`mm`,2],0,`minute`),U(`m`,H,Fe),U(`mm`,H,ye),G([`m`,`mm`],qe);var ia=tt(`Minutes`,!1);R(`s`,[`ss`,2],0,`second`),U(`s`,H,Fe),U(`ss`,H,ye),G([`s`,`ss`],Je);var aa=tt(`Seconds`,!1);R(`S`,0,0,function(){return~~(this.millisecond()/100)}),R(0,[`SS`,2],0,function(){return~~(this.millisecond()/10)}),R(0,[`SSS`,3],0,`millisecond`),R(0,[`SSSS`,4],0,function(){return this.millisecond()*10}),R(0,[`SSSSS`,5],0,function(){return this.millisecond()*100}),R(0,[`SSSSSS`,6],0,function(){return this.millisecond()*1e3}),R(0,[`SSSSSSS`,7],0,function(){return this.millisecond()*1e4}),R(0,[`SSSSSSSS`,8],0,function(){return this.millisecond()*1e5}),R(0,[`SSSSSSSSS`,9],0,function(){return this.millisecond()*1e6}),U(`S`,Te,ve),U(`SS`,Te,ye),U(`SSS`,Te,be);var oa,sa;for(oa=`SSSS`;oa.length<=9;oa+=`S`)U(oa,Oe);function ca(e,t){t[Ye]=W((`0.`+e)*1e3)}for(oa=`S`;oa.length<=9;oa+=`S`)G(oa,ca);sa=tt(`Milliseconds`,!1),R(`z`,0,0,`zoneAbbr`),R(`zz`,0,0,`zoneName`);function la(){return this._isUTC?`UTC`:``}function ua(){return this._isUTC?`Coordinated Universal Time`:``}var Z=x.prototype;Z.add=Lr,Z.calendar=Gr,Z.clone=Kr,Z.diff=$r,Z.endOf=bi,Z.format=ii,Z.from=ai,Z.fromNow=oi,Z.to=si,Z.toNow=ci,Z.get=it,Z.invalidAt=ki,Z.isAfter=qr,Z.isBefore=Jr,Z.isBetween=Yr,Z.isSame=Xr,Z.isSameOrAfter=Zr,Z.isSameOrBefore=Qr,Z.isValid=Di,Z.lang=ui,Z.locale=li,Z.localeData=di,Z.max=er,Z.min=$n,Z.parsingFlags=Oi,Z.set=at,Z.startOf=yi,Z.subtract=Rr,Z.toArray=wi,Z.toObject=Ti,Z.toDate=Ci,Z.toISOString=ni,Z.inspect=ri,typeof Symbol<`u`&&Symbol.for!=null&&(Z[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return`Moment<`+this.format()+`>`}),Z.toJSON=Ei,Z.toString=ti,Z.unix=Si,Z.valueOf=xi,Z.creationData=Ai,Z.eraName=Pi,Z.eraNarrow=Fi,Z.eraAbbr=Ii,Z.eraYear=Li,Z.year=$e,Z.isLeapYear=et,Z.weekYear=qi,Z.isoWeekYear=Ji,Z.quarter=Z.quarters=ta,Z.month=vt,Z.daysInMonth=yt,Z.week=Z.weeks=Nt,Z.isoWeek=Z.isoWeeks=Pt,Z.weeksInYear=Zi,Z.weeksInWeekYear=Qi,Z.isoWeeksInYear=Yi,Z.isoWeeksInISOWeekYear=Xi,Z.date=na,Z.day=Z.days=Yt,Z.weekday=Xt,Z.isoWeekday=Zt,Z.dayOfYear=ra,Z.hour=Z.hours=ln,Z.minute=Z.minutes=ia,Z.second=Z.seconds=aa,Z.millisecond=Z.milliseconds=sa,Z.utcOffset=vr,Z.utc=br,Z.local=xr,Z.parseZone=Sr,Z.hasAlignedHourOffset=Cr,Z.isDST=wr,Z.isLocal=Er,Z.isUtcOffset=Dr,Z.isUtc=Or,Z.isUTC=Or,Z.zoneAbbr=la,Z.zoneName=ua,Z.dates=w(`dates accessor is deprecated. Use date instead.`,na),Z.months=w(`months accessor is deprecated. Use month instead`,vt),Z.years=w(`years accessor is deprecated. Use year instead`,$e),Z.zone=w(`moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/`,yr),Z.isDSTShifted=w(`isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information`,Tr);function da(e){return X(e*1e3)}function fa(){return X.apply(null,arguments).parseZone()}function pa(e){return e}var Q=A.prototype;Q.calendar=te,Q.longDateFormat=ae,Q.invalidDate=se,Q.ordinal=ue,Q.preparse=pa,Q.postformat=pa,Q.relativeTime=fe,Q.pastFuture=pe,Q.set=O,Q.eras=ji,Q.erasParse=Mi,Q.erasConvertYear=Ni,Q.erasAbbrRegex=zi,Q.erasNameRegex=Ri,Q.erasNarrowRegex=Bi,Q.months=pt,Q.monthsShort=mt,Q.monthsParse=gt,Q.monthsRegex=xt,Q.monthsShortRegex=bt,Q.week=kt,Q.firstDayOfYear=Mt,Q.firstDayOfWeek=jt,Q.weekdays=Wt,Q.weekdaysMin=Kt,Q.weekdaysShort=Gt,Q.weekdaysParse=Jt,Q.weekdaysRegex=Qt,Q.weekdaysShortRegex=$t,Q.weekdaysMinRegex=en,Q.isPM=sn,Q.meridiem=un;function ma(e,t,n,r){var i=Sn(),a=p().set(r,t);return i[n](a,e)}function ha(e,t,n){if(l(e)&&(t=e,e=void 0),e||=``,t!=null)return ma(e,t,n,`month`);var r,i=[];for(r=0;r<12;r++)i[r]=ma(e,r,n,`month`);return i}function ga(e,t,n,r){typeof e==`boolean`?(l(t)&&(n=t,t=void 0),t||=``):(t=e,n=t,e=!1,l(t)&&(n=t,t=void 0),t||=``);var i=Sn(),a=e?i._week.dow:0,o,s=[];if(n!=null)return ma(t,(n+a)%7,r,`day`);for(o=0;o<7;o++)s[o]=ma(t,(o+a)%7,r,`day`);return s}function _a(e,t){return ha(e,t,`months`)}function va(e,t){return ha(e,t,`monthsShort`)}function ya(e,t,n){return ga(e,t,n,`weekdays`)}function ba(e,t,n){return ga(e,t,n,`weekdaysShort`)}function xa(e,t,n){return ga(e,t,n,`weekdaysMin`)}yn(`en`,{eras:[{since:`0001-01-01`,until:1/0,offset:1,name:`Anno Domini`,narrow:`AD`,abbr:`AD`},{since:`0000-12-31`,until:-1/0,offset:1,name:`Before Christ`,narrow:`BC`,abbr:`BC`}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(W(e%100/10)===1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)}}),n.lang=w(`moment.lang is deprecated. Use moment.locale instead.`,yn),n.langData=w(`moment.langData is deprecated. Use moment.localeData instead.`,Sn);var Sa=Math.abs;function Ca(){var e=this._data;return this._milliseconds=Sa(this._milliseconds),this._days=Sa(this._days),this._months=Sa(this._months),e.milliseconds=Sa(e.milliseconds),e.seconds=Sa(e.seconds),e.minutes=Sa(e.minutes),e.hours=Sa(e.hours),e.months=Sa(e.months),e.years=Sa(e.years),this}function wa(e,t,n,r){var i=jr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Ta(e,t){return wa(this,e,t,1)}function Ea(e,t){return wa(this,e,t,-1)}function Da(e){return e<0?Math.floor(e):Math.ceil(e)}function Oa(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,o,s,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Da(Aa(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=Be(e/1e3),r.seconds=i%60,a=Be(i/60),r.minutes=a%60,o=Be(a/60),r.hours=o%24,t+=Be(o/24),c=Be(ka(t)),n+=c,t-=Da(Aa(c)),s=Be(n/12),n%=12,r.days=t,r.months=n,r.years=s,this}function ka(e){return e*4800/146097}function Aa(e){return e*146097/4800}function ja(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=V(e),e===`month`||e===`quarter`||e===`year`)switch(t=this._days+r/864e5,n=this._months+ka(t),e){case`month`:return n;case`quarter`:return n/3;case`year`:return n/12}else switch(t=this._days+Math.round(Aa(this._months)),e){case`week`:return t/7+r/6048e5;case`day`:return t+r/864e5;case`hour`:return t*24+r/36e5;case`minute`:return t*1440+r/6e4;case`second`:return t*86400+r/1e3;case`millisecond`:return Math.floor(t*864e5)+r;default:throw Error(`Unknown unit `+e)}}function Ma(e){return function(){return this.as(e)}}var Na=Ma(`ms`),Pa=Ma(`s`),Fa=Ma(`m`),Ia=Ma(`h`),La=Ma(`d`),Ra=Ma(`w`),za=Ma(`M`),Ba=Ma(`Q`),Va=Ma(`y`),Ha=Na;function Ua(){return jr(this)}function Wa(e){return e=V(e),this.isValid()?this[e+`s`]():NaN}function Ga(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ka=Ga(`milliseconds`),qa=Ga(`seconds`),Ja=Ga(`minutes`),Ya=Ga(`hours`),Xa=Ga(`days`),Za=Ga(`months`),Qa=Ga(`years`);function $a(){return Be(this.days()/7)}var eo=Math.round,to={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function no(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ro(e,t,n,r){var i=jr(e).abs(),a=eo(i.as(`s`)),o=eo(i.as(`m`)),s=eo(i.as(`h`)),c=eo(i.as(`d`)),l=eo(i.as(`M`)),u=eo(i.as(`w`)),d=eo(i.as(`y`)),f=a<=n.ss&&[`s`,a]||a<n.s&&[`ss`,a]||o<=1&&[`m`]||o<n.m&&[`mm`,o]||s<=1&&[`h`]||s<n.h&&[`hh`,s]||c<=1&&[`d`]||c<n.d&&[`dd`,c];return n.w!=null&&(f=f||u<=1&&[`w`]||u<n.w&&[`ww`,u]),f=f||l<=1&&[`M`]||l<n.M&&[`MM`,l]||d<=1&&[`y`]||[`yy`,d],f[2]=t,f[3]=+e>0,f[4]=r,no.apply(null,f)}function io(e){return e===void 0?eo:typeof e==`function`?(eo=e,!0):!1}function ao(e,t){return to[e]===void 0?!1:t===void 0?to[e]:(to[e]=t,e===`s`&&(to.ss=t-1),!0)}function oo(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=to,i,a;return typeof e==`object`&&(t=e,e=!1),typeof e==`boolean`&&(n=e),typeof t==`object`&&(r=Object.assign({},to,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=ro(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var so=Math.abs;function co(e){return(e>0)-(e<0)||+e}function lo(){if(!this.isValid())return this.localeData().invalidDate();var e=so(this._milliseconds)/1e3,t=so(this._days),n=so(this._months),r,i,a,o,s=this.asSeconds(),c,l,u,d;return s?(r=Be(e/60),i=Be(r/60),e%=60,r%=60,a=Be(n/12),n%=12,o=e?e.toFixed(3).replace(/\.?0+$/,``):``,c=s<0?`-`:``,l=co(this._months)===co(s)?``:`-`,u=co(this._days)===co(s)?``:`-`,d=co(this._milliseconds)===co(s)?``:`-`,c+`P`+(a?l+a+`Y`:``)+(n?l+n+`M`:``)+(t?u+t+`D`:``)+(i||r||e?`T`:``)+(i?d+i+`H`:``)+(r?d+r+`M`:``)+(e?d+o+`S`:``)):`P0D`}var $=lr.prototype;return $.isValid=sr,$.abs=Ca,$.add=Ta,$.subtract=Ea,$.as=ja,$.asMilliseconds=Na,$.asSeconds=Pa,$.asMinutes=Fa,$.asHours=Ia,$.asDays=La,$.asWeeks=Ra,$.asMonths=za,$.asQuarters=Ba,$.asYears=Va,$.valueOf=Ha,$._bubble=Oa,$.clone=Ua,$.get=Wa,$.milliseconds=Ka,$.seconds=qa,$.minutes=Ja,$.hours=Ya,$.days=Xa,$.weeks=$a,$.months=Za,$.years=Qa,$.humanize=oo,$.toISOString=lo,$.toString=lo,$.toJSON=lo,$.locale=li,$.localeData=di,$.toIsoString=w(`toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)`,lo),$.lang=ui,R(`X`,0,0,`unix`),R(`x`,0,0,`valueOf`),U(`x`,ke),U(`X`,Me),G(`X`,function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),G(`x`,function(e,t,n){n._d=new Date(W(e))}),n.version=`2.30.1`,r(X),n.fn=Z,n.min=nr,n.max=rr,n.now=ir,n.utc=p,n.unix=da,n.months=_a,n.isDate=u,n.locale=yn,n.invalid=_,n.duration=jr,n.isMoment=S,n.weekdays=ya,n.parseZone=fa,n.localeData=Sn,n.isDuration=ur,n.monthsShort=va,n.weekdaysMin=xa,n.defineLocale=bn,n.updateLocale=xn,n.locales=Cn,n.weekdaysShort=ba,n.normalizeUnits=V,n.relativeTimeRounding=io,n.relativeTimeThreshold=ao,n.calendarFormat=Wr,n.prototype=Z,n.HTML5_FMT={DATETIME_LOCAL:`YYYY-MM-DDTHH:mm`,DATETIME_LOCAL_SECONDS:`YYYY-MM-DDTHH:mm:ss`,DATETIME_LOCAL_MS:`YYYY-MM-DDTHH:mm:ss.SSS`,DATE:`YYYY-MM-DD`,TIME:`HH:mm`,TIME_SECONDS:`HH:mm:ss`,TIME_MS:`HH:mm:ss.SSS`,WEEK:`GGGG-[W]WW`,MONTH:`YYYY-MM`},n}))})),Ie=E(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Fe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";return e.defineLocale(`it`,{months:`gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre`.split(`_`),monthsShort:`gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic`.split(`_`),weekdays:`domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato`.split(`_`),weekdaysShort:`dom_lun_mar_mer_gio_ven_sab`.split(`_`),weekdaysMin:`do_lu_ma_me_gi_ve_sa`.split(`_`),longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd D MMMM YYYY HH:mm`},calendar:{sameDay:function(){return`[Oggi a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},nextDay:function(){return`[Domani a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},nextWeek:function(){return`dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},lastDay:function(){return`[Ieri a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},lastWeek:function(){switch(this.day()){case 0:return`[La scorsa] dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`;default:return`[Lo scorso] dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`}},sameElse:`L`},relativeTime:{future:`tra %s`,past:`%s fa`,s:`alcuni secondi`,ss:`%d secondi`,m:`un minuto`,mm:`%d minuti`,h:`un'ora`,hh:`%d ore`,d:`un giorno`,dd:`%d giorni`,w:`una settimana`,ww:`%d settimane`,M:`un mese`,MM:`%d mesi`,y:`un anno`,yy:`%d anni`},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:`%dº`,week:{dow:1,doy:4}})}))})),U=E(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Fe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";return e.defineLocale(`en-gb`,{months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),monthsShort:`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),weekdaysShort:`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),weekdaysMin:`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd, D MMMM YYYY HH:mm`},calendar:{sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`},relativeTime:{future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(~~(e%100/10)==1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)},week:{dow:1,doy:4}})}))})),Le=E(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Fe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";function t(e,t,n,r){var i={m:[`eine Minute`,`einer Minute`],h:[`eine Stunde`,`einer Stunde`],d:[`ein Tag`,`einem Tag`],dd:[e+` Tage`,e+` Tagen`],w:[`eine Woche`,`einer Woche`],M:[`ein Monat`,`einem Monat`],MM:[e+` Monate`,e+` Monaten`],y:[`ein Jahr`,`einem Jahr`],yy:[e+` Jahre`,e+` Jahren`]};return t?i[n][0]:i[n][1]}return e.defineLocale(`de`,{months:`Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember`.split(`_`),monthsShort:`Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.`.split(`_`),monthsParseExact:!0,weekdays:`Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag`.split(`_`),weekdaysShort:`So._Mo._Di._Mi._Do._Fr._Sa.`.split(`_`),weekdaysMin:`So_Mo_Di_Mi_Do_Fr_Sa`.split(`_`),weekdaysParseExact:!0,longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD.MM.YYYY`,LL:`D. MMMM YYYY`,LLL:`D. MMMM YYYY HH:mm`,LLLL:`dddd, D. MMMM YYYY HH:mm`},calendar:{sameDay:`[heute um] LT [Uhr]`,sameElse:`L`,nextDay:`[morgen um] LT [Uhr]`,nextWeek:`dddd [um] LT [Uhr]`,lastDay:`[gestern um] LT [Uhr]`,lastWeek:`[letzten] dddd [um] LT [Uhr]`},relativeTime:{future:`in %s`,past:`vor %s`,s:`ein paar Sekunden`,ss:`%d Sekunden`,m:t,mm:`%d Minuten`,h:t,hh:`%d Stunden`,d:t,dd:t,w:t,ww:`%d Wochen`,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:`%d.`,week:{dow:1,doy:4}})}))}));Ie(),U(),Le();var Re=e=>{let t=``;return e.split(`:`).forEach(e=>{t+=e}),parseInt(t)},ze=e=>e.toString().padStart(4,`0`).match(/.{1,2}/g).join(`:`),Be=e=>{let t=e.address;if(e.addresstype===`county`&&t.country)return t.county;if(e.addresstype===`village`&&t.village)return t.village;let n=[];return[`emergency`,`historic`,`military`,`natural`,`landuse`,`place`,`railway`,`man_made`,`aerialway`,`boundary`,`amenity`,`aeroway`,`club`,`craft`,`leisure`,`office`,`mountain_pass`,`shop`,`tourism`,`bridge`,`tunnel`,`waterway`,`name`].forEach(e=>{t.hasOwnProperty(e)&&t[e]&&n.push(t[e])}),t.road?n.push(t.road):t.pedestrian?n.push(t.pedestrian):t.suburb?n.push(t.suburb):t.square?n.push(t.square):(t.neighbourhood&&n.push(t.neighbourhood),t.hamlet?n.push(t.hamlet):t.isolated_dwelling?n.push(t.isolated_dwelling):t.locality?n.push(t.locality):t.croft&&n.push(t.croft)),t.house_number&&n.push(t.house_number),t.postcode&&n.push(t.postcode),t.village&&n.push(t.village),t.town?n.push(t.town):t.city&&n.push(t.city),n.join(`, `).substr(0,150)};function W(e){let t=window.sessionStorage.getItem(e);if(t!==null){let n=JSON.parse(t);if(new Date(n.expirationDate)>new Date)return n.value;window.sessionStorage.removeItem(e)}return null}function Ve(e,t,n){let r=n?new Date(n*1e3):null;if(r){let n={value:t,expirationDate:r.toISOString()};window.sessionStorage.setItem(e,JSON.stringify(n))}}function G({day:e,slot:t,i18next:n}){return(0,r.jsx)(`li`,{className:`it-list-item`,children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsx)(`div`,{className:`it-right-zone`,children:(0,r.jsxs)(`span`,{className:`text pl-4`,children:[(0,r.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,r.jsx)(`b`,{children:t})]})})})})}function He(){return typeof document>`u`?void 0:document.activeElement?.closest?.(`[data-formio-widget-scope]`)||document.querySelector(`[data-formio-widget-scope]`)||document.querySelector(`widget-formio`)||document.body}var Ue=t.Formio.Components.components.field,We=({component:e,current:t,onChange:n,i18next:i})=>{let[f,p]=(0,a.useState)(),[m,h]=(0,a.useState)([]),[ee,g]=(0,a.useState)([]),[_,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[x,S]=(0,a.useState)(null),[C,w]=(0,a.useState)(null),[T,E]=(0,a.useState)(null),[D,O]=(0,a.useState)({}),[k,A]=(0,a.useState)(null),[j,te]=(0,a.useState)(!1),[N,P]=(0,a.useState)([]),[F,I]=(0,a.useState)(!1),L=(0,a.useRef)(),R=e.calendarId;c.default.locale(i.language),d.default.locale(i.language);let ne=e=>{let t=(0,c.default)(e).format(`YYYY-MM-DD`);fetch(ie(t)).then(e=>e.json()).then(t=>{let n=re(e||new Date),r=t.filter(e=>e.available==1);r.length===0&&he();let i=[];n.forEach(e=>{t.some(t=>t.date===e&&t.available==1)?i.push({available:!0,date:e}):i.push({available:!1,date:e})}),h(i.map(e=>{if(e.available===!1)return(0,c.default)(e.date,`YYYY-MM-DD`).toDate()})),z(r.length?r[0].date:e)}).catch(e=>console.error(e))},z=e=>{E(null),w(null),g([]);let t=(0,c.default)(e).format(`YYYY-MM-DD`);fetch(ae(t)).then(e=>e.json()).then(t=>{let n=t.filter(e=>e.availability==1);O(n[0]),n.length>0?(g(t),v(!1),w((0,c.default)(e).format(`L`)),p((0,c.default)(e,`YYYY-MM-DD`).toDate())):(t.length>0&&p((0,c.default)(t[0].date,`YYYY-MM-DD`).toDate()),g([]),he())})},B=()=>{if(R!==``&&R!=null)if(!t.dataValue)ne(new Date);else if(e.multiple&&Array.isArray(t.dataValue)){if(t.dataValue.length>0){A(t.dataValue);let e=[];t.dataValue.map(t=>{e.push({...t,date:(0,c.default)(t.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)})}),P(e)}}else if(!e.multiple&&typeof t.dataValue==`object`){let e={date:t.dataValue.date,slot:t.dataValue.slot};P([{...t.dataValue,date:(0,c.default)(t.dataValue.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)}]),A(e)}else{let r=t.dataValue.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),i=r[2].split(`#`),a={date:(0,c.default)(r[0],`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:r[1]};e.multiple?(n([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}]),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])):(n({date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])),A(a)}};(0,a.useEffect)(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{B()},1e3)})},[]);let re=e=>{let t=(0,c.default)(e,`YYYY-MM`).daysInMonth(),n=[];for(;t;){let r=(0,c.default)(e).date(t);n.push(r.format(`YYYY-MM-DD`)),t--}return n},ie=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=`${M()}/api/calendars/${r}/availabilities`,s=[`from_time=${(0,c.default)(t).startOf(`month`).format(`YYYY-MM-DD`)}`,`to_time=${(0,c.default)(t).endOf(`month`).format(`YYYY-MM-DD`)}`];return n&&s.push(`available=${n}`),i&&a&&s.push(`opening_hours=${a.join()}`),`${o}?${s.join(`&`)}`},ae=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=(0,c.default)(t).format(`YYYY-MM-DD`),s=`${M()}/api/calendars/${r}/availabilities/${o}`,l=[];return n&&l.push(`available=${n}`),i&&a&&l.push(`opening_hours=${a.join()}`),l&&(s=`${s}?${l.join(`&`)}`),s},oe=e=>{ne(e)},se=e=>{setTimeout(()=>{te(!j)},1e3),z(e)},ce=e=>{E(null),setTimeout(()=>{e&&(S(e.target.dataset),E(e.target.id))},300)},le=t=>{b(null);let n=`${M()}/it/meetings/new-draft`,r={date:x?.date?(0,c.default)(x?.date).format(`DD-MM-YYYY`):(0,c.default)(t.target.dataset.date).format(`DD-MM-YYYY`),slot:x?.value_start&&x?.value_end?x.value_start+`-`+x.value_end:t.target.dataset.slots,calendar:e.calendarId,opening_hour:x?.opening_hour?x?.opening_hour:t.target.dataset.opening_hour,meeting:y?y.id:``,first_available_date:D.date,first_available_start_time:D.start_time,first_available_end_time:D.end_time,first_availability_updated_at:(0,c.default)().format()};fetch(n,{method:`POST`,body:JSON.stringify(r),headers:{"Content-Type":`application/json; charset=utf-8`},strictErrors:!0}).then(e=>{if(!e.ok)throw Error(i.t(`Intervallo selezionato non disponibile!`));return e.json()}).then(e=>{b(e);let t={date:r.date,slot:r.slot,calendar_id:r.calendar[0],opening_hour_id:r.opening_hour||r.opening_hour_id,meeting_id:e.id};P([...N,t])}).catch(e=>{console.log(e),u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},ue=()=>{x&&(le(),te(!j))},de=()=>(0,r.jsx)(`span`,{children:i.t(`Tempo prenotazione scaduto!`)}),fe=({minutes:e,seconds:t,completed:n})=>n?(0,r.jsx)(de,{}):(0,r.jsx)(`div`,{children:(0,r.jsxs)(`div`,{children:[` `,(0,r.jsxs)(`span`,{children:[` `,(0,r.jsxs)(`i`,{children:[i.t(`Per confermare la prenotazione che ti abbiamo riservato procedi con l’invio di questa pratica e con il pagamento (se richiesto) di quanto previsto entro`),`:`]}),` `,(0,r.jsxs)(`b`,{children:[e,` `,i.t(`minuti`),` `,t,` `,i.t(`secondi`)]})]})]})}),pe=e=>{let t=Re(e.target.value),n=Re(e.target.min),r=Re(e.target.max);t<n||t>r||t>Re(x.end)?(u.default.fire({title:``,html:`<p>${i.t(`l'orario`)} <b>${ze(t)}</b> ${i.t(`non è valido`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),V(``)):S({...x,value_start:e.target.value})},me=e=>{let t=Re(e.target.value),n=Re(e.target.min),r=Re(e.target.max);t<n||t>r||t<Re(x.start)?(u.default.fire({title:``,html:`<p>${i.t(`l'orario`)} <b>${ze(t)}</b> ${i.t(`non è valido`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),V(``)):S({...x,value_end:e.target.value})},V=t=>{if(t===null||t===``)n(``);else if(Array.isArray(t)&&t.length>0){let t=[];N.map(e=>{t.push({date:(0,c.default)(e.date,`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:e.slot,calendar_id:e.calendar_id||e.calendar[0],meeting_id:e.meeting_id,opening_hour_id:e.opening_hour||e.opening_hour_id})}),e.multiple?n(t):n(t[0])}else n(``)},he=()=>{v(!0),b(null),w(null),V(null)},ge=()=>{if(i.language===`it`)return Pe;if(i.language===`en`)return Te;if(i.language===`de`)return ye};(0,a.useEffect)(()=>{V(N)},[N]),(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&F===!1?(I(!0),setTimeout(()=>{B()},1e3)):(I(!1),setTimeout(()=>{B()},1e3))},[]);let _e=(e,t)=>{let n=`${M()}/api/meetings/${t.meeting_id}`;fetch(n,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${W(`auth-token`)}`},strictErrors:!0}).then(t=>{t&&t.status>400?u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori durante la cancellazione dello slot`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):(P([...N.slice(0,e),...N.slice(e+1)]),ne(new Date))})};return(0,r.jsxs)(r.Fragment,{children:[F&&k?(0,r.jsxs)(`div`,{className:`my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none`,children:[(0,r.jsxs)(`b`,{children:[Array.isArray(k)&&k.length>1?i.t(`Giorni selezionati per la prenotazione`):i.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,r.jsx)(`div`,{className:`mb-5`,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:Array.isArray(k)?k.map(e=>(0,r.jsx)(G,{day:(0,c.default)(e.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:i,slot:e.slot})):(0,r.jsx)(G,{day:(0,c.default)(k.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:i,slot:k.slot})})})})]}):(0,r.jsx)(`div`,{className:`slot-calendar `,children:(0,r.jsxs)(`div`,{className:`row`,children:[e.multiple?(0,r.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,r.jsxs)(`div`,{className:`m-2`,children:[(0,r.jsx)(`h6`,{children:i.t(e.label)}),(0,r.jsx)(o.DayPicker,{mode:`single`,selected:f,locale:ge(),disabled:m,onMonthChange:oe,onDayClick:se}),(0,r.jsx)(`p`,{children:i.t(`Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione`)})]})}):N.length===1?null:(0,r.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,r.jsxs)(`div`,{className:`m-2`,children:[(0,r.jsx)(`h6`,{children:i.t(e.label)}),(0,r.jsx)(o.DayPicker,{mode:`single`,selected:f,locale:ge(),disabled:m,onMonthChange:oe,onDayClick:se}),(0,r.jsxs)(`p`,{children:[` `,i.t(`Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione`)]})]})}),(0,r.jsx)(`div`,{className:`col-12`,children:N.length?(0,r.jsx)(`div`,{className:`row m-2`,children:(0,r.jsxs)(`div`,{className:`col-12 mb-4`,children:[(0,r.jsxs)(`b`,{children:[N.length>1?i.t(`Giorni selezionati per la prenotazione`):i.t(`Giorno selezionato per la prenotazione`),`:`,` `]}),(0,r.jsx)(`div`,{className:`mb-5`,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:N.map((e,t)=>(0,r.jsx)(`li`,{children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsxs)(`div`,{className:`it-right-zone`,children:[(0,r.jsxs)(`span`,{className:`text pl-4`,children:[e.date,` `,x||e.slot?`${i.t(`alle`)} ${e.slot}`:``]}),(0,r.jsx)(l.Icon,{icon:`it-delete`,onClick:()=>_e(t,e),role:`button`})]})})},`li`+t))})})}),y?(0,r.jsx)(l.Alert,{color:`info`,defaultValue:`string`,className:`d-print-none d-preview-calendar-none`,children:(0,r.jsx)(s.default,{date:y.expiration_time,renderer:fe})}):null]})}):null})]})}),(0,r.jsxs)(l.Modal,{isOpen:j,toggle:()=>te(!j),labelledBy:`daySelected`,size:`lg`,centered:!0,container:He(),children:[(0,r.jsx)(l.ModalHeader,{toggle:()=>te(!j),id:`daySelected`,children:i.t(`Seleziona una fascia oraria`)}),_?null:(0,r.jsxs)(`div`,{className:`title-xsmall u-grey-dark px-4`,children:[` `,i.t(`Seleziona una fascia oraria e, se necessario, utilizza l'apposito controllo per accorciare la durata della prenotazione, Poi clicca su Conferma`)]}),(0,r.jsx)(l.ModalBody,{children:(0,r.jsxs)(`div`,{className:`row`,children:[N.length>=1?(0,r.jsxs)(`div`,{children:[C&&!_?(0,r.jsxs)(`h6`,{children:[i.t(`Orari disponibili del`),` `,(0,d.default)(C).format(`DD/MM/YYYY`)]}):null,(0,r.jsxs)(`div`,{className:`calendar-last-selection col-12 pt-2 mb-5`,children:[(0,r.jsx)(`small`,{className:`pl-2 mb-2 d-flex px-2`,children:(0,r.jsxs)(`b`,{children:[(0,r.jsx)(l.Icon,{icon:`it-clock`,className:`mr-1`,size:`sm`}),` `,i.t(`Ultimo orario selezionato`)]})}),(0,r.jsx)(`div`,{className:`col-6 px-2`,children:(0,r.jsx)(`button`,{type:`button`,id:`slot-last-selection`,onClick:ce,tabIndex:`1`,className:T===`slot-last-selection`?`active btn btn-slot p-0`:`btn btn-slot p-0`,"data-date":(0,c.default)(C,`DD/MM/YYYY`).format(`YYYY-MM-DD`),"data-slots":N[N.length-1].slot,"data-opening_hour":N[N.length-1].opening_hour_id,"data-start":N[N.length-1].slot.split(`-`)[0],"data-end":N[N.length-1].slot.split(`-`)[1],"data-value_start":N[N.length-1].slot.split(`-`)[0],"data-value_end":N[N.length-1].slot.split(`-`)[1],disabled:_,children:N[N.length-1].slot})})]})]}):null,(0,r.jsx)(`div`,{children:C&&N.length>=1?(0,r.jsx)(`h6`,{children:i.t(`Seleziona altri orari`)}):_?null:(0,r.jsxs)(`h6`,{children:[i.t(`Orari disponibili del`),` `,(0,d.default)(C).format(`DD/MM/YYYY`)]})}),ee.map((e,t)=>(0,r.jsx)(`div`,{className:`col-6`,children:(0,r.jsxs)(`button`,{type:`button`,id:`slot-`+t,onClick:ce,ref:L,className:T===`slot-`+t?`active btn btn-slot p-0`:`btn btn-slot p-0`,tabIndex:`1`,"data-date":e.date,"data-start":e.start_time,"data-end":e.end_time,"data-value_start":e.start_time,"data-value_end":e.end_time,"data-slots":e.start_time+`-`+e.end_time,"data-opening_hour":e.opening_hour,"data-min_duration":e.min_duration,disabled:e.slots_available==0,children:[e.start_time,` - `,e.end_time]})},`slot-`+t)),_?(0,r.jsxs)(`div`,{className:`callout callout-highlight warning`,children:[(0,r.jsxs)(`div`,{className:`callout-title`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":!0,icon:`it-help-circle`}),i.t(`Attenzione`)]}),(0,r.jsxs)(`p`,{children:[` `,i.t(`Non è possibile prenotare per la data selezionata`),`.`]})]}):null,(0,r.jsx)(`div`,{className:`col-12`,children:x?.value_start&&T?(0,r.jsxs)(`div`,{className:`row`,children:[(0,r.jsx)(`div`,{className:`col-12 mb-3`,children:(0,r.jsx)(`p`,{className:`mb-3`,children:(0,r.jsx)(`b`,{children:i.t(`Se necessario, utilizza il controllo che segue per accorciare la durata della prenotazione`)})})}),(0,r.jsx)(`div`,{className:`col-12 col-md-6 mb-4`,children:(0,r.jsx)(l.Input,{type:`time`,label:i.t(`Dalle`),className:`active`,defaultValue:x.value_start||x.start,min:x.start,max:x.end,onBlur:pe})}),(0,r.jsx)(`div`,{className:`col-12 col-md-6 mb-4`,children:(0,r.jsx)(l.Input,{type:`time`,label:i.t(`alle`),className:`active`,defaultValue:x.value_end||x.end,onBlur:me,min:x.start,max:x.end})})]}):null})]})}),(0,r.jsx)(l.ModalFooter,{children:(0,r.jsx)(l.Button,{color:`primary`,onClick:()=>ue(),disabled:!C||!x?.value_start,children:i.t(`Conferma`)})})]})]})},K=class e extends Ue{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Dynamic Calendar`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Ue.schema({type:`dynamic_calendar`})}static editForm=N;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,n.createRoot)(e),this.rootComponent.render((0,r.jsx)(We,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){if(e)if(Array.isArray(e))this.selectedNextSlots=e,this.updateValue(e),this.shouldSetValue=!0;else if(typeof e==`object`)this.date=e.date,this.slot=e.slot,this.meeting=e.meeting_id,this.meeting_expiration_time=null,this.opening_hour=e.opening_hour_id,this.calendar_id=e.calendar_id,this.updateValue(e),this.shouldSetValue=!0;else{let t=e.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),n=t[2].split(`#`);this.date=t[0],this.slot=t[1],this.meeting=n[1],this.meeting_expiration_time=null,this.opening_hour=n.length===3?n[2]:``,this.updateValue({date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:this.meeting,opening_hour_id:this.opening_hour})}}getValue(){if(!(this.date&&this.slot&&this.meeting&&this.opening_hour)&&!(this.selectedNextSlots&&this.selectedNextSlots.length>0))return null;let e=this.meeting?this.meeting:``,t=this.opening_hour?this.opening_hour:``;return this.component.multiple?this.selectedNextSlots:{date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:e,opening_hour_id:t}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Ge=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{type:`select`,label:`Nome Calendario`,key:`calendarId`,input:!0,weight:1,placeholder:`Nome Calendario`,tooltip:`Inserisci il nome del calendario`,dataSrc:`url`,defaultValue:``,data:{url:M()+`/api/calendars?type=time_fixed_slots`},valueProperty:`id`,template:`<span>{{ item.title }}</span>`,selectValues:`Results`},{type:`checkbox`,label:`Seleziona orari di apertura`,key:`select_opening_hours`,input:!0,weight:1,tooltip:`Abilita per selezionare i singoli orari di apertura`,defaultValue:!1},{label:`Base url`,calculateValue:`let url = '`+M()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{type:`select`,label:`Orari di apertura`,key:`opening_hours`,input:!0,weight:1,placeholder:`Seleziona gli orari di apertura`,tooltip:`Seleziona gli orari di apertura`,multiple:!0,dataSrc:`url`,defaultValue:``,data:{url:M()+`/api/calendars/{{data.calendarId}}/opening-hours`},valueProperty:`id`,template:`<span>{{ item.name }}</span>`,selectValues:`results`,conditional:{show:!0,when:`select_opening_hours`,eq:`true`}},{label:`Api Url`,redrawOn:`data`,calculateValue:`if (data.calendarId) {
|
|
36
|
+
`+Error().stack),r=!1}return t.apply(this,arguments)},t)}var T={};function E(e,t){n.deprecationHandler!=null&&n.deprecationHandler(e,t),T[e]||(C(t),T[e]=!0)}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;function D(e){return typeof Function<`u`&&e instanceof Function||Object.prototype.toString.call(e)===`[object Function]`}function O(e){var t,n;for(n in e)o(e,n)&&(t=e[n],D(t)?this[n]=t:this[`_`+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+`|\\d{1,2}`)}function k(e,t){var n=f({},e),r;for(r in t)o(t,r)&&(a(e[r])&&a(t[r])?(n[r]={},f(n[r],e[r]),f(n[r],t[r])):t[r]==null?delete n[r]:n[r]=t[r]);for(r in e)o(e,r)&&!o(t,r)&&a(e[r])&&(n[r]=f({},n[r]));return n}function A(e){e!=null&&this.set(e)}var j=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)o(e,t)&&n.push(t);return n},M={sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`};function te(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return D(r)?r.call(t,n):r}function N(e,t,n){var r=``+Math.abs(e),i=t-r.length;return(e>=0?n?`+`:``:`-`)+(10**Math.max(0,i)).toString().substr(1)+r}var P=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},L={};function R(e,t,n,r){var i=r;typeof r==`string`&&(i=function(){return this[r]()}),e&&(L[e]=i),t&&(L[t[0]]=function(){return N(i.apply(this,arguments),t[1],t[2])}),n&&(L[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function ne(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,``):e.replace(/\\/g,``)}function re(e){var t=e.match(P),n,r;for(n=0,r=t.length;n<r;n++)L[t[n]]?t[n]=L[t[n]]:t[n]=ne(t[n]);return function(n){var i=``,a;for(a=0;a<r;a++)i+=D(t[a])?t[a].call(n,e):t[a];return i}}function z(e,t){return e.isValid()?(t=ie(t,e.localeData()),I[t]=I[t]||re(t),I[t](e)):e.localeData().invalidDate()}function ie(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(F.lastIndex=0;n>=0&&F.test(e);)e=e.replace(F,r),F.lastIndex=0,--n;return e}var ae={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};function oe(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(P).map(function(e){return e===`MMMM`||e===`MM`||e===`DD`||e===`dddd`?e.slice(1):e}).join(``),this._longDateFormat[e])}var se=`Invalid date`;function ce(){return this._invalidDate}var le=`%d`,ue=/\d{1,2}/;function de(e){return this._ordinal.replace(`%d`,e)}var fe={future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,w:`a week`,ww:`%d weeks`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function pe(e,t,n,r){var i=this._relativeTime[n];return D(i)?i(e,t,n,r):i.replace(/%d/i,e)}function me(e,t){var n=this._relativeTime[e>0?`future`:`past`];return D(n)?n(t):n.replace(/%s/i,t)}var he={D:`date`,dates:`date`,date:`date`,d:`day`,days:`day`,day:`day`,e:`weekday`,weekdays:`weekday`,weekday:`weekday`,E:`isoWeekday`,isoweekdays:`isoWeekday`,isoweekday:`isoWeekday`,DDD:`dayOfYear`,dayofyears:`dayOfYear`,dayofyear:`dayOfYear`,h:`hour`,hours:`hour`,hour:`hour`,ms:`millisecond`,milliseconds:`millisecond`,millisecond:`millisecond`,m:`minute`,minutes:`minute`,minute:`minute`,M:`month`,months:`month`,month:`month`,Q:`quarter`,quarters:`quarter`,quarter:`quarter`,s:`second`,seconds:`second`,second:`second`,gg:`weekYear`,weekyears:`weekYear`,weekyear:`weekYear`,GG:`isoWeekYear`,isoweekyears:`isoWeekYear`,isoweekyear:`isoWeekYear`,w:`week`,weeks:`week`,week:`week`,W:`isoWeek`,isoweeks:`isoWeek`,isoweek:`isoWeek`,y:`year`,years:`year`,year:`year`};function B(e){return typeof e==`string`?he[e]||he[e.toLowerCase()]:void 0}function ge(e){var t={},n,r;for(r in e)o(e,r)&&(n=B(r),n&&(t[n]=e[r]));return t}var _e={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ve(e){var t=[],n;for(n in e)o(e,n)&&t.push({unit:n,priority:_e[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}var ye=/\d/,V=/\d\d/,be=/\d{3}/,xe=/\d{4}/,Se=/[+-]?\d{6}/,H=/\d\d?/,Ce=/\d\d\d\d?/,we=/\d\d\d\d\d\d?/,Te=/\d{1,3}/,Ee=/\d{1,4}/,De=/[+-]?\d{1,6}/,Oe=/\d+/,ke=/[+-]?\d+/,Ae=/Z|[+-]\d\d:?\d\d/gi,je=/Z|[+-]\d\d(?::?\d\d)?/gi,Me=/[+-]?\d+(\.\d{1,3})?/,Ne=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Pe=/^[1-9]\d?/,Fe=/^([1-9]\d|\d)/,Ie={};function U(e,t,n){Ie[e]=D(t)?t:function(e,r){return e&&n?n:t}}function Le(e,t){return o(Ie,e)?Ie[e](t._strict,t._locale):new RegExp(Re(e))}function Re(e){return ze(e.replace(`\\`,``).replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i}))}function ze(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)}function Be(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function W(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=Be(t)),n}var Ve={};function G(e,t){var n,r=t,i;for(typeof e==`string`&&(e=[e]),l(t)&&(r=function(e,n){n[t]=W(e)}),i=e.length,n=0;n<i;n++)Ve[e[n]]=r}function He(e,t){G(e,function(e,n,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function Ue(e,t,n){t!=null&&o(Ve,e)&&Ve[e](t,n._a,n,e)}function We(e){return e%4==0&&e%100!=0||e%400==0}var K=0,Ge=1,Ke=2,q=3,qe=4,Je=5,Ye=6,Xe=7,Ze=8;R(`Y`,0,0,function(){var e=this.year();return e<=9999?N(e,4):`+`+e}),R(0,[`YY`,2],0,function(){return this.year()%100}),R(0,[`YYYY`,4],0,`year`),R(0,[`YYYYY`,5],0,`year`),R(0,[`YYYYYY`,6,!0],0,`year`),U(`Y`,ke),U(`YY`,H,V),U(`YYYY`,Ee,xe),U(`YYYYY`,De,Se),U(`YYYYYY`,De,Se),G([`YYYYY`,`YYYYYY`],K),G(`YYYY`,function(e,t){t[K]=e.length===2?n.parseTwoDigitYear(e):W(e)}),G(`YY`,function(e,t){t[K]=n.parseTwoDigitYear(e)}),G(`Y`,function(e,t){t[K]=parseInt(e,10)});function Qe(e){return We(e)?366:365}n.parseTwoDigitYear=function(e){return W(e)+(W(e)>68?1900:2e3)};var $e=tt(`FullYear`,!0);function et(){return We(this.year())}function tt(e,t){return function(r){return r==null?nt(this,e):(rt(this,e,r),n.updateOffset(this,t),this)}}function nt(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case`Milliseconds`:return r?n.getUTCMilliseconds():n.getMilliseconds();case`Seconds`:return r?n.getUTCSeconds():n.getSeconds();case`Minutes`:return r?n.getUTCMinutes():n.getMinutes();case`Hours`:return r?n.getUTCHours():n.getHours();case`Date`:return r?n.getUTCDate():n.getDate();case`Day`:return r?n.getUTCDay():n.getDay();case`Month`:return r?n.getUTCMonth():n.getMonth();case`FullYear`:return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function rt(e,t,n){var r,i,a,o,s;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case`Milliseconds`:i?r.setUTCMilliseconds(n):r.setMilliseconds(n);return;case`Seconds`:i?r.setUTCSeconds(n):r.setSeconds(n);return;case`Minutes`:i?r.setUTCMinutes(n):r.setMinutes(n);return;case`Hours`:i?r.setUTCHours(n):r.setHours(n);return;case`Date`:i?r.setUTCDate(n):r.setDate(n);return;case`FullYear`:break;default:return}a=n,o=e.month(),s=e.date(),s=s===29&&o===1&&!We(a)?28:s,i?r.setUTCFullYear(a,o,s):r.setFullYear(a,o,s)}}function it(e){return e=B(e),D(this[e])?this[e]():this}function at(e,t){if(typeof e==`object`){e=ge(e);var n=ve(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=B(e),D(this[e]))return this[e](t);return this}function ot(e,t){return(e%t+t)%t}var J=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function st(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ot(t,12);return e+=(t-n)/12,n===1?We(e)?29:28:31-n%7%2}R(`M`,[`MM`,2],`Mo`,function(){return this.month()+1}),R(`MMM`,0,0,function(e){return this.localeData().monthsShort(this,e)}),R(`MMMM`,0,0,function(e){return this.localeData().months(this,e)}),U(`M`,H,Pe),U(`MM`,H,V),U(`MMM`,function(e,t){return t.monthsShortRegex(e)}),U(`MMMM`,function(e,t){return t.monthsRegex(e)}),G([`M`,`MM`],function(e,t){t[Ge]=W(e)-1}),G([`MMM`,`MMMM`],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i==null?h(n).invalidMonth=e:t[Ge]=i});var ct=`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),lt=`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),ut=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,dt=Ne,ft=Ne;function pt(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ut).test(t)?`format`:`standalone`][e.month()]:i(this._months)?this._months:this._months.standalone}function mt(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ut.test(t)?`format`:`standalone`][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ht(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,``).toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,``).toLocaleLowerCase();return n?t===`MMM`?(i=J.call(this._shortMonthsParse,o),i===-1?null:i):(i=J.call(this._longMonthsParse,o),i===-1?null:i):t===`MMM`?(i=J.call(this._shortMonthsParse,o),i===-1?(i=J.call(this._longMonthsParse,o),i===-1?null:i):i):(i=J.call(this._longMonthsParse,o),i===-1?(i=J.call(this._shortMonthsParse,o),i===-1?null:i):i)}function gt(e,t,n){var r,i,a;if(this._monthsParseExact)return ht.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++)if(i=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=RegExp(`^`+this.months(i,``).replace(`.`,``)+`$`,`i`),this._shortMonthsParse[r]=RegExp(`^`+this.monthsShort(i,``).replace(`.`,``)+`$`,`i`)),!n&&!this._monthsParse[r]&&(a=`^`+this.months(i,``)+`|^`+this.monthsShort(i,``),this._monthsParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`MMMM`&&this._longMonthsParse[r].test(e)||n&&t===`MMM`&&this._shortMonthsParse[r].test(e)||!n&&this._monthsParse[r].test(e))return r}function _t(e,t){if(!e.isValid())return e;if(typeof t==`string`){if(/^\d+$/.test(t))t=W(t);else if(t=e.localeData().monthsParse(t),!l(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,st(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function vt(e){return e==null?nt(this,`Month`):(_t(this,e),n.updateOffset(this,!0),this)}function yt(){return st(this.year(),this.month())}function bt(e){return this._monthsParseExact?(o(this,`_monthsRegex`)||St.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,`_monthsShortRegex`)||(this._monthsShortRegex=dt),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function xt(e){return this._monthsParseExact?(o(this,`_monthsRegex`)||St.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,`_monthsRegex`)||(this._monthsRegex=ft),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function St(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i,a,o,s;for(i=0;i<12;i++)a=p([2e3,i]),o=ze(this.monthsShort(a,``)),s=ze(this.months(a,``)),t.push(o),n.push(s),r.push(s),r.push(o);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._monthsShortStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function Ct(e,t,n,r,i,a,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,a,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,a,o),s}function wt(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Tt(e,t,n){var r=7+t-n;return-((7+wt(e,0,r).getUTCDay()-t)%7)+r-1}function Et(e,t,n,r,i){var a=(7+n-r)%7,o=Tt(e,r,i),s=1+7*(t-1)+a+o,c,l;return s<=0?(c=e-1,l=Qe(c)+s):s>Qe(e)?(c=e+1,l=s-Qe(e)):(c=e,l=s),{year:c,dayOfYear:l}}function Dt(e,t,n){var r=Tt(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,o;return i<1?(o=e.year()-1,a=i+Ot(o,t,n)):i>Ot(e.year(),t,n)?(a=i-Ot(e.year(),t,n),o=e.year()+1):(o=e.year(),a=i),{week:a,year:o}}function Ot(e,t,n){var r=Tt(e,t,n),i=Tt(e+1,t,n);return(Qe(e)-r+i)/7}R(`w`,[`ww`,2],`wo`,`week`),R(`W`,[`WW`,2],`Wo`,`isoWeek`),U(`w`,H,Pe),U(`ww`,H,V),U(`W`,H,Pe),U(`WW`,H,V),He([`w`,`ww`,`W`,`WW`],function(e,t,n,r){t[r.substr(0,1)]=W(e)});function kt(e){return Dt(e,this._week.dow,this._week.doy).week}var At={dow:0,doy:6};function jt(){return this._week.dow}function Mt(){return this._week.doy}function Nt(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,`d`)}function Pt(e){var t=Dt(this,1,4).week;return e==null?t:this.add((e-t)*7,`d`)}R(`d`,0,`do`,`day`),R(`dd`,0,0,function(e){return this.localeData().weekdaysMin(this,e)}),R(`ddd`,0,0,function(e){return this.localeData().weekdaysShort(this,e)}),R(`dddd`,0,0,function(e){return this.localeData().weekdays(this,e)}),R(`e`,0,0,`weekday`),R(`E`,0,0,`isoWeekday`),U(`d`,H),U(`e`,H),U(`E`,H),U(`dd`,function(e,t){return t.weekdaysMinRegex(e)}),U(`ddd`,function(e,t){return t.weekdaysShortRegex(e)}),U(`dddd`,function(e,t){return t.weekdaysRegex(e)}),He([`dd`,`ddd`,`dddd`],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i==null?h(n).invalidWeekday=e:t.d=i}),He([`d`,`e`,`E`],function(e,t,n,r){t[r]=W(e)});function Ft(e,t){return typeof e==`string`?isNaN(e)?(e=t.weekdaysParse(e),typeof e==`number`?e:null):parseInt(e,10):e}function It(e,t){return typeof e==`string`?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Lt(e,t){return e.slice(t,7).concat(e.slice(0,t))}var Rt=`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),zt=`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),Bt=`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),Vt=Ne,Ht=Ne,Ut=Ne;function Wt(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?`format`:`standalone`];return e===!0?Lt(n,this._week.dow):e?n[e.day()]:n}function Gt(e){return e===!0?Lt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Kt(e){return e===!0?Lt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function qt(e,t,n){var r,i,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,``).toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,``).toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,``).toLocaleLowerCase();return n?t===`dddd`?(i=J.call(this._weekdaysParse,o),i===-1?null:i):t===`ddd`?(i=J.call(this._shortWeekdaysParse,o),i===-1?null:i):(i=J.call(this._minWeekdaysParse,o),i===-1?null:i):t===`dddd`?(i=J.call(this._weekdaysParse,o),i!==-1||(i=J.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=J.call(this._minWeekdaysParse,o),i===-1?null:i)):t===`ddd`?(i=J.call(this._shortWeekdaysParse,o),i!==-1||(i=J.call(this._weekdaysParse,o),i!==-1)?i:(i=J.call(this._minWeekdaysParse,o),i===-1?null:i)):(i=J.call(this._minWeekdaysParse,o),i!==-1||(i=J.call(this._weekdaysParse,o),i!==-1)?i:(i=J.call(this._shortWeekdaysParse,o),i===-1?null:i))}function Jt(e,t,n){var r,i,a;if(this._weekdaysParseExact)return qt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++)if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=RegExp(`^`+this.weekdays(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._shortWeekdaysParse[r]=RegExp(`^`+this.weekdaysShort(i,``).replace(`.`,`\\.?`)+`$`,`i`),this._minWeekdaysParse[r]=RegExp(`^`+this.weekdaysMin(i,``).replace(`.`,`\\.?`)+`$`,`i`)),this._weekdaysParse[r]||(a=`^`+this.weekdays(i,``)+`|^`+this.weekdaysShort(i,``)+`|^`+this.weekdaysMin(i,``),this._weekdaysParse[r]=new RegExp(a.replace(`.`,``),`i`)),n&&t===`dddd`&&this._fullWeekdaysParse[r].test(e)||n&&t===`ddd`&&this._shortWeekdaysParse[r].test(e)||n&&t===`dd`&&this._minWeekdaysParse[r].test(e)||!n&&this._weekdaysParse[r].test(e))return r}function Yt(e){if(!this.isValid())return e==null?NaN:this;var t=nt(this,`Day`);return e==null?t:(e=Ft(e,this.localeData()),this.add(e-t,`d`))}function Xt(e){if(!this.isValid())return e==null?NaN:this;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,`d`)}function Zt(e){if(!this.isValid())return e==null?NaN:this;if(e!=null){var t=It(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function Qt(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,`_weekdaysRegex`)||(this._weekdaysRegex=Vt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function $t(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,`_weekdaysShortRegex`)||(this._weekdaysShortRegex=Ht),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function en(e){return this._weekdaysParseExact?(o(this,`_weekdaysRegex`)||tn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,`_weekdaysMinRegex`)||(this._weekdaysMinRegex=Ut),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function tn(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i=[],a,o,s,c,l;for(a=0;a<7;a++)o=p([2e3,1]).day(a),s=ze(this.weekdaysMin(o,``)),c=ze(this.weekdaysShort(o,``)),l=ze(this.weekdays(o,``)),t.push(s),n.push(c),r.push(l),i.push(s),i.push(c),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=RegExp(`^(`+i.join(`|`)+`)`,`i`),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._weekdaysShortStrictRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`),this._weekdaysMinStrictRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`)}function nn(){return this.hours()%12||12}function rn(){return this.hours()||24}R(`H`,[`HH`,2],0,`hour`),R(`h`,[`hh`,2],0,nn),R(`k`,[`kk`,2],0,rn),R(`hmm`,0,0,function(){return``+nn.apply(this)+N(this.minutes(),2)}),R(`hmmss`,0,0,function(){return``+nn.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)}),R(`Hmm`,0,0,function(){return``+this.hours()+N(this.minutes(),2)}),R(`Hmmss`,0,0,function(){return``+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)});function an(e,t){R(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}an(`a`,!0),an(`A`,!1);function on(e,t){return t._meridiemParse}U(`a`,on),U(`A`,on),U(`H`,H,Fe),U(`h`,H,Pe),U(`k`,H,Pe),U(`HH`,H,V),U(`hh`,H,V),U(`kk`,H,V),U(`hmm`,Ce),U(`hmmss`,we),U(`Hmm`,Ce),U(`Hmmss`,we),G([`H`,`HH`],q),G([`k`,`kk`],function(e,t,n){var r=W(e);t[q]=r===24?0:r}),G([`a`,`A`],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),G([`h`,`hh`],function(e,t,n){t[q]=W(e),h(n).bigHour=!0}),G(`hmm`,function(e,t,n){var r=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r)),h(n).bigHour=!0}),G(`hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r,2)),t[Je]=W(e.substr(i)),h(n).bigHour=!0}),G(`Hmm`,function(e,t,n){var r=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r))}),G(`Hmmss`,function(e,t,n){var r=e.length-4,i=e.length-2;t[q]=W(e.substr(0,r)),t[qe]=W(e.substr(r,2)),t[Je]=W(e.substr(i))});function sn(e){return(e+``).toLowerCase().charAt(0)===`p`}var cn=/[ap]\.?m?\.?/i,ln=tt(`Hours`,!0);function un(e,t,n){return e>11?n?`pm`:`PM`:n?`am`:`AM`}var dn={calendar:M,longDateFormat:ae,invalidDate:se,ordinal:le,dayOfMonthOrdinalParse:ue,relativeTime:fe,months:ct,monthsShort:lt,week:At,weekdays:Rt,weekdaysMin:Bt,weekdaysShort:zt,meridiemParse:cn},Y={},fn={},pn;function mn(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function hn(e){return e&&e.toLowerCase().replace(`_`,`-`)}function gn(e){for(var t=0,n,r,i,a;t<e.length;){for(a=hn(e[t]).split(`-`),n=a.length,r=hn(e[t+1]),r=r?r.split(`-`):null;n>0;){if(i=vn(a.slice(0,n).join(`-`)),i)return i;if(r&&r.length>=n&&mn(a,r)>=n-1)break;n--}t++}return pn}function _n(e){return!!(e&&e.match(`^[^/\\\\]*$`))}function vn(e){var n=null,r;if(Y[e]===void 0&&t!==void 0&&t&&t.exports&&_n(e))try{n=pn._abbr,r=require,r(`./locale/`+e),yn(n)}catch{Y[e]=null}return Y[e]}function yn(e,t){var n;return e&&(n=c(t)?Sn(e):bn(e,t),n?pn=n:typeof console<`u`&&console.warn&&console.warn(`Locale `+e+` not found. Did you forget to load it?`)),pn._abbr}function bn(e,t){if(t!==null){var n,r=dn;if(t.abbr=e,Y[e]!=null)E(`defineLocaleOverride`,`use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.`),r=Y[e]._config;else if(t.parentLocale!=null)if(Y[t.parentLocale]!=null)r=Y[t.parentLocale]._config;else if(n=vn(t.parentLocale),n!=null)r=n._config;else return fn[t.parentLocale]||(fn[t.parentLocale]=[]),fn[t.parentLocale].push({name:e,config:t}),null;return Y[e]=new A(k(r,t)),fn[e]&&fn[e].forEach(function(e){bn(e.name,e.config)}),yn(e),Y[e]}else return delete Y[e],null}function xn(e,t){if(t!=null){var n,r,i=dn;Y[e]!=null&&Y[e].parentLocale!=null?Y[e].set(k(Y[e]._config,t)):(r=vn(e),r!=null&&(i=r._config),t=k(i,t),r??(t.abbr=e),n=new A(t),n.parentLocale=Y[e],Y[e]=n),yn(e)}else Y[e]!=null&&(Y[e].parentLocale==null?Y[e]!=null&&delete Y[e]:(Y[e]=Y[e].parentLocale,e===yn()&&yn(e)));return Y[e]}function Sn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return pn;if(!i(e)){if(t=vn(e),t)return t;e=[e]}return gn(e)}function Cn(){return j(Y)}function wn(e){var t,n=e._a;return n&&h(e).overflow===-2&&(t=n[Ge]<0||n[Ge]>11?Ge:n[Ke]<1||n[Ke]>st(n[K],n[Ge])?Ke:n[q]<0||n[q]>24||n[q]===24&&(n[qe]!==0||n[Je]!==0||n[Ye]!==0)?q:n[qe]<0||n[qe]>59?qe:n[Je]<0||n[Je]>59?Je:n[Ye]<0||n[Ye]>999?Ye:-1,h(e)._overflowDayOfYear&&(t<K||t>Ke)&&(t=Ke),h(e)._overflowWeeks&&t===-1&&(t=Xe),h(e)._overflowWeekday&&t===-1&&(t=Ze),h(e).overflow=t),e}var Tn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,En=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Dn=/Z|[+-]\d\d(?::?\d\d)?/,On=[[`YYYYYY-MM-DD`,/[+-]\d{6}-\d\d-\d\d/],[`YYYY-MM-DD`,/\d{4}-\d\d-\d\d/],[`GGGG-[W]WW-E`,/\d{4}-W\d\d-\d/],[`GGGG-[W]WW`,/\d{4}-W\d\d/,!1],[`YYYY-DDD`,/\d{4}-\d{3}/],[`YYYY-MM`,/\d{4}-\d\d/,!1],[`YYYYYYMMDD`,/[+-]\d{10}/],[`YYYYMMDD`,/\d{8}/],[`GGGG[W]WWE`,/\d{4}W\d{3}/],[`GGGG[W]WW`,/\d{4}W\d{2}/,!1],[`YYYYDDD`,/\d{7}/],[`YYYYMM`,/\d{6}/,!1],[`YYYY`,/\d{4}/,!1]],kn=[[`HH:mm:ss.SSSS`,/\d\d:\d\d:\d\d\.\d+/],[`HH:mm:ss,SSSS`,/\d\d:\d\d:\d\d,\d+/],[`HH:mm:ss`,/\d\d:\d\d:\d\d/],[`HH:mm`,/\d\d:\d\d/],[`HHmmss.SSSS`,/\d\d\d\d\d\d\.\d+/],[`HHmmss,SSSS`,/\d\d\d\d\d\d,\d+/],[`HHmmss`,/\d\d\d\d\d\d/],[`HHmm`,/\d\d\d\d/],[`HH`,/\d\d/]],An=/^\/?Date\((-?\d+)/i,jn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Mn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Nn(e){var t,n,r=e._i,i=Tn.exec(r)||En.exec(r),a,o,s,c,l=On.length,u=kn.length;if(i){for(h(e).iso=!0,t=0,n=l;t<n;t++)if(On[t][1].exec(i[1])){o=On[t][0],a=On[t][2]!==!1;break}if(o==null){e._isValid=!1;return}if(i[3]){for(t=0,n=u;t<n;t++)if(kn[t][1].exec(i[3])){s=(i[2]||` `)+kn[t][0];break}if(s==null){e._isValid=!1;return}}if(!a&&s!=null){e._isValid=!1;return}if(i[4])if(Dn.exec(i[4]))c=`Z`;else{e._isValid=!1;return}e._f=o+(s||``)+(c||``),Gn(e)}else e._isValid=!1}function Pn(e,t,n,r,i,a){var o=[Fn(e),lt.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&o.push(parseInt(a,10)),o}function Fn(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function In(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).replace(/^\s\s*/,``).replace(/\s\s*$/,``)}function Ln(e,t,n){return e&&zt.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay()?(h(n).weekdayMismatch=!0,n._isValid=!1,!1):!0}function Rn(e,t,n){if(e)return Mn[e];if(t)return 0;var r=parseInt(n,10),i=r%100;return(r-i)/100*60+i}function zn(e){var t=jn.exec(In(e._i)),n;if(t){if(n=Pn(t[4],t[3],t[2],t[5],t[6],t[7]),!Ln(t[1],n,e))return;e._a=n,e._tzm=Rn(t[8],t[9],t[10]),e._d=wt.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function Bn(e){var t=An.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Nn(e),e._isValid===!1)delete e._isValid;else return;if(zn(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:n.createFromInputFallback(e)}n.createFromInputFallback=w(`value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.`,function(e){e._d=new Date(e._i+(e._useUTC?` UTC`:``))});function Vn(e,t,n){return e??t??n}function Hn(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Un(e){var t,n,r=[],i,a,o;if(!e._d){for(i=Hn(e),e._w&&e._a[Ke]==null&&e._a[Ge]==null&&Wn(e),e._dayOfYear!=null&&(o=Vn(e._a[K],i[K]),(e._dayOfYear>Qe(o)||e._dayOfYear===0)&&(h(e)._overflowDayOfYear=!0),n=wt(o,0,e._dayOfYear),e._a[Ge]=n.getUTCMonth(),e._a[Ke]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[q]===24&&e._a[qe]===0&&e._a[Je]===0&&e._a[Ye]===0&&(e._nextDay=!0,e._a[q]=0),e._d=(e._useUTC?wt:Ct).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[q]=24),e._w&&e._w.d!==void 0&&e._w.d!==a&&(h(e).weekdayMismatch=!0)}}function Wn(e){var t=e._w,n,r,i,a,o,s,c,l;t.GG!=null||t.W!=null||t.E!=null?(a=1,o=4,n=Vn(t.GG,e._a[K],Dt(X(),1,4).year),r=Vn(t.W,1),i=Vn(t.E,1),(i<1||i>7)&&(c=!0)):(a=e._locale._week.dow,o=e._locale._week.doy,l=Dt(X(),a,o),n=Vn(t.gg,e._a[K],l.year),r=Vn(t.w,l.week),t.d==null?t.e==null?i=a:(i=t.e+a,(t.e<0||t.e>6)&&(c=!0)):(i=t.d,(i<0||i>6)&&(c=!0))),r<1||r>Ot(n,a,o)?h(e)._overflowWeeks=!0:c==null?(s=Et(n,r,i,a,o),e._a[K]=s.year,e._dayOfYear=s.dayOfYear):h(e)._overflowWeekday=!0}n.ISO_8601=function(){},n.RFC_2822=function(){};function Gn(e){if(e._f===n.ISO_8601){Nn(e);return}if(e._f===n.RFC_2822){zn(e);return}e._a=[],h(e).empty=!0;var t=``+e._i,r,i,a,o,s,c=t.length,l=0,u,d;for(a=ie(e._f,e._locale).match(P)||[],d=a.length,r=0;r<d;r++)o=a[r],i=(t.match(Le(o,e))||[])[0],i&&(s=t.substr(0,t.indexOf(i)),s.length>0&&h(e).unusedInput.push(s),t=t.slice(t.indexOf(i)+i.length),l+=i.length),L[o]?(i?h(e).empty=!1:h(e).unusedTokens.push(o),Ue(o,i,e)):e._strict&&!i&&h(e).unusedTokens.push(o);h(e).charsLeftOver=c-l,t.length>0&&h(e).unusedInput.push(t),e._a[q]<=12&&h(e).bigHour===!0&&e._a[q]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[q]=Kn(e._locale,e._a[q],e._meridiem),u=h(e).era,u!==null&&(e._a[K]=e._locale.erasConvertYear(u,e._a[K])),Un(e),wn(e)}function Kn(e,t,n){var r;return n==null?t:e.meridiemHour==null?e.isPM==null?t:(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0),t):e.meridiemHour(t,n)}function qn(e){var t,n,r,i,a,o,s=!1,c=e._f.length;if(c===0){h(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<c;i++)a=0,o=!1,t=b({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Gn(t),g(t)&&(o=!0),a+=h(t).charsLeftOver,a+=h(t).unusedTokens.length*10,h(t).score=a,s?a<r&&(r=a,n=t):(r==null||a<r||o)&&(r=a,n=t,o&&(s=!0));f(e,n||t)}function Jn(e){if(!e._d){var t=ge(e._i),n=t.day===void 0?t.date:t.day;e._a=d([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Un(e)}}function Yn(e){var t=new x(wn(Xn(e)));return t._nextDay&&=(t.add(1,`d`),void 0),t}function Xn(e){var t=e._i,n=e._f;return e._locale=e._locale||Sn(e._l),t===null||n===void 0&&t===``?_({nullInput:!0}):(typeof t==`string`&&(e._i=t=e._locale.preparse(t)),S(t)?new x(wn(t)):(u(t)?e._d=t:i(n)?qn(e):n?Gn(e):Zn(e),g(e)||(e._d=null),e))}function Zn(e){var t=e._i;c(t)?e._d=new Date(n.now()):u(t)?e._d=new Date(t.valueOf()):typeof t==`string`?Bn(e):i(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),Un(e)):a(t)?Jn(e):l(t)?e._d=new Date(t):n.createFromInputFallback(e)}function Qn(e,t,n,r,o){var c={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(a(e)&&s(e)||i(e)&&e.length===0)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=o,c._l=n,c._i=e,c._f=t,c._strict=r,Yn(c)}function X(e,t,n,r){return Qn(e,t,n,r,!1)}var $n=w(`moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=X.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:_()}),er=w(`moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/`,function(){var e=X.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:_()});function tr(e,t){var n,r;if(t.length===1&&i(t[0])&&(t=t[0]),!t.length)return X();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function nr(){return tr(`isBefore`,[].slice.call(arguments,0))}function rr(){return tr(`isAfter`,[].slice.call(arguments,0))}var ir=function(){return Date.now?Date.now():+new Date},ar=[`year`,`quarter`,`month`,`week`,`day`,`hour`,`minute`,`second`,`millisecond`];function or(e){var t,n=!1,r,i=ar.length;for(t in e)if(o(e,t)&&!(J.call(ar,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[ar[r]]){if(n)return!1;parseFloat(e[ar[r]])!==W(e[ar[r]])&&(n=!0)}return!0}function sr(){return this._isValid}function cr(){return jr(NaN)}function lr(e){var t=ge(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,o=t.day||0,s=t.hour||0,c=t.minute||0,l=t.second||0,u=t.millisecond||0;this._isValid=or(t),this._milliseconds=+u+l*1e3+c*6e4+s*1e3*60*60,this._days=+o+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=Sn(),this._bubble()}function ur(e){return e instanceof lr}function dr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function fr(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,o;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&W(e[o])!==W(t[o]))&&a++;return a+i}function pr(e,t){R(e,0,0,function(){var e=this.utcOffset(),n=`+`;return e<0&&(e=-e,n=`-`),n+N(~~(e/60),2)+t+N(~~e%60,2)})}pr(`Z`,`:`),pr(`ZZ`,``),U(`Z`,je),U(`ZZ`,je),G([`Z`,`ZZ`],function(e,t,n){n._useUTC=!0,n._tzm=hr(je,e)});var mr=/([\+\-]|\d\d)/gi;function hr(e,t){var n=(t||``).match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+``).match(mr)||[`-`,0,0],a=+(i[1]*60)+W(i[2]),a===0?0:i[0]===`+`?a:-a)}function gr(e,t){var r,i;return t._isUTC?(r=t.clone(),i=(S(e)||u(e)?e.valueOf():X(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+i),n.updateOffset(r,!1),r):X(e).local()}function _r(e){return-Math.round(e._d.getTimezoneOffset())}n.updateOffset=function(){};function vr(e,t,r){var i=this._offset||0,a;if(!this.isValid())return e==null?NaN:this;if(e!=null){if(typeof e==`string`){if(e=hr(je,e),e===null)return this}else Math.abs(e)<16&&!r&&(e*=60);return!this._isUTC&&t&&(a=_r(this)),this._offset=e,this._isUTC=!0,a!=null&&this.add(a,`m`),i!==e&&(!t||this._changeInProgress?Ir(this,jr(e-i,`m`),1,!1):this._changeInProgress||=(this._changeInProgress=!0,n.updateOffset(this,!0),null)),this}else return this._isUTC?i:_r(this)}function yr(e,t){return e==null?-this.utcOffset():(typeof e!=`string`&&(e=-e),this.utcOffset(e,t),this)}function br(e){return this.utcOffset(0,e)}function xr(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(_r(this),`m`)),this}function Sr(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i==`string`){var e=hr(Ae,this._i);e==null?this.utcOffset(0,!0):this.utcOffset(e)}return this}function Cr(e){return this.isValid()?(e=e?X(e).utcOffset():0,(this.utcOffset()-e)%60==0):!1}function wr(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Tr(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e={},t;return b(e,this),e=Xn(e),e._a?(t=e._isUTC?p(e._a):X(e._a),this._isDSTShifted=this.isValid()&&fr(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Er(){return this.isValid()?!this._isUTC:!1}function Dr(){return this.isValid()?this._isUTC:!1}function Or(){return this.isValid()?this._isUTC&&this._offset===0:!1}var kr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ar=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jr(e,t){var n=e,r=null,i,a,s;return ur(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=kr.exec(e))?(i=r[1]===`-`?-1:1,n={y:0,d:W(r[Ke])*i,h:W(r[q])*i,m:W(r[qe])*i,s:W(r[Je])*i,ms:W(dr(r[Ye]*1e3))*i}):(r=Ar.exec(e))?(i=r[1]===`-`?-1:1,n={y:Mr(r[2],i),M:Mr(r[3],i),w:Mr(r[4],i),d:Mr(r[5],i),h:Mr(r[6],i),m:Mr(r[7],i),s:Mr(r[8],i)}):n==null?n={}:typeof n==`object`&&(`from`in n||`to`in n)&&(s=Pr(X(n.from),X(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),a=new lr(n),ur(e)&&o(e,`_locale`)&&(a._locale=e._locale),ur(e)&&o(e,`_isValid`)&&(a._isValid=e._isValid),a}jr.fn=lr.prototype,jr.invalid=cr;function Mr(e,t){var n=e&&parseFloat(e.replace(`,`,`.`));return(isNaN(n)?0:n)*t}function Nr(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,`M`).isAfter(t)&&--n.months,n.milliseconds=t-+e.clone().add(n.months,`M`),n}function Pr(e,t){var n;return e.isValid()&&t.isValid()?(t=gr(t,e),e.isBefore(t)?n=Nr(e,t):(n=Nr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Fr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(E(t,`moment().`+t+`(period, number) is deprecated. Please use moment().`+t+`(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.`),a=n,n=r,r=a),i=jr(n,r),Ir(this,i,e),this}}function Ir(e,t,r,i){var a=t._milliseconds,o=dr(t._days),s=dr(t._months);e.isValid()&&(i??=!0,s&&_t(e,nt(e,`Month`)+s*r),o&&rt(e,`Date`,nt(e,`Date`)+o*r),a&&e._d.setTime(e._d.valueOf()+a*r),i&&n.updateOffset(e,o||s))}var Lr=Fr(1,`add`),Rr=Fr(-1,`subtract`);function zr(e){return typeof e==`string`||e instanceof String}function Br(e){return S(e)||u(e)||zr(e)||l(e)||Hr(e)||Vr(e)||e==null}function Vr(e){var t=a(e)&&!s(e),n=!1,r=[`years`,`year`,`y`,`months`,`month`,`M`,`days`,`day`,`d`,`dates`,`date`,`D`,`hours`,`hour`,`h`,`minutes`,`minute`,`m`,`seconds`,`second`,`s`,`milliseconds`,`millisecond`,`ms`],i,c,l=r.length;for(i=0;i<l;i+=1)c=r[i],n||=o(e,c);return t&&n}function Hr(e){var t=i(e),n=!1;return t&&(n=e.filter(function(t){return!l(t)&&zr(e)}).length===0),t&&n}function Ur(e){var t=a(e)&&!s(e),n=!1,r=[`sameDay`,`nextDay`,`lastDay`,`nextWeek`,`lastWeek`,`sameElse`],i,c;for(i=0;i<r.length;i+=1)c=r[i],n||=o(e,c);return t&&n}function Wr(e,t){var n=e.diff(t,`days`,!0);return n<-6?`sameElse`:n<-1?`lastWeek`:n<0?`lastDay`:n<1?`sameDay`:n<2?`nextDay`:n<7?`nextWeek`:`sameElse`}function Gr(e,t){arguments.length===1&&(arguments[0]?Br(arguments[0])?(e=arguments[0],t=void 0):Ur(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var r=e||X(),i=gr(r,this).startOf(`day`),a=n.calendarFormat(this,i)||`sameElse`,o=t&&(D(t[a])?t[a].call(this,r):t[a]);return this.format(o||this.localeData().calendar(a,this,X(r)))}function Kr(){return new x(this)}function qr(e,t){var n=S(e)?e:X(e);return this.isValid()&&n.isValid()?(t=B(t)||`millisecond`,t===`millisecond`?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Jr(e,t){var n=S(e)?e:X(e);return this.isValid()&&n.isValid()?(t=B(t)||`millisecond`,t===`millisecond`?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Yr(e,t,n,r){var i=S(e)?e:X(e),a=S(t)?t:X(t);return this.isValid()&&i.isValid()&&a.isValid()?(r||=`()`,(r[0]===`(`?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===`)`?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Xr(e,t){var n=S(e)?e:X(e),r;return this.isValid()&&n.isValid()?(t=B(t)||`millisecond`,t===`millisecond`?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Zr(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Qr(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function $r(e,t,n){var r,i,a;if(!this.isValid()||(r=gr(e,this),!r.isValid()))return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=B(t),t){case`year`:a=ei(this,r)/12;break;case`month`:a=ei(this,r);break;case`quarter`:a=ei(this,r)/3;break;case`second`:a=(this-r)/1e3;break;case`minute`:a=(this-r)/6e4;break;case`hour`:a=(this-r)/36e5;break;case`day`:a=(this-r-i)/864e5;break;case`week`:a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:Be(a)}function ei(e,t){if(e.date()<t.date())return-ei(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,`months`),i,a;return t-r<0?(i=e.clone().add(n-1,`months`),a=(t-r)/(r-i)):(i=e.clone().add(n+1,`months`),a=(t-r)/(i-r)),-(n+a)||0}n.defaultFormat=`YYYY-MM-DDTHH:mm:ssZ`,n.defaultFormatUtc=`YYYY-MM-DDTHH:mm:ss[Z]`;function ti(){return this.clone().locale(`en`).format(`ddd MMM DD YYYY HH:mm:ss [GMT]ZZ`)}function ni(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?z(n,t?`YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYYYY-MM-DD[T]HH:mm:ss.SSSZ`):D(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace(`Z`,z(n,`Z`)):z(n,t?`YYYY-MM-DD[T]HH:mm:ss.SSS[Z]`:`YYYY-MM-DD[T]HH:mm:ss.SSSZ`)}function ri(){if(!this.isValid())return`moment.invalid(/* `+this._i+` */)`;var e=`moment`,t=``,n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?`moment.utc`:`moment.parseZone`,t=`Z`),n=`[`+e+`("]`,r=0<=this.year()&&this.year()<=9999?`YYYY`:`YYYYYY`,i=`-MM-DD[T]HH:mm:ss.SSS`,a=t+`[")]`,this.format(n+r+i+a)}function ii(e){e||=this.isUtc()?n.defaultFormatUtc:n.defaultFormat;var t=z(this,e);return this.localeData().postformat(t)}function ai(e,t){return this.isValid()&&(S(e)&&e.isValid()||X(e).isValid())?jr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oi(e){return this.from(X(),e)}function si(e,t){return this.isValid()&&(S(e)&&e.isValid()||X(e).isValid())?jr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ci(e){return this.to(X(),e)}function li(e){var t;return e===void 0?this._locale._abbr:(t=Sn(e),t!=null&&(this._locale=t),this)}var ui=w(`moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.`,function(e){return e===void 0?this.localeData():this.locale(e)});function di(){return this._locale}var fi=1e3,pi=60*fi,mi=60*pi,hi=146097*24*mi;function gi(e,t){return(e%t+t)%t}function _i(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-hi:new Date(e,t,n).valueOf()}function vi(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hi:Date.UTC(e,t,n)}function yi(e){var t,r;if(e=B(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(r=this._isUTC?vi:_i,e){case`year`:t=r(this.year(),0,1);break;case`quarter`:t=r(this.year(),this.month()-this.month()%3,1);break;case`month`:t=r(this.year(),this.month(),1);break;case`week`:t=r(this.year(),this.month(),this.date()-this.weekday());break;case`isoWeek`:t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case`day`:case`date`:t=r(this.year(),this.month(),this.date());break;case`hour`:t=this._d.valueOf(),t-=gi(t+(this._isUTC?0:this.utcOffset()*pi),mi);break;case`minute`:t=this._d.valueOf(),t-=gi(t,pi);break;case`second`:t=this._d.valueOf(),t-=gi(t,fi);break}return this._d.setTime(t),n.updateOffset(this,!0),this}function bi(e){var t,r;if(e=B(e),e===void 0||e===`millisecond`||!this.isValid())return this;switch(r=this._isUTC?vi:_i,e){case`year`:t=r(this.year()+1,0,1)-1;break;case`quarter`:t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case`month`:t=r(this.year(),this.month()+1,1)-1;break;case`week`:t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case`isoWeek`:t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case`day`:case`date`:t=r(this.year(),this.month(),this.date()+1)-1;break;case`hour`:t=this._d.valueOf(),t+=mi-gi(t+(this._isUTC?0:this.utcOffset()*pi),mi)-1;break;case`minute`:t=this._d.valueOf(),t+=pi-gi(t,pi)-1;break;case`second`:t=this._d.valueOf(),t+=fi-gi(t,fi)-1;break}return this._d.setTime(t),n.updateOffset(this,!0),this}function xi(){return this._d.valueOf()-(this._offset||0)*6e4}function Si(){return Math.floor(this.valueOf()/1e3)}function Ci(){return new Date(this.valueOf())}function wi(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ti(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Ei(){return this.isValid()?this.toISOString():null}function Di(){return g(this)}function Oi(){return f({},h(this))}function ki(){return h(this).overflow}function Ai(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}R(`N`,0,0,`eraAbbr`),R(`NN`,0,0,`eraAbbr`),R(`NNN`,0,0,`eraAbbr`),R(`NNNN`,0,0,`eraName`),R(`NNNNN`,0,0,`eraNarrow`),R(`y`,[`y`,1],`yo`,`eraYear`),R(`y`,[`yy`,2],0,`eraYear`),R(`y`,[`yyy`,3],0,`eraYear`),R(`y`,[`yyyy`,4],0,`eraYear`),U(`N`,Vi),U(`NN`,Vi),U(`NNN`,Vi),U(`NNNN`,Hi),U(`NNNNN`,Ui),G([`N`,`NN`,`NNN`,`NNNN`,`NNNNN`],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?h(n).era=i:h(n).invalidEra=e}),U(`y`,Oe),U(`yy`,Oe),U(`yyy`,Oe),U(`yyyy`,Oe),U(`yo`,Wi),G([`y`,`yy`,`yyy`,`yyyy`],K),G([`yo`],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[K]=n._locale.eraYearOrdinalParse(e,i):t[K]=parseInt(e,10)});function ji(e,t){var r,i,a,o=this._eras||Sn(`en`)._eras;for(r=0,i=o.length;r<i;++r){switch(typeof o[r].since){case`string`:a=n(o[r].since).startOf(`day`),o[r].since=a.valueOf();break}switch(typeof o[r].until){case`undefined`:o[r].until=1/0;break;case`string`:a=n(o[r].until).startOf(`day`).valueOf(),o[r].until=a.valueOf();break}}return o}function Mi(e,t,n){var r,i,a=this.eras(),o,s,c;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(o=a[r].name.toUpperCase(),s=a[r].abbr.toUpperCase(),c=a[r].narrow.toUpperCase(),n)switch(t){case`N`:case`NN`:case`NNN`:if(s===e)return a[r];break;case`NNNN`:if(o===e)return a[r];break;case`NNNNN`:if(c===e)return a[r];break}else if([o,s,c].indexOf(e)>=0)return a[r]}function Ni(e,t){var r=e.since<=e.until?1:-1;return t===void 0?n(e.since).year():n(e.since).year()+(t-e.offset)*r}function Pi(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return``}function Fi(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return``}function Ii(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf(`day`).valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return``}function Li(){var e,t,r,i,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(r=a[e].since<=a[e].until?1:-1,i=this.clone().startOf(`day`).valueOf(),a[e].since<=i&&i<=a[e].until||a[e].until<=i&&i<=a[e].since)return(this.year()-n(a[e].since).year())*r+a[e].offset;return this.year()}function Ri(e){return o(this,`_erasNameRegex`)||Gi.call(this),e?this._erasNameRegex:this._erasRegex}function zi(e){return o(this,`_erasAbbrRegex`)||Gi.call(this),e?this._erasAbbrRegex:this._erasRegex}function Bi(e){return o(this,`_erasNarrowRegex`)||Gi.call(this),e?this._erasNarrowRegex:this._erasRegex}function Vi(e,t){return t.erasAbbrRegex(e)}function Hi(e,t){return t.erasNameRegex(e)}function Ui(e,t){return t.erasNarrowRegex(e)}function Wi(e,t){return t._eraYearOrdinalRegex||Oe}function Gi(){var e=[],t=[],n=[],r=[],i,a,o,s,c,l=this.eras();for(i=0,a=l.length;i<a;++i)o=ze(l[i].name),s=ze(l[i].abbr),c=ze(l[i].narrow),t.push(o),e.push(s),n.push(c),r.push(o),r.push(s),r.push(c);this._erasRegex=RegExp(`^(`+r.join(`|`)+`)`,`i`),this._erasNameRegex=RegExp(`^(`+t.join(`|`)+`)`,`i`),this._erasAbbrRegex=RegExp(`^(`+e.join(`|`)+`)`,`i`),this._erasNarrowRegex=RegExp(`^(`+n.join(`|`)+`)`,`i`)}R(0,[`gg`,2],0,function(){return this.weekYear()%100}),R(0,[`GG`,2],0,function(){return this.isoWeekYear()%100});function Ki(e,t){R(0,[e,e.length],0,t)}Ki(`gggg`,`weekYear`),Ki(`ggggg`,`weekYear`),Ki(`GGGG`,`isoWeekYear`),Ki(`GGGGG`,`isoWeekYear`),U(`G`,ke),U(`g`,ke),U(`GG`,H,V),U(`gg`,H,V),U(`GGGG`,Ee,xe),U(`gggg`,Ee,xe),U(`GGGGG`,De,Se),U(`ggggg`,De,Se),He([`gggg`,`ggggg`,`GGGG`,`GGGGG`],function(e,t,n,r){t[r.substr(0,2)]=W(e)}),He([`gg`,`GG`],function(e,t,r,i){t[i]=n.parseTwoDigitYear(e)});function qi(e){return $i.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Ji(e){return $i.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Yi(){return Ot(this.year(),1,4)}function Xi(){return Ot(this.isoWeekYear(),1,4)}function Zi(){var e=this.localeData()._week;return Ot(this.year(),e.dow,e.doy)}function Qi(){var e=this.localeData()._week;return Ot(this.weekYear(),e.dow,e.doy)}function $i(e,t,n,r,i){var a;return e==null?Dt(this,r,i).year:(a=Ot(e,r,i),t>a&&(t=a),ea.call(this,e,t,n,r,i))}function ea(e,t,n,r,i){var a=Et(e,t,n,r,i),o=wt(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}R(`Q`,0,`Qo`,`quarter`),U(`Q`,ye),G(`Q`,function(e,t){t[Ge]=(W(e)-1)*3});function ta(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}R(`D`,[`DD`,2],`Do`,`date`),U(`D`,H,Pe),U(`DD`,H,V),U(`Do`,function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),G([`D`,`DD`],Ke),G(`Do`,function(e,t){t[Ke]=W(e.match(H)[0])});var na=tt(`Date`,!0);R(`DDD`,[`DDDD`,3],`DDDo`,`dayOfYear`),U(`DDD`,Te),U(`DDDD`,be),G([`DDD`,`DDDD`],function(e,t,n){n._dayOfYear=W(e)});function ra(e){var t=Math.round((this.clone().startOf(`day`)-this.clone().startOf(`year`))/864e5)+1;return e==null?t:this.add(e-t,`d`)}R(`m`,[`mm`,2],0,`minute`),U(`m`,H,Fe),U(`mm`,H,V),G([`m`,`mm`],qe);var ia=tt(`Minutes`,!1);R(`s`,[`ss`,2],0,`second`),U(`s`,H,Fe),U(`ss`,H,V),G([`s`,`ss`],Je);var aa=tt(`Seconds`,!1);R(`S`,0,0,function(){return~~(this.millisecond()/100)}),R(0,[`SS`,2],0,function(){return~~(this.millisecond()/10)}),R(0,[`SSS`,3],0,`millisecond`),R(0,[`SSSS`,4],0,function(){return this.millisecond()*10}),R(0,[`SSSSS`,5],0,function(){return this.millisecond()*100}),R(0,[`SSSSSS`,6],0,function(){return this.millisecond()*1e3}),R(0,[`SSSSSSS`,7],0,function(){return this.millisecond()*1e4}),R(0,[`SSSSSSSS`,8],0,function(){return this.millisecond()*1e5}),R(0,[`SSSSSSSSS`,9],0,function(){return this.millisecond()*1e6}),U(`S`,Te,ye),U(`SS`,Te,V),U(`SSS`,Te,be);var oa,sa;for(oa=`SSSS`;oa.length<=9;oa+=`S`)U(oa,Oe);function ca(e,t){t[Ye]=W((`0.`+e)*1e3)}for(oa=`S`;oa.length<=9;oa+=`S`)G(oa,ca);sa=tt(`Milliseconds`,!1),R(`z`,0,0,`zoneAbbr`),R(`zz`,0,0,`zoneName`);function la(){return this._isUTC?`UTC`:``}function ua(){return this._isUTC?`Coordinated Universal Time`:``}var Z=x.prototype;Z.add=Lr,Z.calendar=Gr,Z.clone=Kr,Z.diff=$r,Z.endOf=bi,Z.format=ii,Z.from=ai,Z.fromNow=oi,Z.to=si,Z.toNow=ci,Z.get=it,Z.invalidAt=ki,Z.isAfter=qr,Z.isBefore=Jr,Z.isBetween=Yr,Z.isSame=Xr,Z.isSameOrAfter=Zr,Z.isSameOrBefore=Qr,Z.isValid=Di,Z.lang=ui,Z.locale=li,Z.localeData=di,Z.max=er,Z.min=$n,Z.parsingFlags=Oi,Z.set=at,Z.startOf=yi,Z.subtract=Rr,Z.toArray=wi,Z.toObject=Ti,Z.toDate=Ci,Z.toISOString=ni,Z.inspect=ri,typeof Symbol<`u`&&Symbol.for!=null&&(Z[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return`Moment<`+this.format()+`>`}),Z.toJSON=Ei,Z.toString=ti,Z.unix=Si,Z.valueOf=xi,Z.creationData=Ai,Z.eraName=Pi,Z.eraNarrow=Fi,Z.eraAbbr=Ii,Z.eraYear=Li,Z.year=$e,Z.isLeapYear=et,Z.weekYear=qi,Z.isoWeekYear=Ji,Z.quarter=Z.quarters=ta,Z.month=vt,Z.daysInMonth=yt,Z.week=Z.weeks=Nt,Z.isoWeek=Z.isoWeeks=Pt,Z.weeksInYear=Zi,Z.weeksInWeekYear=Qi,Z.isoWeeksInYear=Yi,Z.isoWeeksInISOWeekYear=Xi,Z.date=na,Z.day=Z.days=Yt,Z.weekday=Xt,Z.isoWeekday=Zt,Z.dayOfYear=ra,Z.hour=Z.hours=ln,Z.minute=Z.minutes=ia,Z.second=Z.seconds=aa,Z.millisecond=Z.milliseconds=sa,Z.utcOffset=vr,Z.utc=br,Z.local=xr,Z.parseZone=Sr,Z.hasAlignedHourOffset=Cr,Z.isDST=wr,Z.isLocal=Er,Z.isUtcOffset=Dr,Z.isUtc=Or,Z.isUTC=Or,Z.zoneAbbr=la,Z.zoneName=ua,Z.dates=w(`dates accessor is deprecated. Use date instead.`,na),Z.months=w(`months accessor is deprecated. Use month instead`,vt),Z.years=w(`years accessor is deprecated. Use year instead`,$e),Z.zone=w(`moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/`,yr),Z.isDSTShifted=w(`isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information`,Tr);function da(e){return X(e*1e3)}function fa(){return X.apply(null,arguments).parseZone()}function pa(e){return e}var Q=A.prototype;Q.calendar=te,Q.longDateFormat=oe,Q.invalidDate=ce,Q.ordinal=de,Q.preparse=pa,Q.postformat=pa,Q.relativeTime=pe,Q.pastFuture=me,Q.set=O,Q.eras=ji,Q.erasParse=Mi,Q.erasConvertYear=Ni,Q.erasAbbrRegex=zi,Q.erasNameRegex=Ri,Q.erasNarrowRegex=Bi,Q.months=pt,Q.monthsShort=mt,Q.monthsParse=gt,Q.monthsRegex=xt,Q.monthsShortRegex=bt,Q.week=kt,Q.firstDayOfYear=Mt,Q.firstDayOfWeek=jt,Q.weekdays=Wt,Q.weekdaysMin=Kt,Q.weekdaysShort=Gt,Q.weekdaysParse=Jt,Q.weekdaysRegex=Qt,Q.weekdaysShortRegex=$t,Q.weekdaysMinRegex=en,Q.isPM=sn,Q.meridiem=un;function ma(e,t,n,r){var i=Sn(),a=p().set(r,t);return i[n](a,e)}function ha(e,t,n){if(l(e)&&(t=e,e=void 0),e||=``,t!=null)return ma(e,t,n,`month`);var r,i=[];for(r=0;r<12;r++)i[r]=ma(e,r,n,`month`);return i}function ga(e,t,n,r){typeof e==`boolean`?(l(t)&&(n=t,t=void 0),t||=``):(t=e,n=t,e=!1,l(t)&&(n=t,t=void 0),t||=``);var i=Sn(),a=e?i._week.dow:0,o,s=[];if(n!=null)return ma(t,(n+a)%7,r,`day`);for(o=0;o<7;o++)s[o]=ma(t,(o+a)%7,r,`day`);return s}function _a(e,t){return ha(e,t,`months`)}function va(e,t){return ha(e,t,`monthsShort`)}function ya(e,t,n){return ga(e,t,n,`weekdays`)}function ba(e,t,n){return ga(e,t,n,`weekdaysShort`)}function xa(e,t,n){return ga(e,t,n,`weekdaysMin`)}yn(`en`,{eras:[{since:`0001-01-01`,until:1/0,offset:1,name:`Anno Domini`,narrow:`AD`,abbr:`AD`},{since:`0000-12-31`,until:-1/0,offset:1,name:`Before Christ`,narrow:`BC`,abbr:`BC`}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(W(e%100/10)===1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)}}),n.lang=w(`moment.lang is deprecated. Use moment.locale instead.`,yn),n.langData=w(`moment.langData is deprecated. Use moment.localeData instead.`,Sn);var Sa=Math.abs;function Ca(){var e=this._data;return this._milliseconds=Sa(this._milliseconds),this._days=Sa(this._days),this._months=Sa(this._months),e.milliseconds=Sa(e.milliseconds),e.seconds=Sa(e.seconds),e.minutes=Sa(e.minutes),e.hours=Sa(e.hours),e.months=Sa(e.months),e.years=Sa(e.years),this}function wa(e,t,n,r){var i=jr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Ta(e,t){return wa(this,e,t,1)}function Ea(e,t){return wa(this,e,t,-1)}function Da(e){return e<0?Math.floor(e):Math.ceil(e)}function Oa(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,o,s,c;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Da(Aa(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=Be(e/1e3),r.seconds=i%60,a=Be(i/60),r.minutes=a%60,o=Be(a/60),r.hours=o%24,t+=Be(o/24),c=Be(ka(t)),n+=c,t-=Da(Aa(c)),s=Be(n/12),n%=12,r.days=t,r.months=n,r.years=s,this}function ka(e){return e*4800/146097}function Aa(e){return e*146097/4800}function ja(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=B(e),e===`month`||e===`quarter`||e===`year`)switch(t=this._days+r/864e5,n=this._months+ka(t),e){case`month`:return n;case`quarter`:return n/3;case`year`:return n/12}else switch(t=this._days+Math.round(Aa(this._months)),e){case`week`:return t/7+r/6048e5;case`day`:return t+r/864e5;case`hour`:return t*24+r/36e5;case`minute`:return t*1440+r/6e4;case`second`:return t*86400+r/1e3;case`millisecond`:return Math.floor(t*864e5)+r;default:throw Error(`Unknown unit `+e)}}function Ma(e){return function(){return this.as(e)}}var Na=Ma(`ms`),Pa=Ma(`s`),Fa=Ma(`m`),Ia=Ma(`h`),La=Ma(`d`),Ra=Ma(`w`),za=Ma(`M`),Ba=Ma(`Q`),Va=Ma(`y`),Ha=Na;function Ua(){return jr(this)}function Wa(e){return e=B(e),this.isValid()?this[e+`s`]():NaN}function Ga(e){return function(){return this.isValid()?this._data[e]:NaN}}var Ka=Ga(`milliseconds`),qa=Ga(`seconds`),Ja=Ga(`minutes`),Ya=Ga(`hours`),Xa=Ga(`days`),Za=Ga(`months`),Qa=Ga(`years`);function $a(){return Be(this.days()/7)}var eo=Math.round,to={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function no(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ro(e,t,n,r){var i=jr(e).abs(),a=eo(i.as(`s`)),o=eo(i.as(`m`)),s=eo(i.as(`h`)),c=eo(i.as(`d`)),l=eo(i.as(`M`)),u=eo(i.as(`w`)),d=eo(i.as(`y`)),f=a<=n.ss&&[`s`,a]||a<n.s&&[`ss`,a]||o<=1&&[`m`]||o<n.m&&[`mm`,o]||s<=1&&[`h`]||s<n.h&&[`hh`,s]||c<=1&&[`d`]||c<n.d&&[`dd`,c];return n.w!=null&&(f=f||u<=1&&[`w`]||u<n.w&&[`ww`,u]),f=f||l<=1&&[`M`]||l<n.M&&[`MM`,l]||d<=1&&[`y`]||[`yy`,d],f[2]=t,f[3]=+e>0,f[4]=r,no.apply(null,f)}function io(e){return e===void 0?eo:typeof e==`function`?(eo=e,!0):!1}function ao(e,t){return to[e]===void 0?!1:t===void 0?to[e]:(to[e]=t,e===`s`&&(to.ss=t-1),!0)}function oo(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=to,i,a;return typeof e==`object`&&(t=e,e=!1),typeof e==`boolean`&&(n=e),typeof t==`object`&&(r=Object.assign({},to,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=ro(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var so=Math.abs;function co(e){return(e>0)-(e<0)||+e}function lo(){if(!this.isValid())return this.localeData().invalidDate();var e=so(this._milliseconds)/1e3,t=so(this._days),n=so(this._months),r,i,a,o,s=this.asSeconds(),c,l,u,d;return s?(r=Be(e/60),i=Be(r/60),e%=60,r%=60,a=Be(n/12),n%=12,o=e?e.toFixed(3).replace(/\.?0+$/,``):``,c=s<0?`-`:``,l=co(this._months)===co(s)?``:`-`,u=co(this._days)===co(s)?``:`-`,d=co(this._milliseconds)===co(s)?``:`-`,c+`P`+(a?l+a+`Y`:``)+(n?l+n+`M`:``)+(t?u+t+`D`:``)+(i||r||e?`T`:``)+(i?d+i+`H`:``)+(r?d+r+`M`:``)+(e?d+o+`S`:``)):`P0D`}var $=lr.prototype;return $.isValid=sr,$.abs=Ca,$.add=Ta,$.subtract=Ea,$.as=ja,$.asMilliseconds=Na,$.asSeconds=Pa,$.asMinutes=Fa,$.asHours=Ia,$.asDays=La,$.asWeeks=Ra,$.asMonths=za,$.asQuarters=Ba,$.asYears=Va,$.valueOf=Ha,$._bubble=Oa,$.clone=Ua,$.get=Wa,$.milliseconds=Ka,$.seconds=qa,$.minutes=Ja,$.hours=Ya,$.days=Xa,$.weeks=$a,$.months=Za,$.years=Qa,$.humanize=oo,$.toISOString=lo,$.toString=lo,$.toJSON=lo,$.locale=li,$.localeData=di,$.toIsoString=w(`toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)`,lo),$.lang=ui,R(`X`,0,0,`unix`),R(`x`,0,0,`valueOf`),U(`x`,ke),U(`X`,Me),G(`X`,function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),G(`x`,function(e,t,n){n._d=new Date(W(e))}),n.version=`2.30.1`,r(X),n.fn=Z,n.min=nr,n.max=rr,n.now=ir,n.utc=p,n.unix=da,n.months=_a,n.isDate=u,n.locale=yn,n.invalid=_,n.duration=jr,n.isMoment=S,n.weekdays=ya,n.parseZone=fa,n.localeData=Sn,n.isDuration=ur,n.monthsShort=va,n.weekdaysMin=xa,n.defineLocale=bn,n.updateLocale=xn,n.locales=Cn,n.weekdaysShort=ba,n.normalizeUnits=B,n.relativeTimeRounding=io,n.relativeTimeThreshold=ao,n.calendarFormat=Wr,n.prototype=Z,n.HTML5_FMT={DATETIME_LOCAL:`YYYY-MM-DDTHH:mm`,DATETIME_LOCAL_SECONDS:`YYYY-MM-DDTHH:mm:ss`,DATETIME_LOCAL_MS:`YYYY-MM-DDTHH:mm:ss.SSS`,DATE:`YYYY-MM-DD`,TIME:`HH:mm`,TIME_SECONDS:`HH:mm:ss`,TIME_MS:`HH:mm:ss.SSS`,WEEK:`GGGG-[W]WW`,MONTH:`YYYY-MM`},n}))})),Ie=E(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Fe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";return e.defineLocale(`it`,{months:`gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre`.split(`_`),monthsShort:`gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic`.split(`_`),weekdays:`domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato`.split(`_`),weekdaysShort:`dom_lun_mar_mer_gio_ven_sab`.split(`_`),weekdaysMin:`do_lu_ma_me_gi_ve_sa`.split(`_`),longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd D MMMM YYYY HH:mm`},calendar:{sameDay:function(){return`[Oggi a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},nextDay:function(){return`[Domani a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},nextWeek:function(){return`dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},lastDay:function(){return`[Ieri a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`},lastWeek:function(){switch(this.day()){case 0:return`[La scorsa] dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`;default:return`[Lo scorso] dddd [a`+(this.hours()>1?`lle `:this.hours()===0?` `:`ll'`)+`]LT`}},sameElse:`L`},relativeTime:{future:`tra %s`,past:`%s fa`,s:`alcuni secondi`,ss:`%d secondi`,m:`un minuto`,mm:`%d minuti`,h:`un'ora`,hh:`%d ore`,d:`un giorno`,dd:`%d giorni`,w:`una settimana`,ww:`%d settimane`,M:`un mese`,MM:`%d mesi`,y:`un anno`,yy:`%d anni`},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:`%dº`,week:{dow:1,doy:4}})}))})),U=E(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Fe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";return e.defineLocale(`en-gb`,{months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),monthsShort:`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),weekdaysShort:`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),weekdaysMin:`Su_Mo_Tu_We_Th_Fr_Sa`.split(`_`),longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd, D MMMM YYYY HH:mm`},calendar:{sameDay:`[Today at] LT`,nextDay:`[Tomorrow at] LT`,nextWeek:`dddd [at] LT`,lastDay:`[Yesterday at] LT`,lastWeek:`[Last] dddd [at] LT`,sameElse:`L`},relativeTime:{future:`in %s`,past:`%s ago`,s:`a few seconds`,ss:`%d seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(~~(e%100/10)==1?`th`:t===1?`st`:t===2?`nd`:t===3?`rd`:`th`)},week:{dow:1,doy:4}})}))})),Le=E(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0&&typeof require==`function`?r(Fe()):typeof define==`function`&&define.amd?define([`../moment`],r):r(n.moment)})(e,(function(e){"use strict";function t(e,t,n,r){var i={m:[`eine Minute`,`einer Minute`],h:[`eine Stunde`,`einer Stunde`],d:[`ein Tag`,`einem Tag`],dd:[e+` Tage`,e+` Tagen`],w:[`eine Woche`,`einer Woche`],M:[`ein Monat`,`einem Monat`],MM:[e+` Monate`,e+` Monaten`],y:[`ein Jahr`,`einem Jahr`],yy:[e+` Jahre`,e+` Jahren`]};return t?i[n][0]:i[n][1]}return e.defineLocale(`de`,{months:`Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember`.split(`_`),monthsShort:`Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.`.split(`_`),monthsParseExact:!0,weekdays:`Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag`.split(`_`),weekdaysShort:`So._Mo._Di._Mi._Do._Fr._Sa.`.split(`_`),weekdaysMin:`So_Mo_Di_Mi_Do_Fr_Sa`.split(`_`),weekdaysParseExact:!0,longDateFormat:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD.MM.YYYY`,LL:`D. MMMM YYYY`,LLL:`D. MMMM YYYY HH:mm`,LLLL:`dddd, D. MMMM YYYY HH:mm`},calendar:{sameDay:`[heute um] LT [Uhr]`,sameElse:`L`,nextDay:`[morgen um] LT [Uhr]`,nextWeek:`dddd [um] LT [Uhr]`,lastDay:`[gestern um] LT [Uhr]`,lastWeek:`[letzten] dddd [um] LT [Uhr]`},relativeTime:{future:`in %s`,past:`vor %s`,s:`ein paar Sekunden`,ss:`%d Sekunden`,m:t,mm:`%d Minuten`,h:t,hh:`%d Stunden`,d:t,dd:t,w:t,ww:`%d Wochen`,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:`%d.`,week:{dow:1,doy:4}})}))}));Ie(),U(),Le();var Re=e=>{let t=``;return e.split(`:`).forEach(e=>{t+=e}),parseInt(t)},ze=e=>e.toString().padStart(4,`0`).match(/.{1,2}/g).join(`:`),Be=e=>{let t=e.address;if(e.addresstype===`county`&&t.country)return t.county;if(e.addresstype===`village`&&t.village)return t.village;let n=[];return[`emergency`,`historic`,`military`,`natural`,`landuse`,`place`,`railway`,`man_made`,`aerialway`,`boundary`,`amenity`,`aeroway`,`club`,`craft`,`leisure`,`office`,`mountain_pass`,`shop`,`tourism`,`bridge`,`tunnel`,`waterway`,`name`].forEach(e=>{t.hasOwnProperty(e)&&t[e]&&n.push(t[e])}),t.road?n.push(t.road):t.pedestrian?n.push(t.pedestrian):t.suburb?n.push(t.suburb):t.square?n.push(t.square):(t.neighbourhood&&n.push(t.neighbourhood),t.hamlet?n.push(t.hamlet):t.isolated_dwelling?n.push(t.isolated_dwelling):t.locality?n.push(t.locality):t.croft&&n.push(t.croft)),t.house_number&&n.push(t.house_number),t.postcode&&n.push(t.postcode),t.village&&n.push(t.village),t.town?n.push(t.town):t.city&&n.push(t.city),n.join(`, `).substr(0,150)};function W(e){let t=window.sessionStorage.getItem(e);if(t!==null){let n=JSON.parse(t);if(new Date(n.expirationDate)>new Date)return n.value;window.sessionStorage.removeItem(e)}return null}function Ve(e,t,n){let r=n?new Date(n*1e3):null;if(r){let n={value:t,expirationDate:r.toISOString()};window.sessionStorage.setItem(e,JSON.stringify(n))}}function G({day:e,slot:t,i18next:n}){return(0,r.jsx)(`li`,{className:`it-list-item`,children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsx)(`div`,{className:`it-right-zone`,children:(0,r.jsxs)(`span`,{className:`text pl-4`,children:[(0,r.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,r.jsx)(`b`,{children:t})]})})})})}function He(){return typeof document>`u`?void 0:document.activeElement?.closest?.(`[data-formio-widget-scope]`)||document.querySelector(`[data-formio-widget-scope]`)||document.querySelector(`widget-formio`)||document.body}var Ue=t.Formio.Components.components.field,We=({component:e,current:t,onChange:n,i18next:i})=>{let[f,p]=(0,a.useState)(),[m,h]=(0,a.useState)([]),[ee,g]=(0,a.useState)([]),[_,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[x,S]=(0,a.useState)(null),[C,w]=(0,a.useState)(null),[T,E]=(0,a.useState)(null),[D,O]=(0,a.useState)({}),[k,A]=(0,a.useState)(null),[j,te]=(0,a.useState)(!1),[N,P]=(0,a.useState)([]),[F,I]=(0,a.useState)(!1),L=(0,a.useRef)(),R=e.calendarId;c.default.locale(i.language),d.default.locale(i.language);let ne=e=>{let t=(0,c.default)(e).format(`YYYY-MM-DD`);fetch(ae(t)).then(e=>e.json()).then(t=>{let n=ie(e||new Date),r=t.filter(e=>e.available==1);r.length===0&&ge();let i=[];n.forEach(e=>{t.some(t=>t.date===e&&t.available==1)?i.push({available:!0,date:e}):i.push({available:!1,date:e})}),h(i.map(e=>{if(e.available===!1)return(0,c.default)(e.date,`YYYY-MM-DD`).toDate()})),re(r.length?r[0].date:e)}).catch(e=>console.error(e))},re=e=>{E(null),w(null),g([]);let t=(0,c.default)(e).format(`YYYY-MM-DD`);fetch(oe(t)).then(e=>e.json()).then(t=>{let n=t.filter(e=>e.availability==1);O(n[0]),n.length>0?(g(t),v(!1),w((0,c.default)(e).format(`L`)),p((0,c.default)(e,`YYYY-MM-DD`).toDate())):(t.length>0&&p((0,c.default)(t[0].date,`YYYY-MM-DD`).toDate()),g([]),ge())})},z=()=>{if(R!==``&&R!=null)if(!t.dataValue)ne(new Date);else if(e.multiple&&Array.isArray(t.dataValue)){if(t.dataValue.length>0){A(t.dataValue);let e=[];t.dataValue.map(t=>{e.push({...t,date:(0,c.default)(t.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)})}),P(e)}}else if(!e.multiple&&typeof t.dataValue==`object`){let e={date:t.dataValue.date,slot:t.dataValue.slot};P([{...t.dataValue,date:(0,c.default)(t.dataValue.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)}]),A(e)}else{let r=t.dataValue.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),i=r[2].split(`#`),a={date:(0,c.default)(r[0],`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:r[1]};e.multiple?(n([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}]),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])):(n({date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])),A(a)}};(0,a.useEffect)(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{z()},1e3)})},[]);let ie=e=>{let t=(0,c.default)(e,`YYYY-MM`).daysInMonth(),n=[];for(;t;){let r=(0,c.default)(e).date(t);n.push(r.format(`YYYY-MM-DD`)),t--}return n},ae=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=`${M()}/api/calendars/${r}/availabilities`,s=[`from_time=${(0,c.default)(t).startOf(`month`).format(`YYYY-MM-DD`)}`,`to_time=${(0,c.default)(t).endOf(`month`).format(`YYYY-MM-DD`)}`];return n&&s.push(`available=${n}`),i&&a&&s.push(`opening_hours=${a.join()}`),`${o}?${s.join(`&`)}`},oe=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=(0,c.default)(t).format(`YYYY-MM-DD`),s=`${M()}/api/calendars/${r}/availabilities/${o}`,l=[];return n&&l.push(`available=${n}`),i&&a&&l.push(`opening_hours=${a.join()}`),l&&(s=`${s}?${l.join(`&`)}`),s},se=e=>{ne(e)},ce=e=>{setTimeout(()=>{te(!j)},1e3),re(e)},le=e=>{E(null),setTimeout(()=>{e&&(S(e.target.dataset),E(e.target.id))},300)},ue=t=>{b(null);let n=`${M()}/it/meetings/new-draft`,r={date:x?.date?(0,c.default)(x?.date).format(`DD-MM-YYYY`):(0,c.default)(t.target.dataset.date).format(`DD-MM-YYYY`),slot:x?.value_start&&x?.value_end?x.value_start+`-`+x.value_end:t.target.dataset.slots,calendar:e.calendarId,opening_hour:x?.opening_hour?x?.opening_hour:t.target.dataset.opening_hour,meeting:y?y.id:``,first_available_date:D.date,first_available_start_time:D.start_time,first_available_end_time:D.end_time,first_availability_updated_at:(0,c.default)().format()};fetch(n,{method:`POST`,body:JSON.stringify(r),headers:{"Content-Type":`application/json; charset=utf-8`},strictErrors:!0}).then(e=>{if(!e.ok)throw Error(i.t(`Intervallo selezionato non disponibile!`));return e.json()}).then(e=>{b(e);let t={date:r.date,slot:r.slot,calendar_id:r.calendar[0],opening_hour_id:r.opening_hour||r.opening_hour_id,meeting_id:e.id};P([...N,t])}).catch(e=>{console.log(e),u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},de=()=>{x&&(ue(),te(!j))},fe=()=>(0,r.jsx)(`span`,{children:i.t(`Tempo prenotazione scaduto!`)}),pe=({minutes:e,seconds:t,completed:n})=>n?(0,r.jsx)(fe,{}):(0,r.jsx)(`div`,{children:(0,r.jsxs)(`div`,{children:[` `,(0,r.jsxs)(`span`,{children:[` `,(0,r.jsxs)(`i`,{children:[i.t(`Per confermare la prenotazione che ti abbiamo riservato procedi con l’invio di questa pratica e con il pagamento (se richiesto) di quanto previsto entro`),`:`]}),` `,(0,r.jsxs)(`b`,{children:[e,` `,i.t(`minuti`),` `,t,` `,i.t(`secondi`)]})]})]})}),me=e=>{let t=Re(e.target.value),n=Re(e.target.min),r=Re(e.target.max);t<n||t>r||t>Re(x.end)?(u.default.fire({title:``,html:`<p>${i.t(`l'orario`)} <b>${ze(t)}</b> ${i.t(`non è valido`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),B(``)):S({...x,value_start:e.target.value})},he=e=>{let t=Re(e.target.value),n=Re(e.target.min),r=Re(e.target.max);t<n||t>r||t<Re(x.start)?(u.default.fire({title:``,html:`<p>${i.t(`l'orario`)} <b>${ze(t)}</b> ${i.t(`non è valido`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),B(``)):S({...x,value_end:e.target.value})},B=t=>{if(t===null||t===``)n(``);else if(Array.isArray(t)&&t.length>0){let t=[];N.map(e=>{t.push({date:(0,c.default)(e.date,`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:e.slot,calendar_id:e.calendar_id||e.calendar[0],meeting_id:e.meeting_id,opening_hour_id:e.opening_hour||e.opening_hour_id})}),e.multiple?n(t):n(t[0])}else n(``)},ge=()=>{v(!0),b(null),w(null),B(null)},_e=()=>{if(i.language===`it`)return Pe;if(i.language===`en`)return Te;if(i.language===`de`)return V};(0,a.useEffect)(()=>{B(N)},[N]),(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&F===!1?(I(!0),setTimeout(()=>{z()},1e3)):(I(!1),setTimeout(()=>{z()},1e3))},[]);let ve=(e,t)=>{let n=`${M()}/api/meetings/${t.meeting_id}`;fetch(n,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${W(`auth-token`)}`},strictErrors:!0}).then(t=>{t&&t.status>400?u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori durante la cancellazione dello slot`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):(P([...N.slice(0,e),...N.slice(e+1)]),ne(new Date))})};return(0,r.jsxs)(r.Fragment,{children:[F&&k?(0,r.jsxs)(`div`,{className:`my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none`,children:[(0,r.jsxs)(`b`,{children:[Array.isArray(k)&&k.length>1?i.t(`Giorni selezionati per la prenotazione`):i.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,r.jsx)(`div`,{className:`mb-5`,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:Array.isArray(k)?k.map(e=>(0,r.jsx)(G,{day:(0,c.default)(e.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:i,slot:e.slot})):(0,r.jsx)(G,{day:(0,c.default)(k.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:i,slot:k.slot})})})})]}):(0,r.jsx)(`div`,{className:`slot-calendar `,children:(0,r.jsxs)(`div`,{className:`row`,children:[e.multiple?(0,r.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,r.jsxs)(`div`,{className:`m-2`,children:[(0,r.jsx)(`h6`,{children:i.t(e.label)}),(0,r.jsx)(o.DayPicker,{mode:`single`,selected:f,locale:_e(),disabled:m,onMonthChange:se,onDayClick:ce}),(0,r.jsx)(`p`,{children:i.t(`Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione`)})]})}):N.length===1?null:(0,r.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,r.jsxs)(`div`,{className:`m-2`,children:[(0,r.jsx)(`h6`,{children:i.t(e.label)}),(0,r.jsx)(o.DayPicker,{mode:`single`,selected:f,locale:_e(),disabled:m,onMonthChange:se,onDayClick:ce}),(0,r.jsxs)(`p`,{children:[` `,i.t(`Seleziona un'altra data nel calendario per aggiungere una nuova prenotazione`)]})]})}),(0,r.jsx)(`div`,{className:`col-12`,children:N.length?(0,r.jsx)(`div`,{className:`row m-2`,children:(0,r.jsxs)(`div`,{className:`col-12 mb-4`,children:[(0,r.jsxs)(`b`,{children:[N.length>1?i.t(`Giorni selezionati per la prenotazione`):i.t(`Giorno selezionato per la prenotazione`),`:`,` `]}),(0,r.jsx)(`div`,{className:`mb-5`,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:N.map((e,t)=>(0,r.jsx)(`li`,{children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsxs)(`div`,{className:`it-right-zone`,children:[(0,r.jsxs)(`span`,{className:`text pl-4`,children:[e.date,` `,x||e.slot?`${i.t(`alle`)} ${e.slot}`:``]}),(0,r.jsx)(l.Icon,{icon:`it-delete`,onClick:()=>ve(t,e),role:`button`})]})})},`li`+t))})})}),y?(0,r.jsx)(l.Alert,{color:`info`,defaultValue:`string`,className:`d-print-none d-preview-calendar-none`,children:(0,r.jsx)(s.default,{date:y.expiration_time,renderer:pe})}):null]})}):null})]})}),(0,r.jsxs)(l.Modal,{isOpen:j,toggle:()=>te(!j),labelledBy:`daySelected`,size:`lg`,centered:!0,container:He(),children:[(0,r.jsx)(l.ModalHeader,{toggle:()=>te(!j),id:`daySelected`,children:i.t(`Seleziona una fascia oraria`)}),_?null:(0,r.jsxs)(`div`,{className:`title-xsmall u-grey-dark px-4`,children:[` `,i.t(`Seleziona una fascia oraria e, se necessario, utilizza l'apposito controllo per accorciare la durata della prenotazione, Poi clicca su Conferma`)]}),(0,r.jsx)(l.ModalBody,{children:(0,r.jsxs)(`div`,{className:`row`,children:[N.length>=1?(0,r.jsxs)(`div`,{children:[C&&!_?(0,r.jsxs)(`h6`,{children:[i.t(`Orari disponibili del`),` `,(0,d.default)(C).format(`DD/MM/YYYY`)]}):null,(0,r.jsxs)(`div`,{className:`calendar-last-selection col-12 pt-2 mb-5`,children:[(0,r.jsx)(`small`,{className:`pl-2 mb-2 d-flex px-2`,children:(0,r.jsxs)(`b`,{children:[(0,r.jsx)(l.Icon,{icon:`it-clock`,className:`mr-1`,size:`sm`}),` `,i.t(`Ultimo orario selezionato`)]})}),(0,r.jsx)(`div`,{className:`col-6 px-2`,children:(0,r.jsx)(`button`,{type:`button`,id:`slot-last-selection`,onClick:le,tabIndex:`1`,className:T===`slot-last-selection`?`active btn btn-slot p-0`:`btn btn-slot p-0`,"data-date":(0,c.default)(C,`DD/MM/YYYY`).format(`YYYY-MM-DD`),"data-slots":N[N.length-1].slot,"data-opening_hour":N[N.length-1].opening_hour_id,"data-start":N[N.length-1].slot.split(`-`)[0],"data-end":N[N.length-1].slot.split(`-`)[1],"data-value_start":N[N.length-1].slot.split(`-`)[0],"data-value_end":N[N.length-1].slot.split(`-`)[1],disabled:_,children:N[N.length-1].slot})})]})]}):null,(0,r.jsx)(`div`,{children:C&&N.length>=1?(0,r.jsx)(`h6`,{children:i.t(`Seleziona altri orari`)}):_?null:(0,r.jsxs)(`h6`,{children:[i.t(`Orari disponibili del`),` `,(0,d.default)(C).format(`DD/MM/YYYY`)]})}),ee.map((e,t)=>(0,r.jsx)(`div`,{className:`col-6`,children:(0,r.jsxs)(`button`,{type:`button`,id:`slot-`+t,onClick:le,ref:L,className:T===`slot-`+t?`active btn btn-slot p-0`:`btn btn-slot p-0`,tabIndex:`1`,"data-date":e.date,"data-start":e.start_time,"data-end":e.end_time,"data-value_start":e.start_time,"data-value_end":e.end_time,"data-slots":e.start_time+`-`+e.end_time,"data-opening_hour":e.opening_hour,"data-min_duration":e.min_duration,disabled:e.slots_available==0,children:[e.start_time,` - `,e.end_time]})},`slot-`+t)),_?(0,r.jsxs)(`div`,{className:`callout callout-highlight warning`,children:[(0,r.jsxs)(`div`,{className:`callout-title`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":!0,icon:`it-help-circle`}),i.t(`Attenzione`)]}),(0,r.jsxs)(`p`,{children:[` `,i.t(`Non è possibile prenotare per la data selezionata`),`.`]})]}):null,(0,r.jsx)(`div`,{className:`col-12`,children:x?.value_start&&T?(0,r.jsxs)(`div`,{className:`row`,children:[(0,r.jsx)(`div`,{className:`col-12 mb-3`,children:(0,r.jsx)(`p`,{className:`mb-3`,children:(0,r.jsx)(`b`,{children:i.t(`Se necessario, utilizza il controllo che segue per accorciare la durata della prenotazione`)})})}),(0,r.jsx)(`div`,{className:`col-12 col-md-6 mb-4`,children:(0,r.jsx)(l.Input,{type:`time`,label:i.t(`Dalle`),className:`active`,defaultValue:x.value_start||x.start,min:x.start,max:x.end,onBlur:me})}),(0,r.jsx)(`div`,{className:`col-12 col-md-6 mb-4`,children:(0,r.jsx)(l.Input,{type:`time`,label:i.t(`alle`),className:`active`,defaultValue:x.value_end||x.end,onBlur:he,min:x.start,max:x.end})})]}):null})]})}),(0,r.jsx)(l.ModalFooter,{children:(0,r.jsx)(l.Button,{color:`primary`,onClick:()=>de(),disabled:!C||!x?.value_start,children:i.t(`Conferma`)})})]})]})},K=class e extends Ue{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Dynamic Calendar`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Ue.schema({type:`dynamic_calendar`})}static editForm=N;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,n.createRoot)(e),this.rootComponent.render((0,r.jsx)(We,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){if(e)if(Array.isArray(e))this.selectedNextSlots=e,this.updateValue(e),this.shouldSetValue=!0;else if(typeof e==`object`)this.date=e.date,this.slot=e.slot,this.meeting=e.meeting_id,this.meeting_expiration_time=null,this.opening_hour=e.opening_hour_id,this.calendar_id=e.calendar_id,this.updateValue(e),this.shouldSetValue=!0;else{let t=e.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),n=t[2].split(`#`);this.date=t[0],this.slot=t[1],this.meeting=n[1],this.meeting_expiration_time=null,this.opening_hour=n.length===3?n[2]:``,this.updateValue({date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:this.meeting,opening_hour_id:this.opening_hour})}}getValue(){if(!(this.date&&this.slot&&this.meeting&&this.opening_hour)&&!(this.selectedNextSlots&&this.selectedNextSlots.length>0))return null;let e=this.meeting?this.meeting:``,t=this.opening_hour?this.opening_hour:``;return this.component.multiple?this.selectedNextSlots:{date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:e,opening_hour_id:t}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Ge=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{type:`select`,label:`Nome Calendario`,key:`calendarId`,input:!0,weight:1,placeholder:`Nome Calendario`,tooltip:`Inserisci il nome del calendario`,dataSrc:`url`,defaultValue:``,data:{url:M()+`/api/calendars?type=time_fixed_slots`},valueProperty:`id`,template:`<span>{{ item.title }}</span>`,selectValues:`Results`},{type:`checkbox`,label:`Seleziona orari di apertura`,key:`select_opening_hours`,input:!0,weight:1,tooltip:`Abilita per selezionare i singoli orari di apertura`,defaultValue:!1},{label:`Base url`,calculateValue:`let url = '`+M()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{type:`select`,label:`Orari di apertura`,key:`opening_hours`,input:!0,weight:1,placeholder:`Seleziona gli orari di apertura`,tooltip:`Seleziona gli orari di apertura`,multiple:!0,dataSrc:`url`,defaultValue:``,data:{url:M()+`/api/calendars/{{data.calendarId}}/opening-hours`},valueProperty:`id`,template:`<span>{{ item.name }}</span>`,selectValues:`results`,conditional:{show:!0,when:`select_opening_hours`,eq:`true`}},{label:`Api Url`,redrawOn:`data`,calculateValue:`if (data.calendarId) {
|
|
37
37
|
let url = data.url + '/api/calendars/' + data.calendarId + '/overlaps';
|
|
38
38
|
if (data.select_opening_hours && data.opening_hours.length > 0) {
|
|
39
39
|
let qs = "?opening_hours=" + data.opening_hours.join();
|
|
@@ -64,10 +64,10 @@ if(data.calendarId && data.api_url){
|
|
|
64
64
|
data.overlaps_validation = -1; document.querySelector("input[name^='data[overlaps_validation]']").value = -1;
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
}`,validateOn:`change`,validate:{customMessage:`Vi sono sovrapposizioni negli orari di apertura`,custom:`if (document.querySelector("input[name^='data[overlaps_validation]']").value === '0') {valid=true} else {valid = 'Sovrapposizione';}`},key:`overlaps_validation`,attributes:{readonly:`true`},required:!0,type:`number`,input:!0,weight:1},{label:`Precisione minima (minuti)`,defaultValue:1,required:!0,inputFormat:`plain`,key:`range_step`,type:`number`,input:!0,weight:1}];function Ke(...e){return i.Components.baseEditForm([{key:`display`,components:Ge}],...e)}function q({day:e,slot:t,i18next:n}){return(0,r.jsx)(`li`,{className:`it-list-item`,children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsx)(`div`,{className:`it-right-zone`,children:(0,r.jsxs)(`span`,{className:`text pl-4`,children:[(0,r.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,r.jsx)(`b`,{children:t})]})})})})}var qe=t.Formio.Components.components.field,Je=({component:e,current:t,onChange:n,i18next:i})=>{let[f,p]=(0,a.useState)(),[m,h]=(0,a.useState)([]),[ee,g]=(0,a.useState)([]),[_,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[x,S]=(0,a.useState)(null),[C,w]=(0,a.useState)(null),[T,E]=(0,a.useState)(null),[D,O]=(0,a.useState)({}),[k,A]=(0,a.useState)(null),[j,te]=(0,a.useState)(!1),[N,P]=(0,a.useState)([]),[F,I]=(0,a.useState)(!1),L=(0,a.useRef)(),R=e.calendarId;c.default.locale(i.language),d.default.locale(i.language);let ne=e=>{let t=(0,c.default)(e).format(`YYYY-MM-DD`);fetch(ie(t)).then(e=>e.json()).then(t=>{let n=re(e||new Date),r=t.filter(e=>e.available==1);r.length===0&&me();let i=[];n.forEach(e=>{t.some(t=>t.date===e&&t.available==1)?i.push({available:!0,date:e}):i.push({available:!1,date:e})}),h(i.map(e=>{if(e.available===!1)return(0,c.default)(e.date,`YYYY-MM-DD`).toDate()})),z(r.length?r[0].date:e)}).catch(e=>console.error(e))},z=e=>{E(null),w(null),g([]);let t=(0,c.default)(e).format(`YYYY-MM-DD`);fetch(ae(t)).then(e=>e.json()).then(t=>{let n=t.filter(e=>e.availability==1);O(n[0]),n.length>0?(g(t),v(!1),w((0,c.default)(e).format(`L`)),p((0,c.default)(e,`YYYY-MM-DD`).toDate())):(t.length>0&&p((0,c.default)(t[0].date,`YYYY-MM-DD`).toDate()),g([]),me())})},B=()=>{if(R!==``&&R!=null)if(!t.dataValue)ne(new Date);else if(e.multiple&&Array.isArray(t.dataValue)){if(t.dataValue.length>0){A(t.dataValue);let e=[];t.dataValue.map(t=>{e.push({...t,date:(0,c.default)(t.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)})}),P(e)}}else if(!e.multiple&&typeof t.dataValue==`object`){let e={date:t.dataValue.date,slot:t.dataValue.slot};P([{...t.dataValue,date:(0,c.default)(t.dataValue.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)}]),A(e)}else{let r=t.dataValue.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),i=r[2].split(`#`),a={date:(0,c.default)(r[0],`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:r[1]};e.multiple?(n([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}]),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])):(n({date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])),A(a)}};(0,a.useEffect)(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{B()},1e3)})},[]);let re=e=>{let t=(0,c.default)(e,`YYYY-MM`).daysInMonth(),n=[];for(;t;){let r=(0,c.default)(e).date(t);n.push(r.format(`YYYY-MM-DD`)),t--}return n},ie=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=`${M()}/api/calendars/${r}/availabilities`,s=[`from_time=${(0,c.default)(t).startOf(`month`).format(`YYYY-MM-DD`)}`,`to_time=${(0,c.default)(t).endOf(`month`).format(`YYYY-MM-DD`)}`];return n&&s.push(`available=${n}`),i&&a&&s.push(`opening_hours=${a.join()}`),`${o}?${s.join(`&`)}`},ae=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=(0,c.default)(t).format(`YYYY-MM-DD`),s=`${M()}/api/calendars/${r}/availabilities/${o}`,l=[];return n&&l.push(`available=${n}`),i&&a&&l.push(`opening_hours=${a.join()}`),l&&(s=`${s}?${l.join(`&`)}`),s},oe=e=>{ne(e)},se=e=>{setTimeout(()=>{te(!j)},1e3),z(e)},ce=e=>{E(null),setTimeout(()=>{e&&(S(e.target.dataset),E(e.target.id))},300)},le=t=>{b(null);let n=`${M()}/it/meetings/new-draft`,r={date:x?.date?(0,c.default)(x?.date).format(`DD-MM-YYYY`):(0,c.default)(t.target.dataset.date).format(`DD-MM-YYYY`),slot:x?.value_start&&x?.value_end?x.value_start+`-`+x.value_end:t.target.dataset.slots,calendar:e.calendarId,opening_hour:x?.opening_hour?x?.opening_hour:t.target.dataset.opening_hour,meeting:y?y.id:``,first_available_date:D.date,first_available_start_time:D.start_time,first_available_end_time:D.end_time,first_availability_updated_at:(0,c.default)().format()};fetch(n,{method:`POST`,body:JSON.stringify(r),headers:{"Content-Type":`application/json; charset=utf-8`},strictErrors:!0}).then(e=>{if(!e.ok)throw Error(i.t(`Intervallo selezionato non disponibile!`));return e.json()}).then(e=>{b(e);let t={date:r.date,slot:r.slot,calendar_id:r.calendar[0],opening_hour_id:r.opening_hour||r.opening_hour_id,meeting_id:e.id};P([...N,t])}).catch(e=>{console.log(e),u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},ue=()=>{x&&(le(),te(!j))},de=()=>(0,r.jsx)(`span`,{children:i.t(`Tempo prenotazione scaduto!`)}),fe=({minutes:e,seconds:t,completed:n})=>n?(0,r.jsx)(de,{}):(0,r.jsx)(`div`,{children:(0,r.jsxs)(`div`,{children:[` `,(0,r.jsxs)(`span`,{children:[` `,(0,r.jsxs)(`i`,{children:[i.t(`Per confermare la prenotazione che ti abbiamo riservato procedi con l’invio di questa pratica e con il pagamento (se richiesto) di quanto previsto entro`),`:`]}),` `,(0,r.jsxs)(`b`,{children:[e,` `,i.t(`minuti`),` `,t,` `,i.t(`secondi`)]})]})]})}),pe=t=>{if(t===null||t===``)n(``);else if(Array.isArray(t)&&t.length>0){let t=[];N.map(e=>{t.push({date:(0,c.default)(e.date,`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:e.slot,calendar_id:e.calendar_id||e.calendar[0],meeting_id:e.meeting_id,opening_hour_id:e.opening_hour||e.opening_hour_id})}),e.multiple?n(t):n(t[0])}else n(``)},me=()=>{v(!0),b(null),w(null),pe(null)},V=()=>{if(i.language===`it`)return Pe;if(i.language===`en`)return Te;if(i.language===`de`)return ye};(0,a.useEffect)(()=>{pe(N)},[N]),(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&F===!1?(I(!0),setTimeout(()=>{B()},1e3)):(I(!1),setTimeout(()=>{B()},1e3))},[]);let he=(e,t)=>{let n=`${M()}/api/meetings/${t.meeting_id}`;fetch(n,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${W(`auth-token`)}`},strictErrors:!0}).then(t=>{t&&t.status>400?u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori durante la cancellazione dello slot`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):(P([...N.slice(0,e),...N.slice(e+1)]),ne(new Date))})};return(0,r.jsxs)(r.Fragment,{children:[F&&k?(0,r.jsxs)(`div`,{className:`my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none`,children:[(0,r.jsxs)(`b`,{children:[Array.isArray(k)&&k.length>1?i.t(`Giorni selezionati per la prenotazione`):i.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,r.jsx)(`div`,{className:`mb-5`,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:Array.isArray(k)?k.map(e=>(0,r.jsx)(q,{day:(0,c.default)(e.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:i,slot:e.slot})):(0,r.jsx)(q,{day:(0,d.default)(k.date).format(`DD/MM/YYYY`),i18next:i,slot:k.slot})})})})]}):(0,r.jsx)(`div`,{className:`slot-calendar `,children:(0,r.jsxs)(`div`,{className:`row`,children:[e.multiple?(0,r.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,r.jsxs)(`div`,{className:`m-2`,children:[(0,r.jsx)(`h6`,{children:i.t(e.label)}),(0,r.jsx)(o.DayPicker,{mode:`single`,selected:f,locale:V(),disabled:m,onMonthChange:oe,onDayClick:se})]})}):N.length===1?null:(0,r.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,r.jsxs)(`div`,{className:`m-2`,children:[(0,r.jsx)(`h6`,{children:i.t(e.label)}),(0,r.jsx)(o.DayPicker,{mode:`single`,selected:f,locale:V(),disabled:m,onMonthChange:oe,onDayClick:se})]})}),(0,r.jsx)(`div`,{className:`col-12`,children:N.length?(0,r.jsx)(`div`,{className:`row m-2`,children:(0,r.jsxs)(`div`,{className:`col-12 mb-4`,children:[(0,r.jsxs)(`b`,{children:[N.length>1?i.t(`Giorni selezionati per la prenotazione`):i.t(`Giorno selezionato per la prenotazione`),`:`,` `]}),(0,r.jsx)(`div`,{className:`mb-5`,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:N.map((e,t)=>(0,r.jsx)(`li`,{children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsxs)(`div`,{className:`it-right-zone`,children:[(0,r.jsxs)(`span`,{className:`text pl-4`,children:[e.date,` `,x||e.slot?`${i.t(`alle`)} ${e.slot}`:``]}),(0,r.jsx)(l.Icon,{icon:`it-delete`,onClick:()=>he(t,e),role:`button`})]})})},`li`+t))})})}),y?(0,r.jsx)(l.Alert,{color:`info`,defaultValue:`string`,className:`d-print-none d-preview-calendar-none`,children:(0,r.jsx)(s.default,{date:y.expiration_time,renderer:fe})}):null]})}):null})]})}),(0,r.jsxs)(l.Modal,{isOpen:j,toggle:()=>te(!j),labelledBy:`daySelected`,size:`lg`,centered:!0,container:He(),children:[(0,r.jsx)(l.ModalHeader,{toggle:()=>te(!j),id:`daySelected`,children:i.t(`Seleziona una fascia oraria`)}),(0,r.jsx)(l.ModalBody,{children:(0,r.jsxs)(`div`,{className:`row`,children:[N.length>=1?(0,r.jsxs)(`div`,{children:[C&&!_?(0,r.jsxs)(`h6`,{children:[i.t(`Orari disponibili del`),` `,(0,d.default)(C).format(`DD/MM/YYYY`)]}):null,(0,r.jsxs)(`div`,{className:`calendar-last-selection col-12 pt-2 mb-5`,children:[(0,r.jsx)(`small`,{className:`pl-2 mb-2 d-flex px-2`,children:(0,r.jsxs)(`b`,{children:[(0,r.jsx)(l.Icon,{icon:`it-clock`,className:`mr-1`,size:`sm`}),` `,i.t(`Ultimo orario selezionato`)]})}),(0,r.jsx)(`div`,{className:`col-6 px-2`,children:(0,r.jsx)(`button`,{type:`button`,id:`slot-last-selection`,onClick:ce,tabIndex:`1`,className:T===`slot-last-selection`?`active btn btn-slot p-0`:`btn btn-slot p-0`,"data-date":(0,c.default)(C,`DD/MM/YYYY`).format(`YYYY-MM-DD`),"data-slots":N[N.length-1].slot,"data-opening_hour":N[N.length-1].opening_hour_id,"data-start":N[N.length-1].slot.split(`-`)[0],"data-end":N[N.length-1].slot.split(`-`)[1],"data-value_start":N[N.length-1].slot.split(`-`)[0],"data-value_end":N[N.length-1].slot.split(`-`)[1],disabled:_,children:N[N.length-1].slot})})]})]}):null,(0,r.jsx)(`div`,{children:C&&N.length>=1?(0,r.jsx)(`h6`,{children:i.t(`Seleziona altri orari`)}):_?null:(0,r.jsxs)(`h6`,{children:[i.t(`Orari disponibili del`),` `,(0,d.default)(C).format(`DD/MM/YYYY`)]})}),ee.map((e,t)=>(0,r.jsx)(`div`,{className:`col-6`,children:(0,r.jsxs)(`button`,{type:`button`,id:`slot-`+t,onClick:ce,ref:L,className:T===`slot-`+t?`active btn btn-slot p-0`:`btn btn-slot p-0`,tabIndex:`1`,"data-date":e.date,"data-start":e.start_time,"data-end":e.end_time,"data-value_start":e.start_time,"data-value_end":e.end_time,"data-slots":e.start_time+`-`+e.end_time,"data-opening_hour":e.opening_hour,"data-min_duration":e.min_duration,disabled:e.slots_available==0,children:[e.start_time,` - `,e.end_time]})},`slot-`+t)),_?(0,r.jsxs)(`div`,{className:`callout callout-highlight warning`,children:[(0,r.jsxs)(`div`,{className:`callout-title`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":!0,icon:`it-help-circle`}),i.t(`Attenzione`)]}),(0,r.jsxs)(`p`,{children:[` `,i.t(`Non è possibile prenotare per la data selezionata`),`.`]})]}):null]})}),(0,r.jsx)(l.ModalFooter,{children:(0,r.jsx)(l.Button,{color:`primary`,onClick:()=>ue(),disabled:!C||!x?.value_start,children:i.t(`Conferma`)})})]})]})},Ye=class e extends qe{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Calendar`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return qe.schema({type:`calendar`})}static editForm=Ke;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,n.createRoot)(e),this.rootComponent.render((0,r.jsx)(Je,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){if(e)if(Array.isArray(e))this.selectedNextSlots=e,this.updateValue(e),this.shouldSetValue=!0;else if(typeof e==`object`)this.date=e.date,this.slot=e.slot,this.meeting=e.meeting_id,this.meeting_expiration_time=null,this.opening_hour=e.opening_hour_id,this.calendar_id=e.calendar_id,this.updateValue(e),this.shouldSetValue=!0;else{let t=e.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),n=t[2].split(`#`);this.date=t[0],this.slot=t[1],this.meeting=n[1],this.meeting_expiration_time=null,this.opening_hour=n.length===3?n[2]:``,this.updateValue({date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:this.meeting,opening_hour_id:this.opening_hour})}}getValue(){if(!(this.date&&this.slot&&this.meeting&&this.opening_hour)&&!(this.selectedNextSlots&&this.selectedNextSlots.length>0))return null;let e=this.meeting?this.meeting:``,t=this.opening_hour?this.opening_hour:``;return this.component.multiple?this.selectedNextSlots:{date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:e,opening_hour_id:t}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Xe=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{label:`Base url`,calculateValue:`let url = '`+M()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{label:`Tipo di visualizazzione`,widget:`choicesjs`,tableView:!0,data:{values:[{label:`calendar`,value:`calendar`},{label:`select`,value:`select`}]},validateWhenHidden:!1,defaultValue:`calendar`,key:`view`,type:`select`,input:!0}];function Ze(...e){return i.Components.baseEditForm([{key:`display`,components:Xe}],...e)}function Qe({day:e,slot:t,i18next:n}){return(0,r.jsx)(`li`,{className:`it-list-item`,children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsx)(`div`,{className:`it-right-zone`,children:(0,r.jsxs)(`span`,{className:`text-paragraph pl-4`,children:[(0,r.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,r.jsx)(`b`,{children:t})]})})})})}function $e(e,t){if(!t||t.length===0)return;let n=t.map(e=>{let t=new Date(e.start);return(new Date(e.end)-t)/6e4}),r=Math.min(...n),i=n.reduce((e,t)=>e+t,0)/n.length,a=0;a=r<=30&&r>15?i*1:r<=15?i*24:i*4,e.setOption(`slotHeight`,a),document.documentElement.style.setProperty(`--slot-height`,`${a}px`)}var et={AVAILABILITY:{key:`availability_data_cache_`,duration:10},SLOTS:{key:`availability_slots_cache_`,duration:10},SUBMISSION:{key:`submission_cache_`,duration:30}},tt=(e,t,n)=>{let r={data:n,timestamp:(0,d.default)().toISOString()};localStorage.setItem(t,JSON.stringify(r))},nt=(e,t)=>{try{let n=localStorage.getItem(t);if(!n)return null;let r=JSON.parse(n),i=(0,d.default)().diff((0,d.default)(r.timestamp),`minutes`);return i>et[e].duration?(localStorage.removeItem(t),console.log(`⏰ Cache scaduto: ${e}`),null):(console.log(`✅ Cache letto: ${e} (${i} minuti fa)`),r.data)}catch(t){return console.error(`Errore nel leggere il cache (${e}):`,t),null}},rt=(e,...t)=>et[e].key+btoa(t),it=`calendar_view_state`,at=`calendar_view_date`,ot=(e,t)=>{try{localStorage.setItem(it,e),localStorage.setItem(at,t||new Date().toISOString())}catch(e){console.error(`Errore nel salvare lo stato della view:`,e)}},J=()=>{try{let e=localStorage.getItem(it),t=localStorage.getItem(at);return{viewType:e||`timeGridWeek`,date:t?new Date(t):new Date}}catch(e){return console.error(`Errore nel leggere lo stato della view:`,e),{viewType:`timeGridWeek`,date:new Date}}},st=()=>!!localStorage.getItem(at),ct=()=>{try{localStorage.removeItem(it),localStorage.removeItem(at)}catch(e){console.error(`Errore nel pulire lo stato della view:`,e)}},lt=t.Formio.Components.components.field,ut=({component:e,current:t,onChange:n,i18next:i})=>{let[o,s]=(0,a.useState)(null),[p,m]=(0,a.useState)(null),[h,ee]=(0,a.useState)([]),[g,_]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[b,x]=(0,a.useState)(null),[S,C]=(0,a.useState)([]),[w,T]=(0,a.useState)([]),[E,D]=(0,a.useState)([]),[O,k]=(0,a.useState)(null),[A,j]=(0,a.useState)(null),[te,N]=(0,a.useState)(null),P=(0,a.useRef)(null),F=(0,a.useRef)(null);i.language,c.default.locale(i.language),d.default.locale(i.language);function I(e){if(!e||e.length===0)return null;let t=e.map(e=>({start:e.start_time,end:e.end_time}));return{earliestStartTime:t.reduce((e,t)=>t.start<e?t.start:e,t[0].start),latestEndTime:t.reduce((e,t)=>t.end>e?t.end:e,t[0].end)}}function L(e){let t=e.map(e=>(0,c.default)(e.date).isoWeekday()),n=[1,2,3,4,5,6,7].filter(e=>!t.includes(e));n.length>0?F.current.setOption(`hiddenDays`,n):F.current.setOption(`hiddenDays`,[])}function R(e,t,n){let r=new URL(e),i=`${r.pathname.split(`/`).slice(0,4).join(`/`)}/${t}/${n}`;return`${r.origin}${i}${r.search}`}function ne(e,t,n){let r=new URL(e),i=`${r.pathname.split(`/`).slice(0,4).join(`/`)}`;return`${r.origin}${i}${r.search}&from_to=${t}&to_date=${n}`}function z(e,t,n){return`${M()}/api/availabilities/${e}/${t}?calendar_ids=${n}&available=true`}let B=e=>{D([]),T([]),n({}),e&&T((o??[]).filter(t=>t.date.startsWith(e)))},re=async(e,t)=>{let r=JSON.parse(e),a=rt(`SLOTS`,r.date,r.calendar_ids);if(t===`manual`)D([]),N(null),x(null),n({});else{let e=nt(`SLOTS`,a);if(e){D(e);return}}try{let e=await window.FormioHelper.anonymousCall(`availabilities/${r.date}?calendar_ids=${r.calendar_ids}`),t=Array.isArray(e)?e:e?.data??[];tt(`SLOTS`,a,t),D(t)}catch(e){console.error(`Errore nel caricamento degli slot:`,e),u.default.fire({icon:`error`,title:i.t(`Errore`),text:i.t(`Errore nel caricamento degli orari`)})}},ie=e=>{let n=t?.dataValue?.id,r=n?`PATCH`:`POST`,i=n?`meetings/${n}`:`meetings`;return window.FormioHelper.authenticatedRequest(r,i,e).catch(t=>{if((t?.response?.status===404||t?.status===404)&&r===`PATCH`)return window.FormioHelper.authenticatedRequest(`POST`,`meetings`,e);throw t})},ae=e=>{let r=JSON.parse(e),a={status:6,calendar:r.calendar_id,opening_hour:r.opening_hour_id,user:null,email:null,fiscal_code:null,name:` `,phone_number:null,from_time:(0,d.default)(`${r.date}T${r.start_time}`).toISOString(),to_time:(0,d.default)(`${r.date}T${r.end_time}`).toISOString(),user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:t?.data?.service_data?.id,calendar_group_office_id:t?.data?.user_group?.id,calendar_group_place_id:t?.data?.place?.id};ie(a).then(e=>{x({day:(0,d.default)(r.date).format(`dddd, DD MMMM YYYY`),startDate:r.start_time,endDate:r.end_time}),n(e?.id?e:e?{...e,id:t.dataValue.id}:t.dataValue.id?{...a,id:t.dataValue.id}:{...a})}).catch(e=>{console.error(e),e.status===400&&e?.response?.data?.type===`validation_error`?u.default.fire({title:``,html:`<p>`+i.t(`Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa`)+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},oe=e=>{let t=new Set,n=[];return e.forEach(e=>{let r=(0,d.default)(e.date),i=r.format(`YYYY-MM`);t.has(i)||(t.add(i),n.push({value:i,label:r.format(`MMMM YYYY`).replace(/^\w/,e=>e.toUpperCase())}))}),n},se=async()=>{let e=t?.root?.data?.place?.merge_availabilities?t?.root?.data?.place?.merged_availabilities_link:null,r=(0,c.default)().format(`YYYY-MM-DD`),a=(0,c.default)().add(1,`month`).format(`YYYY-MM-DD`),o=t?.root?.data?.place?.calendars[0]?.id||null,l=e?ne(e,r,a):z(r,a,o),d=rt(`AVAILABILITY`,l),f=nt(`AVAILABILITY`,d);if(f){s(f),C(oe(f));return}else n({});_(!0);try{let e=await window.FormioHelper.fetchAPIUrlLimit(l);if(_(!1),!e?.length){u.default.fire({icon:`warning`,title:i.t(`warning`),html:i.t(`no_meetings`)});return}tt(`AVAILABILITY`,d,e),s(e),C(oe(e))}catch(e){_(!1),console.error(`Errore nel caricamento disponibilità:`,e)}};(0,a.useEffect)(()=>{if(o?.length){let e=t?.dataValue??t?.getValue();if(e?.from_time&&e?.to_time&&!(0,d.default)().isAfter(e?.draft_expiration)){let t=(0,d.default)(e.from_time).format(`YYYY-MM`);k(t),t&&T&&(T(o.filter(e=>e.date.startsWith(t))),j((0,d.default)(e.from_time).format(`YYYY-MM-DD`)))}else e?.draft_expiration&&(0,d.default)().isAfter(e?.draft_expiration)&&u.default.fire({icon:`warning`,title:i.t(`warning`),html:i.t(`expired_meeting`)})}},[o]),(0,a.useEffect)(()=>{let e=t?.dataValue??t?.getValue();if(!S.length||O||e?.from_time||e?.to_time)return;let n=S[0];n&&(k(n.value),B(n.value))},[S,O,t?.dataValue]),(0,a.useEffect)(()=>{if(A&&v===!1){let e=t?.dataValue??t?.getValue();re(JSON.stringify({date:A,calendar_ids:e.calendar.id}))}},[A]);let ce=()=>window.innerWidth>768?`timeGridWeek`:`timeGridDay`;(0,a.useEffect)(()=>{let e=()=>{let e=F.current;if(!e)return;let t=ce();t!==e.getView().type&&e.setOption(`view`,t)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,a.useEffect)(()=>{let e=t?.dataValue??t?.getValue();E?.length&&e?.from_time&&(N((0,d.default)(e.from_time).format(`HH:mm`)+` - `+(0,d.default)(e.to_time).format(`HH:mm`)),x({day:(0,d.default)(e.from_time).format(`dddd D MMM YYYY`),startDate:(0,d.default)(e.from_time).format(`HH:mm`),endDate:(0,d.default)(e.to_time).format(`HH:mm`)}))},[E]);async function le(){try{let e=t?.root?.data?.place?.calendars?.[0]?.id??``,n=await window.FormioHelper.anonymousCall(`availabilities/first-available-date?calendar_ids=${e}`);n?.date&&ot(ce(),new Date(n.date))}catch(e){console.error(`Errore nel recuperare la prima disponibilità:`,e)}}let ue=()=>{let e=J();F.current=(0,f.createCalendar)(P.current,[f.TimeGrid],{events:[],buttonText:{today:i.t(`Oggi`)},allDaySlot:!1,firstDay:1,date:e.date,slotEventOverlap:!1,view:ce(),height:`400px`,views:{timeGridWeek:{allDaySlot:!1,firstDay:1,slotHeight:48},timeGridDay:{allDaySlot:!1,firstDay:1,slotHeight:48}},datesSet:e=>{ot(e.view.type,e.start)},eventClick({event:e,el:r}){document.querySelectorAll(`.ec-event`).forEach(e=>{e.classList.remove(`highlighted-event`)}),r.classList.add(`highlighted-event`);let a=new Date(e.start),o=new Date(e.end),s=a.toLocaleDateString(`it-IT`,{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),c=a.toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}),l=o.toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}),d={status:6,calendar:e.extendedProps.calendar_id,opening_hour:e.extendedProps.opening_hour_id,user:null,email:null,fiscal_code:null,name:` `,phone_number:null,from_time:a,to_time:o,user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:t?.data?.service_data?.id,calendar_group_office_id:t?.data?.user_group?.id,calendar_group_place_id:t?.data?.place?.id};ie(d).then(e=>{let r;!e||e===``?r={...d,code:null,id:t?.dataValue?.id}:typeof e==`object`&&(r=e),x({day:s,startDate:c,endDate:l}),n(r)}).catch(e=>{console.error(e),e.status===400&&e?.response?.data?.type===`validation_error`?u.default.fire({title:``,html:`<p>`+i.t(`Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa`)+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},viewDidMount:de,eventDidMount:e=>{let{event:t,el:n}=e,r=t.extendedProps;n.setAttribute(`data-event-id`,t.id+`-`+r.date+`-`+r.start_time)},loading:e=>{_(e)}})},de=e=>{t?.root?.data?.place&&F.current.setOption(`eventSources`,[{events:fe}])};async function fe(e){try{F.current.setOption(`events`,[]);let n=(0,c.default)(e.start).format(`YYYY-MM-DD`),r=new Date(e.end);r.setDate(r.getDate()-1);let a=(0,c.default)(r).format(`YYYY-MM-DD`),o=t?.root?.data?.place?.merge_availabilities?t?.root?.data?.place?.merged_availabilities_link:null,s=o?R(o,n,a):z(n,a,null),l=rt(`AVAILABILITY`,s),d=nt(`AVAILABILITY`,l),f;if(d?(f=d,_(!1)):(f=await window.FormioHelper.fetchAPIUrlLimit(s),tt(`AVAILABILITY`,l,f)),!f?.length)return u.default.fire({icon:`warning`,title:i.t(`warning`),html:i.t(`no_meetings`)}),[];let p=f.map(e=>({id:e.opening_hour_id,allDay:!1,start:`${e.date}T${e.start_time}:00`,end:`${e.date}T${e.end_time}:00`,title:``,editable:!1,display:`auto`,color:`#ebeef0`,textColor:`#000`,className:`event-slot`,extendedProps:{...e}})),m=I(f);return F.current.setOption(`slotMinTime`,m.earliestStartTime),F.current.setOption(`slotMaxTime`,m.latestEndTime),L(f),$e(F.current,p),setTimeout(()=>{pe(p)},500),p}catch(e){throw console.error(`Errore nel caricamento disponibilità:`,e),e}}(0,a.useEffect)(()=>{let r,a=!1;async function o(){try{if(await window.FormioInstance?.formReady,a)return;if(!P.current){console.warn(`Elemento calendario non trovato`);return}let r=t?.dataValue??t?.getValue();r&&r?.draft_expiration&&(0,d.default)().isAfter(r.draft_expiration)&&(n({}),ct()),t?.data?.service_data?.view_type===`calendar`||e.view===`calendar`?F?.current||(st()||await le(),ue()):t?.data?.service_data?.view_type===`select`||e.view===`select`?se():alert(i.t(`Il componente non è configurato per la visualizzazione a calendario`))}catch(e){console.error(`Errore durante l'inizializzazione del calendario:`,e)}}return r=setTimeout(o,500),()=>{a=!0,r&&clearTimeout(r),F.current&&=((0,f.destroyCalendar)(F.current),null)}},[t?.root?.data?.place]);function pe(e){let n=t?.dataValue;if(!n?.from_time)return;let r=(0,d.default)(n.from_time).format(`DD-MM-YYYY HH:mm`),i=(0,d.default)(n.to_time).format(`DD-MM-YYYY HH:mm`),a=e.find(e=>(0,d.default)(e.start).format(`DD-MM-YYYY HH:mm`)===r&&(0,d.default)(e.end).format(`DD-MM-YYYY HH:mm`)===i);if(!a)return;let o=document.querySelector(`.ec-event[data-event-id="${a.id}-${(0,d.default)(n?.from_time).format(`YYYY-MM-DD`)}-${(0,d.default)(n?.from_time).format(`HH:mm`)}"]`);o&&(o.classList.add(`highlighted-event`),o.scrollIntoView({behavior:`smooth`,block:`center`}),x({day:(0,d.default)(n?.from_time).format(`dddd, DD MMMM YYYY`),startDate:(0,d.default)(n?.from_time).format(`HH:mm`),endDate:(0,d.default)(n?.to_time).format(`HH:mm`)}))}return(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&v===!1?y(!0):(t?.data?.service_data?.view_type===`select`&&se(),y(!1))},[]),(0,a.useEffect)(()=>{v&&setTimeout(()=>{let e=t?.dataValue??t?.getValue();e&&m(e)},500)},[v]),(0,r.jsx)(r.Fragment,{children:v&&p?(0,r.jsxs)(`div`,{className:`mx-2`,children:[(0,r.jsxs)(`p`,{className:`text-paragraph`,children:[i.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,r.jsx)(`div`,{className:``,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:(0,r.jsx)(Qe,{day:(0,d.default)(p.from_time).format(`dddd D MMM YYYY`),i18next:i,slot:`${(0,d.default)(p.from_time).format(`HH:mm`)} - ${(0,d.default)(p.to_time).format(`HH:mm`)}`})})})})]}):(0,r.jsxs)(`div`,{className:``,children:[(0,r.jsx)(`div`,{ref:P}),S.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.Select,{label:`Mese`,id:`selectMonthYear`,onChange:B,children:[(0,r.jsx)(`option`,{value:``,children:i.t(`Scegli un'opzione`)}),S.map(e=>(0,r.jsx)(`option`,{value:e.value,selected:e.value===O,children:e.label},e.value))]}),(0,r.jsxs)(l.Select,{label:`Giorno`,id:`selectDay`,onChange:e=>re(e,`manual`),disabled:w.length===0,children:[(0,r.jsx)(`option`,{value:``,children:i.t(`Scegli un'opzione`)}),w.map(e=>(0,r.jsx)(`option`,{value:JSON.stringify(e),selected:e.date===A,children:(0,d.default)(e.date).format(`dddd,DD MMMM YYYY`)},e.date))]}),(0,r.jsxs)(l.Select,{label:`Orario`,id:`selectSlot`,onChange:ae,disabled:E.length===0,children:[(0,r.jsx)(`option`,{value:``,children:i.t(`Scegli un'opzione`)}),E.map(e=>(0,r.jsx)(`option`,{value:JSON.stringify(e),selected:e.start_time+` - `+e.end_time===te,children:e.start_time+` - `+e.end_time},e.start_time+` - `+e.end_time))]})]}):null,b?(({day:e,startDate:t,endDate:n})=>(0,r.jsx)(`div`,{className:`mt-3`,children:(0,r.jsxs)(`div`,{className:`row align-items-center gy-3`,children:[(0,r.jsxs)(`div`,{className:`col-12 col-md border-light mx-md-3`,children:[(0,r.jsx)(`div`,{className:`text-paragraph-small`,children:i.t(`Data`)}),(0,r.jsx)(`p`,{className:`data-text`,children:(0,r.jsx)(`strong`,{children:e})})]}),(0,r.jsxs)(`div`,{className:`col-12 col-md border-light mx-md-3`,children:[(0,r.jsx)(`div`,{className:`text-paragraph-small`,children:i.t(`Ora`)}),(0,r.jsx)(`p`,{className:`data-text`,children:(0,r.jsxs)(`strong`,{children:[t,` - `,n]})})]})]})}))({day:b.day,startDate:b.startDate,endDate:b.endDate}):null,g?(0,r.jsx)(`div`,{className:`d-flex align-items-center justify-content-center position-absolute-center`,children:(0,r.jsx)(l.Spinner,{active:!0})}):null]})})},dt=class e extends lt{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Calendar Advanced`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return lt.schema({type:`calendar-advanced`})}static editForm=Ze;attach(e,t){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent&&=(this.rootComponent.unmount(),null),this.rootComponent=(0,n.createRoot)(e),this.builderMode?(this.rootComponent.render((0,r.jsx)(`div`,{className:`my-1 border border-2 border-light rounded p-3 text-secondary`,children:(0,r.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`Calendar Advanced`})})),this):(this.rootComponent.render((0,r.jsx)(ut,{ref:t,component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this)):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){e&&(this.updateValue(e),this.shouldSetValue=!0)}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},ft=[{key:`defaultValue`,ignore:!0}],pt=[{key:`placeholder`,ignore:!0},{type:`checkbox`,label:`Files Synchronization feature`,tooltip:`Enable ability to control files synchronization. Files will be auto synced before submit.`,key:`autoSync`,input:!0,conditional:{json:{in:[{var:`data.storage`},[`s3`,`azure`,`googledrive`]]}}}],mt=[{type:`select`,input:!0,key:`storage`,label:`Storage`,placeholder:`Select your file storage provider`,weight:0,tooltip:`Which storage to save the files in.`,valueProperty:`value`,dataSrc:`custom`,hidden:!0,data:{custom:function(){return[{label:`url`,value:`url`}]}}},{type:`checkbox`,input:!0,defaultValue:!0,key:`protocol_required`,label:`Richiede protocollazione?`,tooltip:``,weight:10},{type:`checkbox`,input:!0,defaultValue:!1,key:`check_signature`,label:`Effettuare il controllo della firma?`,tooltip:``,weight:15},{type:`checkbox`,input:!0,key:`useMultipartUpload`,label:`Use the S3 Multipart Upload API`,tooltip:`The <a href='https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html'>S3 Multipart Upload API</a> is designed to improve the upload experience for larger objects (> 5GB).`,conditional:{json:{"===":[{var:`data.storage`},`s3`]}}},{label:`Multipart Upload`,tableView:!1,key:`multipart`,type:`container`,input:!0,components:[{label:`Part Size (MB)`,applyMaskOn:`change`,mask:!1,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:`plain`,truncateMultipleSpaces:!1,validate:{min:5,max:5e3},key:`partSize`,type:`number`,input:!0,defaultValue:500}],conditional:{json:{"===":[{var:`data.useMultipartUpload`},!0]}}},{type:`textfield`,input:!0,key:`options.indexeddb`,label:`Database`,weight:10,placeholder:`Enter the indexeddb database name`,conditional:{json:{in:[{var:`data.storage`},[`indexeddb`]]}}},{type:`textfield`,input:!0,label:`Table`,key:`options.indexeddbTable`,weight:10,placeholder:`Enter the name for indexeddb table`,conditional:{json:{in:[{var:`data.storage`},[`indexeddb`]]}}},{type:`textarea`,key:`options`,label:`Custom request options`,tooltip:`Pass your custom xhr options(optional)`,rows:5,editor:`ace`,input:!0,weight:15,placeholder:`{
|
|
67
|
+
}`,validateOn:`change`,validate:{customMessage:`Vi sono sovrapposizioni negli orari di apertura`,custom:`if (document.querySelector("input[name^='data[overlaps_validation]']").value === '0') {valid=true} else {valid = 'Sovrapposizione';}`},key:`overlaps_validation`,attributes:{readonly:`true`},required:!0,type:`number`,input:!0,weight:1},{label:`Precisione minima (minuti)`,defaultValue:1,required:!0,inputFormat:`plain`,key:`range_step`,type:`number`,input:!0,weight:1}];function Ke(...e){return i.Components.baseEditForm([{key:`display`,components:Ge}],...e)}function q({day:e,slot:t,i18next:n}){return(0,r.jsx)(`li`,{className:`it-list-item`,children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsx)(`div`,{className:`it-right-zone`,children:(0,r.jsxs)(`span`,{className:`text pl-4`,children:[(0,r.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,r.jsx)(`b`,{children:t})]})})})})}var qe=t.Formio.Components.components.field,Je=({component:e,current:t,onChange:n,i18next:i})=>{let[f,p]=(0,a.useState)(),[m,h]=(0,a.useState)([]),[ee,g]=(0,a.useState)([]),[_,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(null),[x,S]=(0,a.useState)(null),[C,w]=(0,a.useState)(null),[T,E]=(0,a.useState)(null),[D,O]=(0,a.useState)({}),[k,A]=(0,a.useState)(null),[j,te]=(0,a.useState)(!1),[N,P]=(0,a.useState)([]),[F,I]=(0,a.useState)(!1),L=(0,a.useRef)(),R=e.calendarId;c.default.locale(i.language),d.default.locale(i.language);let ne=e=>{let t=(0,c.default)(e).format(`YYYY-MM-DD`);fetch(ae(t)).then(e=>e.json()).then(t=>{let n=ie(e||new Date),r=t.filter(e=>e.available==1);r.length===0&&he();let i=[];n.forEach(e=>{t.some(t=>t.date===e&&t.available==1)?i.push({available:!0,date:e}):i.push({available:!1,date:e})}),h(i.map(e=>{if(e.available===!1)return(0,c.default)(e.date,`YYYY-MM-DD`).toDate()})),re(r.length?r[0].date:e)}).catch(e=>console.error(e))},re=e=>{E(null),w(null),g([]);let t=(0,c.default)(e).format(`YYYY-MM-DD`);fetch(oe(t)).then(e=>e.json()).then(t=>{let n=t.filter(e=>e.availability==1);O(n[0]),n.length>0?(g(t),v(!1),w((0,c.default)(e).format(`L`)),p((0,c.default)(e,`YYYY-MM-DD`).toDate())):(t.length>0&&p((0,c.default)(t[0].date,`YYYY-MM-DD`).toDate()),g([]),he())})},z=()=>{if(R!==``&&R!=null)if(!t.dataValue)ne(new Date);else if(e.multiple&&Array.isArray(t.dataValue)){if(t.dataValue.length>0){A(t.dataValue);let e=[];t.dataValue.map(t=>{e.push({...t,date:(0,c.default)(t.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)})}),P(e)}}else if(!e.multiple&&typeof t.dataValue==`object`){let e={date:t.dataValue.date,slot:t.dataValue.slot};P([{...t.dataValue,date:(0,c.default)(t.dataValue.date,`YYYY-MM-DD`).format(`DD-MM-YYYY`)}]),A(e)}else{let r=t.dataValue.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),i=r[2].split(`#`),a={date:(0,c.default)(r[0],`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:r[1]};e.multiple?(n([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}]),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])):(n({date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}),P([{date:r[0],slot:r[1],calendar_id:i[0],meeting_id:i[1],opening_hour_id:i.length===3?i[2]:``}])),A(a)}};(0,a.useEffect)(()=>{window.FormioInstance?.formReady.then(()=>{setTimeout(()=>{z()},1e3)})},[]);let ie=e=>{let t=(0,c.default)(e,`YYYY-MM`).daysInMonth(),n=[];for(;t;){let r=(0,c.default)(e).date(t);n.push(r.format(`YYYY-MM-DD`)),t--}return n},ae=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=`${M()}/api/calendars/${r}/availabilities`,s=[`from_time=${(0,c.default)(t).startOf(`month`).format(`YYYY-MM-DD`)}`,`to_time=${(0,c.default)(t).endOf(`month`).format(`YYYY-MM-DD`)}`];return n&&s.push(`available=${n}`),i&&a&&s.push(`opening_hours=${a.join()}`),`${o}?${s.join(`&`)}`},oe=(t,n=!1)=>{let r=e.calendarId,i=e.select_opening_hours,a=e.select_opening_hours?e.opening_hours:[];window.location.pathname.split(`/`);let o=(0,c.default)(t).format(`YYYY-MM-DD`),s=`${M()}/api/calendars/${r}/availabilities/${o}`,l=[];return n&&l.push(`available=${n}`),i&&a&&l.push(`opening_hours=${a.join()}`),l&&(s=`${s}?${l.join(`&`)}`),s},se=e=>{ne(e)},ce=e=>{setTimeout(()=>{te(!j)},1e3),re(e)},le=e=>{E(null),setTimeout(()=>{e&&(S(e.target.dataset),E(e.target.id))},300)},ue=t=>{b(null);let n=`${M()}/it/meetings/new-draft`,r={date:x?.date?(0,c.default)(x?.date).format(`DD-MM-YYYY`):(0,c.default)(t.target.dataset.date).format(`DD-MM-YYYY`),slot:x?.value_start&&x?.value_end?x.value_start+`-`+x.value_end:t.target.dataset.slots,calendar:e.calendarId,opening_hour:x?.opening_hour?x?.opening_hour:t.target.dataset.opening_hour,meeting:y?y.id:``,first_available_date:D.date,first_available_start_time:D.start_time,first_available_end_time:D.end_time,first_availability_updated_at:(0,c.default)().format()};fetch(n,{method:`POST`,body:JSON.stringify(r),headers:{"Content-Type":`application/json; charset=utf-8`},strictErrors:!0}).then(e=>{if(!e.ok)throw Error(i.t(`Intervallo selezionato non disponibile!`));return e.json()}).then(e=>{b(e);let t={date:r.date,slot:r.slot,calendar_id:r.calendar[0],opening_hour_id:r.opening_hour||r.opening_hour_id,meeting_id:e.id};P([...N,t])}).catch(e=>{console.log(e),u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},de=()=>{x&&(ue(),te(!j))},fe=()=>(0,r.jsx)(`span`,{children:i.t(`Tempo prenotazione scaduto!`)}),pe=({minutes:e,seconds:t,completed:n})=>n?(0,r.jsx)(fe,{}):(0,r.jsx)(`div`,{children:(0,r.jsxs)(`div`,{children:[` `,(0,r.jsxs)(`span`,{children:[` `,(0,r.jsxs)(`i`,{children:[i.t(`Per confermare la prenotazione che ti abbiamo riservato procedi con l’invio di questa pratica e con il pagamento (se richiesto) di quanto previsto entro`),`:`]}),` `,(0,r.jsxs)(`b`,{children:[e,` `,i.t(`minuti`),` `,t,` `,i.t(`secondi`)]})]})]})}),me=t=>{if(t===null||t===``)n(``);else if(Array.isArray(t)&&t.length>0){let t=[];N.map(e=>{t.push({date:(0,c.default)(e.date,`DD-MM-YYYY`).format(`YYYY-MM-DD`),slot:e.slot,calendar_id:e.calendar_id||e.calendar[0],meeting_id:e.meeting_id,opening_hour_id:e.opening_hour||e.opening_hour_id})}),e.multiple?n(t):n(t[0])}else n(``)},he=()=>{v(!0),b(null),w(null),me(null)},B=()=>{if(i.language===`it`)return Pe;if(i.language===`en`)return Te;if(i.language===`de`)return V};(0,a.useEffect)(()=>{me(N)},[N]),(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&F===!1?(I(!0),setTimeout(()=>{z()},1e3)):(I(!1),setTimeout(()=>{z()},1e3))},[]);let ge=(e,t)=>{let n=`${M()}/api/meetings/${t.meeting_id}`;fetch(n,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${W(`auth-token`)}`},strictErrors:!0}).then(t=>{t&&t.status>400?u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori durante la cancellazione dello slot`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):(P([...N.slice(0,e),...N.slice(e+1)]),ne(new Date))})};return(0,r.jsxs)(r.Fragment,{children:[F&&k?(0,r.jsxs)(`div`,{className:`my-5 mx-2 d-print-block d-preview-calendar d-preview-calendar-none`,children:[(0,r.jsxs)(`b`,{children:[Array.isArray(k)&&k.length>1?i.t(`Giorni selezionati per la prenotazione`):i.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,r.jsx)(`div`,{className:`mb-5`,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:Array.isArray(k)?k.map(e=>(0,r.jsx)(q,{day:(0,c.default)(e.date,`DD-MM-YYYY`).format(`DD/MM/YYYY`),i18next:i,slot:e.slot})):(0,r.jsx)(q,{day:(0,d.default)(k.date).format(`DD/MM/YYYY`),i18next:i,slot:k.slot})})})})]}):(0,r.jsx)(`div`,{className:`slot-calendar `,children:(0,r.jsxs)(`div`,{className:`row`,children:[e.multiple?(0,r.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,r.jsxs)(`div`,{className:`m-2`,children:[(0,r.jsx)(`h6`,{children:i.t(e.label)}),(0,r.jsx)(o.DayPicker,{mode:`single`,selected:f,locale:B(),disabled:m,onMonthChange:se,onDayClick:ce})]})}):N.length===1?null:(0,r.jsx)(`div`,{className:`col-12 d-print-none d-preview-calendar-none`,children:(0,r.jsxs)(`div`,{className:`m-2`,children:[(0,r.jsx)(`h6`,{children:i.t(e.label)}),(0,r.jsx)(o.DayPicker,{mode:`single`,selected:f,locale:B(),disabled:m,onMonthChange:se,onDayClick:ce})]})}),(0,r.jsx)(`div`,{className:`col-12`,children:N.length?(0,r.jsx)(`div`,{className:`row m-2`,children:(0,r.jsxs)(`div`,{className:`col-12 mb-4`,children:[(0,r.jsxs)(`b`,{children:[N.length>1?i.t(`Giorni selezionati per la prenotazione`):i.t(`Giorno selezionato per la prenotazione`),`:`,` `]}),(0,r.jsx)(`div`,{className:`mb-5`,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:N.map((e,t)=>(0,r.jsx)(`li`,{children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsxs)(`div`,{className:`it-right-zone`,children:[(0,r.jsxs)(`span`,{className:`text pl-4`,children:[e.date,` `,x||e.slot?`${i.t(`alle`)} ${e.slot}`:``]}),(0,r.jsx)(l.Icon,{icon:`it-delete`,onClick:()=>ge(t,e),role:`button`})]})})},`li`+t))})})}),y?(0,r.jsx)(l.Alert,{color:`info`,defaultValue:`string`,className:`d-print-none d-preview-calendar-none`,children:(0,r.jsx)(s.default,{date:y.expiration_time,renderer:pe})}):null]})}):null})]})}),(0,r.jsxs)(l.Modal,{isOpen:j,toggle:()=>te(!j),labelledBy:`daySelected`,size:`lg`,centered:!0,container:He(),children:[(0,r.jsx)(l.ModalHeader,{toggle:()=>te(!j),id:`daySelected`,children:i.t(`Seleziona una fascia oraria`)}),(0,r.jsx)(l.ModalBody,{children:(0,r.jsxs)(`div`,{className:`row`,children:[N.length>=1?(0,r.jsxs)(`div`,{children:[C&&!_?(0,r.jsxs)(`h6`,{children:[i.t(`Orari disponibili del`),` `,(0,d.default)(C).format(`DD/MM/YYYY`)]}):null,(0,r.jsxs)(`div`,{className:`calendar-last-selection col-12 pt-2 mb-5`,children:[(0,r.jsx)(`small`,{className:`pl-2 mb-2 d-flex px-2`,children:(0,r.jsxs)(`b`,{children:[(0,r.jsx)(l.Icon,{icon:`it-clock`,className:`mr-1`,size:`sm`}),` `,i.t(`Ultimo orario selezionato`)]})}),(0,r.jsx)(`div`,{className:`col-6 px-2`,children:(0,r.jsx)(`button`,{type:`button`,id:`slot-last-selection`,onClick:le,tabIndex:`1`,className:T===`slot-last-selection`?`active btn btn-slot p-0`:`btn btn-slot p-0`,"data-date":(0,c.default)(C,`DD/MM/YYYY`).format(`YYYY-MM-DD`),"data-slots":N[N.length-1].slot,"data-opening_hour":N[N.length-1].opening_hour_id,"data-start":N[N.length-1].slot.split(`-`)[0],"data-end":N[N.length-1].slot.split(`-`)[1],"data-value_start":N[N.length-1].slot.split(`-`)[0],"data-value_end":N[N.length-1].slot.split(`-`)[1],disabled:_,children:N[N.length-1].slot})})]})]}):null,(0,r.jsx)(`div`,{children:C&&N.length>=1?(0,r.jsx)(`h6`,{children:i.t(`Seleziona altri orari`)}):_?null:(0,r.jsxs)(`h6`,{children:[i.t(`Orari disponibili del`),` `,(0,d.default)(C).format(`DD/MM/YYYY`)]})}),ee.map((e,t)=>(0,r.jsx)(`div`,{className:`col-6`,children:(0,r.jsxs)(`button`,{type:`button`,id:`slot-`+t,onClick:le,ref:L,className:T===`slot-`+t?`active btn btn-slot p-0`:`btn btn-slot p-0`,tabIndex:`1`,"data-date":e.date,"data-start":e.start_time,"data-end":e.end_time,"data-value_start":e.start_time,"data-value_end":e.end_time,"data-slots":e.start_time+`-`+e.end_time,"data-opening_hour":e.opening_hour,"data-min_duration":e.min_duration,disabled:e.slots_available==0,children:[e.start_time,` - `,e.end_time]})},`slot-`+t)),_?(0,r.jsxs)(`div`,{className:`callout callout-highlight warning`,children:[(0,r.jsxs)(`div`,{className:`callout-title`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":!0,icon:`it-help-circle`}),i.t(`Attenzione`)]}),(0,r.jsxs)(`p`,{children:[` `,i.t(`Non è possibile prenotare per la data selezionata`),`.`]})]}):null]})}),(0,r.jsx)(l.ModalFooter,{children:(0,r.jsx)(l.Button,{color:`primary`,onClick:()=>de(),disabled:!C||!x?.value_start,children:i.t(`Conferma`)})})]})]})},Ye=class e extends qe{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Calendar`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return qe.schema({type:`calendar`})}static editForm=Ke;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,n.createRoot)(e),this.rootComponent.render((0,r.jsx)(Je,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){if(e)if(Array.isArray(e))this.selectedNextSlots=e,this.updateValue(e),this.shouldSetValue=!0;else if(typeof e==`object`)this.date=e.date,this.slot=e.slot,this.meeting=e.meeting_id,this.meeting_expiration_time=null,this.opening_hour=e.opening_hour_id,this.calendar_id=e.calendar_id,this.updateValue(e),this.shouldSetValue=!0;else{let t=e.replace(`)`,``).replace(` (`,` @ `).replace(/\//g,`-`).split(` @ `),n=t[2].split(`#`);this.date=t[0],this.slot=t[1],this.meeting=n[1],this.meeting_expiration_time=null,this.opening_hour=n.length===3?n[2]:``,this.updateValue({date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:this.meeting,opening_hour_id:this.opening_hour})}}getValue(){if(!(this.date&&this.slot&&this.meeting&&this.opening_hour)&&!(this.selectedNextSlots&&this.selectedNextSlots.length>0))return null;let e=this.meeting?this.meeting:``,t=this.opening_hour?this.opening_hour:``;return this.component.multiple?this.selectedNextSlots:{date:this.date,slot:this.slot,calendar_id:this.calendar_id,meeting_id:e,opening_hour_id:t}}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Xe=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{label:`Base url`,calculateValue:`let url = '`+M()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1},{label:`Tipo di visualizazzione`,widget:`choicesjs`,tableView:!0,data:{values:[{label:`calendar`,value:`calendar`},{label:`select`,value:`select`}]},validateWhenHidden:!1,defaultValue:`calendar`,key:`view`,type:`select`,input:!0}];function Ze(...e){return i.Components.baseEditForm([{key:`display`,components:Xe}],...e)}function Qe({day:e,slot:t,i18next:n}){return(0,r.jsx)(`li`,{className:`it-list-item`,children:(0,r.jsx)(`div`,{className:`list-item`,children:(0,r.jsx)(`div`,{className:`it-right-zone`,children:(0,r.jsxs)(`span`,{className:`text-paragraph pl-4`,children:[(0,r.jsx)(`b`,{children:e}),` `,n.t(`alle`),` `,n.t(`ore`),` `,(0,r.jsx)(`b`,{children:t})]})})})})}function $e(e,t){if(!t||t.length===0)return;let n=t.map(e=>{let t=new Date(e.start);return(new Date(e.end)-t)/6e4}),r=Math.min(...n),i=n.reduce((e,t)=>e+t,0)/n.length,a=0;a=r<=30&&r>15?i*1:r<=15?i*24:i*4,e.setOption(`slotHeight`,a),document.documentElement.style.setProperty(`--slot-height`,`${a}px`)}var et={AVAILABILITY:{key:`availability_data_cache_`,duration:10},SLOTS:{key:`availability_slots_cache_`,duration:10},SUBMISSION:{key:`submission_cache_`,duration:30}},tt=(e,t,n)=>{let r={data:n,timestamp:(0,d.default)().toISOString()};localStorage.setItem(t,JSON.stringify(r))},nt=(e,t)=>{try{let n=localStorage.getItem(t);if(!n)return null;let r=JSON.parse(n),i=(0,d.default)().diff((0,d.default)(r.timestamp),`minutes`);return i>et[e].duration?(localStorage.removeItem(t),console.log(`⏰ Cache scaduto: ${e}`),null):(console.log(`✅ Cache letto: ${e} (${i} minuti fa)`),r.data)}catch(t){return console.error(`Errore nel leggere il cache (${e}):`,t),null}},rt=(e,...t)=>et[e].key+btoa(t),it=`calendar_view_state`,at=`calendar_view_date`,ot=(e,t)=>{try{localStorage.setItem(it,e),localStorage.setItem(at,t||new Date().toISOString())}catch(e){console.error(`Errore nel salvare lo stato della view:`,e)}},J=()=>{try{let e=localStorage.getItem(it),t=localStorage.getItem(at);return{viewType:e||`timeGridWeek`,date:t?new Date(t):new Date}}catch(e){return console.error(`Errore nel leggere lo stato della view:`,e),{viewType:`timeGridWeek`,date:new Date}}},st=()=>{try{localStorage.removeItem(it),localStorage.removeItem(at)}catch(e){console.error(`Errore nel pulire lo stato della view:`,e)}},ct=t.Formio.Components.components.field,lt=({component:e,current:t,onChange:n,i18next:i})=>{let[o,s]=(0,a.useState)(null),[p,m]=(0,a.useState)(null),[h,ee]=(0,a.useState)([]),[g,_]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[b,x]=(0,a.useState)(null),[S,C]=(0,a.useState)([]),[w,T]=(0,a.useState)([]),[E,D]=(0,a.useState)([]),[O,k]=(0,a.useState)(null),[A,j]=(0,a.useState)(null),[te,N]=(0,a.useState)(null),P=(0,a.useRef)(null),F=(0,a.useRef)(null);i.language,c.default.locale(i.language),d.default.locale(i.language);function I(e){if(!e||e.length===0)return null;let t=e.map(e=>({start:e.start_time,end:e.end_time}));return{earliestStartTime:t.reduce((e,t)=>t.start<e?t.start:e,t[0].start),latestEndTime:t.reduce((e,t)=>t.end>e?t.end:e,t[0].end)}}function L(e){let t=e.map(e=>(0,c.default)(e.date).isoWeekday()),n=[1,2,3,4,5,6,7].filter(e=>!t.includes(e));n.length>0?F.current.setOption(`hiddenDays`,n):F.current.setOption(`hiddenDays`,[])}function R(e,t,n){let r=new URL(e),i=`${r.pathname.split(`/`).slice(0,4).join(`/`)}/${t}/${n}`;return`${r.origin}${i}${r.search}`}function ne(e,t,n){let r=new URL(e),i=`${r.pathname.split(`/`).slice(0,4).join(`/`)}`;return`${r.origin}${i}${r.search}&from_to=${t}&to_date=${n}`}function re(e,t,n){return`${M()}/api/availabilities/${e}/${t}?calendar_ids=${n}&available=true`}let z=e=>{D([]),T([]),n({}),e&&T((o??[]).filter(t=>t.date.startsWith(e)))},ie=async(e,t)=>{let r=JSON.parse(e),a=rt(`SLOTS`,r.date,r.calendar_ids);if(t===`manual`)D([]),N(null),x(null),n({});else{let e=nt(`SLOTS`,a);if(e){D(e);return}}try{let e=await window.FormioHelper.anonymousCall(`availabilities/${r.date}?calendar_ids=${r.calendar_ids}`),t=Array.isArray(e)?e:e?.data??[];tt(`SLOTS`,a,t),D(t)}catch(e){console.error(`Errore nel caricamento degli slot:`,e),u.default.fire({icon:`error`,title:i.t(`Errore`),text:i.t(`Errore nel caricamento degli orari`)})}},ae=e=>{let n=t?.dataValue?.id,r=n?`PATCH`:`POST`,i=n?`meetings/${n}`:`meetings`;return window.FormioHelper.authenticatedRequest(r,i,e).catch(t=>{if((t?.response?.status===404||t?.status===404)&&r===`PATCH`)return window.FormioHelper.authenticatedRequest(`POST`,`meetings`,e);throw t})},oe=e=>{let r=JSON.parse(e),a={status:6,calendar:r.calendar_id,opening_hour:r.opening_hour_id,user:null,email:null,fiscal_code:null,name:` `,phone_number:null,from_time:(0,d.default)(`${r.date}T${r.start_time}`).toISOString(),to_time:(0,d.default)(`${r.date}T${r.end_time}`).toISOString(),user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:t?.data?.service_data?.id,calendar_group_office_id:t?.data?.user_group?.id,calendar_group_place_id:t?.data?.place?.id};ae(a).then(e=>{x({day:(0,d.default)(r.date).format(`dddd, DD MMMM YYYY`),startDate:r.start_time,endDate:r.end_time}),n(e?.id?e:e?{...e,id:t.dataValue.id}:t.dataValue.id?{...a,id:t.dataValue.id}:{...a})}).catch(e=>{console.error(e),e.status===400&&e?.response?.data?.type===`validation_error`?u.default.fire({title:``,html:`<p>`+i.t(`Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa`)+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},se=e=>{let t=new Set,n=[];return e.forEach(e=>{let r=(0,d.default)(e.date),i=r.format(`YYYY-MM`);t.has(i)||(t.add(i),n.push({value:i,label:r.format(`MMMM YYYY`).replace(/^\w/,e=>e.toUpperCase())}))}),n},ce=async()=>{let e=t?.root?.data?.place?.merge_availabilities?t?.root?.data?.place?.merged_availabilities_link:null,r=(0,c.default)().format(`YYYY-MM-DD`),a=(0,c.default)().add(1,`month`).format(`YYYY-MM-DD`),o=t?.root?.data?.place?.calendars[0]?.id||null,l=e?ne(e,r,a):re(r,a,o),d=rt(`AVAILABILITY`,l),f=nt(`AVAILABILITY`,d);if(f){s(f),C(se(f));return}else n({});_(!0);try{let e=await window.FormioHelper.fetchAPIUrlLimit(l);if(_(!1),!e?.length){u.default.fire({icon:`warning`,title:i.t(`warning`),html:i.t(`no_meetings`)});return}tt(`AVAILABILITY`,d,e),s(e),C(se(e))}catch(e){_(!1),console.error(`Errore nel caricamento disponibilità:`,e)}};(0,a.useEffect)(()=>{if(o?.length){let e=t?.dataValue??t?.getValue();if(e?.from_time&&e?.to_time&&!(0,d.default)().isAfter(e?.draft_expiration)){let t=(0,d.default)(e.from_time).format(`YYYY-MM`);k(t),t&&T&&(T(o.filter(e=>e.date.startsWith(t))),j((0,d.default)(e.from_time).format(`YYYY-MM-DD`)))}else e?.draft_expiration&&(0,d.default)().isAfter(e?.draft_expiration)&&u.default.fire({icon:`warning`,title:i.t(`warning`),html:i.t(`expired_meeting`)})}},[o]),(0,a.useEffect)(()=>{let e=t?.dataValue??t?.getValue();if(!S.length||O||e?.from_time||e?.to_time)return;let n=S[0];n&&(k(n.value),z(n.value))},[S,O,t?.dataValue]),(0,a.useEffect)(()=>{if(A&&v===!1){let e=t?.dataValue??t?.getValue();ie(JSON.stringify({date:A,calendar_ids:e.calendar.id}))}},[A]);let le=()=>window.innerWidth>768?`timeGridWeek`:`timeGridDay`;(0,a.useEffect)(()=>{let e=()=>{let e=F.current;if(!e)return;let t=le();t!==e.getView().type&&e.setOption(`view`,t)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,a.useEffect)(()=>{let e=t?.dataValue??t?.getValue();E?.length&&e?.from_time&&(N((0,d.default)(e.from_time).format(`HH:mm`)+` - `+(0,d.default)(e.to_time).format(`HH:mm`)),x({day:(0,d.default)(e.from_time).format(`dddd D MMM YYYY`),startDate:(0,d.default)(e.from_time).format(`HH:mm`),endDate:(0,d.default)(e.to_time).format(`HH:mm`)}))},[E]);async function ue(){try{let e=t?.root?.data?.place?.calendars?.[0]?.id??``,n=await window.FormioHelper.anonymousCall(`availabilities/first-available-date?calendar_ids=${e}`);return n?.date?new Date(n.date):null}catch(e){return console.error(`Errore nel recuperare la prima disponibilità:`,e),null}}let de=e=>{let r=J();F.current=(0,f.createCalendar)(P.current,[f.TimeGrid],{events:[],buttonText:{today:i.t(`Oggi`)},allDaySlot:!1,firstDay:1,date:e??r.date,slotEventOverlap:!1,view:le(),height:`400px`,views:{timeGridWeek:{allDaySlot:!1,firstDay:1,slotHeight:48},timeGridDay:{allDaySlot:!1,firstDay:1,slotHeight:48}},datesSet:e=>{ot(e.view.type,e.start)},eventClick({event:e,el:r}){document.querySelectorAll(`.ec-event`).forEach(e=>{e.classList.remove(`highlighted-event`)}),r.classList.add(`highlighted-event`);let a=new Date(e.start),o=new Date(e.end),s=a.toLocaleDateString(`it-IT`,{weekday:`long`,day:`numeric`,month:`long`,year:`numeric`}),c=a.toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}),l=o.toLocaleTimeString(`it-IT`,{hour:`2-digit`,minute:`2-digit`}),d={status:6,calendar:e.extendedProps.calendar_id,opening_hour:e.extendedProps.opening_hour_id,user:null,email:null,fiscal_code:null,name:` `,phone_number:null,from_time:a,to_time:o,user_message:null,reason:null,location:null,motivation_outcome:null,calendar_group_config_id:t?.data?.service_data?.id,calendar_group_office_id:t?.data?.user_group?.id,calendar_group_place_id:t?.data?.place?.id};ae(d).then(e=>{let r;!e||e===``?r={...d,code:null,id:t?.dataValue?.id}:typeof e==`object`&&(r=e),x({day:s,startDate:c,endDate:l}),n(r)}).catch(e=>{console.error(e),e.status===400&&e?.response?.data?.type===`validation_error`?u.default.fire({title:``,html:`<p>`+i.t(`Lo slot orario selezionato non è disponibile perché già prenotato Seleziona un altro orario o una data diversa`)+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})},viewDidMount:fe,eventDidMount:e=>{let{event:t,el:n}=e,r=t.extendedProps;n.setAttribute(`data-event-id`,t.id+`-`+r.date+`-`+r.start_time)},loading:e=>{_(e)}})},fe=e=>{t?.root?.data?.place&&F.current.setOption(`eventSources`,[{events:pe}])};async function pe(e){try{F.current.setOption(`events`,[]);let n=(0,c.default)(e.start).format(`YYYY-MM-DD`),r=new Date(e.end);r.setDate(r.getDate()-1);let a=(0,c.default)(r).format(`YYYY-MM-DD`),o=t?.root?.data?.place?.merge_availabilities?t?.root?.data?.place?.merged_availabilities_link:null,s=o?R(o,n,a):re(n,a,null),l=rt(`AVAILABILITY`,s),d=nt(`AVAILABILITY`,l),f;if(d?(f=d,_(!1)):(f=await window.FormioHelper.fetchAPIUrlLimit(s),tt(`AVAILABILITY`,l,f)),!f?.length)return u.default.fire({icon:`warning`,title:i.t(`warning`),html:i.t(`no_meetings`)}),[];let p=f.map(e=>({id:e.opening_hour_id,allDay:!1,start:`${e.date}T${e.start_time}:00`,end:`${e.date}T${e.end_time}:00`,title:``,editable:!1,display:`auto`,color:`#ebeef0`,textColor:`#000`,className:`event-slot`,extendedProps:{...e}})),m=I(f);return F.current.setOption(`slotMinTime`,m.earliestStartTime),F.current.setOption(`slotMaxTime`,m.latestEndTime),L(f),$e(F.current,p),setTimeout(()=>{me(p)},500),p}catch(e){throw console.error(`Errore nel caricamento disponibilità:`,e),e}}(0,a.useEffect)(()=>{let r,a=!1;async function o(){try{if(await window.FormioInstance?.formReady,a)return;if(!P.current){console.warn(`Elemento calendario non trovato`);return}let r=t?.dataValue??t?.getValue();r&&r?.draft_expiration&&(0,d.default)().isAfter(r.draft_expiration)&&(n({}),st()),t?.data?.service_data?.view_type===`calendar`||e.view===`calendar`?F?.current||de(await ue()):t?.data?.service_data?.view_type===`select`||e.view===`select`?ce():alert(i.t(`Il componente non è configurato per la visualizzazione a calendario`))}catch(e){console.error(`Errore durante l'inizializzazione del calendario:`,e)}}return r=setTimeout(o,500),()=>{a=!0,r&&clearTimeout(r),F.current&&=((0,f.destroyCalendar)(F.current),null)}},[t?.root?.data?.place]);function me(e){let n=t?.dataValue;if(!n?.from_time)return;let r=(0,d.default)(n.from_time).format(`DD-MM-YYYY HH:mm`),i=(0,d.default)(n.to_time).format(`DD-MM-YYYY HH:mm`),a=e.find(e=>(0,d.default)(e.start).format(`DD-MM-YYYY HH:mm`)===r&&(0,d.default)(e.end).format(`DD-MM-YYYY HH:mm`)===i);if(!a)return;let o=document.querySelector(`.ec-event[data-event-id="${a.id}-${(0,d.default)(n?.from_time).format(`YYYY-MM-DD`)}-${(0,d.default)(n?.from_time).format(`HH:mm`)}"]`);o&&(o.classList.add(`highlighted-event`),o.scrollIntoView({behavior:`smooth`,block:`center`}),x({day:(0,d.default)(n?.from_time).format(`dddd, DD MMMM YYYY`),startDate:(0,d.default)(n?.from_time).format(`HH:mm`),endDate:(0,d.default)(n?.to_time).format(`HH:mm`)}))}return(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&v===!1?y(!0):(t?.data?.service_data?.view_type===`select`&&ce(),y(!1))},[]),(0,a.useEffect)(()=>{v&&setTimeout(()=>{let e=t?.dataValue??t?.getValue();e&&m(e)},500)},[v]),(0,r.jsx)(r.Fragment,{children:v&&p?(0,r.jsxs)(`div`,{className:`mx-2`,children:[(0,r.jsxs)(`p`,{className:`text-paragraph`,children:[i.t(`Giorno selezionato per la prenotazione`),`:`]}),(0,r.jsx)(`div`,{className:``,children:(0,r.jsx)(`div`,{className:`it-list-wrapper`,children:(0,r.jsx)(`ul`,{className:`it-list`,children:(0,r.jsx)(Qe,{day:(0,d.default)(p.from_time).format(`dddd D MMM YYYY`),i18next:i,slot:`${(0,d.default)(p.from_time).format(`HH:mm`)} - ${(0,d.default)(p.to_time).format(`HH:mm`)}`})})})})]}):(0,r.jsxs)(`div`,{className:``,children:[(0,r.jsx)(`div`,{ref:P}),S.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.Select,{label:`Mese`,id:`selectMonthYear`,onChange:z,children:[(0,r.jsx)(`option`,{value:``,children:i.t(`Scegli un'opzione`)}),S.map(e=>(0,r.jsx)(`option`,{value:e.value,selected:e.value===O,children:e.label},e.value))]}),(0,r.jsxs)(l.Select,{label:`Giorno`,id:`selectDay`,onChange:e=>ie(e,`manual`),disabled:w.length===0,children:[(0,r.jsx)(`option`,{value:``,children:i.t(`Scegli un'opzione`)}),w.map(e=>(0,r.jsx)(`option`,{value:JSON.stringify(e),selected:e.date===A,children:(0,d.default)(e.date).format(`dddd,DD MMMM YYYY`)},e.date))]}),(0,r.jsxs)(l.Select,{label:`Orario`,id:`selectSlot`,onChange:oe,disabled:E.length===0,children:[(0,r.jsx)(`option`,{value:``,children:i.t(`Scegli un'opzione`)}),E.map(e=>(0,r.jsx)(`option`,{value:JSON.stringify(e),selected:e.start_time+` - `+e.end_time===te,children:e.start_time+` - `+e.end_time},e.start_time+` - `+e.end_time))]})]}):null,b?(({day:e,startDate:t,endDate:n})=>(0,r.jsx)(`div`,{className:`mt-3`,children:(0,r.jsxs)(`div`,{className:`row align-items-center gy-3`,children:[(0,r.jsxs)(`div`,{className:`col-12 col-md border-light mx-md-3`,children:[(0,r.jsx)(`div`,{className:`text-paragraph-small`,children:i.t(`Data`)}),(0,r.jsx)(`p`,{className:`data-text`,children:(0,r.jsx)(`strong`,{children:e})})]}),(0,r.jsxs)(`div`,{className:`col-12 col-md border-light mx-md-3`,children:[(0,r.jsx)(`div`,{className:`text-paragraph-small`,children:i.t(`Ora`)}),(0,r.jsx)(`p`,{className:`data-text`,children:(0,r.jsxs)(`strong`,{children:[t,` - `,n]})})]})]})}))({day:b.day,startDate:b.startDate,endDate:b.endDate}):null,g?(0,r.jsx)(`div`,{className:`d-flex align-items-center justify-content-center position-absolute-center`,children:(0,r.jsx)(l.Spinner,{active:!0})}):null]})})},ut=class e extends ct{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Calendar Advanced`,group:`basic`,icon:`bi bi-calendar-plus`,documentation:``,weight:70,schema:e.schema()}}static schema(){return ct.schema({type:`calendar-advanced`})}static editForm=Ze;attach(e,t){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent&&=(this.rootComponent.unmount(),null),this.rootComponent=(0,n.createRoot)(e),this.builderMode?(this.rootComponent.render((0,r.jsx)(`div`,{className:`my-1 border border-2 border-light rounded p-3 text-secondary`,children:(0,r.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`Calendar Advanced`})})),this):(this.rootComponent.render((0,r.jsx)(lt,{ref:t,component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this})),this)):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){e&&(this.updateValue(e),this.shouldSetValue=!0)}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},dt=[{key:`defaultValue`,ignore:!0}],ft=[{key:`placeholder`,ignore:!0},{type:`checkbox`,label:`Files Synchronization feature`,tooltip:`Enable ability to control files synchronization. Files will be auto synced before submit.`,key:`autoSync`,input:!0,conditional:{json:{in:[{var:`data.storage`},[`s3`,`azure`,`googledrive`]]}}}],pt=[{type:`select`,input:!0,key:`storage`,label:`Storage`,placeholder:`Select your file storage provider`,weight:0,tooltip:`Which storage to save the files in.`,valueProperty:`value`,dataSrc:`custom`,hidden:!0,data:{custom:function(){return[{label:`url`,value:`url`}]}}},{type:`checkbox`,input:!0,defaultValue:!0,key:`protocol_required`,label:`Richiede protocollazione?`,tooltip:``,weight:10},{type:`checkbox`,input:!0,defaultValue:!1,key:`check_signature`,label:`Effettuare il controllo della firma?`,tooltip:``,weight:15},{type:`checkbox`,input:!0,key:`useMultipartUpload`,label:`Use the S3 Multipart Upload API`,tooltip:`The <a href='https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html'>S3 Multipart Upload API</a> is designed to improve the upload experience for larger objects (> 5GB).`,conditional:{json:{"===":[{var:`data.storage`},`s3`]}}},{label:`Multipart Upload`,tableView:!1,key:`multipart`,type:`container`,input:!0,components:[{label:`Part Size (MB)`,applyMaskOn:`change`,mask:!1,tableView:!1,delimiter:!1,requireDecimal:!1,inputFormat:`plain`,truncateMultipleSpaces:!1,validate:{min:5,max:5e3},key:`partSize`,type:`number`,input:!0,defaultValue:500}],conditional:{json:{"===":[{var:`data.useMultipartUpload`},!0]}}},{type:`textfield`,input:!0,key:`options.indexeddb`,label:`Database`,weight:10,placeholder:`Enter the indexeddb database name`,conditional:{json:{in:[{var:`data.storage`},[`indexeddb`]]}}},{type:`textfield`,input:!0,label:`Table`,key:`options.indexeddbTable`,weight:10,placeholder:`Enter the name for indexeddb table`,conditional:{json:{in:[{var:`data.storage`},[`indexeddb`]]}}},{type:`textarea`,key:`options`,label:`Custom request options`,tooltip:`Pass your custom xhr options(optional)`,rows:5,editor:`ace`,input:!0,weight:15,placeholder:`{
|
|
68
68
|
"withCredentials": true,
|
|
69
69
|
"headers": {
|
|
70
70
|
"Authorization": "Basic <key>"
|
|
71
71
|
}
|
|
72
|
-
}`,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`fileKey`,label:`File form-data key`,weight:17,placeholder:`Enter the key name of a file for form data.`,tooltip:`Key name that you would like to modify for the file while calling API request.`,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`dir`,label:`Directory`,placeholder:`(optional) Enter a directory for the files`,tooltip:`This will place all the files uploaded in this field in the directory`,weight:20,conditional:{json:{"!==":[{var:`data.storage`},`googledrive`]}}},{type:`textfield`,input:!0,key:`dir`,label:`Folder ID`,placeholder:`(optional) Enter an ID of the folder for the files`,tooltip:`This will place all the files uploaded in this field in the folder`,weight:20,conditional:{json:{"===":[{var:`data.storage`},`googledrive`]}}},{type:`textfield`,input:!0,key:`fileNameTemplate`,label:`File Name Template`,placeholder:`(optional) { {name} }-{ {guid} }"`,tooltip:"Specify template for name of uploaded file(s). Regular template variables are available (`data`, `component`, `user`, `value`, `moment` etc.), also `fileName`, `guid` variables are available. `guid` part must be present, if not found in template, will be added at the end.",weight:25},{type:`checkbox`,input:!0,key:`image`,label:`Display as image(s)`,tooltip:`Instead of a list of linked files, images will be rendered in the view.`,weight:30},{type:`checkbox`,input:!0,key:`uploadOnly`,label:`Upload Only`,tooltip:`When this is checked, will only allow you to upload file(s) and consequently the download, in this component, will be unavailable.`,weight:33},{type:`checkbox`,input:!0,key:`privateDownload`,label:`Private Download`,tooltip:`When this is checked, the file download will send a POST request to the download URL with the x-jwt-token header. This will allow your endpoint to create a Private download system.`,weight:31,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`imageSize`,label:`Image Size`,placeholder:`100`,tooltip:`The image size for previewing images.`,weight:40,conditional:{json:{"==":[{var:`data.image`},!0]}}},{type:`textfield`,input:!0,key:`maxFiles`,label:`Numero massimo di file`,placeholder:`100`,tooltip:`Numero massimo di file caricabilii, default è 100.`,weight:40},{type:`checkbox`,input:!0,key:`webcam`,label:`Enable web camera`,tooltip:`This will allow using an attached camera to directly take a picture instead of uploading an existing file.`,weight:32},{type:`textfield`,input:!0,key:`webcamSize`,label:`Webcam Width`,placeholder:`320`,tooltip:`The webcam size for taking pictures.`,weight:38,conditional:{json:{"==":[{var:`data.webcam`},!0]}}},{type:`datagrid`,input:!0,label:`File Types`,key:`fileTypes`,tooltip:`Specify file types to classify the uploads. This is useful if you allow multiple types of uploads but want to allow the user to specify which type of file each is.`,weight:11,components:[{label:`Label`,key:`label`,input:!0,type:`textfield`},{label:`Value`,key:`value`,input:!0,type:`textfield`}]},{type:`textfield`,input:!0,key:`filePattern`,label:`File Pattern`,placeholder:`.jpg,video/*,application/pdf`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file patterns.`,weight:50},{type:`textfield`,input:!0,key:`fileMinSize`,label:`File Minimum Size`,placeholder:`1MB`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.`,weight:60},{type:`textfield`,input:!0,key:`fileMaxSize`,label:`File Maximum Size`,placeholder:`10MB`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.`,weight:70},{type:`textfield`,input:!0,key:`maxFiles`,label:`Numero massimo di file`,placeholder:`100`,tooltip:`Numero massimo di file caricabilii, default è 100.`,weight:40}],ht=[{key:`unique`,ignore:!0},{key:`validateOn`,ignore:!0}];function gt(...e){return i.Components.baseEditForm([{key:`display`,components:pt},{key:`data`,components:ft},{label:`File`,key:`file`,weight:5,components:mt},{key:`validation`,components:ht}],...e)}var _t=E(((e,t)=>{t.exports=Array.isArray})),vt=E(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),yt=E(((e,t)=>{var n=vt(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),bt=E(((e,t)=>{t.exports=yt().Symbol})),xt=E(((e,t)=>{var n=bt(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),St=E(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),Ct=E(((e,t)=>{var n=bt(),r=xt(),i=St(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),wt=E(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),Tt=E(((e,t)=>{var n=Ct(),r=wt(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Et=E(((e,t)=>{var n=_t(),r=Tt(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Dt=E(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Ot=E(((e,t)=>{var n=Ct(),r=Dt(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),kt=E(((e,t)=>{t.exports=yt()[`__core-js_shared__`]})),At=E(((e,t)=>{var n=kt(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),jt=E(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),Mt=E(((e,t)=>{var n=Ot(),r=At(),i=Dt(),a=jt(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Nt=E(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Pt=E(((e,t)=>{var n=Mt(),r=Nt();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Ft=E(((e,t)=>{t.exports=Pt()(Object,`create`)})),It=E(((e,t)=>{var n=Ft();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),Lt=E(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Rt=E(((e,t)=>{var n=Ft(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),zt=E(((e,t)=>{var n=Ft(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),Bt=E(((e,t)=>{var n=Ft(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),Vt=E(((e,t)=>{var n=It(),r=Lt(),i=Rt(),a=zt(),o=Bt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Ht=E(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Ut=E(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Wt=E(((e,t)=>{var n=Ut();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Gt=E(((e,t)=>{var n=Wt(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Kt=E(((e,t)=>{var n=Wt();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),qt=E(((e,t)=>{var n=Wt();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Jt=E(((e,t)=>{var n=Wt();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Yt=E(((e,t)=>{var n=Ht(),r=Gt(),i=Kt(),a=qt(),o=Jt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Xt=E(((e,t)=>{t.exports=Pt()(yt(),`Map`)})),Zt=E(((e,t)=>{var n=Vt(),r=Yt(),i=Xt();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Qt=E(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),$t=E(((e,t)=>{var n=Qt();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),en=E(((e,t)=>{var n=$t();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),tn=E(((e,t)=>{var n=$t();function r(e){return n(this,e).get(e)}t.exports=r})),nn=E(((e,t)=>{var n=$t();function r(e){return n(this,e).has(e)}t.exports=r})),rn=E(((e,t)=>{var n=$t();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),an=E(((e,t)=>{var n=Zt(),r=en(),i=tn(),a=nn(),o=rn();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),on=E(((e,t)=>{var n=an(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),sn=E(((e,t)=>{var n=on(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),cn=E(((e,t)=>{var n=sn(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),ln=E(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),un=E(((e,t)=>{var n=bt(),r=ln(),i=_t(),a=Tt(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),dn=E(((e,t)=>{var n=un();function r(e){return e==null?``:n(e)}t.exports=r})),Y=E(((e,t)=>{var n=_t(),r=Et(),i=cn(),a=dn();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),fn=E(((e,t)=>{var n=Tt(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),pn=E(((e,t)=>{var n=Y(),r=fn();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),mn=E(((e,t)=>{var n=pn();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),hn=E(((e,t)=>{var n=Pt();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),gn=E(((e,t)=>{var n=hn();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),_n=E(((e,t)=>{var n=gn(),r=Ut(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),vn=E(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),yn=E(((e,t)=>{var n=_n(),r=Y(),i=vn(),a=Dt(),o=fn();function s(e,t,s,c){if(!a(e))return e;t=r(t,e);for(var l=-1,u=t.length,d=u-1,f=e;f!=null&&++l<u;){var p=o(t[l]),m=s;if(p===`__proto__`||p===`constructor`||p===`prototype`)return e;if(l!=d){var h=f[p];m=c?c(h,p,f):void 0,m===void 0&&(m=a(h)?h:i(t[l+1])?[]:{})}n(f,p,m),f=f[p]}return e}t.exports=s})),bn=E(((e,t)=>{var n=yn();function r(e,t,r){return e==null?e:n(e,t,r)}t.exports=r})),xn=O(mn(),1),Sn=O(bn(),1);document.documentElement.lang.toString();var Cn=class{constructor(){this.token=null,this.basePath=null,this.init()}init(){this.token=null,this.basePath=M()}async getSessionAuthToken(){let e=this;await m.default.get(e.basePath+`/api/session-auth`).then(t=>{e.token=t.data.token}).catch(e=>{u.default.fire(`'error_message_detail`,`'auth_error'`,`error`)})}getSessionAuthTokenPromise(){let e=this;return new Promise(async(t,n)=>{W(`auth-token`)?t({token:W(`auth-token`)}):await m.default.get(e.basePath+`/api/session-auth?with-cookie=true`,{withCredentials:!0,headers:{"Content-Type":`application/json; charset=utf-8`}}).then(e=>{let t=(0,g.jwtDecode)(e.data.token);t.exp&&Ve(`auth-token`,e.data.token,t.exp)}).catch(e=>{console.log(e)})})}getToken(){return this.token}execAuthenticatedCall(e){this.token?e(this.token):this.getSessionAuthTokenPromise().then(t=>{this.token=t.token,e(this.token)})}},wn=t.Formio.Components.components.file,Tn=null;document.querySelector(`widget-formio`)!==null&&(Tn=document.querySelector(`widget-formio`).getAttribute(`signature-check-ws-url`));var En=({component:e,current:t,onChange:n,i18next:i})=>{let[o,s]=(0,a.useState)([]),[c,d]=(0,a.useState)(new Map),[f,g]=(0,a.useState)(!1),_=new Cn;(0,a.useEffect)(()=>{_.getSessionAuthTokenPromise()},[]);let v=(e,t)=>{d(n=>{let r=new Map(n);return r.set(e,{...t,progress:Number(t?.progress)||0}),r})};function y(t){return t.size>(A(e.fileMaxSize)||A(`1GB`))?{code:`size-files`,message:`${i.t(`I file non possono superare le dimensioni di`)} ${e.fileMaxSize?e.fileMaxSize:`1GB`}`}:o.length>=(e.maxFiles?parseInt(e.maxFiles):e.multiple?100:1)?{code:`too-many-files`,message:`${i.t(`Puoi caricare massimo `)} ${e.maxFiles||100} ${i.t(`file`)}`}:t.size<A(e.fileMinSize)?{code:`file-too-small`,message:`${i.t(`I file devono avare una dimensione superiore a `)} ${e.fileMinSize}`}:null}function b(){if(e.filePattern){let t=e.filePattern.split(`,`).map(e=>e.trim()).filter(Boolean).reduce((e,t)=>{let n=t.startsWith(`.`)?t:`.${t}`,r=h.default.getType(n);return r?(e[r]||(e[r]=[]),e[r].push(n),e):e},{});return Object.keys(t).length?t:void 0}else return!0}let x=e=>{let t={};return t.originalName=e.originalName?e.originalName:e.name,t.name=e.name,t.url=e.url,t.data=e.data,t.signature_validation=e.signature_validation,t.mime_type=e.mime_type,t.storage=`url`,t.size=e.size,t},{getRootProps:S,getInputProps:C,fileRejections:w,isDragActive:T,open:E}=(0,p.useDropzone)({onDrop:e=>{e.map(e=>{k(e).then(e=>{})})},maxFiles:e.maxFiles?parseInt(e.maxFiles)-o.length:e.multiple?100:1,validator:y,accept:b()}),D=e=>{let t=M()+`/api/attachments/`+e.data.id;fetch(t,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${W(`auth-token`)}`},strictErrors:!0}).then(()=>{s(t=>{let r=t.filter(t=>t.data.id!==e.data.id);return n(r),r})}).catch(e=>{u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori durante l'eliminazione del file`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),console.error(e)})},O=()=>{let e=typeof t?.getCurrentValue==`function`?t.getCurrentValue():t?.dataValue;e?.length>0&&(s(e),setTimeout(()=>{n(e)},100))};(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&f===!1?(g(!0),setTimeout(()=>{O()},1e3)):(g(!1),setTimeout(()=>{O()},1e3))},[]);async function k(r){let a,o=M()+`/it/upload`,c={mime_type:r.type,name:r.name,original_filename:r.name,protocol_required:e.protocol_required,size:r.size};return await m.default.post(o,c,{maxContentLength:1/0,maxBodyLength:1/0}).then(async o=>(a=o.data.id,r.url=M()+`/it/allegati/`+a,r.storage=`url`,r.mime_type=r.type,r.protocol_required=e.protocol_required,r.data={...o.data,baseUrl:M()+`/it/allegati/`+a},v(a,r),await m.default.put(o.data.uri,r,{onUploadProgress:e=>{let t=Math.round(e.loaded*100/e.total);d(e=>{let n=new Map(e),i=r;return i.progress=parseInt(t),n.has(a)&&n.set(a,i),n})},maxContentLength:1/0,maxBodyLength:1/0,headers:{"Content-Type":`multipart/form-data`}}).then(async o=>{let c=o.headers.etag.replace(/\\|"/gi,``)||null;return await m.default.put(M()+`/it/upload/`+a,{file_hash:c,check_signature:e.check_signature}).then(async i=>{d(e=>{let t=new Map(e);return t.delete(a),t});let o=t.dataValue||[],c=null;if(s(e=>{let t=[...e,x(r)];return c=t.length-1,n(t),t}),e.check_signature&&i.data.url&&Tn)return await m.default.post(Tn,{url:i.data.url,content:null},{headers:{"Content-Type":`application/json`}}).then(e=>{r.signature_validation=e.data.sign,o[c].signature_validation=e.data.sign}).catch(e=>{o[c].signature_validation=`File validation error: `+e});d(e=>{let t=new Map(e);return t.delete(a),t})}).catch(e=>{d(e=>{let t=new Map(e);return t.delete(a),t}),console.log(e),u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})}).catch(e=>{d(e=>{let t=new Map(e);return t.delete(a),t}),console.log(e),u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})}))).catch(e=>{console.log(e),u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),d(e=>{let t=new Map(e);return t.delete(a),t})})}function A(e){if(typeof e==`string`){if(e.search(/kb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024);if(e.search(/mb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024*1024);if(e.search(/gb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024*1024*1024);if(e.search(/b/i)===e.length-1||e.search(/s/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/m/i)===e.length-1)return parseFloat(e.substring(0,e.length-1)*60);if(e.search(/h/i)===e.length-1)return parseFloat(e.substring(0,e.length-1)*3600)}return e}function j(e,t=2){if(!+e)return`0 Bytes`;let n=1024,r=t<0?0:t,i=[`Bytes`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],a=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/n**+a).toFixed(r))} ${i[a]}`}return t.conditionallyHidden()||t.visible===!1?null:(0,r.jsx)(r.Fragment,{children:f?(0,r.jsxs)(`div`,{children:[(0,r.jsxs)(`label`,{className:`col-form-label floating-label`,htmlFor:`${e.id}-${e.key}`,children:[e.label,e.validate.required&&(0,r.jsx)(`span`,{className:`text-danger`})]}),(0,r.jsxs)(`ul`,{className:`upload-file-list`,children:[o.map((e,t)=>(0,r.jsxs)(`li`,{className:`upload-file success mw-100`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,r.jsxs)(`p`,{children:[(0,r.jsx)(`span`,{className:`visually-hidden`,children:i.t(`File caricato:`)}),e.name,(0,r.jsx)(`span`,{className:`upload-file-weight`,children:j(e.size)})]})]},e.size+t)),o.length<1&&(0,r.jsxs)(`li`,{className:`upload-file text-secondary mw-100`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`light`,icon:`it-files`,title:`Icona file`,size:`sm`}),(0,r.jsx)(`p`,{children:i.t(`Nessun elemento`)})]})]})]}):(0,r.jsxs)(r.Fragment,{children:[e.hideLabel||e.hidden?``:(0,r.jsxs)(`label`,{className:`col-form-label floating-label`,htmlFor:`${e.id}-${e.key}`,title:e.tooltip||void 0,children:[e.label,e.validate.required&&(0,r.jsx)(`span`,{className:`text-danger`}),e.tooltip&&(0,r.jsx)(`i`,{tabIndex:0,className:`bi bi-question-circle text-muted ms-1`,"data-tooltip":e.tooltip,"aria-expanded":`false`})]}),(0,r.jsxs)(`div`,{className:`my-1 border-2 border-light file-uploader-box rounded p-3 text-secondary${T?` dragover`:``}`,style:{border:`dashed`},...S({onClick:e=>e.stopPropagation()}),children:[(0,r.jsx)(`input`,{id:`${e.id}-${e.key}`,"aria-describedby":`file-uploader-description-${e.id}-${e.key}`,...C()}),(0,r.jsxs)(`div`,{className:`upload-dragdrop${T?` dragover`:``}`,children:[(0,r.jsx)(`div`,{className:`ms-1 me-3`,children:(0,r.jsx)(l.Icon,{color:`secondary`,icon:`it-upload`,title:i.t(`Carica file`),size:`_sm`})}),(0,r.jsxs)(`div`,{className:`upload-dragdrop-text`,children:[(0,r.jsx)(`div`,{className:`h5`,id:`file-uploader-description-${e.id}-${e.key}`,children:i.t(`Trascina il file per caricarlo`)}),(0,r.jsxs)(`p`,{className:`d-inline-flex`,children:[i.t(`oppure`),(0,r.jsx)(l.Button,{tag:`input`,type:`button`,value:i.t(`selezionalo dal dispositivo`),onClick:E,className:`px-1 py-0 text-decoration-underline primary-color`,size:`xs`})]})]})]})]}),(0,r.jsx)(`div`,{dangerouslySetInnerHTML:{__html:ee.default.sanitize(e.description||``)}}),(0,r.jsxs)(`ul`,{className:`upload-file-list my-0`,children:[o.map((e,t)=>(0,r.jsxs)(`li`,{className:`upload-file success`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,r.jsxs)(`p`,{children:[(0,r.jsx)(`span`,{className:`visually-hidden`,children:i.t(`File caricato:`)}),e.name,(0,r.jsx)(`span`,{className:`upload-file-weight`,children:j(e.size)})]}),(0,r.jsx)(l.Button,{className:`px-1`,onClick:()=>D(e),children:(0,r.jsx)(l.Icon,{title:`${i.t(`Elimina file caricato`)} ${e.name}`,color:`secondary`,icon:`it-delete`,className:`ms-auto pointer`,size:`sm`})})]},e.size+t)),Array.from(c.entries()).map(([e,t])=>(0,r.jsxs)(`li`,{className:`upload-file success`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,r.jsxs)(`p`,{children:[(0,r.jsx)(`span`,{className:`visually-hidden`,children:i.t(`Caricamento file:`)}),t.name,(0,r.jsx)(`span`,{className:`upload-file-weight`,children:j(t.size)})]}),(0,r.jsx)(l.Progress,{value:Number(t?.progress)||0})]},e))]}),!!(w&&w.length)&&(0,r.jsx)(`div`,{className:`formio-error-wrapper`,children:(0,r.jsx)(`ul`,{className:`formio-errors upload-file-list my-0 `,children:w.map(({file:t,errors:n},a)=>(0,r.jsxs)(`li`,{className:`upload-file error`,children:[(0,r.jsxs)(`div`,{className:`upload-file-name-error-wrapper`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`error`,icon:`it-error`,title:`Icona file`,size:`sm`}),(0,r.jsxs)(`p`,{className:`text-wrap error`,children:[(0,r.jsx)(`span`,{className:`visually-hidden`,children:i.t(`Errore caricamento file:`)}),t.name,(0,r.jsx)(`span`,{className:`upload-file-weight`,children:j(t.size)})]})]}),(0,r.jsx)(`div`,{children:n.map(t=>t.code===`file-invalid-type`?(0,r.jsxs)(`p`,{className:`text-wrap ms-0`,children:[i.t(`I file possono essere di tipo `),e.filePattern]}):t.code===`too-many-files`?(0,r.jsxs)(`p`,{className:`text-wrap ms-0`,children:[i.t(`Puoi caricare massimo `),` `,e.maxFiles?e.maxFiles:e.multiple?100:1,` `,i.t(`file`)]}):(0,r.jsx)(`p`,{className:`text-wrap ms-0`,children:t.message}))})]},t.size+a))})})]})})},Dn=class e extends wn{constructor(e,t,n){super({...e,clearOnHide:!1},t,n),this.reactRef=null,this.lastRenderedVisible=void 0,this.rootComponent=null,this.mountNode=null}static get builderInfo(){return{title:`File Sdc`,group:`basic`,icon:`bi bi-file-earmark-text`,documentation:``,weight:70,schema:e.schema()}}get emptyValue(){return[]}init(){if(super.init(),this.component?.multiple&&!Array.isArray(this.getCurrentValue())){this.dataValue=[];let e=this.path||this.component?.key;e&&this.rootValue&&(0,Sn.default)(this.rootValue,e,[])}}static schema(){return wn.schema({type:`sdcfile`,modelType:`array`})}static editForm=gt;getI18next(){return this.i18next&&typeof this.i18next.t==`function`?this.i18next:{language:this.options?.language||document?.documentElement?.lang||`it`,t:(e,t)=>this.t(e,t)}}hideFileProcessingLoader(){this.refs?.fileProcessingLoader&&(this.refs.fileProcessingLoader.style.display=`none`)}renderReact(){if(this.rootComponent){if(this.builderMode){this.rootComponent.render((0,r.jsx)(`div`,{className:`my-1 border border-2 border-light file-uploader-box rounded p-3 text-secondary`,children:(0,r.jsx)(`div`,{className:`upload-dragdrop`,children:(0,r.jsx)(`div`,{className:`upload-dragdrop-text`,children:(0,r.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`File Sdc`})})})}));return}this.rootComponent.render((0,r.jsx)(En,{component:this.component,current:this,i18next:this.getI18next(),onChange:e=>this.updateValueFromReact(e)}))}}attach(e){let t=super.attach(e);this.hideFileProcessingLoader();let r=`react-${this.id}`;this.loadRefs(e,{[r]:`single`});let i=this.refs[r];return i?(this.rootComponent&&this.mountNode!==i&&(this.rootComponent.unmount(),this.rootComponent=null),this.rootComponent||=(0,n.createRoot)(i),this.mountNode=i,this.lastRenderedVisible=this.visible,this.renderReact(),t):t}updateValueFromReact(e,t={modified:!0}){let n=this.normalizeValue(e,t),r=this.updateValue(n,t),i=this.path||this.component?.key;if(i&&this.rootValue){let e=(0,xn.default)(this.rootValue,i);this.isEqual(e,n)||(0,Sn.default)(this.rootValue,i,n)}return r}setValue(e,t={}){let n=this.normalizeValue(e,t),r=super.setValue(n,t),i=this.path||this.component?.key;if(i&&this.rootValue){let e=(0,xn.default)(this.rootValue,i);this.isEqual(e,n)||(0,Sn.default)(this.rootValue,i,n)}return r}normalizeValue(e,t={}){let n=super.normalizeValue(e,t);return!this.component?.multiple||Array.isArray(n)?n:n==null||n===``?[]:[n]}detach(){return this.hideFileProcessingLoader(),this.rootComponent&&=(this.rootComponent.unmount(),null),this.mountNode=null,super.detach()}getValue(){return this.getCurrentValue()}get validationValue(){return this.getCurrentValue()}getCurrentValue(){let e=super.getValue(),t=this.path||this.component?.key,n=t&&this.rootValue?(0,xn.default)(this.rootValue,t):void 0;return this.component?.multiple?Array.isArray(e)&&e.length>0?e:Array.isArray(n)?n:[]:e??n??null}isEmpty(e=this.validationValue){return this.component?.multiple?!Array.isArray(e)||e.length===0:e==null||e===``}checkCondition(e,t){let n=super.checkCondition(e,t),r=this.visible;return this.lastRenderedVisible!==r&&(this.lastRenderedVisible=r,this.renderReact()),n}render(){let e=`<div ref="react-${this.id}"></div>`;return Object.getPrototypeOf(Object.getPrototypeOf(wn.prototype)).render.call(this,e)}},On=[{key:`labelPosition`,ignore:!0},{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0}];function kn(...e){return i.Components.baseEditForm([{key:`display`,components:On}],...e)}var An=_.default?.default??_.default,jn=({value:e,defaultValue:t=``,onConfirm:n,source:i,disabled:o,onClear:s,tClearInput:c=()=>`Clear input`,...u})=>{let d=(0,a.useRef)(null),f=e=>{setTimeout(()=>{d.current&&(d.current.elementReferences[-1].value=e)},0)};(0,a.useEffect)(()=>{e!==void 0&&f(e)},[e]),(0,a.useEffect)(()=>{o?d.current&&(d.current.elementReferences[-1].disabled=!0):d.current&&(d.current.elementReferences[-1].disabled=!1)},[o]);let p=()=>{s&&s()},m=(e,t)=>{d.current.elementReferences[-1].classList.contains(`autocomplete__input--focused`)&&i(e,t)},h=t=>{t?n(t):f(e)};return(0,r.jsxs)(`div`,{style:{position:`relative`,width:`100%`},children:[(0,r.jsx)(An,{ref:d,...u,defaultValue:t,onConfirm:h,source:m}),!!(e&&e.length>0&&!o)&&(0,r.jsx)(`button`,{onClick:p,style:{position:`absolute`,right:`0px`,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:`none`,cursor:`pointer`,padding:0},"aria-label":c(),children:(0,r.jsx)(l.Icon,{icon:`it-close`,size:`sm`,title:c()})})]})},Mn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==`,Nn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=`,Pn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC`,Fn=({position:e,areasLayer:t,bounds:n,onMarkedMoved:i})=>{let o=(0,a.useRef)(null),s=null,[c,l]=(0,a.useState)([]),u=(0,v.tileLayer)(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>`}),d=[41.9,12.5],f=()=>{let r=v.default.map(o.current,{keyboard:!1,minZoom:6,maxZoom:18}).setView(d,10);u.addTo(r),t&&t.map(e=>{e.addTo(r)});let a=e?[`${e.lat}`,`${e.lon}`]:n?n.getCenter():d;if(delete v.default.Icon.Default.prototype._getIconUrl,v.default.Icon.Default.mergeOptions({iconRetinaUrl:Mn,iconUrl:Nn,shadowUrl:Pn}),s=v.default.marker(a,{draggable:!0}).addTo(r),s.on(`moveend`,function(e){i(e.target.getLatLng(),s)}),r.on(`click`,function(e){let t=e.latlng;s&&s.setLatLng(t).update(),i(t,s)}),!e&&n)r.fitBounds(n);else{let t=e?[e.lat,e.lon]:d;s&&(s.setLatLng(t).update(),r.setView(t,15))}};return(0,a.useEffect)(()=>{o.current&&f()},[o]),(0,r.jsx)(`div`,{className:`d-block`,style:{height:`60vh`,width:`100%`,display:`block`},children:(0,r.jsx)(`div`,{ref:o,style:{height:`100%`,width:`100%`},"aria-hidden":!0})})},In=t.Formio.Components.components.field,Ln=({component:e,value:t,current:n,onChange:i,i18next:o})=>{let[s,c]=(0,a.useState)(null),[d,f]=(0,a.useState)([]),[p,m]=(0,a.useState)(),[h,ee]=(0,a.useState)(),[g,_]=(0,a.useState)(!1),[b,x]=(0,a.useState)(),[S,C]=(0,a.useState)(!1),[w,T]=(0,a.useState)(),[E,D]=(0,a.useState)(),[O,k]=(0,a.useState)(!1),[A,j]=(0,a.useState)(``),[te,N]=(0,a.useState)(``),[P,F]=(0,a.useState)(!1),[I,L]=(0,a.useState)(!1),R=new URLSearchParams(window.location.search).get(`area`),{geographic_areas_id:ne}=window.OC_SERVICE_DETAILS,z=(0,a.useRef)(),B=o.language,re=v.default.latLngBounds(),ie=R||(ne&&ne.length>0?ne:void 0),ae=(e,t)=>{z.current=e;let n=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&countrycodes=it&viewbox=${p}&bounded=1&addressdetails=1&limit=14&format=jsonv2&accept-language=${B}`,r=[],i=[];C(!0),fetch(n).then(e=>e.json()).then(n=>{if(n.length&&z.current===e){C(!0);let e=n.map((e,t)=>{let{lat:n,lon:r}=e,i=`${M()}/api/geographic-areas/contains?lat=${n}&lon=${r}&geographic_areas_ids=${b.join(`,`)}`;return fetch(i).then(e=>e.json()).then(t=>t.result?(e.label=Be(e),e):null)});return Promise.all(e)}else z.current===e&&(t([]),C(!1))}).then(n=>{n=n?n.filter(e=>e!==null):[],n.length>0?(n.forEach((e,t)=>{n[t].label=Be(e)}),n=y.default.uniqWith(n,(e,t)=>e.label===t.label),n.forEach((e,t)=>{i.push(e.label),r.push(e)}),z.current===e&&(t(i),f(r),C(!1))):z.current===e&&(t([]),C(!1))}).catch(e=>{console.error(`Error fetching locations:`,e),C(!1)})},oe=(e,t)=>{ae(e,t)},se=(e,t)=>{let{lat:n,lng:r}=e,i=`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${n}&lon=${r}&accept-language=${B}`;fetch(i).then(e=>e.json()).then(e=>{if(e&&e.display_name)if(e.label=Be(e),e.lat=n,e.lon=r,t)t.bindPopup(`${e.label}`,{className:`address-map-popup`}).openPopup(),D(e);else{D(e);return}}).catch(e=>console.error(`Error with reverse geocoding:`,e))};function ce(){navigator.geolocation.getCurrentPosition(e=>{let t=e.coords.latitude,n=e.coords.longitude;if((b||[]).length>0){let e=`${M()}/api/geographic-areas/contains?lat=${t}&lon=${n}&geographic_areas_ids=${b.join(`,`)}`;fetch(e).then(e=>e.json()).then(e=>{e.result?(c({lat:t,lon:n}),se({lat:t,lng:n}),L(!I)):L(!I)})}else c({lat:t,lon:n}),se({lat:t,lng:n}),L(!I)},e=>{e?.code===1?(F(!P),N(o.t(`error_message_code_1`))):e?.code===2?(F(!P),N(o.t(`error_message_code_2`))):e?.code===3?(F(!P),N(o.t(`error_message_code_3`))):(F(!P),N(o.t(`error_message_generic`)))})}(0,a.useEffect)(()=>{t&&c(t),n.valuePosition&&c(n.valuePosition)},[t,n]);let le=()=>{t&&c(t),n.valuePosition&&c(n.valuePosition)};(0,a.useEffect)(()=>{window?.Formio?.formioReady.then(()=>{setTimeout(()=>{le(),ue()},1)})},[]);let ue=()=>{let e=`${M()}/api/geographic-areas`,t=[],n=[],r=[];fetch(e).then(e=>e.json()).then(e=>{if(Array.isArray(e)&&e.length>0){e.filter(e=>ie?Array.isArray(ie)?ie.includes(e.id):e.id===ie:!0).forEach(e=>{t.push(e.id);let i=JSON.parse(e.geofence);n.push(i);let a=v.default.geoJSON(i,{style:{color:`#3478bd`,fillColor:`#87CEEB`,fillOpacity:.2,weight:1.5},filter:function(e){return e.geometry.type===`Polygon`||e.geometry.type===`MultiPolygon`}});re.extend(a.getBounds()),r.push(a)}),ee(r),x(t),T(re);let i=re.getNorthEast(),a=re.getSouthWest();m([i.lng,i.lat,a.lng,a.lat])}else console.log(`No geographic_areas_ids found.`)}).catch(e=>{console.error(`Error with reverse geocoding:`,e)})},de=()=>{j(s?.label?s.label:``)};(0,a.useEffect)(()=>{de(),i(s)},[s]),(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&O===!1?k(!0):k(!1)},[]);let fe=()=>{if(E){let e=`${M()}/api/geographic-areas/contains?lat=${E.lat}&lon=${E.lon}&geographic_areas_ids=${b.join(`,`)}`;_(!0),fetch(e).then(e=>e.json()).then(e=>{_(!1),e?e.result===!1?u.default.fire({title:``,html:`<p>`+o.t(`Attenzione: Il luogo selezionato si trova al di fuori dell’area coperta dal servizio. Per favore, scegli un luogo all'interno dell'area evidenziata nella mappa.`)+`</p>`,icon:`error`,cancelButtonText:o.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):e.result===!0&&(L(!I),c(E)):(_(!1),console.log(`No geographic-areas/contains .`))}).catch(e=>{console.error(`Error with geographic-areas/contains:`,e),u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:o.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})}};return(0,r.jsx)(`div`,{children:(0,r.jsxs)(`div`,{id:`address-map-container-${e.key}`,className:`address-map-container`,children:[(0,r.jsx)(`div`,{children:(0,r.jsxs)(l.Modal,{wrapClassName:`formio-component-address_map`,isOpen:I,size:`lg`,scrollable:!0,toggle:()=>L(!I),labelledBy:`maps-evo`,container:He(),children:[(0,r.jsx)(l.ModalHeader,{toggle:()=>L(!I),id:`maps-evo`,children:o.t(`Individua il luogo sulla mappa`)}),(0,r.jsxs)(l.ModalBody,{children:[(0,r.jsx)(`p`,{children:(0,r.jsx)(`small`,{children:o.t(`Trascina l’icona nel punto preciso in cui si verifica l’evento che vuoi segnalare e fai click su Salva indirizzo`)})}),(0,r.jsx)(Fn,{position:s,areasLayer:h,bounds:w,onMarkedMoved:(e,t)=>{se(e,t)}})]}),(0,r.jsxs)(l.ModalFooter,{children:[(0,r.jsx)(l.Button,{color:`secondary`,onClick:()=>L(!I),children:o.t(`Chiudi`)}),(0,r.jsx)(l.Button,{color:`primary`,onClick:()=>{fe()},disabled:!E||g,children:o.t(`Salva indirizzo`)})]})]})}),(0,r.jsx)(`div`,{children:(0,r.jsxs)(l.Modal,{isOpen:P,toggle:()=>F(!P),withIcon:!0,labelledBy:`error-modal-message`,container:He(),children:[(0,r.jsx)(l.ModalHeader,{icon:`it-info-circle`,id:`error-modal-message`,children:o.t(`warning`)}),(0,r.jsx)(l.ModalBody,{children:(0,r.jsx)(`p`,{children:te})}),(0,r.jsx)(l.ModalFooter,{children:(0,r.jsx)(l.Button,{color:`primary`,onClick:()=>F(!P),children:o.t(`close`)})})]})}),(0,r.jsxs)(`div`,{className:`position-relative`,children:[(0,r.jsx)(jn,{id:`${e.id}-${e.key}`,inputClasses:`form-control`,source:(0,y.debounce)(oe,520),onConfirm:e=>{C(!1),z.current=``,e&&(e===``&&c(null),c(d.find(t=>t.label===e)))},onClear:()=>{C(!1),z.current=``,c(null)},dropdownArrow:()=>null,minLength:3,disabled:O,confirmOnBlur:!0,showNoOptionsFound:!S,defaultValue:s?.label,value:A,tNoResults:()=>o.t(`Nessun risultato trovato, prova a inserire l'indirizzo completo`),tClearInput:()=>o.t(`Clear input`)}),S&&(0,r.jsx)(`div`,{className:`position-absolute`,style:{width:`100%`,bottom:`0px`},children:(0,r.jsx)(l.Progress,{indeterminate:!0,label:`In elaborazione...`})})]}),!O&&(0,r.jsxs)(l.Button,{type:`button`,value:o.t(`Individua con precisione sulla mappa`),onClick:()=>{/Mobi|Android/i.test(navigator.userAgent)?ce():(L(!0),D(!1))},icon:!0,className:`px-0 primary-color`,children:[(0,r.jsx)(l.Icon,{color:`primary`,icon:`it-map-marker-circle`,role:`presentation`}),(0,r.jsx)(`span`,{children:o.t(`Individua con precisione sulla mappa`)})]})]})})},Rn=class e extends In{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Address Map`,group:`basic`,icon:`bi bi-map`,documentation:``,weight:70,schema:e.schema()}}static schema(){return In.schema({type:`address_map`})}static editForm=kn;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,n.createRoot)(e),this.rootComponent.render((0,r.jsx)(Ln,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this},this.dataValue)),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){this.valuePosition=e,this.updateValue(e)}getValue(){return this.valuePosition}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},zn=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{label:`Base url`,calculateValue:`let url = '`+M()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1}];function Bn(...e){return i.Components.baseEditForm([{key:`display`,components:zn}],...e)}var Vn=t.Formio.Components.components.field,Hn=({component:e,current:t,onChange:n,i18next:i})=>{let o=`list-services`,s=`selected-category`,[c,u]=(0,a.useState)([]),[d,f]=(0,a.useState)([]),[p,m]=(0,a.useState)(null),[h,g]=(0,a.useState)(null),[_,v]=(0,a.useState)(``),[y,b]=(0,a.useState)(!1),[x,S]=(0,a.useState)(!1),C=(0,a.useRef)(!1),w=(0,a.useRef)(),T=(0,a.useMemo)(()=>p&&(d.find(e=>e.name===p)||c.find(e=>e.name===p))||null,[p,d,c]),E=(0,a.useMemo)(()=>T?.services||[],[T]),D=async()=>{S(!0);let e=sessionStorage.getItem(o),t=sessionStorage.getItem(s);if(e)try{let n=JSON.parse(e);if(Array.isArray(n)&&n.length>0)return u(n),f(n),m((n.find(e=>e.name===t)||n[0])?.name||null),S(!1),n}catch{console.warn(`⚠️ Cache corrotta, rigenerazione...`)}let n=await window.FormioHelper.getBookingConfig(),r={};n.forEach(e=>{(e.categories??[]).forEach(t=>{r[t]||(r[t]={name:t,services:[]}),r[t].services.push(e)})});let i=Object.fromEntries(Object.entries(r).sort(([e],[t])=>e.localeCompare(t,`it`,{sensitivity:`base`}))),a=Object.values(i).filter(e=>(e.name??``).trim()!==``);return u(a),f(a),m(a[0]?.name||null),sessionStorage.setItem(o,JSON.stringify(a)),sessionStorage.setItem(s,a[0]?.name||``),S(!1),a};(0,a.useEffect)(()=>{p&&sessionStorage.setItem(s,p)},[p]),(0,a.useEffect)(()=>{C.current||(C.current=!0,D())},[]);let O=e=>{let t=(e=``)=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=(e=``)=>e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/\s+/g,` `).trim(),r=(e=``)=>e.replace(/<[^>]*>/g,` `),i=(e,n)=>RegExp(`\\b${t(n)}`,`i`).test(e),a=(e,t)=>{let a=n(e.name),o=n((e.categories??[]).join(` `)),s=n(r(e.abstract??``));if(!t.every(e=>i(a,e)||i(o,e)||i(s,e)))return-1;let c=0;for(let e of t)i(a,e)?c+=3:i(o,e)?c+=2:i(s,e)&&(c+=1);return c},o=e.target.value;v(o);let s=n(o);if(!s){f(c),m(e=>e??c[0]?.name??null);return}let l=s.split(` `).filter(Boolean),u=c.map(e=>{let t=e.services.map(e=>({service:e,score:a(e,l)})).filter(e=>e.score>=0).sort((e,t)=>t.score-e.score).map(e=>e.service);return t.length?{...e,services:t}:null}).filter(Boolean);f(u),m(u.some(e=>e.name===p)?p:u[0]?.name??null)},k=e=>{g(e);let r=c.find(t=>t.services.some(t=>t.id===e.id));r&&m(r.name),n({id:e.id,link:e.link,name:e.name,show_howto_in_motivation:e.show_howto_in_motivation,categories:e.categories,offices:e.offices,abstract:e.abstract,view_type:e.view_type}),t.data.user_group=null,ct()},A=e=>{m(e.name),g(null),v(``),f(c),n({})};return(0,a.useEffect)(()=>{b(!!document.querySelector(`.formio-read-only`))},[]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{let e=t?.dataValue??t?.getValue();if(e?.id&&(g(e),c.length>0)){let t=c.find(t=>t.services.some(t=>t.id===e.id));t&&m(t.name)}},500);return()=>clearTimeout(e)},[t?.dataValue,t?.data,c]),(0,a.useEffect)(()=>{let e=window.FormioInstance;if(!e)return;let n=()=>{let n=e.submission?.data?.[t?.component?.key];if(n?.id&&(g(n),c.length>0)){let e=c.find(e=>e.services.some(e=>e.id===n.id));e&&m(e.name)}};return e.on(`change`,n),()=>e.off(`change`,n)},[c,t?.component?.key]),x?(0,r.jsx)(`div`,{className:`services-booking`,ref:w,children:(0,r.jsxs)(`div`,{children:[i.t(`Caricamento in corso`),`...`]})}):(0,r.jsx)(`div`,{className:`services-booking`,ref:w,children:c&&!y?(0,r.jsxs)(l.Container,{children:[(0,r.jsx)(l.Row,{className:`mb-3`,children:(0,r.jsx)(l.Col,{children:(0,r.jsx)(`h3`,{className:`h6 fw-bold text-uppercase mb-3`,children:i.t(`Seleziona il servizio per cui stai richiedendo un appuntamento`)})})}),(0,r.jsx)(l.Row,{className:`mb-3`,children:(0,r.jsx)(l.Col,{children:(0,r.jsx)(`div`,{className:`search-container`,children:(0,r.jsx)(l.Input,{id:`search`,label:i.t(`Cerca`),type:`text`,value:_,onChange:O,onInput:O,infoText:i.t(`Cerca per categoria, servizio o descrizione`)})})})}),(0,r.jsxs)(l.Row,{className:`mb-3`,children:[T?(0,r.jsx)(l.Col,{lg:3,md:4,className:`mb-4 mb-lg-0`,children:(0,r.jsxs)(`div`,{className:`categories-list`,children:[(0,r.jsx)(`h3`,{className:`h6 fw-bold text-uppercase mb-3`,children:i.t(`Categorie`)}),d.length>0&&d.map(e=>{let t=p===e.name;return(0,r.jsxs)(`button`,{onClick:()=>A(e),className:`category-item w-100 text-start p-3 mb-2 border-0 rounded ${t?`category-active bg-primary text-white`:`bg-light text-dark`}`,children:[(0,r.jsx)(`span`,{className:`fw-500 d-block`,children:e.name}),(0,r.jsxs)(`small`,{className:`d-block mt-1 ${t?`text-white`:`text-muted`}`,children:[e.services.length,` `,e.services.length>1?i.t(`servizi`):i.t(`servizio`)]})]},e.name)})]})}):null,(0,r.jsx)(l.Col,{lg:T?9:12,md:T?8:12,children:(0,r.jsxs)(`div`,{className:`services-container`,children:[E.length>0?(0,r.jsxs)(`div`,{className:`services-header mb-4`,children:[(0,r.jsx)(`h3`,{className:`h5 fw-bold text-primary mb-0`,children:T?.name}),(0,r.jsx)(`div`,{className:`border-bottom border-primary mt-3 mb-4`})]}):null,E.length>0?(0,r.jsx)(`div`,{className:`services-list`,children:E.map(e=>{let t=h?.id===e.id,n=ee.default.sanitize(e?.abstract);return(0,r.jsx)(`button`,{onClick:()=>k(e),className:`service-card mb-4 p-4 rounded border cursor-pointer transition text-start w-100 ${t?`border-primary border-2 bg-light`:`border-light border-1 bg-white`}`,style:{cursor:`pointer`},tabIndex:`0`,role:`button`,"aria-label":`${e.name}`,"aria-pressed":t,children:(0,r.jsx)(`div`,{className:`d-flex justify-content-between align-items-start`,children:(0,r.jsxs)(`div`,{className:`flex-grow-1`,children:[(0,r.jsx)(`h5`,{className:`h6 fw-bold mb-2 text-dark`,children:e.name}),e?.abstract&&(0,r.jsx)(`p`,{className:`text-muted small mb-0`,dangerouslySetInnerHTML:{__html:n}})]})})},e.id)})}):(0,r.jsx)(`div`,{className:`alert alert-info text-italic`,children:i.t(`Il servizio che stai cercando non è disponibile per la prenotazione appuntamento`)})]})})]})]}):y?(0,r.jsx)(`fieldset`,{className:`it-page-section`,children:(0,r.jsx)(`div`,{className:`cmp-card mt-2`,children:(0,r.jsxs)(`div`,{className:`card has-bkg-grey shadow-sm p-big`,children:[(0,r.jsx)(`div`,{className:`card-header border-0 p-0 mb-lg-30`,children:(0,r.jsx)(`div`,{className:`d-flex`,children:(0,r.jsx)(`h2`,{className:`title-xxlarge mb-1`,children:T?.name})})}),(0,r.jsx)(`div`,{className:`card p-3 p-lg-4 fieldset-body`,children:t?.dataValue?.id?(0,r.jsx)(`div`,{className:`services-list`,children:(0,r.jsx)(`div`,{className:`service-card p-4 rounded border transition border-light border-1 bg-white`,children:(0,r.jsx)(`div`,{className:`d-flex justify-content-between align-items-start`,children:(0,r.jsx)(`div`,{className:`flex-grow-1`,children:(0,r.jsx)(`p`,{className:`mb-2 text-dark text-paragraph`,children:t.dataValue.name})})})},t.dataValue.id)}):null})]})})}):null})},Un=class e extends Vn{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Lista Servizi`,group:`basic`,icon:`bi bi-list`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Vn.schema({type:`list-services`})}static editForm=Bn;attach(e,t){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent&&=(this.rootComponent.unmount(),null),this.rootComponent=(0,n.createRoot)(e),this.builderMode?(this.rootComponent.render((0,r.jsx)(`div`,{className:`my-1 border border-2 border-light rounded p-3 text-secondary`,children:(0,r.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`Lista Servizi`})})),this):(this.rootComponent.render((0,r.jsx)(Hn,{ref:t,component:this.component,onChange:e=>this.setValue(e),...this,current:this})),this)):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){e&&(this.shouldSetValue=!0,this.updateValue(e))}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Wn=t.Components.components.select,Gn=class extends Wn{attach(e){let t=super.attach(e);return(Array.isArray(this.refs.autocompleteInput)?this.refs.autocompleteInput:[this.refs.autocompleteInput]).forEach(e=>{e?.parentNode&&e.parentNode.removeChild(e)}),t}},Kn={pagebreak:j,dynamic_calendar:K,calendar:Ye,"calendar-advanced":dt,sdcfile:Dn,address_map:Rn,"list-services":Un,select:Gn};function qn(e){if(!e||typeof e.addComponent!=`function`)throw Error(`registerFormioComponents requires Formio Components with addComponent(name, component)`);return Object.entries(Kn).forEach(([t,n])=>{e.addComponent(t,n)}),Kn}return e.Calendar=Ye,e.CalendarAdvanced=dt,e.FormioAddressMap=Rn,e.FormioDynamicCalendar=K,e.FormioListServices=Un,e.FormioPageBreak=j,e.SdcFile=Dn,e.Select=Gn,e.formioCustomComponents=Kn,e.registerFormioComponents=qn,e})({},_formio_js,react_dom_client,react_jsx_runtime,_formio_react,react,react_day_picker,react_countdown,moment,design_react_kit,sweetalert2,dayjs,_event_calendar_core,react_dropzone,axios,mime,dompurify,jwt_decode,accessible_autocomplete_react,leaflet,lodash);
|
|
72
|
+
}`,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`fileKey`,label:`File form-data key`,weight:17,placeholder:`Enter the key name of a file for form data.`,tooltip:`Key name that you would like to modify for the file while calling API request.`,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`dir`,label:`Directory`,placeholder:`(optional) Enter a directory for the files`,tooltip:`This will place all the files uploaded in this field in the directory`,weight:20,conditional:{json:{"!==":[{var:`data.storage`},`googledrive`]}}},{type:`textfield`,input:!0,key:`dir`,label:`Folder ID`,placeholder:`(optional) Enter an ID of the folder for the files`,tooltip:`This will place all the files uploaded in this field in the folder`,weight:20,conditional:{json:{"===":[{var:`data.storage`},`googledrive`]}}},{type:`textfield`,input:!0,key:`fileNameTemplate`,label:`File Name Template`,placeholder:`(optional) { {name} }-{ {guid} }"`,tooltip:"Specify template for name of uploaded file(s). Regular template variables are available (`data`, `component`, `user`, `value`, `moment` etc.), also `fileName`, `guid` variables are available. `guid` part must be present, if not found in template, will be added at the end.",weight:25},{type:`checkbox`,input:!0,key:`image`,label:`Display as image(s)`,tooltip:`Instead of a list of linked files, images will be rendered in the view.`,weight:30},{type:`checkbox`,input:!0,key:`uploadOnly`,label:`Upload Only`,tooltip:`When this is checked, will only allow you to upload file(s) and consequently the download, in this component, will be unavailable.`,weight:33},{type:`checkbox`,input:!0,key:`privateDownload`,label:`Private Download`,tooltip:`When this is checked, the file download will send a POST request to the download URL with the x-jwt-token header. This will allow your endpoint to create a Private download system.`,weight:31,conditional:{json:{"===":[{var:`data.storage`},`url`]}}},{type:`textfield`,input:!0,key:`imageSize`,label:`Image Size`,placeholder:`100`,tooltip:`The image size for previewing images.`,weight:40,conditional:{json:{"==":[{var:`data.image`},!0]}}},{type:`textfield`,input:!0,key:`maxFiles`,label:`Numero massimo di file`,placeholder:`100`,tooltip:`Numero massimo di file caricabilii, default è 100.`,weight:40},{type:`checkbox`,input:!0,key:`webcam`,label:`Enable web camera`,tooltip:`This will allow using an attached camera to directly take a picture instead of uploading an existing file.`,weight:32},{type:`textfield`,input:!0,key:`webcamSize`,label:`Webcam Width`,placeholder:`320`,tooltip:`The webcam size for taking pictures.`,weight:38,conditional:{json:{"==":[{var:`data.webcam`},!0]}}},{type:`datagrid`,input:!0,label:`File Types`,key:`fileTypes`,tooltip:`Specify file types to classify the uploads. This is useful if you allow multiple types of uploads but want to allow the user to specify which type of file each is.`,weight:11,components:[{label:`Label`,key:`label`,input:!0,type:`textfield`},{label:`Value`,key:`value`,input:!0,type:`textfield`}]},{type:`textfield`,input:!0,key:`filePattern`,label:`File Pattern`,placeholder:`.jpg,video/*,application/pdf`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file patterns.`,weight:50},{type:`textfield`,input:!0,key:`fileMinSize`,label:`File Minimum Size`,placeholder:`1MB`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.`,weight:60},{type:`textfield`,input:!0,key:`fileMaxSize`,label:`File Maximum Size`,placeholder:`10MB`,tooltip:`See <a href='https://github.com/danialfarid/ng-file-upload#full-reference' target='_blank'>https://github.com/danialfarid/ng-file-upload#full-reference</a> for how to specify file sizes.`,weight:70},{type:`textfield`,input:!0,key:`maxFiles`,label:`Numero massimo di file`,placeholder:`100`,tooltip:`Numero massimo di file caricabilii, default è 100.`,weight:40}],mt=[{key:`unique`,ignore:!0},{key:`validateOn`,ignore:!0}];function ht(...e){return i.Components.baseEditForm([{key:`display`,components:ft},{key:`data`,components:dt},{label:`File`,key:`file`,weight:5,components:pt},{key:`validation`,components:mt}],...e)}var gt=E(((e,t)=>{t.exports=Array.isArray})),_t=E(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),vt=E(((e,t)=>{var n=_t(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),yt=E(((e,t)=>{t.exports=vt().Symbol})),bt=E(((e,t)=>{var n=yt(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),xt=E(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),St=E(((e,t)=>{var n=yt(),r=bt(),i=xt(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),Ct=E(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),wt=E(((e,t)=>{var n=St(),r=Ct(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),Tt=E(((e,t)=>{var n=gt(),r=wt(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),Et=E(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),Dt=E(((e,t)=>{var n=St(),r=Et(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),Ot=E(((e,t)=>{t.exports=vt()[`__core-js_shared__`]})),kt=E(((e,t)=>{var n=Ot(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),At=E(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),jt=E(((e,t)=>{var n=Dt(),r=kt(),i=Et(),a=At(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),Mt=E(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),Nt=E(((e,t)=>{var n=jt(),r=Mt();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Pt=E(((e,t)=>{t.exports=Nt()(Object,`create`)})),Ft=E(((e,t)=>{var n=Pt();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),It=E(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),Lt=E(((e,t)=>{var n=Pt(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),Rt=E(((e,t)=>{var n=Pt(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),zt=E(((e,t)=>{var n=Pt(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),Bt=E(((e,t)=>{var n=Ft(),r=It(),i=Lt(),a=Rt(),o=zt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Vt=E(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Ht=E(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),Ut=E(((e,t)=>{var n=Ht();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Wt=E(((e,t)=>{var n=Ut(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),Gt=E(((e,t)=>{var n=Ut();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Kt=E(((e,t)=>{var n=Ut();function r(e){return n(this.__data__,e)>-1}t.exports=r})),qt=E(((e,t)=>{var n=Ut();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Jt=E(((e,t)=>{var n=Vt(),r=Wt(),i=Gt(),a=Kt(),o=qt();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Yt=E(((e,t)=>{t.exports=Nt()(vt(),`Map`)})),Xt=E(((e,t)=>{var n=Bt(),r=Jt(),i=Yt();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),Zt=E(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Qt=E(((e,t)=>{var n=Zt();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),$t=E(((e,t)=>{var n=Qt();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),en=E(((e,t)=>{var n=Qt();function r(e){return n(this,e).get(e)}t.exports=r})),tn=E(((e,t)=>{var n=Qt();function r(e){return n(this,e).has(e)}t.exports=r})),nn=E(((e,t)=>{var n=Qt();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),rn=E(((e,t)=>{var n=Xt(),r=$t(),i=en(),a=tn(),o=nn();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),an=E(((e,t)=>{var n=rn(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),on=E(((e,t)=>{var n=an(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),sn=E(((e,t)=>{var n=on(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),cn=E(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),ln=E(((e,t)=>{var n=yt(),r=cn(),i=gt(),a=wt(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),un=E(((e,t)=>{var n=ln();function r(e){return e==null?``:n(e)}t.exports=r})),dn=E(((e,t)=>{var n=gt(),r=Tt(),i=sn(),a=un();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Y=E(((e,t)=>{var n=wt(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),fn=E(((e,t)=>{var n=dn(),r=Y();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),pn=E(((e,t)=>{var n=fn();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),mn=E(((e,t)=>{var n=Nt();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),hn=E(((e,t)=>{var n=mn();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),gn=E(((e,t)=>{var n=hn(),r=Ht(),i=Object.prototype.hasOwnProperty;function a(e,t,a){var o=e[t];(!(i.call(e,t)&&r(o,a))||a===void 0&&!(t in e))&&n(e,t,a)}t.exports=a})),_n=E(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),vn=E(((e,t)=>{var n=gn(),r=dn(),i=_n(),a=Et(),o=Y();function s(e,t,s,c){if(!a(e))return e;t=r(t,e);for(var l=-1,u=t.length,d=u-1,f=e;f!=null&&++l<u;){var p=o(t[l]),m=s;if(p===`__proto__`||p===`constructor`||p===`prototype`)return e;if(l!=d){var h=f[p];m=c?c(h,p,f):void 0,m===void 0&&(m=a(h)?h:i(t[l+1])?[]:{})}n(f,p,m),f=f[p]}return e}t.exports=s})),yn=E(((e,t)=>{var n=vn();function r(e,t,r){return e==null?e:n(e,t,r)}t.exports=r})),bn=O(pn(),1),xn=O(yn(),1);document.documentElement.lang.toString();var Sn=class{constructor(){this.token=null,this.basePath=null,this.init()}init(){this.token=null,this.basePath=M()}async getSessionAuthToken(){let e=this;await m.default.get(e.basePath+`/api/session-auth`).then(t=>{e.token=t.data.token}).catch(e=>{u.default.fire(`'error_message_detail`,`'auth_error'`,`error`)})}getSessionAuthTokenPromise(){let e=this;return new Promise(async(t,n)=>{W(`auth-token`)?t({token:W(`auth-token`)}):await m.default.get(e.basePath+`/api/session-auth?with-cookie=true`,{withCredentials:!0,headers:{"Content-Type":`application/json; charset=utf-8`}}).then(e=>{let t=(0,g.jwtDecode)(e.data.token);t.exp&&Ve(`auth-token`,e.data.token,t.exp)}).catch(e=>{console.log(e)})})}getToken(){return this.token}execAuthenticatedCall(e){this.token?e(this.token):this.getSessionAuthTokenPromise().then(t=>{this.token=t.token,e(this.token)})}},Cn=t.Formio.Components.components.file,wn=null;document.querySelector(`widget-formio`)!==null&&(wn=document.querySelector(`widget-formio`).getAttribute(`signature-check-ws-url`));var Tn=({component:e,current:t,onChange:n,i18next:i})=>{let[o,s]=(0,a.useState)([]),[c,d]=(0,a.useState)(new Map),[f,g]=(0,a.useState)(!1),_=new Sn;(0,a.useEffect)(()=>{_.getSessionAuthTokenPromise()},[]);let v=(e,t)=>{d(n=>{let r=new Map(n);return r.set(e,{...t,progress:Number(t?.progress)||0}),r})};function y(t){return t.size>(A(e.fileMaxSize)||A(`1GB`))?{code:`size-files`,message:`${i.t(`I file non possono superare le dimensioni di`)} ${e.fileMaxSize?e.fileMaxSize:`1GB`}`}:o.length>=(e.maxFiles?parseInt(e.maxFiles):e.multiple?100:1)?{code:`too-many-files`,message:`${i.t(`Puoi caricare massimo `)} ${e.maxFiles||100} ${i.t(`file`)}`}:t.size<A(e.fileMinSize)?{code:`file-too-small`,message:`${i.t(`I file devono avare una dimensione superiore a `)} ${e.fileMinSize}`}:null}function b(){if(e.filePattern){let t=e.filePattern.split(`,`).map(e=>e.trim()).filter(Boolean).reduce((e,t)=>{let n=t.startsWith(`.`)?t:`.${t}`,r=h.default.getType(n);return r?(e[r]||(e[r]=[]),e[r].push(n),e):e},{});return Object.keys(t).length?t:void 0}else return!0}let x=e=>{let t={};return t.originalName=e.originalName?e.originalName:e.name,t.name=e.name,t.url=e.url,t.data=e.data,t.signature_validation=e.signature_validation,t.mime_type=e.mime_type,t.storage=`url`,t.size=e.size,t},{getRootProps:S,getInputProps:C,fileRejections:w,isDragActive:T,open:E}=(0,p.useDropzone)({onDrop:e=>{e.map(e=>{k(e).then(e=>{})})},maxFiles:e.maxFiles?parseInt(e.maxFiles)-o.length:e.multiple?100:1,validator:y,accept:b()}),D=e=>{let t=M()+`/api/attachments/`+e.data.id;fetch(t,{method:`DELETE`,headers:{"Content-Type":`application/json; charset=utf-8`,Authorization:`Bearer ${W(`auth-token`)}`},strictErrors:!0}).then(()=>{s(t=>{let r=t.filter(t=>t.data.id!==e.data.id);return n(r),r})}).catch(e=>{u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori durante l'eliminazione del file`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),console.error(e)})},O=()=>{let e=typeof t?.getCurrentValue==`function`?t.getCurrentValue():t?.dataValue;e?.length>0&&(s(e),setTimeout(()=>{n(e)},100))};(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&f===!1?(g(!0),setTimeout(()=>{O()},1e3)):(g(!1),setTimeout(()=>{O()},1e3))},[]);async function k(r){let a,o=M()+`/it/upload`,c={mime_type:r.type,name:r.name,original_filename:r.name,protocol_required:e.protocol_required,size:r.size};return await m.default.post(o,c,{maxContentLength:1/0,maxBodyLength:1/0}).then(async o=>(a=o.data.id,r.url=M()+`/it/allegati/`+a,r.storage=`url`,r.mime_type=r.type,r.protocol_required=e.protocol_required,r.data={...o.data,baseUrl:M()+`/it/allegati/`+a},v(a,r),await m.default.put(o.data.uri,r,{onUploadProgress:e=>{let t=Math.round(e.loaded*100/e.total);d(e=>{let n=new Map(e),i=r;return i.progress=parseInt(t),n.has(a)&&n.set(a,i),n})},maxContentLength:1/0,maxBodyLength:1/0,headers:{"Content-Type":`multipart/form-data`}}).then(async o=>{let c=o.headers.etag.replace(/\\|"/gi,``)||null;return await m.default.put(M()+`/it/upload/`+a,{file_hash:c,check_signature:e.check_signature}).then(async i=>{d(e=>{let t=new Map(e);return t.delete(a),t});let o=t.dataValue||[],c=null;if(s(e=>{let t=[...e,x(r)];return c=t.length-1,n(t),t}),e.check_signature&&i.data.url&&wn)return await m.default.post(wn,{url:i.data.url,content:null},{headers:{"Content-Type":`application/json`}}).then(e=>{r.signature_validation=e.data.sign,o[c].signature_validation=e.data.sign}).catch(e=>{o[c].signature_validation=`File validation error: `+e});d(e=>{let t=new Map(e);return t.delete(a),t})}).catch(e=>{d(e=>{let t=new Map(e);return t.delete(a),t}),console.log(e),u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})}).catch(e=>{d(e=>{let t=new Map(e);return t.delete(a),t}),console.log(e),u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})}))).catch(e=>{console.log(e),u.default.fire({title:``,html:`<p>${i.t(`Ci sono stati degli errori dutante il caricamento dei file, riprova più tardi!`)}</p>`,icon:`error`,cancelButtonText:i.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}),d(e=>{let t=new Map(e);return t.delete(a),t})})}function A(e){if(typeof e==`string`){if(e.search(/kb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024);if(e.search(/mb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024*1024);if(e.search(/gb/i)===e.length-2)return parseFloat(e.substring(0,e.length-2)*1024*1024*1024);if(e.search(/b/i)===e.length-1||e.search(/s/i)===e.length-1)return parseFloat(e.substring(0,e.length-1));if(e.search(/m/i)===e.length-1)return parseFloat(e.substring(0,e.length-1)*60);if(e.search(/h/i)===e.length-1)return parseFloat(e.substring(0,e.length-1)*3600)}return e}function j(e,t=2){if(!+e)return`0 Bytes`;let n=1024,r=t<0?0:t,i=[`Bytes`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],a=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/n**+a).toFixed(r))} ${i[a]}`}return t.conditionallyHidden()||t.visible===!1?null:(0,r.jsx)(r.Fragment,{children:f?(0,r.jsxs)(`div`,{children:[(0,r.jsxs)(`label`,{className:`col-form-label floating-label`,htmlFor:`${e.id}-${e.key}`,children:[e.label,e.validate.required&&(0,r.jsx)(`span`,{className:`text-danger`})]}),(0,r.jsxs)(`ul`,{className:`upload-file-list`,children:[o.map((e,t)=>(0,r.jsxs)(`li`,{className:`upload-file success mw-100`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,r.jsxs)(`p`,{children:[(0,r.jsx)(`span`,{className:`visually-hidden`,children:i.t(`File caricato:`)}),e.name,(0,r.jsx)(`span`,{className:`upload-file-weight`,children:j(e.size)})]})]},e.size+t)),o.length<1&&(0,r.jsxs)(`li`,{className:`upload-file text-secondary mw-100`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`light`,icon:`it-files`,title:`Icona file`,size:`sm`}),(0,r.jsx)(`p`,{children:i.t(`Nessun elemento`)})]})]})]}):(0,r.jsxs)(r.Fragment,{children:[e.hideLabel||e.hidden?``:(0,r.jsxs)(`label`,{className:`col-form-label floating-label`,htmlFor:`${e.id}-${e.key}`,title:e.tooltip||void 0,children:[e.label,e.validate.required&&(0,r.jsx)(`span`,{className:`text-danger`}),e.tooltip&&(0,r.jsx)(`i`,{tabIndex:0,className:`bi bi-question-circle text-muted ms-1`,"data-tooltip":e.tooltip,"aria-expanded":`false`})]}),(0,r.jsxs)(`div`,{className:`my-1 border-2 border-light file-uploader-box rounded p-3 text-secondary${T?` dragover`:``}`,style:{border:`dashed`},...S({onClick:e=>e.stopPropagation()}),children:[(0,r.jsx)(`input`,{id:`${e.id}-${e.key}`,"aria-describedby":`file-uploader-description-${e.id}-${e.key}`,...C()}),(0,r.jsxs)(`div`,{className:`upload-dragdrop${T?` dragover`:``}`,children:[(0,r.jsx)(`div`,{className:`ms-1 me-3`,children:(0,r.jsx)(l.Icon,{color:`secondary`,icon:`it-upload`,title:i.t(`Carica file`),size:`_sm`})}),(0,r.jsxs)(`div`,{className:`upload-dragdrop-text`,children:[(0,r.jsx)(`div`,{className:`h5`,id:`file-uploader-description-${e.id}-${e.key}`,children:i.t(`Trascina il file per caricarlo`)}),(0,r.jsxs)(`p`,{className:`d-inline-flex`,children:[i.t(`oppure`),(0,r.jsx)(l.Button,{tag:`input`,type:`button`,value:i.t(`selezionalo dal dispositivo`),onClick:E,className:`px-1 py-0 text-decoration-underline primary-color`,size:`xs`})]})]})]})]}),(0,r.jsx)(`div`,{dangerouslySetInnerHTML:{__html:ee.default.sanitize(e.description||``)}}),(0,r.jsxs)(`ul`,{className:`upload-file-list my-0`,children:[o.map((e,t)=>(0,r.jsxs)(`li`,{className:`upload-file success`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,r.jsxs)(`p`,{children:[(0,r.jsx)(`span`,{className:`visually-hidden`,children:i.t(`File caricato:`)}),e.name,(0,r.jsx)(`span`,{className:`upload-file-weight`,children:j(e.size)})]}),(0,r.jsx)(l.Button,{className:`px-1`,onClick:()=>D(e),children:(0,r.jsx)(l.Icon,{title:`${i.t(`Elimina file caricato`)} ${e.name}`,color:`secondary`,icon:`it-delete`,className:`ms-auto pointer`,size:`sm`})})]},e.size+t)),Array.from(c.entries()).map(([e,t])=>(0,r.jsxs)(`li`,{className:`upload-file success`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`primary`,icon:`it-file`,title:`Icona file`,size:`sm`}),(0,r.jsxs)(`p`,{children:[(0,r.jsx)(`span`,{className:`visually-hidden`,children:i.t(`Caricamento file:`)}),t.name,(0,r.jsx)(`span`,{className:`upload-file-weight`,children:j(t.size)})]}),(0,r.jsx)(l.Progress,{value:Number(t?.progress)||0})]},e))]}),!!(w&&w.length)&&(0,r.jsx)(`div`,{className:`formio-error-wrapper`,children:(0,r.jsx)(`ul`,{className:`formio-errors upload-file-list my-0 `,children:w.map(({file:t,errors:n},a)=>(0,r.jsxs)(`li`,{className:`upload-file error`,children:[(0,r.jsxs)(`div`,{className:`upload-file-name-error-wrapper`,children:[(0,r.jsx)(l.Icon,{"aria-hidden":`true`,color:`error`,icon:`it-error`,title:`Icona file`,size:`sm`}),(0,r.jsxs)(`p`,{className:`text-wrap error`,children:[(0,r.jsx)(`span`,{className:`visually-hidden`,children:i.t(`Errore caricamento file:`)}),t.name,(0,r.jsx)(`span`,{className:`upload-file-weight`,children:j(t.size)})]})]}),(0,r.jsx)(`div`,{children:n.map(t=>t.code===`file-invalid-type`?(0,r.jsxs)(`p`,{className:`text-wrap ms-0`,children:[i.t(`I file possono essere di tipo `),e.filePattern]}):t.code===`too-many-files`?(0,r.jsxs)(`p`,{className:`text-wrap ms-0`,children:[i.t(`Puoi caricare massimo `),` `,e.maxFiles?e.maxFiles:e.multiple?100:1,` `,i.t(`file`)]}):(0,r.jsx)(`p`,{className:`text-wrap ms-0`,children:t.message}))})]},t.size+a))})})]})})},En=class e extends Cn{constructor(e,t,n){super({...e,clearOnHide:!1},t,n),this.reactRef=null,this.lastRenderedVisible=void 0,this.rootComponent=null,this.mountNode=null}static get builderInfo(){return{title:`File Sdc`,group:`basic`,icon:`bi bi-file-earmark-text`,documentation:``,weight:70,schema:e.schema()}}get emptyValue(){return[]}init(){if(super.init(),this.component?.multiple&&!Array.isArray(this.getCurrentValue())){this.dataValue=[];let e=this.path||this.component?.key;e&&this.rootValue&&(0,xn.default)(this.rootValue,e,[])}}static schema(){return Cn.schema({type:`sdcfile`,modelType:`array`})}static editForm=ht;getI18next(){return this.i18next&&typeof this.i18next.t==`function`?this.i18next:{language:this.options?.language||document?.documentElement?.lang||`it`,t:(e,t)=>this.t(e,t)}}hideFileProcessingLoader(){this.refs?.fileProcessingLoader&&(this.refs.fileProcessingLoader.style.display=`none`)}renderReact(){if(this.rootComponent){if(this.builderMode){this.rootComponent.render((0,r.jsx)(`div`,{className:`my-1 border border-2 border-light file-uploader-box rounded p-3 text-secondary`,children:(0,r.jsx)(`div`,{className:`upload-dragdrop`,children:(0,r.jsx)(`div`,{className:`upload-dragdrop-text`,children:(0,r.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`File Sdc`})})})}));return}this.rootComponent.render((0,r.jsx)(Tn,{component:this.component,current:this,i18next:this.getI18next(),onChange:e=>this.updateValueFromReact(e)}))}}attach(e){let t=super.attach(e);this.hideFileProcessingLoader();let r=`react-${this.id}`;this.loadRefs(e,{[r]:`single`});let i=this.refs[r];return i?(this.rootComponent&&this.mountNode!==i&&(this.rootComponent.unmount(),this.rootComponent=null),this.rootComponent||=(0,n.createRoot)(i),this.mountNode=i,this.lastRenderedVisible=this.visible,this.renderReact(),t):t}updateValueFromReact(e,t={modified:!0}){let n=this.normalizeValue(e,t),r=this.updateValue(n,t),i=this.path||this.component?.key;if(i&&this.rootValue){let e=(0,bn.default)(this.rootValue,i);this.isEqual(e,n)||(0,xn.default)(this.rootValue,i,n)}return r}setValue(e,t={}){let n=this.normalizeValue(e,t),r=super.setValue(n,t),i=this.path||this.component?.key;if(i&&this.rootValue){let e=(0,bn.default)(this.rootValue,i);this.isEqual(e,n)||(0,xn.default)(this.rootValue,i,n)}return r}normalizeValue(e,t={}){let n=super.normalizeValue(e,t);return!this.component?.multiple||Array.isArray(n)?n:n==null||n===``?[]:[n]}detach(){return this.hideFileProcessingLoader(),this.rootComponent&&=(this.rootComponent.unmount(),null),this.mountNode=null,super.detach()}getValue(){return this.getCurrentValue()}get validationValue(){return this.getCurrentValue()}getCurrentValue(){let e=super.getValue(),t=this.path||this.component?.key,n=t&&this.rootValue?(0,bn.default)(this.rootValue,t):void 0;return this.component?.multiple?Array.isArray(e)&&e.length>0?e:Array.isArray(n)?n:[]:e??n??null}isEmpty(e=this.validationValue){return this.component?.multiple?!Array.isArray(e)||e.length===0:e==null||e===``}checkCondition(e,t){let n=super.checkCondition(e,t),r=this.visible;return this.lastRenderedVisible!==r&&(this.lastRenderedVisible=r,this.renderReact()),n}render(){let e=`<div ref="react-${this.id}"></div>`;return Object.getPrototypeOf(Object.getPrototypeOf(Cn.prototype)).render.call(this,e)}},Dn=[{key:`labelPosition`,ignore:!0},{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0}];function On(...e){return i.Components.baseEditForm([{key:`display`,components:Dn}],...e)}var kn=_.default?.default??_.default,An=({value:e,defaultValue:t=``,onConfirm:n,source:i,disabled:o,onClear:s,tClearInput:c=()=>`Clear input`,...u})=>{let d=(0,a.useRef)(null),f=e=>{setTimeout(()=>{d.current&&(d.current.elementReferences[-1].value=e)},0)};(0,a.useEffect)(()=>{e!==void 0&&f(e)},[e]),(0,a.useEffect)(()=>{o?d.current&&(d.current.elementReferences[-1].disabled=!0):d.current&&(d.current.elementReferences[-1].disabled=!1)},[o]);let p=()=>{s&&s()},m=(e,t)=>{d.current.elementReferences[-1].classList.contains(`autocomplete__input--focused`)&&i(e,t)},h=t=>{t?n(t):f(e)};return(0,r.jsxs)(`div`,{style:{position:`relative`,width:`100%`},children:[(0,r.jsx)(kn,{ref:d,...u,defaultValue:t,onConfirm:h,source:m}),!!(e&&e.length>0&&!o)&&(0,r.jsx)(`button`,{onClick:p,style:{position:`absolute`,right:`0px`,top:`50%`,transform:`translateY(-50%)`,background:`transparent`,border:`none`,cursor:`pointer`,padding:0},"aria-label":c(),children:(0,r.jsx)(l.Icon,{icon:`it-close`,size:`sm`,title:c()})})]})},jn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==`,Mn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=`,Nn=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC`,Pn=({position:e,areasLayer:t,bounds:n,onMarkedMoved:i})=>{let o=(0,a.useRef)(null),s=null,[c,l]=(0,a.useState)([]),u=(0,v.tileLayer)(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>`}),d=[41.9,12.5],f=()=>{let r=v.default.map(o.current,{keyboard:!1,minZoom:6,maxZoom:18}).setView(d,10);u.addTo(r),t&&t.map(e=>{e.addTo(r)});let a=e?[`${e.lat}`,`${e.lon}`]:n?n.getCenter():d;if(delete v.default.Icon.Default.prototype._getIconUrl,v.default.Icon.Default.mergeOptions({iconRetinaUrl:jn,iconUrl:Mn,shadowUrl:Nn}),s=v.default.marker(a,{draggable:!0}).addTo(r),s.on(`moveend`,function(e){i(e.target.getLatLng(),s)}),r.on(`click`,function(e){let t=e.latlng;s&&s.setLatLng(t).update(),i(t,s)}),!e&&n)r.fitBounds(n);else{let t=e?[e.lat,e.lon]:d;s&&(s.setLatLng(t).update(),r.setView(t,15))}};return(0,a.useEffect)(()=>{o.current&&f()},[o]),(0,r.jsx)(`div`,{className:`d-block`,style:{height:`60vh`,width:`100%`,display:`block`},children:(0,r.jsx)(`div`,{ref:o,style:{height:`100%`,width:`100%`},"aria-hidden":!0})})},Fn=t.Formio.Components.components.field,In=({component:e,value:t,current:n,onChange:i,i18next:o})=>{let[s,c]=(0,a.useState)(null),[d,f]=(0,a.useState)([]),[p,m]=(0,a.useState)(),[h,ee]=(0,a.useState)(),[g,_]=(0,a.useState)(!1),[b,x]=(0,a.useState)(),[S,C]=(0,a.useState)(!1),[w,T]=(0,a.useState)(),[E,D]=(0,a.useState)(),[O,k]=(0,a.useState)(!1),[A,j]=(0,a.useState)(``),[te,N]=(0,a.useState)(``),[P,F]=(0,a.useState)(!1),[I,L]=(0,a.useState)(!1),R=new URLSearchParams(window.location.search).get(`area`),{geographic_areas_id:ne}=window.OC_SERVICE_DETAILS,re=(0,a.useRef)(),z=o.language,ie=v.default.latLngBounds(),ae=R||(ne&&ne.length>0?ne:void 0),oe=(e,t)=>{re.current=e;let n=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&countrycodes=it&viewbox=${p}&bounded=1&addressdetails=1&limit=14&format=jsonv2&accept-language=${z}`,r=[],i=[];C(!0),fetch(n).then(e=>e.json()).then(n=>{if(n.length&&re.current===e){C(!0);let e=n.map((e,t)=>{let{lat:n,lon:r}=e,i=`${M()}/api/geographic-areas/contains?lat=${n}&lon=${r}&geographic_areas_ids=${b.join(`,`)}`;return fetch(i).then(e=>e.json()).then(t=>t.result?(e.label=Be(e),e):null)});return Promise.all(e)}else re.current===e&&(t([]),C(!1))}).then(n=>{n=n?n.filter(e=>e!==null):[],n.length>0?(n.forEach((e,t)=>{n[t].label=Be(e)}),n=y.default.uniqWith(n,(e,t)=>e.label===t.label),n.forEach((e,t)=>{i.push(e.label),r.push(e)}),re.current===e&&(t(i),f(r),C(!1))):re.current===e&&(t([]),C(!1))}).catch(e=>{console.error(`Error fetching locations:`,e),C(!1)})},se=(e,t)=>{oe(e,t)},ce=(e,t)=>{let{lat:n,lng:r}=e,i=`https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=${n}&lon=${r}&accept-language=${z}`;fetch(i).then(e=>e.json()).then(e=>{if(e&&e.display_name)if(e.label=Be(e),e.lat=n,e.lon=r,t)t.bindPopup(`${e.label}`,{className:`address-map-popup`}).openPopup(),D(e);else{D(e);return}}).catch(e=>console.error(`Error with reverse geocoding:`,e))};function le(){navigator.geolocation.getCurrentPosition(e=>{let t=e.coords.latitude,n=e.coords.longitude;if((b||[]).length>0){let e=`${M()}/api/geographic-areas/contains?lat=${t}&lon=${n}&geographic_areas_ids=${b.join(`,`)}`;fetch(e).then(e=>e.json()).then(e=>{e.result?(c({lat:t,lon:n}),ce({lat:t,lng:n}),L(!I)):L(!I)})}else c({lat:t,lon:n}),ce({lat:t,lng:n}),L(!I)},e=>{e?.code===1?(F(!P),N(o.t(`error_message_code_1`))):e?.code===2?(F(!P),N(o.t(`error_message_code_2`))):e?.code===3?(F(!P),N(o.t(`error_message_code_3`))):(F(!P),N(o.t(`error_message_generic`)))})}(0,a.useEffect)(()=>{t&&c(t),n.valuePosition&&c(n.valuePosition)},[t,n]);let ue=()=>{t&&c(t),n.valuePosition&&c(n.valuePosition)};(0,a.useEffect)(()=>{window?.Formio?.formioReady.then(()=>{setTimeout(()=>{ue(),de()},1)})},[]);let de=()=>{let e=`${M()}/api/geographic-areas`,t=[],n=[],r=[];fetch(e).then(e=>e.json()).then(e=>{if(Array.isArray(e)&&e.length>0){e.filter(e=>ae?Array.isArray(ae)?ae.includes(e.id):e.id===ae:!0).forEach(e=>{t.push(e.id);let i=JSON.parse(e.geofence);n.push(i);let a=v.default.geoJSON(i,{style:{color:`#3478bd`,fillColor:`#87CEEB`,fillOpacity:.2,weight:1.5},filter:function(e){return e.geometry.type===`Polygon`||e.geometry.type===`MultiPolygon`}});ie.extend(a.getBounds()),r.push(a)}),ee(r),x(t),T(ie);let i=ie.getNorthEast(),a=ie.getSouthWest();m([i.lng,i.lat,a.lng,a.lat])}else console.log(`No geographic_areas_ids found.`)}).catch(e=>{console.error(`Error with reverse geocoding:`,e)})},fe=()=>{j(s?.label?s.label:``)};(0,a.useEffect)(()=>{fe(),i(s)},[s]),(0,a.useEffect)(()=>{document.querySelector(`.formio-read-only`)&&O===!1?k(!0):k(!1)},[]);let pe=()=>{if(E){let e=`${M()}/api/geographic-areas/contains?lat=${E.lat}&lon=${E.lon}&geographic_areas_ids=${b.join(`,`)}`;_(!0),fetch(e).then(e=>e.json()).then(e=>{_(!1),e?e.result===!1?u.default.fire({title:``,html:`<p>`+o.t(`Attenzione: Il luogo selezionato si trova al di fuori dell’area coperta dal servizio. Per favore, scegli un luogo all'interno dell'area evidenziata nella mappa.`)+`</p>`,icon:`error`,cancelButtonText:o.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1}):e.result===!0&&(L(!I),c(E)):(_(!1),console.log(`No geographic-areas/contains .`))}).catch(e=>{console.error(`Error with geographic-areas/contains:`,e),u.default.fire({title:``,html:`<p>`+e+`</p>`,icon:`error`,cancelButtonText:o.t(`Chiudi`),showCancelButton:!0,showConfirmButton:!1})})}};return(0,r.jsx)(`div`,{children:(0,r.jsxs)(`div`,{id:`address-map-container-${e.key}`,className:`address-map-container`,children:[(0,r.jsx)(`div`,{children:(0,r.jsxs)(l.Modal,{wrapClassName:`formio-component-address_map`,isOpen:I,size:`lg`,scrollable:!0,toggle:()=>L(!I),labelledBy:`maps-evo`,container:He(),children:[(0,r.jsx)(l.ModalHeader,{toggle:()=>L(!I),id:`maps-evo`,children:o.t(`Individua il luogo sulla mappa`)}),(0,r.jsxs)(l.ModalBody,{children:[(0,r.jsx)(`p`,{children:(0,r.jsx)(`small`,{children:o.t(`Trascina l’icona nel punto preciso in cui si verifica l’evento che vuoi segnalare e fai click su Salva indirizzo`)})}),(0,r.jsx)(Pn,{position:s,areasLayer:h,bounds:w,onMarkedMoved:(e,t)=>{ce(e,t)}})]}),(0,r.jsxs)(l.ModalFooter,{children:[(0,r.jsx)(l.Button,{color:`secondary`,onClick:()=>L(!I),children:o.t(`Chiudi`)}),(0,r.jsx)(l.Button,{color:`primary`,onClick:()=>{pe()},disabled:!E||g,children:o.t(`Salva indirizzo`)})]})]})}),(0,r.jsx)(`div`,{children:(0,r.jsxs)(l.Modal,{isOpen:P,toggle:()=>F(!P),withIcon:!0,labelledBy:`error-modal-message`,container:He(),children:[(0,r.jsx)(l.ModalHeader,{icon:`it-info-circle`,id:`error-modal-message`,children:o.t(`warning`)}),(0,r.jsx)(l.ModalBody,{children:(0,r.jsx)(`p`,{children:te})}),(0,r.jsx)(l.ModalFooter,{children:(0,r.jsx)(l.Button,{color:`primary`,onClick:()=>F(!P),children:o.t(`close`)})})]})}),(0,r.jsxs)(`div`,{className:`position-relative`,children:[(0,r.jsx)(An,{id:`${e.id}-${e.key}`,inputClasses:`form-control`,source:(0,y.debounce)(se,520),onConfirm:e=>{C(!1),re.current=``,e&&(e===``&&c(null),c(d.find(t=>t.label===e)))},onClear:()=>{C(!1),re.current=``,c(null)},dropdownArrow:()=>null,minLength:3,disabled:O,confirmOnBlur:!0,showNoOptionsFound:!S,defaultValue:s?.label,value:A,tNoResults:()=>o.t(`Nessun risultato trovato, prova a inserire l'indirizzo completo`),tClearInput:()=>o.t(`Clear input`)}),S&&(0,r.jsx)(`div`,{className:`position-absolute`,style:{width:`100%`,bottom:`0px`},children:(0,r.jsx)(l.Progress,{indeterminate:!0,label:`In elaborazione...`})})]}),!O&&(0,r.jsxs)(l.Button,{type:`button`,value:o.t(`Individua con precisione sulla mappa`),onClick:()=>{/Mobi|Android/i.test(navigator.userAgent)?le():(L(!0),D(!1))},icon:!0,className:`px-0 primary-color`,children:[(0,r.jsx)(l.Icon,{color:`primary`,icon:`it-map-marker-circle`,role:`presentation`}),(0,r.jsx)(`span`,{children:o.t(`Individua con precisione sulla mappa`)})]})]})})},Ln=class e extends Fn{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Address Map`,group:`basic`,icon:`bi bi-map`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Fn.schema({type:`address_map`})}static editForm=On;attach(e){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent=(0,n.createRoot)(e),this.rootComponent.render((0,r.jsx)(In,{component:this.component,value:this.dataValue,onChange:e=>this.setValue(e),...this,current:this},this.dataValue)),this):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){this.valuePosition=e,this.updateValue(e)}getValue(){return this.valuePosition}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Rn=[{key:`labelPosition`,ignore:!0},{key:`placeholder`,ignore:!0},{key:`description`,ignore:!0},{key:`hideLabel`,ignore:!0},{key:`autofocus`,ignore:!0},{key:`tooltip`,ignore:!0},{key:`tabindex`,ignore:!0},{key:`disabled`,ignore:!0},{label:`Base url`,calculateValue:`let url = '`+M()+`'; data.url = url; value=url;`,key:`url`,type:`hidden`,input:!0,weight:1}];function zn(...e){return i.Components.baseEditForm([{key:`display`,components:Rn}],...e)}var Bn=t.Formio.Components.components.field,Vn=({component:e,current:t,onChange:n,i18next:i})=>{let o=`list-services`,s=`selected-category`,[c,u]=(0,a.useState)([]),[d,f]=(0,a.useState)([]),[p,m]=(0,a.useState)(null),[h,g]=(0,a.useState)(null),[_,v]=(0,a.useState)(``),[y,b]=(0,a.useState)(!1),[x,S]=(0,a.useState)(!1),C=(0,a.useRef)(!1),w=(0,a.useRef)(),T=(0,a.useMemo)(()=>p&&(d.find(e=>e.name===p)||c.find(e=>e.name===p))||null,[p,d,c]),E=(0,a.useMemo)(()=>T?.services||[],[T]),D=async()=>{S(!0);let e=sessionStorage.getItem(o),t=sessionStorage.getItem(s);if(e)try{let n=JSON.parse(e);if(Array.isArray(n)&&n.length>0)return u(n),f(n),m((n.find(e=>e.name===t)||n[0])?.name||null),S(!1),n}catch{console.warn(`⚠️ Cache corrotta, rigenerazione...`)}let n=await window.FormioHelper.getBookingConfig(),r={};n.forEach(e=>{(e.categories??[]).forEach(t=>{r[t]||(r[t]={name:t,services:[]}),r[t].services.push(e)})});let i=Object.fromEntries(Object.entries(r).sort(([e],[t])=>e.localeCompare(t,`it`,{sensitivity:`base`}))),a=Object.values(i).filter(e=>(e.name??``).trim()!==``);return u(a),f(a),m(a[0]?.name||null),sessionStorage.setItem(o,JSON.stringify(a)),sessionStorage.setItem(s,a[0]?.name||``),S(!1),a};(0,a.useEffect)(()=>{p&&sessionStorage.setItem(s,p)},[p]),(0,a.useEffect)(()=>{C.current||(C.current=!0,D())},[]);let O=e=>{let t=(e=``)=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),n=(e=``)=>e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/\s+/g,` `).trim(),r=(e=``)=>e.replace(/<[^>]*>/g,` `),i=(e,n)=>RegExp(`\\b${t(n)}`,`i`).test(e),a=(e,t)=>{let a=n(e.name),o=n((e.categories??[]).join(` `)),s=n(r(e.abstract??``));if(!t.every(e=>i(a,e)||i(o,e)||i(s,e)))return-1;let c=0;for(let e of t)i(a,e)?c+=3:i(o,e)?c+=2:i(s,e)&&(c+=1);return c},o=e.target.value;v(o);let s=n(o);if(!s){f(c),m(e=>e??c[0]?.name??null);return}let l=s.split(` `).filter(Boolean),u=c.map(e=>{let t=e.services.map(e=>({service:e,score:a(e,l)})).filter(e=>e.score>=0).sort((e,t)=>t.score-e.score).map(e=>e.service);return t.length?{...e,services:t}:null}).filter(Boolean);f(u),m(u.some(e=>e.name===p)?p:u[0]?.name??null)},k=e=>{g(e);let r=c.find(t=>t.services.some(t=>t.id===e.id));r&&m(r.name),n({id:e.id,link:e.link,name:e.name,show_howto_in_motivation:e.show_howto_in_motivation,categories:e.categories,offices:e.offices,abstract:e.abstract,view_type:e.view_type}),t.data.user_group=null,st()},A=e=>{m(e.name),g(null),v(``),f(c),n({})};return(0,a.useEffect)(()=>{b(!!document.querySelector(`.formio-read-only`))},[]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{let e=t?.dataValue??t?.getValue();if(e?.id&&(g(e),c.length>0)){let t=c.find(t=>t.services.some(t=>t.id===e.id));t&&m(t.name)}},500);return()=>clearTimeout(e)},[t?.dataValue,t?.data,c]),(0,a.useEffect)(()=>{let e=window.FormioInstance;if(!e)return;let n=()=>{let n=e.submission?.data?.[t?.component?.key];if(n?.id&&(g(n),c.length>0)){let e=c.find(e=>e.services.some(e=>e.id===n.id));e&&m(e.name)}};return e.on(`change`,n),()=>e.off(`change`,n)},[c,t?.component?.key]),x?(0,r.jsx)(`div`,{className:`services-booking`,ref:w,children:(0,r.jsxs)(`div`,{children:[i.t(`Caricamento in corso`),`...`]})}):(0,r.jsx)(`div`,{className:`services-booking`,ref:w,children:c&&!y?(0,r.jsxs)(l.Container,{children:[(0,r.jsx)(l.Row,{className:`mb-3`,children:(0,r.jsx)(l.Col,{children:(0,r.jsx)(`h3`,{className:`h6 fw-bold text-uppercase mb-3`,children:i.t(`Seleziona il servizio per cui stai richiedendo un appuntamento`)})})}),(0,r.jsx)(l.Row,{className:`mb-3`,children:(0,r.jsx)(l.Col,{children:(0,r.jsx)(`div`,{className:`search-container`,children:(0,r.jsx)(l.Input,{id:`search`,label:i.t(`Cerca`),type:`text`,value:_,onChange:O,onInput:O,infoText:i.t(`Cerca per categoria, servizio o descrizione`)})})})}),(0,r.jsxs)(l.Row,{className:`mb-3`,children:[T?(0,r.jsx)(l.Col,{lg:3,md:4,className:`mb-4 mb-lg-0`,children:(0,r.jsxs)(`div`,{className:`categories-list`,children:[(0,r.jsx)(`h3`,{className:`h6 fw-bold text-uppercase mb-3`,children:i.t(`Categorie`)}),d.length>0&&d.map(e=>{let t=p===e.name;return(0,r.jsxs)(`button`,{onClick:()=>A(e),className:`category-item w-100 text-start p-3 mb-2 border-0 rounded ${t?`category-active bg-primary text-white`:`bg-light text-dark`}`,children:[(0,r.jsx)(`span`,{className:`fw-500 d-block`,children:e.name}),(0,r.jsxs)(`small`,{className:`d-block mt-1 ${t?`text-white`:`text-muted`}`,children:[e.services.length,` `,e.services.length>1?i.t(`servizi`):i.t(`servizio`)]})]},e.name)})]})}):null,(0,r.jsx)(l.Col,{lg:T?9:12,md:T?8:12,children:(0,r.jsxs)(`div`,{className:`services-container`,children:[E.length>0?(0,r.jsxs)(`div`,{className:`services-header mb-4`,children:[(0,r.jsx)(`h3`,{className:`h5 fw-bold text-primary mb-0`,children:T?.name}),(0,r.jsx)(`div`,{className:`border-bottom border-primary mt-3 mb-4`})]}):null,E.length>0?(0,r.jsx)(`div`,{className:`services-list`,children:E.map(e=>{let t=h?.id===e.id,n=ee.default.sanitize(e?.abstract);return(0,r.jsx)(`button`,{onClick:()=>k(e),className:`service-card mb-4 p-4 rounded border cursor-pointer transition text-start w-100 ${t?`border-primary border-2 bg-light`:`border-light border-1 bg-white`}`,style:{cursor:`pointer`},tabIndex:`0`,role:`button`,"aria-label":`${e.name}`,"aria-pressed":t,children:(0,r.jsx)(`div`,{className:`d-flex justify-content-between align-items-start`,children:(0,r.jsxs)(`div`,{className:`flex-grow-1`,children:[(0,r.jsx)(`h5`,{className:`h6 fw-bold mb-2 text-dark`,children:e.name}),e?.abstract&&(0,r.jsx)(`p`,{className:`text-muted small mb-0`,dangerouslySetInnerHTML:{__html:n}})]})})},e.id)})}):(0,r.jsx)(`div`,{className:`alert alert-info text-italic`,children:i.t(`Il servizio che stai cercando non è disponibile per la prenotazione appuntamento`)})]})})]})]}):y?(0,r.jsx)(`fieldset`,{className:`it-page-section`,children:(0,r.jsx)(`div`,{className:`cmp-card mt-2`,children:(0,r.jsxs)(`div`,{className:`card has-bkg-grey shadow-sm p-big`,children:[(0,r.jsx)(`div`,{className:`card-header border-0 p-0 mb-lg-30`,children:(0,r.jsx)(`div`,{className:`d-flex`,children:(0,r.jsx)(`h2`,{className:`title-xxlarge mb-1`,children:T?.name})})}),(0,r.jsx)(`div`,{className:`card p-3 p-lg-4 fieldset-body`,children:t?.dataValue?.id?(0,r.jsx)(`div`,{className:`services-list`,children:(0,r.jsx)(`div`,{className:`service-card p-4 rounded border transition border-light border-1 bg-white`,children:(0,r.jsx)(`div`,{className:`d-flex justify-content-between align-items-start`,children:(0,r.jsx)(`div`,{className:`flex-grow-1`,children:(0,r.jsx)(`p`,{className:`mb-2 text-dark text-paragraph`,children:t.dataValue.name})})})},t.dataValue.id)}):null})]})})}):null})},Hn=class e extends Bn{constructor(e,t,n){super(e,t,n)}static get builderInfo(){return{title:`Lista Servizi`,group:`basic`,icon:`bi bi-list`,documentation:``,weight:70,schema:e.schema()}}static schema(){return Bn.schema({type:`list-services`})}static editForm=zn;attach(e,t){return super.attach(e).then(()=>{this.loadRefs(this.element,{[`react-${this.id}`]:`single`});let e=this.refs[`react-${this.id}`];return e?(this.rootComponent&&=(this.rootComponent.unmount(),null),this.rootComponent=(0,n.createRoot)(e),this.builderMode?(this.rootComponent.render((0,r.jsx)(`div`,{className:`my-1 border border-2 border-light rounded p-3 text-secondary`,children:(0,r.jsx)(`div`,{className:`h6 mb-0`,children:this.component?.label||`Lista Servizi`})})),this):(this.rootComponent.render((0,r.jsx)(Vn,{ref:t,component:this.component,onChange:e=>this.setValue(e),...this,current:this})),this)):this})}detach(){return this.rootComponent&&=(this.rootComponent.unmount(),null),super.detach()}setValue(e){e&&(this.shouldSetValue=!0,this.updateValue(e))}getValue(){return this.dataValue}init(){super.init()}render(){return super.render(`<div ref="react-${this.id}"></div>`)}},Un=t.Components.components.select,Wn=class extends Un{attach(e){let t=super.attach(e);return(Array.isArray(this.refs.autocompleteInput)?this.refs.autocompleteInput:[this.refs.autocompleteInput]).forEach(e=>{e?.parentNode&&e.parentNode.removeChild(e)}),t}},Gn={pagebreak:j,dynamic_calendar:K,calendar:Ye,"calendar-advanced":ut,sdcfile:En,address_map:Ln,"list-services":Hn,select:Wn};function Kn(e){if(!e||typeof e.addComponent!=`function`)throw Error(`registerFormioComponents requires Formio Components with addComponent(name, component)`);return Object.entries(Gn).forEach(([t,n])=>{e.addComponent(t,n)}),Gn}return e.Calendar=Ye,e.CalendarAdvanced=ut,e.FormioAddressMap=Ln,e.FormioDynamicCalendar=K,e.FormioListServices=Hn,e.FormioPageBreak=j,e.SdcFile=En,e.Select=Wn,e.formioCustomComponents=Gn,e.registerFormioComponents=Kn,e})({},_formio_js,react_dom_client,react_jsx_runtime,_formio_react,react,react_day_picker,react_countdown,moment,design_react_kit,sweetalert2,dayjs,_event_calendar_core,react_dropzone,axios,mime,dompurify,jwt_decode,accessible_autocomplete_react,leaflet,lodash);
|
|
73
73
|
//# sourceMappingURL=index.iife.js.map
|