@uxland/primary-shell 5.4.1 → 5.4.2

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.
@@ -325,7 +325,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
325
325
  ${template$i(this)}
326
326
  `}static get styles(){return i$A`
327
327
  ${r$H(styles$h)}
328
- `}handleTest(){console.log(this.selectedPeriodDate)}};__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedRadioOption",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"text",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedVisibilityLevelElement",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedPeriodDate",2),__decorateClass$p([n$x({type:Array})],ExportPdfModal.prototype,"arrayElements",2),ExportPdfModal=__decorateClass$p([t$j("export-pdf-modal")],ExportPdfModal);class ExportToPdfHandler extends ApiBaseHandler{async handle(){try{this.api.interactionService.confirm(void 0,ExportPdfModal,{title:translate("modal.selectExportOption"),confirmButtonText:"Exportar",cancelButtonText:"Cancelar"})}catch(J){this._notifyError(J.message)}}_notifyError(J){this.api.notificationService.error(J||"actions.delete.error")}}class ExportPdf{}let request$e;const bootstrapExportPdf=te=>{request$e=te.registerRequest(ExportPdf,ExportToPdfHandler)},teardownExportPdf=()=>{request$e==null||request$e.dispose()},{addActivityHistoryItems}=activityHistoryCollectionsSlice.actions;class AddHistoryItemsHandler extends StoreBaseHandler{async handle(J){try{const X=validateAndFilterBasicItems(J.items);this.store.dispatch(addActivityHistoryItems({id:J.entityId,items:X,componentFactory:J.componentFactory,searchPredicate:J.searchPredicate})),handleAddDiagnosticsFilter(X,this.store)}catch(X){console.log(X.message)}}}let request$d;const bootstrapAddHistoryItems=te=>{request$d=te.registerRequest(addHistoryItemsCommand,AddHistoryItemsHandler)},teardownAddHistoryItems=()=>{request$d==null||request$d.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(J){try{ensureAreValidBasicActivityHistoryItems([J.item]),this.store.dispatch(updateActivityHistoryItem({id:J.entityId,item:J.item}))}catch(X){console.log(X.message)}}}const updateHistoryItemCommand="update_history_item_request";let request$c;const bootstrapUpdateHistoryItem=te=>{request$c=te.registerRequest(updateHistoryItemCommand,UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request$c==null||request$c.dispose()};function connectedProperty(te,J={}){return createConnectedProperty(store)(te,J)}const activityHistorySearchStringSelector=te=>te.activityHistoryFilters.searchString;function getUniqueObjects(te,J,X,re){const ne=`Sense ${re.toLocaleLowerCase()}`,oe=new Map;let de=!1;for(const he of te){const ue=J.reduce((me,ve)=>me==null?void 0:me[ve],he),pe=X.reduce((me,ve)=>me==null?void 0:me[ve],he),fe=typeof ue=="string"&&ue.trim()!=="",ge=typeof pe=="string"&&pe.trim()!=="";fe&&ge?oe.has(ue)||oe.set(ue,{id:ue,title:pe}):de=!0}const ce=Array.from(oe.values()).sort((he,ue)=>he.title.localeCompare(ue.title,"ca",{sensitivity:"base"}));return de&&ce.push({id:"",title:ne}),ce}class TrueSpec extends Spec{isSatisfiedBy(){return!0}}class CommonFilterSpec extends Spec{constructor(J){super(),this.commonFilters=J}isSatisfiedBy(J){return this.commonFilters.filter(ne=>ne.enabled).reduce((ne,oe)=>ne.and(new oe.spec),new TrueSpec).isSatisfiedBy(J)}}class FalseSpec extends Spec{isSatisfiedBy(){return!1}}class PropPathSpec extends Spec{constructor(J,X){super(),this.propPath=J,this.value=X}isSatisfiedBy(J){return this.propPath.reduce((re,ne)=>re==null?void 0:re[ne],J)===this.value}}class CustomFilterSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){const X=this.filters.filter(re=>re.enabled);return X.length===0?!0:X.every(re=>{if(!this.belongsToGroup(J,re))return!0;const ne=re.filters.filter(oe=>oe.enabled||oe.singleOption);return ne.length===0?!0:ne.every(oe=>oe.singleOption?oe.enabled?!0:new PropPathSpec(oe.propPathValue,!1).isSatisfiedBy(J):!oe.enabledValues||oe.enabledValues.length===0?!0:oe.enabledValues.reduce((ce,he)=>ce.or(new PropPathSpec(oe.propPathValue,he)),new FalseSpec).isSatisfiedBy(J))})}belongsToGroup(J,X){return J.type===X.id}}const normalizeStringToNFD=te=>te==null?"":String(te).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase(),propContainsString=(te,J)=>{const X=normalizeStringToNFD(te),re=normalizeStringToNFD(J);return X.toString().toLowerCase().indexOf(re)!==-1||X.toString().indexOf(re)!==-1},commonFieldsSearchPredicate=(te,J)=>{var he,ue,pe,fe,ge,me,ve,be,_e,we,Se;const X=((he=te.professional)==null?void 0:he.name)&&propContainsString((ue=te.professional)==null?void 0:ue.name,J),re=((pe=te.center)==null?void 0:pe.description)&&propContainsString(te.center.description,J),ne=((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.description)&&propContainsString((me=te.professional)==null?void 0:me.speciality.description,J),oe=((be=(ve=te.professional)==null?void 0:ve.role)==null?void 0:be.description)&&propContainsString((_e=te.professional)==null?void 0:_e.role.description,J),de=((we=te.service)==null?void 0:we.description)&&propContainsString(te.service.description,J),ce=(Se=te.diagnostics)==null?void 0:Se.some(Ce=>propContainsString(Ce.id,J)||propContainsString(Ce.description,J));return X||re||ne||oe||de||ce};class SearchStringSpec extends Spec{constructor(J,X){super(),this.searchString=J,this.searchPredicate=X}isSatisfiedBy(J){var ne;if(!((ne=this.searchString)!=null&&ne.trim()))return!0;const X=commonFieldsSearchPredicate(J,this.searchString),re=this.searchPredicate?this.searchPredicate(this.searchString.toLowerCase(),J):!1;return!!(X||re)}}class TypeSpec extends Spec{constructor(J){super(),this.itemType=J}isSatisfiedBy(J){return(J==null?void 0:J.type)===this.itemType}}class ComposedTypeSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){return this.filters.filter(ne=>ne.enabled).map(ne=>ne.id).reduce((ne,oe)=>ne.or(new TypeSpec(oe)),new FalseSpec).isSatisfiedBy(J)}}const activityHistoryFiltersSelector=te=>te.activityHistoryFilters.filters,activityHistoryCommonFiltersSelector=createSelector(activityHistoryFiltersSelector,te=>{var J;return((J=te.find(isCommonFilterGroup))==null?void 0:J.filters)||[]}),activityHistoryEnabledCommonFiltersSelector=createSelector(activityHistoryCommonFiltersSelector,te=>te.filter(J=>J.enabled)),areCommonFiltersActive=createSelector(activityHistoryEnabledCommonFiltersSelector,te=>!!te.length),activityHistoryCustomFilterGroupsSelector=createSelector(activityHistoryFiltersSelector,te=>te.filter(isCustomFilter).sort(sortBySortProperty)),sortBySortProperty=(te,J)=>Number(te.sort)-Number(J.sort),areCustomFiltersActive=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.some(J=>J.filters.some(X=>{var re;return(re=X.enabledValues)==null?void 0:re.length}))),activeGroupsWithEnabledFilters=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.filter(J=>J.enabled).map(({id:J,title:X,enabled:re,sort:ne,filters:oe})=>({id:J,title:X,enabled:re,sort:ne,filters:oe.filter(de=>{var ce;return(ce=de.enabledValues)==null?void 0:ce.length})})).filter(J=>J.filters.length>0)),areSameDiagnostics=(te,J)=>{if(te.length!==J.length)return!1;const X=te.map(ne=>ne.codi).sort(),re=J.map(ne=>ne.codi).sort();return X.every((ne,oe)=>ne===re[oe])},hasValidDiagnostic=te=>te!=null&&typeof te.codi=="string"&&typeof te.cataleg=="string"&&typeof te.description=="string",hasValidDiagnostics=te=>te==null?!0:Array.isArray(te)&&te.every(hasValidDiagnostic),isSameVisit=(te,J)=>{var oe,de,ce,he,ue,pe,fe,ge,me,ve,be,_e,we,Se,Ce,ye,Ae,Le;const X=((oe=te.professional)==null?void 0:oe.id)===((de=J.professional)==null?void 0:de.id)&&((he=(ce=te.professional)==null?void 0:ce.role)==null?void 0:he.id)===((pe=(ue=J.professional)==null?void 0:ue.role)==null?void 0:pe.id)&&((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.id)===((ve=(me=J.professional)==null?void 0:me.speciality)==null?void 0:ve.id),re=((be=te.ep)==null?void 0:be.id)===((_e=J.ep)==null?void 0:_e.id)&&((we=te.up)==null?void 0:we.id)===((Se=J.up)==null?void 0:Se.id)&&((Ce=te.center)==null?void 0:Ce.id)===((ye=J.center)==null?void 0:ye.id)&&((Ae=te.service)==null?void 0:Ae.id)===((Le=J.service)==null?void 0:Le.id),ne=new Date(te.date).toDateString()===new Date(J.date).toDateString();return X&&re&&ne},withinEightHours=(te,J)=>Math.abs(new Date(te).getTime()-new Date(J).getTime())<=8*60*60*1e3;function groupByValidDiagnostics(te){te.forEach(J=>{const X=[],re=[];J.items.forEach(ne=>{const oe=ne.diagnostics;if((oe==null?void 0:oe.length)>0&&hasValidDiagnostics(oe)){let ce=!1;for(const he of X){const ue=he.items[0];if(areSameDiagnostics(ue.diagnostics,oe)){he.items.push(ne),ce=!0;break}}ce||X.push({idSubGroup:crypto.randomUUID(),items:[ne]})}else re.push(ne)}),J.items=re,J.subGroups=X})}const groupActivityHistoryItems=te=>{const J=[];return te==null||te.forEach(X=>{let re=!1;for(const ne of J){const oe=ne.items[0],de=ne.items[ne.items.length-1];if(isSameVisit(oe,X)&&withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),ne.sameVisit=!0,re=!0;break}}if(!re)for(const ne of J){if(ne.sameVisit)continue;const oe=ne.items[0],de=ne.items[ne.items.length-1];if(withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),re=!0;break}}re||J.push({idGroup:crypto.randomUUID(),items:[X],sameVisit:!1})}),groupByValidDiagnostics(J),J},sortGroupsByMostRecentDate=te=>{const J=oe=>oe.reduce((de,ce)=>{const he=new Date(ce.date);return he>de?he:de},new Date(0)),X=oe=>oe.sort((de,ce)=>new Date(ce.date).getTime()-new Date(de.date).getTime()),re=oe=>J(oe.items),ne=oe=>{const de=oe.items.length>0?[J(oe.items)]:[],ce=oe.subGroups.map(re),he=[...de,...ce];return he.length>0?new Date(Math.max(...he.map(ue=>ue.getTime()))):new Date(0)};return te.forEach(oe=>{oe.items=X(oe.items),oe.subGroups.forEach(de=>{de.items=X(de.items)}),oe.subGroups.sort((de,ce)=>re(ce).getTime()-re(de).getTime())}),te.sort((oe,de)=>ne(de).getTime()-ne(oe).getTime())},diagnosticFilterSelector=createSelector(activityHistoryFiltersSelector,te=>te.find(isDiagnosticFilter)),diagnosticFilterEnabledValuesSelector=createSelector(diagnosticFilterSelector,te=>(te==null?void 0:te.enabledValues)||[]),areDiagnosticFiltersActive=createSelector(diagnosticFilterEnabledValuesSelector,te=>!!te.length);class DiagnosticCodeSpec extends Spec{constructor(J){super(),this.diagnosticCodes=J}isSatisfiedBy(J){var re;return(re=this.diagnosticCodes)!=null&&re.length?(J.diagnostics??[]).some(ne=>this.diagnosticCodes.includes(ne.codi)):!0}}const activityHistoryCollectionsSelector=te=>te.activityHistoryCollections.collections,mapItemsWithMetadata=(te,J,X,re)=>te.map(ne=>({...ne,searchPredicate:re,componentFactory:J,type:X})),activityHistoryMappedItems=createSelector(activityHistoryCollectionsSelector,te=>Object.values(te).flatMap(J=>mapItemsWithMetadata(J.items,J.componentFactory,J.id,J.searchPredicate))),customFilterGroupsWithOptionsSelector=createSelector(activityHistoryCustomFilterGroupsSelector,activityHistoryCollectionsSelector,(te,J)=>te.map(re=>{const ne=J[re.id];return{...re,filters:re.filters.map(oe=>({...oe,options:(oe.singleOption?[]:getUniqueObjects(ne.items,oe.propPathValue,oe.propsPathDescription,oe.title))||[]}))}})),activityHistoryGroupedItems=createSelector(activityHistoryMappedItems,activityHistorySearchStringSelector,activityHistoryCommonFiltersSelector,activityHistoryCustomFilterGroupsSelector,diagnosticFilterEnabledValuesSelector,(te,J,X,re,ne)=>{const oe=te.filter(he=>new SearchStringSpec(J,he.searchPredicate).and(new CommonFilterSpec(X)).and(new ComposedTypeSpec(re)).and(new CustomFilterSpec(re)).and(new DiagnosticCodeSpec(ne)).isSatisfiedBy(he)),de=groupActivityHistoryItems(oe);return sortGroupsByMostRecentDate(de)}),styles$g=":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:16px}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";function toDate(te){const J=Object.prototype.toString.call(te);return te instanceof Date||typeof te=="object"&&J==="[object Date]"?new te.constructor(+te):typeof te=="number"||J==="[object Number]"||typeof te=="string"||J==="[object String]"?new Date(te):new Date(NaN)}function constructFrom(te,J){return te instanceof Date?new te.constructor(J):new Date(J)}function addDays(te,J){const X=toDate(te);return isNaN(J)?constructFrom(te,NaN):(J&&X.setDate(X.getDate()+J),X)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.weekStartsOn)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.weekStartsOn)??X.weekStartsOn??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.weekStartsOn)??0,ne=toDate(te),oe=ne.getDay(),de=(oe<re?7:0)+oe-re;return ne.setDate(ne.getDate()-de),ne.setHours(0,0,0,0),ne}function startOfISOWeek(te){return startOfWeek(te,{weekStartsOn:1})}function getISOWeekYear(te){const J=toDate(te),X=J.getFullYear(),re=constructFrom(te,0);re.setFullYear(X+1,0,4),re.setHours(0,0,0,0);const ne=startOfISOWeek(re),oe=constructFrom(te,0);oe.setFullYear(X,0,4),oe.setHours(0,0,0,0);const de=startOfISOWeek(oe);return J.getTime()>=ne.getTime()?X+1:J.getTime()>=de.getTime()?X:X-1}function startOfDay(te){const J=toDate(te);return J.setHours(0,0,0,0),J}function getTimezoneOffsetInMilliseconds(te){const J=toDate(te),X=new Date(Date.UTC(J.getFullYear(),J.getMonth(),J.getDate(),J.getHours(),J.getMinutes(),J.getSeconds(),J.getMilliseconds()));return X.setUTCFullYear(J.getFullYear()),+te-+X}function differenceInCalendarDays(te,J){const X=startOfDay(te),re=startOfDay(J),ne=+X-getTimezoneOffsetInMilliseconds(X),oe=+re-getTimezoneOffsetInMilliseconds(re);return Math.round((ne-oe)/millisecondsInDay)}function startOfISOWeekYear(te){const J=getISOWeekYear(te),X=constructFrom(te,0);return X.setFullYear(J,0,4),X.setHours(0,0,0,0),startOfISOWeek(X)}function isDate(te){return te instanceof Date||typeof te=="object"&&Object.prototype.toString.call(te)==="[object Date]"}function isValid(te){if(!isDate(te)&&typeof te!="number")return!1;const J=toDate(te);return!isNaN(Number(J))}function endOfMonth(te){const J=toDate(te),X=J.getMonth();return J.setFullYear(J.getFullYear(),X+1,0),J.setHours(23,59,59,999),J}function eachDayOfInterval(te,J){const X=toDate(te.start),re=toDate(te.end);let ne=+X>+re;const oe=ne?+X:+re,de=ne?re:X;de.setHours(0,0,0,0);let ce=1;const he=[];for(;+de<=oe;)he.push(toDate(de)),de.setDate(de.getDate()+ce),de.setHours(0,0,0,0);return ne?he.reverse():he}function startOfMonth(te){const J=toDate(te);return J.setDate(1),J.setHours(0,0,0,0),J}function startOfYear(te){const J=toDate(te),X=constructFrom(te,0);return X.setFullYear(J.getFullYear(),0,1),X.setHours(0,0,0,0),X}const formatDistanceLocale={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"}},formatDistance=(te,J,X)=>{let re;const ne=formatDistanceLocale[te];return typeof ne=="string"?re=ne:J===1?re=ne.one:re=ne.other.replace("{{count}}",J.toString()),X!=null&&X.addSuffix?X.comparison&&X.comparison>0?"in "+re:re+" ago":re};function buildFormatLongFn(te){return(J={})=>{const X=J.width?String(J.width):te.defaultWidth;return te.formats[X]||te.formats[te.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(te,J,X,re)=>formatRelativeLocale[te];function buildLocalizeFn(te){return(J,X)=>{const re=X!=null&&X.context?String(X.context):"standalone";let ne;if(re==="formatting"&&te.formattingValues){const de=te.defaultFormattingWidth||te.defaultWidth,ce=X!=null&&X.width?String(X.width):de;ne=te.formattingValues[ce]||te.formattingValues[de]}else{const de=te.defaultWidth,ce=X!=null&&X.width?String(X.width):te.defaultWidth;ne=te.values[ce]||te.values[de]}const oe=te.argumentCallback?te.argumentCallback(J):J;return ne[oe]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={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"]},dayValues={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"]},dayPeriodValues={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"}},formattingDayPeriodValues={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"}},ordinalNumber=(te,J)=>{const X=Number(te),re=X%100;if(re>20||re<10)switch(re%10){case 1:return X+"st";case 2:return X+"nd";case 3:return X+"rd"}return X+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:te=>te-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(te){return(J,X={})=>{const re=X.width,ne=re&&te.matchPatterns[re]||te.matchPatterns[te.defaultMatchWidth],oe=J.match(ne);if(!oe)return null;const de=oe[0],ce=re&&te.parsePatterns[re]||te.parsePatterns[te.defaultParseWidth],he=Array.isArray(ce)?findIndex(ce,fe=>fe.test(de)):findKey(ce,fe=>fe.test(de));let ue;ue=te.valueCallback?te.valueCallback(he):he,ue=X.valueCallback?X.valueCallback(ue):ue;const pe=J.slice(de.length);return{value:ue,rest:pe}}}function findKey(te,J){for(const X in te)if(Object.prototype.hasOwnProperty.call(te,X)&&J(te[X]))return X}function findIndex(te,J){for(let X=0;X<te.length;X++)if(J(te[X]))return X}function buildMatchPatternFn(te){return(J,X={})=>{const re=J.match(te.matchPattern);if(!re)return null;const ne=re[0],oe=J.match(te.parsePattern);if(!oe)return null;let de=te.valueCallback?te.valueCallback(oe[0]):oe[0];de=X.valueCallback?X.valueCallback(de):de;const ce=J.slice(ne.length);return{value:de,rest:ce}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={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},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={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},parseMonthPatterns={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]},matchDayPatterns={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},parseDayPatterns={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]},matchDayPeriodPatterns={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},parseDayPeriodPatterns={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}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:te=>parseInt(te,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:te=>te+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(te){const J=toDate(te);return differenceInCalendarDays(J,startOfYear(J))+1}function getISOWeek(te){const J=toDate(te),X=+startOfISOWeek(J)-+startOfISOWeekYear(J);return Math.round(X/millisecondsInWeek)+1}function getWeekYear(te,J){var pe,fe,ge,me;const X=toDate(te),re=X.getFullYear(),ne=getDefaultOptions$1(),oe=(J==null?void 0:J.firstWeekContainsDate)??((fe=(pe=J==null?void 0:J.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??ne.firstWeekContainsDate??((me=(ge=ne.locale)==null?void 0:ge.options)==null?void 0:me.firstWeekContainsDate)??1,de=constructFrom(te,0);de.setFullYear(re+1,0,oe),de.setHours(0,0,0,0);const ce=startOfWeek(de,J),he=constructFrom(te,0);he.setFullYear(re,0,oe),he.setHours(0,0,0,0);const ue=startOfWeek(he,J);return X.getTime()>=ce.getTime()?re+1:X.getTime()>=ue.getTime()?re:re-1}function startOfWeekYear(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.firstWeekContainsDate)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.firstWeekContainsDate)??X.firstWeekContainsDate??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.firstWeekContainsDate)??1,ne=getWeekYear(te,J),oe=constructFrom(te,0);return oe.setFullYear(ne,0,re),oe.setHours(0,0,0,0),startOfWeek(oe,J)}function getWeek(te,J){const X=toDate(te),re=+startOfWeek(X,J)-+startOfWeekYear(X,J);return Math.round(re/millisecondsInWeek)+1}function addLeadingZeros(te,J){const X=te<0?"-":"",re=Math.abs(te).toString().padStart(J,"0");return X+re}const lightFormatters={y(te,J){const X=te.getFullYear(),re=X>0?X:1-X;return addLeadingZeros(J==="yy"?re%100:re,J.length)},M(te,J){const X=te.getMonth();return J==="M"?String(X+1):addLeadingZeros(X+1,2)},d(te,J){return addLeadingZeros(te.getDate(),J.length)},a(te,J){const X=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.toUpperCase();case"aaa":return X;case"aaaaa":return X[0];case"aaaa":default:return X==="am"?"a.m.":"p.m."}},h(te,J){return addLeadingZeros(te.getHours()%12||12,J.length)},H(te,J){return addLeadingZeros(te.getHours(),J.length)},m(te,J){return addLeadingZeros(te.getMinutes(),J.length)},s(te,J){return addLeadingZeros(te.getSeconds(),J.length)},S(te,J){const X=J.length,re=te.getMilliseconds(),ne=Math.trunc(re*Math.pow(10,X-3));return addLeadingZeros(ne,J.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(te,J,X){const re=te.getFullYear()>0?1:0;switch(J){case"G":case"GG":case"GGG":return X.era(re,{width:"abbreviated"});case"GGGGG":return X.era(re,{width:"narrow"});case"GGGG":default:return X.era(re,{width:"wide"})}},y:function(te,J,X){if(J==="yo"){const re=te.getFullYear(),ne=re>0?re:1-re;return X.ordinalNumber(ne,{unit:"year"})}return lightFormatters.y(te,J)},Y:function(te,J,X,re){const ne=getWeekYear(te,re),oe=ne>0?ne:1-ne;if(J==="YY"){const de=oe%100;return addLeadingZeros(de,2)}return J==="Yo"?X.ordinalNumber(oe,{unit:"year"}):addLeadingZeros(oe,J.length)},R:function(te,J){const X=getISOWeekYear(te);return addLeadingZeros(X,J.length)},u:function(te,J){const X=te.getFullYear();return addLeadingZeros(X,J.length)},Q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"Q":return String(re);case"QQ":return addLeadingZeros(re,2);case"Qo":return X.ordinalNumber(re,{unit:"quarter"});case"QQQ":return X.quarter(re,{width:"abbreviated",context:"formatting"});case"QQQQQ":return X.quarter(re,{width:"narrow",context:"formatting"});case"QQQQ":default:return X.quarter(re,{width:"wide",context:"formatting"})}},q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"q":return String(re);case"qq":return addLeadingZeros(re,2);case"qo":return X.ordinalNumber(re,{unit:"quarter"});case"qqq":return X.quarter(re,{width:"abbreviated",context:"standalone"});case"qqqqq":return X.quarter(re,{width:"narrow",context:"standalone"});case"qqqq":default:return X.quarter(re,{width:"wide",context:"standalone"})}},M:function(te,J,X){const re=te.getMonth();switch(J){case"M":case"MM":return lightFormatters.M(te,J);case"Mo":return X.ordinalNumber(re+1,{unit:"month"});case"MMM":return X.month(re,{width:"abbreviated",context:"formatting"});case"MMMMM":return X.month(re,{width:"narrow",context:"formatting"});case"MMMM":default:return X.month(re,{width:"wide",context:"formatting"})}},L:function(te,J,X){const re=te.getMonth();switch(J){case"L":return String(re+1);case"LL":return addLeadingZeros(re+1,2);case"Lo":return X.ordinalNumber(re+1,{unit:"month"});case"LLL":return X.month(re,{width:"abbreviated",context:"standalone"});case"LLLLL":return X.month(re,{width:"narrow",context:"standalone"});case"LLLL":default:return X.month(re,{width:"wide",context:"standalone"})}},w:function(te,J,X,re){const ne=getWeek(te,re);return J==="wo"?X.ordinalNumber(ne,{unit:"week"}):addLeadingZeros(ne,J.length)},I:function(te,J,X){const re=getISOWeek(te);return J==="Io"?X.ordinalNumber(re,{unit:"week"}):addLeadingZeros(re,J.length)},d:function(te,J,X){return J==="do"?X.ordinalNumber(te.getDate(),{unit:"date"}):lightFormatters.d(te,J)},D:function(te,J,X){const re=getDayOfYear(te);return J==="Do"?X.ordinalNumber(re,{unit:"dayOfYear"}):addLeadingZeros(re,J.length)},E:function(te,J,X){const re=te.getDay();switch(J){case"E":case"EE":case"EEE":return X.day(re,{width:"abbreviated",context:"formatting"});case"EEEEE":return X.day(re,{width:"narrow",context:"formatting"});case"EEEEEE":return X.day(re,{width:"short",context:"formatting"});case"EEEE":default:return X.day(re,{width:"wide",context:"formatting"})}},e:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"e":return String(oe);case"ee":return addLeadingZeros(oe,2);case"eo":return X.ordinalNumber(oe,{unit:"day"});case"eee":return X.day(ne,{width:"abbreviated",context:"formatting"});case"eeeee":return X.day(ne,{width:"narrow",context:"formatting"});case"eeeeee":return X.day(ne,{width:"short",context:"formatting"});case"eeee":default:return X.day(ne,{width:"wide",context:"formatting"})}},c:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"c":return String(oe);case"cc":return addLeadingZeros(oe,J.length);case"co":return X.ordinalNumber(oe,{unit:"day"});case"ccc":return X.day(ne,{width:"abbreviated",context:"standalone"});case"ccccc":return X.day(ne,{width:"narrow",context:"standalone"});case"cccccc":return X.day(ne,{width:"short",context:"standalone"});case"cccc":default:return X.day(ne,{width:"wide",context:"standalone"})}},i:function(te,J,X){const re=te.getDay(),ne=re===0?7:re;switch(J){case"i":return String(ne);case"ii":return addLeadingZeros(ne,J.length);case"io":return X.ordinalNumber(ne,{unit:"day"});case"iii":return X.day(re,{width:"abbreviated",context:"formatting"});case"iiiii":return X.day(re,{width:"narrow",context:"formatting"});case"iiiiii":return X.day(re,{width:"short",context:"formatting"});case"iiii":default:return X.day(re,{width:"wide",context:"formatting"})}},a:function(te,J,X){const ne=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"aaa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"aaaa":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},b:function(te,J,X){const re=te.getHours();let ne;switch(re===12?ne=dayPeriodEnum.noon:re===0?ne=dayPeriodEnum.midnight:ne=re/12>=1?"pm":"am",J){case"b":case"bb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"bbb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"bbbb":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},B:function(te,J,X){const re=te.getHours();let ne;switch(re>=17?ne=dayPeriodEnum.evening:re>=12?ne=dayPeriodEnum.afternoon:re>=4?ne=dayPeriodEnum.morning:ne=dayPeriodEnum.night,J){case"B":case"BB":case"BBB":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"BBBBB":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"BBBB":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},h:function(te,J,X){if(J==="ho"){let re=te.getHours()%12;return re===0&&(re=12),X.ordinalNumber(re,{unit:"hour"})}return lightFormatters.h(te,J)},H:function(te,J,X){return J==="Ho"?X.ordinalNumber(te.getHours(),{unit:"hour"}):lightFormatters.H(te,J)},K:function(te,J,X){const re=te.getHours()%12;return J==="Ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},k:function(te,J,X){let re=te.getHours();return re===0&&(re=24),J==="ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},m:function(te,J,X){return J==="mo"?X.ordinalNumber(te.getMinutes(),{unit:"minute"}):lightFormatters.m(te,J)},s:function(te,J,X){return J==="so"?X.ordinalNumber(te.getSeconds(),{unit:"second"}):lightFormatters.s(te,J)},S:function(te,J){return lightFormatters.S(te,J)},X:function(te,J,X){const re=te.getTimezoneOffset();if(re===0)return"Z";switch(J){case"X":return formatTimezoneWithOptionalMinutes(re);case"XXXX":case"XX":return formatTimezone(re);case"XXXXX":case"XXX":default:return formatTimezone(re,":")}},x:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"x":return formatTimezoneWithOptionalMinutes(re);case"xxxx":case"xx":return formatTimezone(re);case"xxxxx":case"xxx":default:return formatTimezone(re,":")}},O:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(re,":");case"OOOO":default:return"GMT"+formatTimezone(re,":")}},z:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(re,":");case"zzzz":default:return"GMT"+formatTimezone(re,":")}},t:function(te,J,X){const re=Math.trunc(te.getTime()/1e3);return addLeadingZeros(re,J.length)},T:function(te,J,X){const re=te.getTime();return addLeadingZeros(re,J.length)}};function formatTimezoneShort(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=Math.trunc(re/60),oe=re%60;return oe===0?X+String(ne):X+String(ne)+J+addLeadingZeros(oe,2)}function formatTimezoneWithOptionalMinutes(te,J){return te%60===0?(te>0?"-":"+")+addLeadingZeros(Math.abs(te)/60,2):formatTimezone(te,J)}function formatTimezone(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=addLeadingZeros(Math.trunc(re/60),2),oe=addLeadingZeros(re%60,2);return X+ne+J+oe}const dateLongFormatter=(te,J)=>{switch(te){case"P":return J.date({width:"short"});case"PP":return J.date({width:"medium"});case"PPP":return J.date({width:"long"});case"PPPP":default:return J.date({width:"full"})}},timeLongFormatter=(te,J)=>{switch(te){case"p":return J.time({width:"short"});case"pp":return J.time({width:"medium"});case"ppp":return J.time({width:"long"});case"pppp":default:return J.time({width:"full"})}},dateTimeLongFormatter=(te,J)=>{const X=te.match(/(P+)(p+)?/)||[],re=X[1],ne=X[2];if(!ne)return dateLongFormatter(te,J);let oe;switch(re){case"P":oe=J.dateTime({width:"short"});break;case"PP":oe=J.dateTime({width:"medium"});break;case"PPP":oe=J.dateTime({width:"long"});break;case"PPPP":default:oe=J.dateTime({width:"full"});break}return oe.replace("{{date}}",dateLongFormatter(re,J)).replace("{{time}}",timeLongFormatter(ne,J))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(te){return dayOfYearTokenRE.test(te)}function isProtectedWeekYearToken(te){return weekYearTokenRE.test(te)}function warnOrThrowProtectedError(te,J,X){const re=message(te,J,X);if(console.warn(re),throwTokens.includes(te))throw new RangeError(re)}function message(te,J,X){const re=te[0]==="Y"?"years":"days of the month";return`Use \`${te.toLowerCase()}\` instead of \`${te}\` (in \`${J}\`) for formatting ${re} to the input \`${X}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(te,J,X){var pe,fe,ge,me;const re=getDefaultOptions$1(),ne=re.locale??enUS,oe=re.firstWeekContainsDate??((fe=(pe=re.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??1,de=re.weekStartsOn??((me=(ge=re.locale)==null?void 0:ge.options)==null?void 0:me.weekStartsOn)??0,ce=toDate(te);if(!isValid(ce))throw new RangeError("Invalid time value");let he=J.match(longFormattingTokensRegExp$1).map(ve=>{const be=ve[0];if(be==="p"||be==="P"){const _e=longFormatters[be];return _e(ve,ne.formatLong)}return ve}).join("").match(formattingTokensRegExp$1).map(ve=>{if(ve==="''")return{isToken:!1,value:"'"};const be=ve[0];if(be==="'")return{isToken:!1,value:cleanEscapedString$1(ve)};if(formatters[be])return{isToken:!0,value:ve};if(be.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+be+"`");return{isToken:!1,value:ve}});ne.localize.preprocessor&&(he=ne.localize.preprocessor(ce,he));const ue={firstWeekContainsDate:oe,weekStartsOn:de,locale:ne};return he.map(ve=>{if(!ve.isToken)return ve.value;const be=ve.value;(isProtectedWeekYearToken(be)||isProtectedDayOfYearToken(be))&&warnOrThrowProtectedError(be,J,String(te));const _e=formatters[be[0]];return _e(ce,be,ne.localize,ue)}).join("")}function cleanEscapedString$1(te){const J=te.match(escapedStringRegExp$1);return J?J[1].replace(doubleQuoteRegExp$1,"'"):te}function getDay(te){return toDate(te).getDay()}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(te){let X=toDate(te).getDay();return X===0&&(X=7),X}function transpose(te,J){const X=J instanceof Date?constructFrom(J,0):new J(0);return X.setFullYear(te.getFullYear(),te.getMonth(),te.getDate()),X.setHours(te.getHours(),te.getMinutes(),te.getSeconds(),te.getMilliseconds()),X}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){Nt(this,"subPriority",0)}validate(J,X){return!0}}class ValueSetter extends Setter{constructor(J,X,re,ne,oe){super(),this.value=J,this.validateValue=X,this.setValue=re,this.priority=ne,oe&&(this.subPriority=oe)}validate(J,X){return this.validateValue(J,this.value,X)}set(J,X,re){return this.setValue(J,X,this.value,re)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);Nt(this,"priority",TIMEZONE_UNIT_PRIORITY);Nt(this,"subPriority",-1)}set(X,re){return re.timestampIsSet?X:constructFrom(X,transpose(X,Date))}}class Parser{run(J,X,re,ne){const oe=this.parse(J,X,re,ne);return oe?{setter:new ValueSetter(oe.value,this.validate,this.set,this.priority,this.subPriority),rest:oe.rest}:null}validate(J,X,re){return!0}}class EraParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",140);Nt(this,"incompatibleTokens",["R","u","t","T"])}parse(X,re,ne){switch(re){case"G":case"GG":case"GGG":return ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"});case"GGGGG":return ne.era(X,{width:"narrow"});case"GGGG":default:return ne.era(X,{width:"wide"})||ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"})}}set(X,re,ne){return re.era=ne,X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(te,J){return te&&{value:J(te.value),rest:te.rest}}function parseNumericPattern(te,J){const X=J.match(te);return X?{value:parseInt(X[0],10),rest:J.slice(X[0].length)}:null}function parseTimezonePattern(te,J){const X=J.match(te);if(!X)return null;if(X[0]==="Z")return{value:0,rest:J.slice(1)};const re=X[1]==="+"?1:-1,ne=X[2]?parseInt(X[2],10):0,oe=X[3]?parseInt(X[3],10):0,de=X[5]?parseInt(X[5],10):0;return{value:re*(ne*millisecondsInHour+oe*millisecondsInMinute+de*millisecondsInSecond),rest:J.slice(X[0].length)}}function parseAnyDigitsSigned(te){return parseNumericPattern(numericPatterns.anyDigitsSigned,te)}function parseNDigits(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigit,J);case 2:return parseNumericPattern(numericPatterns.twoDigits,J);case 3:return parseNumericPattern(numericPatterns.threeDigits,J);case 4:return parseNumericPattern(numericPatterns.fourDigits,J);default:return parseNumericPattern(new RegExp("^\\d{1,"+te+"}"),J)}}function parseNDigitsSigned(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,J);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,J);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,J);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,J);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+te+"}"),J)}}function dayPeriodEnumToHours(te){switch(te){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(te,J){const X=J>0,re=X?J:1-J;let ne;if(re<=50)ne=te||100;else{const oe=re+50,de=Math.trunc(oe/100)*100,ce=te>=oe%100;ne=te+de-(ce?100:0)}return X?ne:1-ne}function isLeapYearIndex(te){return te%400===0||te%4===0&&te%100!==0}class YearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="yy"});switch(re){case"y":return mapValue(parseNDigits(4,X),oe);case"yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne){const oe=X.getFullYear();if(ne.isTwoDigitYear){const ce=normalizeTwoDigitYear(ne.year,oe);return X.setFullYear(ce,0,1),X.setHours(0,0,0,0),X}const de=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(de,0,1),X.setHours(0,0,0,0),X}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="YY"});switch(re){case"Y":return mapValue(parseNDigits(4,X),oe);case"Yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne,oe){const de=getWeekYear(X,oe);if(ne.isTwoDigitYear){const he=normalizeTwoDigitYear(ne.year,de);return X.setFullYear(he,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}const ce=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(ce,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="R"?4:re.length,X)}set(X,re,ne){const oe=constructFrom(X,0);return oe.setFullYear(ne,0,4),oe.setHours(0,0,0,0),startOfISOWeek(oe)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="u"?4:re.length,X)}set(X,re,ne){return X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}class QuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"Q":case"QQ":return parseNDigits(re.length,X);case"Qo":return ne.ordinalNumber(X,{unit:"quarter"});case"QQQ":return ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQQ":return ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQ":default:return ne.quarter(X,{width:"wide",context:"formatting"})||ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"q":case"qq":return parseNDigits(re.length,X);case"qo":return ne.ordinalNumber(X,{unit:"quarter"});case"qqq":return ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqqq":return ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqq":default:return ne.quarter(X,{width:"wide",context:"standalone"})||ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class MonthParser extends Parser{constructor(){super(...arguments);Nt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Nt(this,"priority",110)}parse(X,re,ne){const oe=de=>de-1;switch(re){case"M":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"MM":return mapValue(parseNDigits(2,X),oe);case"Mo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"MMM":return ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"});case"MMMMM":return ne.month(X,{width:"narrow",context:"formatting"});case"MMMM":default:return ne.month(X,{width:"wide",context:"formatting"})||ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",110);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>de-1;switch(re){case"L":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"LL":return mapValue(parseNDigits(2,X),oe);case"Lo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"LLL":return ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"});case"LLLLL":return ne.month(X,{width:"narrow",context:"standalone"});case"LLLL":default:return ne.month(X,{width:"wide",context:"standalone"})||ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}function setWeek(te,J,X){const re=toDate(te),ne=getWeek(re,X)-J;return re.setDate(re.getDate()-ne*7),re}class LocalWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){switch(re){case"w":return parseNumericPattern(numericPatterns.week,X);case"wo":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne,oe){return startOfWeek(setWeek(X,ne,oe),oe)}}function setISOWeek(te,J){const X=toDate(te),re=getISOWeek(X)-J;return X.setDate(X.getDate()-re*7),X}class ISOWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(X,re,ne){switch(re){case"I":return parseNumericPattern(numericPatterns.week,X);case"Io":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne){return startOfISOWeek(setISOWeek(X,ne))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subPriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"d":return parseNumericPattern(numericPatterns.date,X);case"do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear(),oe=isLeapYearIndex(ne),de=X.getMonth();return oe?re>=1&&re<=DAYS_IN_MONTH_LEAP_YEAR[de]:re>=1&&re<=DAYS_IN_MONTH[de]}set(X,re,ne){return X.setDate(ne),X.setHours(0,0,0,0),X}}class DayOfYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subpriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,X);case"Do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear();return isLeapYearIndex(ne)?re>=1&&re<=366:re>=1&&re<=365}set(X,re,ne){return X.setMonth(0,ne),X.setHours(0,0,0,0),X}}function setDay(te,J,X){var fe,ge,me,ve;const re=getDefaultOptions$1(),ne=(X==null?void 0:X.weekStartsOn)??((ge=(fe=X==null?void 0:X.locale)==null?void 0:fe.options)==null?void 0:ge.weekStartsOn)??re.weekStartsOn??((ve=(me=re.locale)==null?void 0:me.options)==null?void 0:ve.weekStartsOn)??0,oe=toDate(te),de=oe.getDay(),he=(J%7+7)%7,ue=7-ne,pe=J<0||J>6?J-(de+ue)%7:(he+ue)%7-(de+ue)%7;return addDays(oe,pe)}class DayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"E":case"EE":case"EEE":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEEE":return ne.day(X,{width:"narrow",context:"formatting"});case"EEEEEE":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEE":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class LocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"e":case"ee":return mapValue(parseNDigits(re.length,X),de);case"eo":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"eee":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeeee":return ne.day(X,{width:"narrow",context:"formatting"});case"eeeeee":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeee":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"c":case"cc":return mapValue(parseNDigits(re.length,X),de);case"co":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"ccc":return ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"ccccc":return ne.day(X,{width:"narrow",context:"standalone"});case"cccccc":return ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"cccc":default:return ne.day(X,{width:"wide",context:"standalone"})||ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}function setISODay(te,J){const X=toDate(te),re=getISODay(X),ne=J-re;return addDays(X,ne)}class ISODayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(X,re,ne){const oe=de=>de===0?7:de;switch(re){case"i":case"ii":return parseNDigits(re.length,X);case"io":return ne.ordinalNumber(X,{unit:"day"});case"iii":return mapValue(ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiii":return mapValue(ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiiii":return mapValue(ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiii":default:return mapValue(ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe)}}validate(X,re){return re>=1&&re<=7}set(X,re,ne){return X=setISODay(X,ne),X.setHours(0,0,0,0),X}}class AMPMParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"a":case"aa":case"aaa":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaaa":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaa":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"b":case"bb":case"bbb":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbbb":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbb":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class DayPeriodParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","b","t","T"])}parse(X,re,ne){switch(re){case"B":case"BB":case"BBB":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBBB":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBB":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(X,re,ne){switch(re){case"h":return parseNumericPattern(numericPatterns.hour12h,X);case"ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=12}set(X,re,ne){const oe=X.getHours()>=12;return oe&&ne<12?X.setHours(ne+12,0,0,0):!oe&&ne===12?X.setHours(0,0,0,0):X.setHours(ne,0,0,0),X}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(X,re,ne){switch(re){case"H":return parseNumericPattern(numericPatterns.hour23h,X);case"Ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=23}set(X,re,ne){return X.setHours(ne,0,0,0),X}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(X,re,ne){switch(re){case"K":return parseNumericPattern(numericPatterns.hour11h,X);case"Ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.getHours()>=12&&ne<12?X.setHours(ne+12,0,0,0):X.setHours(ne,0,0,0),X}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(X,re,ne){switch(re){case"k":return parseNumericPattern(numericPatterns.hour24h,X);case"ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=24}set(X,re,ne){const oe=ne<=24?ne%24:ne;return X.setHours(oe,0,0,0),X}}class MinuteParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",60);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"m":return parseNumericPattern(numericPatterns.minute,X);case"mo":return ne.ordinalNumber(X,{unit:"minute"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setMinutes(ne,0,0),X}}class SecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",50);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"s":return parseNumericPattern(numericPatterns.second,X);case"so":return ne.ordinalNumber(X,{unit:"second"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setSeconds(ne,0),X}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",30);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re){const ne=oe=>Math.trunc(oe*Math.pow(10,-re.length+3));return mapValue(parseNDigits(re.length,X),ne)}set(X,re,ne){return X.setMilliseconds(ne),X}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","x"])}parse(X,re){switch(re){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"XX":return parseTimezonePattern(timezonePatterns.basic,X);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","X"])}parse(X,re){switch(re){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"xx":return parseTimezonePattern(timezonePatterns.basic,X);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",40);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",20);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(te,J,X,re){var be,_e,we,Se;const ne=getDefaultOptions(),oe=ne.locale??enUS,de=ne.firstWeekContainsDate??((_e=(be=ne.locale)==null?void 0:be.options)==null?void 0:_e.firstWeekContainsDate)??1,ce=ne.weekStartsOn??((Se=(we=ne.locale)==null?void 0:we.options)==null?void 0:Se.weekStartsOn)??0,he={firstWeekContainsDate:de,weekStartsOn:ce,locale:oe},ue=[new DateToSystemTimezoneSetter],pe=J.match(longFormattingTokensRegExp).map(Ce=>{const ye=Ce[0];if(ye in longFormatters){const Ae=longFormatters[ye];return Ae(Ce,oe.formatLong)}return Ce}).join("").match(formattingTokensRegExp),fe=[];for(let Ce of pe){isProtectedWeekYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te),isProtectedDayOfYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te);const ye=Ce[0],Ae=parsers[ye];if(Ae){const{incompatibleTokens:Le}=Ae;if(Array.isArray(Le)){const Me=fe.find(He=>Le.includes(He.token)||He.token===ye);if(Me)throw new RangeError(`The format string mustn't contain \`${Me.fullToken}\` and \`${Ce}\` at the same time`)}else if(Ae.incompatibleTokens==="*"&&fe.length>0)throw new RangeError(`The format string mustn't contain \`${Ce}\` and any other token at the same time`);fe.push({token:ye,fullToken:Ce});const De=Ae.run(te,Ce,oe.match,he);if(!De)return constructFrom(X,NaN);ue.push(De.setter),te=De.rest}else{if(ye.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ye+"`");if(Ce==="''"?Ce="'":ye==="'"&&(Ce=cleanEscapedString(Ce)),te.indexOf(Ce)===0)te=te.slice(Ce.length);else return constructFrom(X,NaN)}}if(te.length>0&&notWhitespaceRegExp.test(te))return constructFrom(X,NaN);const ge=ue.map(Ce=>Ce.priority).sort((Ce,ye)=>ye-Ce).filter((Ce,ye,Ae)=>Ae.indexOf(Ce)===ye).map(Ce=>ue.filter(ye=>ye.priority===Ce).sort((ye,Ae)=>Ae.subPriority-ye.subPriority)).map(Ce=>Ce[0]);let me=toDate(X);if(isNaN(me.getTime()))return constructFrom(X,NaN);const ve={};for(const Ce of ge){if(!Ce.validate(me,he))return constructFrom(X,NaN);const ye=Ce.set(me,ve,he);Array.isArray(ye)?(me=ye[0],Object.assign(ve,ye[1])):me=ye}return constructFrom(X,me)}function cleanEscapedString(te){return te.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}const notFound="data:image/svg+xml,%3csvg%20width='215'%20height='150'%20viewBox='0%200%20215%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.9'%20d='M135.132%2057.43C96.9221%2047.658%2083.3815%20-29.7048%2026.9734%2012.5083C-13.0511%2042.4595%2011.4691%20115.499%2061.6878%20107.019C92.0822%20101.867%2087.3917%20101.341%20113.129%20115.244C139.231%20129.308%20167.972%20136.397%20195.855%20111.436C210.28%2098.5179%20215.939%2067.0352%20201.939%2050.7417C184.388%2030.3592%20158.485%2063.4098%20135.132%2057.43Z'%20fill='%23EFF7FF'/%3e%3cellipse%20cx='120.5'%20cy='143.5'%20rx='52.5'%20ry='3.5'%20fill='%23F5F5F5'/%3e%3cpath%20d='M121.387%2080.2184C121.995%2079.5948%20122.563%2078.953%20123.09%2078.2959L134.396%2089.3383C135.09%2090.0177%20134.851%2091.389%20133.861%2092.4024C132.872%2093.4159%20131.505%2093.6888%20130.811%2093.0094L119.505%2081.967C120.148%2081.424%20120.777%2080.8407%20121.385%2080.2171L121.387%2080.2184Z'%20fill='%231D1D1D'/%3e%3cpath%20opacity='0.6'%20d='M121.127%2079.9896C132.157%2068.6986%20131.888%2050.5485%20120.527%2039.4502C109.166%2028.3519%2091.0149%2028.5081%2079.9849%2039.799C68.955%2051.09%2069.2233%2069.2401%2080.5843%2080.3385C91.9453%2091.4368%20110.097%2091.2806%20121.127%2079.9896Z'%20fill='%238FC2F5'/%3e%3cpath%20d='M78.0382%2083.0622C90.8729%2095.6382%20111.378%2095.4578%20123.835%2082.6609C136.293%2069.8625%20135.986%2049.2932%20123.15%2036.7173C110.316%2024.1413%2089.8107%2024.3217%2077.3538%2037.1186C64.8956%2049.9169%2065.2022%2070.4862%2078.0382%2083.0622ZM80.642%2080.387C69.289%2069.264%2069.0172%2051.0692%2080.037%2039.749C91.0569%2028.4288%20109.194%2028.2694%20120.547%2039.3938C131.9%2050.5182%20132.171%2068.713%20121.152%2080.0332C110.132%2091.3534%2091.9949%2091.5128%2080.642%2080.3884V80.387Z'%20fill='%237BACFC'/%3e%3cpath%20d='M169.953%20128.522L171.714%20126.696C173.474%20124.871%20173.421%20121.964%20171.595%20120.205L135.013%2084.9265C133.187%2083.1661%20130.281%2083.2205%20128.522%2085.0451L126.761%2086.8711C125.001%2088.6957%20125.055%2091.6028%20126.88%2093.3619L163.462%20128.64C165.287%20130.401%20168.194%20130.346%20169.953%20128.522Z'%20fill='%23656565'/%3e%3cpath%20opacity='0.35'%20d='M88.8399%2071.2315C96.506%2079.2245%20101.258%2078.1642%20100.757%2082.4547C100.256%2086.7452%2091.398%2085.7448%2082.7698%2076.0396C74.1415%2066.3344%2075.0893%2054.9166%2079.8491%2055.2485C84.6089%2055.5803%2080.129%2062.1492%2088.8399%2071.2315Z'%20fill='white'/%3e%3c/svg%3e";/**
328
+ `}handleTest(){console.log(this.selectedPeriodDate)}};__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedRadioOption",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"text",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedVisibilityLevelElement",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedPeriodDate",2),__decorateClass$p([n$x({type:Array})],ExportPdfModal.prototype,"arrayElements",2),ExportPdfModal=__decorateClass$p([t$j("export-pdf-modal")],ExportPdfModal);class ExportToPdfHandler extends ApiBaseHandler{async handle(){try{this.api.interactionService.confirm(void 0,ExportPdfModal,{title:translate("modal.selectExportOption"),confirmButtonText:"Exportar",cancelButtonText:"Cancelar"})}catch(J){this._notifyError(J.message)}}_notifyError(J){this.api.notificationService.error(J||"actions.delete.error")}}class ExportPdf{}let request$e;const bootstrapExportPdf=te=>{request$e=te.registerRequest(ExportPdf,ExportToPdfHandler)},teardownExportPdf=()=>{request$e==null||request$e.dispose()},{addActivityHistoryItems}=activityHistoryCollectionsSlice.actions;class AddHistoryItemsHandler extends StoreBaseHandler{async handle(J){try{const X=validateAndFilterBasicItems(J.items);this.store.dispatch(addActivityHistoryItems({id:J.entityId,items:X,componentFactory:J.componentFactory,searchPredicate:J.searchPredicate})),handleAddDiagnosticsFilter(X,this.store)}catch(X){console.log(X.message)}}}let request$d;const bootstrapAddHistoryItems=te=>{request$d=te.registerRequest(addHistoryItemsCommand,AddHistoryItemsHandler)},teardownAddHistoryItems=()=>{request$d==null||request$d.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(J){try{ensureAreValidBasicActivityHistoryItems([J.item]),this.store.dispatch(updateActivityHistoryItem({id:J.entityId,item:J.item}))}catch(X){console.log(X.message)}}}const updateHistoryItemCommand="update_history_item_request";let request$c;const bootstrapUpdateHistoryItem=te=>{request$c=te.registerRequest(updateHistoryItemCommand,UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request$c==null||request$c.dispose()};function connectedProperty(te,J={}){return createConnectedProperty(store)(te,J)}const activityHistorySearchStringSelector=te=>te.activityHistoryFilters.searchString;function getUniqueObjects(te,J,X,re){const ne=`Sense ${re.toLocaleLowerCase()}`,oe=new Map;let de=!1;for(const he of te){const ue=J.reduce((me,ve)=>me==null?void 0:me[ve],he),pe=X.reduce((me,ve)=>me==null?void 0:me[ve],he),fe=typeof ue=="string"&&ue.trim()!=="",ge=typeof pe=="string"&&pe.trim()!=="";fe&&ge?oe.has(ue)||oe.set(ue,{id:ue,title:pe}):de=!0}const ce=Array.from(oe.values()).sort((he,ue)=>he.title.localeCompare(ue.title,"ca",{sensitivity:"base"}));return de&&ce.push({id:"",title:ne}),ce}class TrueSpec extends Spec{isSatisfiedBy(){return!0}}class CommonFilterSpec extends Spec{constructor(J){super(),this.commonFilters=J}isSatisfiedBy(J){return this.commonFilters.filter(ne=>ne.enabled).reduce((ne,oe)=>ne.and(new oe.spec),new TrueSpec).isSatisfiedBy(J)}}class FalseSpec extends Spec{isSatisfiedBy(){return!1}}class PropPathSpec extends Spec{constructor(J,X){super(),this.propPath=J,this.value=X}isSatisfiedBy(J){return this.propPath.reduce((re,ne)=>re==null?void 0:re[ne],J)===this.value}}class CustomFilterSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){const X=this.filters.filter(re=>re.enabled);return X.length===0?!0:X.every(re=>{if(!this.belongsToGroup(J,re))return!0;const ne=re.filters.filter(oe=>oe.enabled||oe.singleOption);return ne.length===0?!0:ne.every(oe=>oe.singleOption?oe.enabled?!0:new PropPathSpec(oe.propPathValue,!1).isSatisfiedBy(J):!oe.enabledValues||oe.enabledValues.length===0?!0:oe.enabledValues.reduce((ce,he)=>ce.or(new PropPathSpec(oe.propPathValue,he)),new FalseSpec).isSatisfiedBy(J))})}belongsToGroup(J,X){return J.type===X.id}}const normalizeStringToNFD=te=>te==null?"":String(te).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase(),propContainsString=(te,J)=>{const X=normalizeStringToNFD(te),re=normalizeStringToNFD(J);return X.toString().toLowerCase().indexOf(re)!==-1||X.toString().indexOf(re)!==-1},commonFieldsSearchPredicate=(te,J)=>{var he,ue,pe,fe,ge,me,ve,be,_e,we,Se;const X=((he=te.professional)==null?void 0:he.name)&&propContainsString((ue=te.professional)==null?void 0:ue.name,J),re=((pe=te.center)==null?void 0:pe.description)&&propContainsString(te.center.description,J),ne=((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.description)&&propContainsString((me=te.professional)==null?void 0:me.speciality.description,J),oe=((be=(ve=te.professional)==null?void 0:ve.role)==null?void 0:be.description)&&propContainsString((_e=te.professional)==null?void 0:_e.role.description,J),de=((we=te.service)==null?void 0:we.description)&&propContainsString(te.service.description,J),ce=(Se=te.diagnostics)==null?void 0:Se.some(Ce=>propContainsString(Ce.id,J)||propContainsString(Ce.description,J));return X||re||ne||oe||de||ce};class SearchStringSpec extends Spec{constructor(J,X){super(),this.searchString=J,this.searchPredicate=X}isSatisfiedBy(J){var ne;if(!((ne=this.searchString)!=null&&ne.trim()))return!0;const X=commonFieldsSearchPredicate(J,this.searchString),re=this.searchPredicate?this.searchPredicate(this.searchString.toLowerCase(),J):!1;return!!(X||re)}}class TypeSpec extends Spec{constructor(J){super(),this.itemType=J}isSatisfiedBy(J){return(J==null?void 0:J.type)===this.itemType}}class ComposedTypeSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){return this.filters.filter(ne=>ne.enabled).map(ne=>ne.id).reduce((ne,oe)=>ne.or(new TypeSpec(oe)),new FalseSpec).isSatisfiedBy(J)}}const activityHistoryFiltersSelector=te=>te.activityHistoryFilters.filters,activityHistoryCommonFiltersSelector=createSelector(activityHistoryFiltersSelector,te=>{var J;return((J=te.find(isCommonFilterGroup))==null?void 0:J.filters)||[]}),activityHistoryEnabledCommonFiltersSelector=createSelector(activityHistoryCommonFiltersSelector,te=>te.filter(J=>J.enabled)),areCommonFiltersActive=createSelector(activityHistoryEnabledCommonFiltersSelector,te=>!!te.length),activityHistoryCustomFilterGroupsSelector=createSelector(activityHistoryFiltersSelector,te=>te.filter(isCustomFilter).sort(sortBySortProperty)),sortBySortProperty=(te,J)=>Number(te.sort)-Number(J.sort),areCustomFiltersActive=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.some(J=>J.filters.some(X=>{var re;return(re=X.enabledValues)==null?void 0:re.length}))),activeGroupsWithEnabledFilters=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.filter(J=>J.enabled).map(({id:J,title:X,enabled:re,sort:ne,filters:oe})=>({id:J,title:X,enabled:re,sort:ne,filters:oe.filter(de=>{var ce;return(ce=de.enabledValues)==null?void 0:ce.length})})).filter(J=>J.filters.length>0)),areSameDiagnostics=(te,J)=>{if(te.length!==J.length)return!1;const X=te.map(ne=>ne.codi).sort(),re=J.map(ne=>ne.codi).sort();return X.every((ne,oe)=>ne===re[oe])},hasValidDiagnostic=te=>te!=null&&typeof te.codi=="string"&&typeof te.cataleg=="string"&&typeof te.descripcio=="string",hasValidDiagnostics=te=>te==null?!0:Array.isArray(te)&&te.every(hasValidDiagnostic),isSameVisit=(te,J)=>{var oe,de,ce,he,ue,pe,fe,ge,me,ve,be,_e,we,Se,Ce,ye,Ae,Le;const X=((oe=te.professional)==null?void 0:oe.id)===((de=J.professional)==null?void 0:de.id)&&((he=(ce=te.professional)==null?void 0:ce.role)==null?void 0:he.id)===((pe=(ue=J.professional)==null?void 0:ue.role)==null?void 0:pe.id)&&((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.id)===((ve=(me=J.professional)==null?void 0:me.speciality)==null?void 0:ve.id),re=((be=te.ep)==null?void 0:be.id)===((_e=J.ep)==null?void 0:_e.id)&&((we=te.up)==null?void 0:we.id)===((Se=J.up)==null?void 0:Se.id)&&((Ce=te.center)==null?void 0:Ce.id)===((ye=J.center)==null?void 0:ye.id)&&((Ae=te.service)==null?void 0:Ae.id)===((Le=J.service)==null?void 0:Le.id),ne=new Date(te.date).toDateString()===new Date(J.date).toDateString();return X&&re&&ne},withinEightHours=(te,J)=>Math.abs(new Date(te).getTime()-new Date(J).getTime())<=8*60*60*1e3;function groupByValidDiagnostics(te){te.forEach(J=>{const X=[],re=[];J.items.forEach(ne=>{const oe=ne.diagnostics;if((oe==null?void 0:oe.length)>0&&hasValidDiagnostics(oe)){let ce=!1;for(const he of X){const ue=he.items[0];if(areSameDiagnostics(ue.diagnostics,oe)){he.items.push(ne),ce=!0;break}}ce||X.push({idSubGroup:crypto.randomUUID(),items:[ne]})}else re.push(ne)}),J.items=re,J.subGroups=X})}const groupActivityHistoryItems=te=>{const J=[];return te==null||te.forEach(X=>{let re=!1;for(const ne of J){const oe=ne.items[0],de=ne.items[ne.items.length-1];if(isSameVisit(oe,X)&&withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),ne.sameVisit=!0,re=!0;break}}if(!re)for(const ne of J){if(ne.sameVisit)continue;const oe=ne.items[0],de=ne.items[ne.items.length-1];if(withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),re=!0;break}}re||J.push({idGroup:crypto.randomUUID(),items:[X],sameVisit:!1})}),groupByValidDiagnostics(J),J},sortGroupsByMostRecentDate=te=>{const J=oe=>oe.reduce((de,ce)=>{const he=new Date(ce.date);return he>de?he:de},new Date(0)),X=oe=>oe.sort((de,ce)=>new Date(ce.date).getTime()-new Date(de.date).getTime()),re=oe=>J(oe.items),ne=oe=>{const de=oe.items.length>0?[J(oe.items)]:[],ce=oe.subGroups.map(re),he=[...de,...ce];return he.length>0?new Date(Math.max(...he.map(ue=>ue.getTime()))):new Date(0)};return te.forEach(oe=>{oe.items=X(oe.items),oe.subGroups.forEach(de=>{de.items=X(de.items)}),oe.subGroups.sort((de,ce)=>re(ce).getTime()-re(de).getTime())}),te.sort((oe,de)=>ne(de).getTime()-ne(oe).getTime())},diagnosticFilterSelector=createSelector(activityHistoryFiltersSelector,te=>te.find(isDiagnosticFilter)),diagnosticFilterEnabledValuesSelector=createSelector(diagnosticFilterSelector,te=>(te==null?void 0:te.enabledValues)||[]),areDiagnosticFiltersActive=createSelector(diagnosticFilterEnabledValuesSelector,te=>!!te.length);class DiagnosticCodeSpec extends Spec{constructor(J){super(),this.diagnosticCodes=J}isSatisfiedBy(J){var re;return(re=this.diagnosticCodes)!=null&&re.length?(J.diagnostics??[]).some(ne=>this.diagnosticCodes.includes(ne.codi)):!0}}const activityHistoryCollectionsSelector=te=>te.activityHistoryCollections.collections,mapItemsWithMetadata=(te,J,X,re)=>te.map(ne=>({...ne,searchPredicate:re,componentFactory:J,type:X})),activityHistoryMappedItems=createSelector(activityHistoryCollectionsSelector,te=>Object.values(te).flatMap(J=>mapItemsWithMetadata(J.items,J.componentFactory,J.id,J.searchPredicate))),customFilterGroupsWithOptionsSelector=createSelector(activityHistoryCustomFilterGroupsSelector,activityHistoryCollectionsSelector,(te,J)=>te.map(re=>{const ne=J[re.id];return{...re,filters:re.filters.map(oe=>({...oe,options:(oe.singleOption?[]:getUniqueObjects(ne.items,oe.propPathValue,oe.propsPathDescription,oe.title))||[]}))}})),activityHistoryGroupedItems=createSelector(activityHistoryMappedItems,activityHistorySearchStringSelector,activityHistoryCommonFiltersSelector,activityHistoryCustomFilterGroupsSelector,diagnosticFilterEnabledValuesSelector,(te,J,X,re,ne)=>{const oe=te.filter(he=>new SearchStringSpec(J,he.searchPredicate).and(new CommonFilterSpec(X)).and(new ComposedTypeSpec(re)).and(new CustomFilterSpec(re)).and(new DiagnosticCodeSpec(ne)).isSatisfiedBy(he)),de=groupActivityHistoryItems(oe);return sortGroupsByMostRecentDate(de)}),styles$g=":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:16px}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";function toDate(te){const J=Object.prototype.toString.call(te);return te instanceof Date||typeof te=="object"&&J==="[object Date]"?new te.constructor(+te):typeof te=="number"||J==="[object Number]"||typeof te=="string"||J==="[object String]"?new Date(te):new Date(NaN)}function constructFrom(te,J){return te instanceof Date?new te.constructor(J):new Date(J)}function addDays(te,J){const X=toDate(te);return isNaN(J)?constructFrom(te,NaN):(J&&X.setDate(X.getDate()+J),X)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.weekStartsOn)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.weekStartsOn)??X.weekStartsOn??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.weekStartsOn)??0,ne=toDate(te),oe=ne.getDay(),de=(oe<re?7:0)+oe-re;return ne.setDate(ne.getDate()-de),ne.setHours(0,0,0,0),ne}function startOfISOWeek(te){return startOfWeek(te,{weekStartsOn:1})}function getISOWeekYear(te){const J=toDate(te),X=J.getFullYear(),re=constructFrom(te,0);re.setFullYear(X+1,0,4),re.setHours(0,0,0,0);const ne=startOfISOWeek(re),oe=constructFrom(te,0);oe.setFullYear(X,0,4),oe.setHours(0,0,0,0);const de=startOfISOWeek(oe);return J.getTime()>=ne.getTime()?X+1:J.getTime()>=de.getTime()?X:X-1}function startOfDay(te){const J=toDate(te);return J.setHours(0,0,0,0),J}function getTimezoneOffsetInMilliseconds(te){const J=toDate(te),X=new Date(Date.UTC(J.getFullYear(),J.getMonth(),J.getDate(),J.getHours(),J.getMinutes(),J.getSeconds(),J.getMilliseconds()));return X.setUTCFullYear(J.getFullYear()),+te-+X}function differenceInCalendarDays(te,J){const X=startOfDay(te),re=startOfDay(J),ne=+X-getTimezoneOffsetInMilliseconds(X),oe=+re-getTimezoneOffsetInMilliseconds(re);return Math.round((ne-oe)/millisecondsInDay)}function startOfISOWeekYear(te){const J=getISOWeekYear(te),X=constructFrom(te,0);return X.setFullYear(J,0,4),X.setHours(0,0,0,0),startOfISOWeek(X)}function isDate(te){return te instanceof Date||typeof te=="object"&&Object.prototype.toString.call(te)==="[object Date]"}function isValid(te){if(!isDate(te)&&typeof te!="number")return!1;const J=toDate(te);return!isNaN(Number(J))}function endOfMonth(te){const J=toDate(te),X=J.getMonth();return J.setFullYear(J.getFullYear(),X+1,0),J.setHours(23,59,59,999),J}function eachDayOfInterval(te,J){const X=toDate(te.start),re=toDate(te.end);let ne=+X>+re;const oe=ne?+X:+re,de=ne?re:X;de.setHours(0,0,0,0);let ce=1;const he=[];for(;+de<=oe;)he.push(toDate(de)),de.setDate(de.getDate()+ce),de.setHours(0,0,0,0);return ne?he.reverse():he}function startOfMonth(te){const J=toDate(te);return J.setDate(1),J.setHours(0,0,0,0),J}function startOfYear(te){const J=toDate(te),X=constructFrom(te,0);return X.setFullYear(J.getFullYear(),0,1),X.setHours(0,0,0,0),X}const formatDistanceLocale={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"}},formatDistance=(te,J,X)=>{let re;const ne=formatDistanceLocale[te];return typeof ne=="string"?re=ne:J===1?re=ne.one:re=ne.other.replace("{{count}}",J.toString()),X!=null&&X.addSuffix?X.comparison&&X.comparison>0?"in "+re:re+" ago":re};function buildFormatLongFn(te){return(J={})=>{const X=J.width?String(J.width):te.defaultWidth;return te.formats[X]||te.formats[te.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(te,J,X,re)=>formatRelativeLocale[te];function buildLocalizeFn(te){return(J,X)=>{const re=X!=null&&X.context?String(X.context):"standalone";let ne;if(re==="formatting"&&te.formattingValues){const de=te.defaultFormattingWidth||te.defaultWidth,ce=X!=null&&X.width?String(X.width):de;ne=te.formattingValues[ce]||te.formattingValues[de]}else{const de=te.defaultWidth,ce=X!=null&&X.width?String(X.width):te.defaultWidth;ne=te.values[ce]||te.values[de]}const oe=te.argumentCallback?te.argumentCallback(J):J;return ne[oe]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={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"]},dayValues={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"]},dayPeriodValues={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"}},formattingDayPeriodValues={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"}},ordinalNumber=(te,J)=>{const X=Number(te),re=X%100;if(re>20||re<10)switch(re%10){case 1:return X+"st";case 2:return X+"nd";case 3:return X+"rd"}return X+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:te=>te-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(te){return(J,X={})=>{const re=X.width,ne=re&&te.matchPatterns[re]||te.matchPatterns[te.defaultMatchWidth],oe=J.match(ne);if(!oe)return null;const de=oe[0],ce=re&&te.parsePatterns[re]||te.parsePatterns[te.defaultParseWidth],he=Array.isArray(ce)?findIndex(ce,fe=>fe.test(de)):findKey(ce,fe=>fe.test(de));let ue;ue=te.valueCallback?te.valueCallback(he):he,ue=X.valueCallback?X.valueCallback(ue):ue;const pe=J.slice(de.length);return{value:ue,rest:pe}}}function findKey(te,J){for(const X in te)if(Object.prototype.hasOwnProperty.call(te,X)&&J(te[X]))return X}function findIndex(te,J){for(let X=0;X<te.length;X++)if(J(te[X]))return X}function buildMatchPatternFn(te){return(J,X={})=>{const re=J.match(te.matchPattern);if(!re)return null;const ne=re[0],oe=J.match(te.parsePattern);if(!oe)return null;let de=te.valueCallback?te.valueCallback(oe[0]):oe[0];de=X.valueCallback?X.valueCallback(de):de;const ce=J.slice(ne.length);return{value:de,rest:ce}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={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},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={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},parseMonthPatterns={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]},matchDayPatterns={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},parseDayPatterns={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]},matchDayPeriodPatterns={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},parseDayPeriodPatterns={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}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:te=>parseInt(te,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:te=>te+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(te){const J=toDate(te);return differenceInCalendarDays(J,startOfYear(J))+1}function getISOWeek(te){const J=toDate(te),X=+startOfISOWeek(J)-+startOfISOWeekYear(J);return Math.round(X/millisecondsInWeek)+1}function getWeekYear(te,J){var pe,fe,ge,me;const X=toDate(te),re=X.getFullYear(),ne=getDefaultOptions$1(),oe=(J==null?void 0:J.firstWeekContainsDate)??((fe=(pe=J==null?void 0:J.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??ne.firstWeekContainsDate??((me=(ge=ne.locale)==null?void 0:ge.options)==null?void 0:me.firstWeekContainsDate)??1,de=constructFrom(te,0);de.setFullYear(re+1,0,oe),de.setHours(0,0,0,0);const ce=startOfWeek(de,J),he=constructFrom(te,0);he.setFullYear(re,0,oe),he.setHours(0,0,0,0);const ue=startOfWeek(he,J);return X.getTime()>=ce.getTime()?re+1:X.getTime()>=ue.getTime()?re:re-1}function startOfWeekYear(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.firstWeekContainsDate)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.firstWeekContainsDate)??X.firstWeekContainsDate??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.firstWeekContainsDate)??1,ne=getWeekYear(te,J),oe=constructFrom(te,0);return oe.setFullYear(ne,0,re),oe.setHours(0,0,0,0),startOfWeek(oe,J)}function getWeek(te,J){const X=toDate(te),re=+startOfWeek(X,J)-+startOfWeekYear(X,J);return Math.round(re/millisecondsInWeek)+1}function addLeadingZeros(te,J){const X=te<0?"-":"",re=Math.abs(te).toString().padStart(J,"0");return X+re}const lightFormatters={y(te,J){const X=te.getFullYear(),re=X>0?X:1-X;return addLeadingZeros(J==="yy"?re%100:re,J.length)},M(te,J){const X=te.getMonth();return J==="M"?String(X+1):addLeadingZeros(X+1,2)},d(te,J){return addLeadingZeros(te.getDate(),J.length)},a(te,J){const X=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.toUpperCase();case"aaa":return X;case"aaaaa":return X[0];case"aaaa":default:return X==="am"?"a.m.":"p.m."}},h(te,J){return addLeadingZeros(te.getHours()%12||12,J.length)},H(te,J){return addLeadingZeros(te.getHours(),J.length)},m(te,J){return addLeadingZeros(te.getMinutes(),J.length)},s(te,J){return addLeadingZeros(te.getSeconds(),J.length)},S(te,J){const X=J.length,re=te.getMilliseconds(),ne=Math.trunc(re*Math.pow(10,X-3));return addLeadingZeros(ne,J.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(te,J,X){const re=te.getFullYear()>0?1:0;switch(J){case"G":case"GG":case"GGG":return X.era(re,{width:"abbreviated"});case"GGGGG":return X.era(re,{width:"narrow"});case"GGGG":default:return X.era(re,{width:"wide"})}},y:function(te,J,X){if(J==="yo"){const re=te.getFullYear(),ne=re>0?re:1-re;return X.ordinalNumber(ne,{unit:"year"})}return lightFormatters.y(te,J)},Y:function(te,J,X,re){const ne=getWeekYear(te,re),oe=ne>0?ne:1-ne;if(J==="YY"){const de=oe%100;return addLeadingZeros(de,2)}return J==="Yo"?X.ordinalNumber(oe,{unit:"year"}):addLeadingZeros(oe,J.length)},R:function(te,J){const X=getISOWeekYear(te);return addLeadingZeros(X,J.length)},u:function(te,J){const X=te.getFullYear();return addLeadingZeros(X,J.length)},Q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"Q":return String(re);case"QQ":return addLeadingZeros(re,2);case"Qo":return X.ordinalNumber(re,{unit:"quarter"});case"QQQ":return X.quarter(re,{width:"abbreviated",context:"formatting"});case"QQQQQ":return X.quarter(re,{width:"narrow",context:"formatting"});case"QQQQ":default:return X.quarter(re,{width:"wide",context:"formatting"})}},q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"q":return String(re);case"qq":return addLeadingZeros(re,2);case"qo":return X.ordinalNumber(re,{unit:"quarter"});case"qqq":return X.quarter(re,{width:"abbreviated",context:"standalone"});case"qqqqq":return X.quarter(re,{width:"narrow",context:"standalone"});case"qqqq":default:return X.quarter(re,{width:"wide",context:"standalone"})}},M:function(te,J,X){const re=te.getMonth();switch(J){case"M":case"MM":return lightFormatters.M(te,J);case"Mo":return X.ordinalNumber(re+1,{unit:"month"});case"MMM":return X.month(re,{width:"abbreviated",context:"formatting"});case"MMMMM":return X.month(re,{width:"narrow",context:"formatting"});case"MMMM":default:return X.month(re,{width:"wide",context:"formatting"})}},L:function(te,J,X){const re=te.getMonth();switch(J){case"L":return String(re+1);case"LL":return addLeadingZeros(re+1,2);case"Lo":return X.ordinalNumber(re+1,{unit:"month"});case"LLL":return X.month(re,{width:"abbreviated",context:"standalone"});case"LLLLL":return X.month(re,{width:"narrow",context:"standalone"});case"LLLL":default:return X.month(re,{width:"wide",context:"standalone"})}},w:function(te,J,X,re){const ne=getWeek(te,re);return J==="wo"?X.ordinalNumber(ne,{unit:"week"}):addLeadingZeros(ne,J.length)},I:function(te,J,X){const re=getISOWeek(te);return J==="Io"?X.ordinalNumber(re,{unit:"week"}):addLeadingZeros(re,J.length)},d:function(te,J,X){return J==="do"?X.ordinalNumber(te.getDate(),{unit:"date"}):lightFormatters.d(te,J)},D:function(te,J,X){const re=getDayOfYear(te);return J==="Do"?X.ordinalNumber(re,{unit:"dayOfYear"}):addLeadingZeros(re,J.length)},E:function(te,J,X){const re=te.getDay();switch(J){case"E":case"EE":case"EEE":return X.day(re,{width:"abbreviated",context:"formatting"});case"EEEEE":return X.day(re,{width:"narrow",context:"formatting"});case"EEEEEE":return X.day(re,{width:"short",context:"formatting"});case"EEEE":default:return X.day(re,{width:"wide",context:"formatting"})}},e:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"e":return String(oe);case"ee":return addLeadingZeros(oe,2);case"eo":return X.ordinalNumber(oe,{unit:"day"});case"eee":return X.day(ne,{width:"abbreviated",context:"formatting"});case"eeeee":return X.day(ne,{width:"narrow",context:"formatting"});case"eeeeee":return X.day(ne,{width:"short",context:"formatting"});case"eeee":default:return X.day(ne,{width:"wide",context:"formatting"})}},c:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"c":return String(oe);case"cc":return addLeadingZeros(oe,J.length);case"co":return X.ordinalNumber(oe,{unit:"day"});case"ccc":return X.day(ne,{width:"abbreviated",context:"standalone"});case"ccccc":return X.day(ne,{width:"narrow",context:"standalone"});case"cccccc":return X.day(ne,{width:"short",context:"standalone"});case"cccc":default:return X.day(ne,{width:"wide",context:"standalone"})}},i:function(te,J,X){const re=te.getDay(),ne=re===0?7:re;switch(J){case"i":return String(ne);case"ii":return addLeadingZeros(ne,J.length);case"io":return X.ordinalNumber(ne,{unit:"day"});case"iii":return X.day(re,{width:"abbreviated",context:"formatting"});case"iiiii":return X.day(re,{width:"narrow",context:"formatting"});case"iiiiii":return X.day(re,{width:"short",context:"formatting"});case"iiii":default:return X.day(re,{width:"wide",context:"formatting"})}},a:function(te,J,X){const ne=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"aaa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"aaaa":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},b:function(te,J,X){const re=te.getHours();let ne;switch(re===12?ne=dayPeriodEnum.noon:re===0?ne=dayPeriodEnum.midnight:ne=re/12>=1?"pm":"am",J){case"b":case"bb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"bbb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"bbbb":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},B:function(te,J,X){const re=te.getHours();let ne;switch(re>=17?ne=dayPeriodEnum.evening:re>=12?ne=dayPeriodEnum.afternoon:re>=4?ne=dayPeriodEnum.morning:ne=dayPeriodEnum.night,J){case"B":case"BB":case"BBB":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"BBBBB":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"BBBB":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},h:function(te,J,X){if(J==="ho"){let re=te.getHours()%12;return re===0&&(re=12),X.ordinalNumber(re,{unit:"hour"})}return lightFormatters.h(te,J)},H:function(te,J,X){return J==="Ho"?X.ordinalNumber(te.getHours(),{unit:"hour"}):lightFormatters.H(te,J)},K:function(te,J,X){const re=te.getHours()%12;return J==="Ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},k:function(te,J,X){let re=te.getHours();return re===0&&(re=24),J==="ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},m:function(te,J,X){return J==="mo"?X.ordinalNumber(te.getMinutes(),{unit:"minute"}):lightFormatters.m(te,J)},s:function(te,J,X){return J==="so"?X.ordinalNumber(te.getSeconds(),{unit:"second"}):lightFormatters.s(te,J)},S:function(te,J){return lightFormatters.S(te,J)},X:function(te,J,X){const re=te.getTimezoneOffset();if(re===0)return"Z";switch(J){case"X":return formatTimezoneWithOptionalMinutes(re);case"XXXX":case"XX":return formatTimezone(re);case"XXXXX":case"XXX":default:return formatTimezone(re,":")}},x:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"x":return formatTimezoneWithOptionalMinutes(re);case"xxxx":case"xx":return formatTimezone(re);case"xxxxx":case"xxx":default:return formatTimezone(re,":")}},O:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(re,":");case"OOOO":default:return"GMT"+formatTimezone(re,":")}},z:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(re,":");case"zzzz":default:return"GMT"+formatTimezone(re,":")}},t:function(te,J,X){const re=Math.trunc(te.getTime()/1e3);return addLeadingZeros(re,J.length)},T:function(te,J,X){const re=te.getTime();return addLeadingZeros(re,J.length)}};function formatTimezoneShort(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=Math.trunc(re/60),oe=re%60;return oe===0?X+String(ne):X+String(ne)+J+addLeadingZeros(oe,2)}function formatTimezoneWithOptionalMinutes(te,J){return te%60===0?(te>0?"-":"+")+addLeadingZeros(Math.abs(te)/60,2):formatTimezone(te,J)}function formatTimezone(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=addLeadingZeros(Math.trunc(re/60),2),oe=addLeadingZeros(re%60,2);return X+ne+J+oe}const dateLongFormatter=(te,J)=>{switch(te){case"P":return J.date({width:"short"});case"PP":return J.date({width:"medium"});case"PPP":return J.date({width:"long"});case"PPPP":default:return J.date({width:"full"})}},timeLongFormatter=(te,J)=>{switch(te){case"p":return J.time({width:"short"});case"pp":return J.time({width:"medium"});case"ppp":return J.time({width:"long"});case"pppp":default:return J.time({width:"full"})}},dateTimeLongFormatter=(te,J)=>{const X=te.match(/(P+)(p+)?/)||[],re=X[1],ne=X[2];if(!ne)return dateLongFormatter(te,J);let oe;switch(re){case"P":oe=J.dateTime({width:"short"});break;case"PP":oe=J.dateTime({width:"medium"});break;case"PPP":oe=J.dateTime({width:"long"});break;case"PPPP":default:oe=J.dateTime({width:"full"});break}return oe.replace("{{date}}",dateLongFormatter(re,J)).replace("{{time}}",timeLongFormatter(ne,J))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(te){return dayOfYearTokenRE.test(te)}function isProtectedWeekYearToken(te){return weekYearTokenRE.test(te)}function warnOrThrowProtectedError(te,J,X){const re=message(te,J,X);if(console.warn(re),throwTokens.includes(te))throw new RangeError(re)}function message(te,J,X){const re=te[0]==="Y"?"years":"days of the month";return`Use \`${te.toLowerCase()}\` instead of \`${te}\` (in \`${J}\`) for formatting ${re} to the input \`${X}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(te,J,X){var pe,fe,ge,me;const re=getDefaultOptions$1(),ne=re.locale??enUS,oe=re.firstWeekContainsDate??((fe=(pe=re.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??1,de=re.weekStartsOn??((me=(ge=re.locale)==null?void 0:ge.options)==null?void 0:me.weekStartsOn)??0,ce=toDate(te);if(!isValid(ce))throw new RangeError("Invalid time value");let he=J.match(longFormattingTokensRegExp$1).map(ve=>{const be=ve[0];if(be==="p"||be==="P"){const _e=longFormatters[be];return _e(ve,ne.formatLong)}return ve}).join("").match(formattingTokensRegExp$1).map(ve=>{if(ve==="''")return{isToken:!1,value:"'"};const be=ve[0];if(be==="'")return{isToken:!1,value:cleanEscapedString$1(ve)};if(formatters[be])return{isToken:!0,value:ve};if(be.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+be+"`");return{isToken:!1,value:ve}});ne.localize.preprocessor&&(he=ne.localize.preprocessor(ce,he));const ue={firstWeekContainsDate:oe,weekStartsOn:de,locale:ne};return he.map(ve=>{if(!ve.isToken)return ve.value;const be=ve.value;(isProtectedWeekYearToken(be)||isProtectedDayOfYearToken(be))&&warnOrThrowProtectedError(be,J,String(te));const _e=formatters[be[0]];return _e(ce,be,ne.localize,ue)}).join("")}function cleanEscapedString$1(te){const J=te.match(escapedStringRegExp$1);return J?J[1].replace(doubleQuoteRegExp$1,"'"):te}function getDay(te){return toDate(te).getDay()}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(te){let X=toDate(te).getDay();return X===0&&(X=7),X}function transpose(te,J){const X=J instanceof Date?constructFrom(J,0):new J(0);return X.setFullYear(te.getFullYear(),te.getMonth(),te.getDate()),X.setHours(te.getHours(),te.getMinutes(),te.getSeconds(),te.getMilliseconds()),X}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){Nt(this,"subPriority",0)}validate(J,X){return!0}}class ValueSetter extends Setter{constructor(J,X,re,ne,oe){super(),this.value=J,this.validateValue=X,this.setValue=re,this.priority=ne,oe&&(this.subPriority=oe)}validate(J,X){return this.validateValue(J,this.value,X)}set(J,X,re){return this.setValue(J,X,this.value,re)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);Nt(this,"priority",TIMEZONE_UNIT_PRIORITY);Nt(this,"subPriority",-1)}set(X,re){return re.timestampIsSet?X:constructFrom(X,transpose(X,Date))}}class Parser{run(J,X,re,ne){const oe=this.parse(J,X,re,ne);return oe?{setter:new ValueSetter(oe.value,this.validate,this.set,this.priority,this.subPriority),rest:oe.rest}:null}validate(J,X,re){return!0}}class EraParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",140);Nt(this,"incompatibleTokens",["R","u","t","T"])}parse(X,re,ne){switch(re){case"G":case"GG":case"GGG":return ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"});case"GGGGG":return ne.era(X,{width:"narrow"});case"GGGG":default:return ne.era(X,{width:"wide"})||ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"})}}set(X,re,ne){return re.era=ne,X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(te,J){return te&&{value:J(te.value),rest:te.rest}}function parseNumericPattern(te,J){const X=J.match(te);return X?{value:parseInt(X[0],10),rest:J.slice(X[0].length)}:null}function parseTimezonePattern(te,J){const X=J.match(te);if(!X)return null;if(X[0]==="Z")return{value:0,rest:J.slice(1)};const re=X[1]==="+"?1:-1,ne=X[2]?parseInt(X[2],10):0,oe=X[3]?parseInt(X[3],10):0,de=X[5]?parseInt(X[5],10):0;return{value:re*(ne*millisecondsInHour+oe*millisecondsInMinute+de*millisecondsInSecond),rest:J.slice(X[0].length)}}function parseAnyDigitsSigned(te){return parseNumericPattern(numericPatterns.anyDigitsSigned,te)}function parseNDigits(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigit,J);case 2:return parseNumericPattern(numericPatterns.twoDigits,J);case 3:return parseNumericPattern(numericPatterns.threeDigits,J);case 4:return parseNumericPattern(numericPatterns.fourDigits,J);default:return parseNumericPattern(new RegExp("^\\d{1,"+te+"}"),J)}}function parseNDigitsSigned(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,J);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,J);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,J);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,J);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+te+"}"),J)}}function dayPeriodEnumToHours(te){switch(te){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(te,J){const X=J>0,re=X?J:1-J;let ne;if(re<=50)ne=te||100;else{const oe=re+50,de=Math.trunc(oe/100)*100,ce=te>=oe%100;ne=te+de-(ce?100:0)}return X?ne:1-ne}function isLeapYearIndex(te){return te%400===0||te%4===0&&te%100!==0}class YearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="yy"});switch(re){case"y":return mapValue(parseNDigits(4,X),oe);case"yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne){const oe=X.getFullYear();if(ne.isTwoDigitYear){const ce=normalizeTwoDigitYear(ne.year,oe);return X.setFullYear(ce,0,1),X.setHours(0,0,0,0),X}const de=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(de,0,1),X.setHours(0,0,0,0),X}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="YY"});switch(re){case"Y":return mapValue(parseNDigits(4,X),oe);case"Yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne,oe){const de=getWeekYear(X,oe);if(ne.isTwoDigitYear){const he=normalizeTwoDigitYear(ne.year,de);return X.setFullYear(he,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}const ce=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(ce,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="R"?4:re.length,X)}set(X,re,ne){const oe=constructFrom(X,0);return oe.setFullYear(ne,0,4),oe.setHours(0,0,0,0),startOfISOWeek(oe)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="u"?4:re.length,X)}set(X,re,ne){return X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}class QuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"Q":case"QQ":return parseNDigits(re.length,X);case"Qo":return ne.ordinalNumber(X,{unit:"quarter"});case"QQQ":return ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQQ":return ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQ":default:return ne.quarter(X,{width:"wide",context:"formatting"})||ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"q":case"qq":return parseNDigits(re.length,X);case"qo":return ne.ordinalNumber(X,{unit:"quarter"});case"qqq":return ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqqq":return ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqq":default:return ne.quarter(X,{width:"wide",context:"standalone"})||ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class MonthParser extends Parser{constructor(){super(...arguments);Nt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Nt(this,"priority",110)}parse(X,re,ne){const oe=de=>de-1;switch(re){case"M":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"MM":return mapValue(parseNDigits(2,X),oe);case"Mo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"MMM":return ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"});case"MMMMM":return ne.month(X,{width:"narrow",context:"formatting"});case"MMMM":default:return ne.month(X,{width:"wide",context:"formatting"})||ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",110);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>de-1;switch(re){case"L":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"LL":return mapValue(parseNDigits(2,X),oe);case"Lo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"LLL":return ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"});case"LLLLL":return ne.month(X,{width:"narrow",context:"standalone"});case"LLLL":default:return ne.month(X,{width:"wide",context:"standalone"})||ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}function setWeek(te,J,X){const re=toDate(te),ne=getWeek(re,X)-J;return re.setDate(re.getDate()-ne*7),re}class LocalWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){switch(re){case"w":return parseNumericPattern(numericPatterns.week,X);case"wo":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne,oe){return startOfWeek(setWeek(X,ne,oe),oe)}}function setISOWeek(te,J){const X=toDate(te),re=getISOWeek(X)-J;return X.setDate(X.getDate()-re*7),X}class ISOWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(X,re,ne){switch(re){case"I":return parseNumericPattern(numericPatterns.week,X);case"Io":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne){return startOfISOWeek(setISOWeek(X,ne))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subPriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"d":return parseNumericPattern(numericPatterns.date,X);case"do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear(),oe=isLeapYearIndex(ne),de=X.getMonth();return oe?re>=1&&re<=DAYS_IN_MONTH_LEAP_YEAR[de]:re>=1&&re<=DAYS_IN_MONTH[de]}set(X,re,ne){return X.setDate(ne),X.setHours(0,0,0,0),X}}class DayOfYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subpriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,X);case"Do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear();return isLeapYearIndex(ne)?re>=1&&re<=366:re>=1&&re<=365}set(X,re,ne){return X.setMonth(0,ne),X.setHours(0,0,0,0),X}}function setDay(te,J,X){var fe,ge,me,ve;const re=getDefaultOptions$1(),ne=(X==null?void 0:X.weekStartsOn)??((ge=(fe=X==null?void 0:X.locale)==null?void 0:fe.options)==null?void 0:ge.weekStartsOn)??re.weekStartsOn??((ve=(me=re.locale)==null?void 0:me.options)==null?void 0:ve.weekStartsOn)??0,oe=toDate(te),de=oe.getDay(),he=(J%7+7)%7,ue=7-ne,pe=J<0||J>6?J-(de+ue)%7:(he+ue)%7-(de+ue)%7;return addDays(oe,pe)}class DayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"E":case"EE":case"EEE":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEEE":return ne.day(X,{width:"narrow",context:"formatting"});case"EEEEEE":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEE":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class LocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"e":case"ee":return mapValue(parseNDigits(re.length,X),de);case"eo":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"eee":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeeee":return ne.day(X,{width:"narrow",context:"formatting"});case"eeeeee":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeee":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"c":case"cc":return mapValue(parseNDigits(re.length,X),de);case"co":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"ccc":return ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"ccccc":return ne.day(X,{width:"narrow",context:"standalone"});case"cccccc":return ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"cccc":default:return ne.day(X,{width:"wide",context:"standalone"})||ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}function setISODay(te,J){const X=toDate(te),re=getISODay(X),ne=J-re;return addDays(X,ne)}class ISODayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(X,re,ne){const oe=de=>de===0?7:de;switch(re){case"i":case"ii":return parseNDigits(re.length,X);case"io":return ne.ordinalNumber(X,{unit:"day"});case"iii":return mapValue(ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiii":return mapValue(ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiiii":return mapValue(ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiii":default:return mapValue(ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe)}}validate(X,re){return re>=1&&re<=7}set(X,re,ne){return X=setISODay(X,ne),X.setHours(0,0,0,0),X}}class AMPMParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"a":case"aa":case"aaa":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaaa":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaa":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"b":case"bb":case"bbb":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbbb":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbb":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class DayPeriodParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","b","t","T"])}parse(X,re,ne){switch(re){case"B":case"BB":case"BBB":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBBB":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBB":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(X,re,ne){switch(re){case"h":return parseNumericPattern(numericPatterns.hour12h,X);case"ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=12}set(X,re,ne){const oe=X.getHours()>=12;return oe&&ne<12?X.setHours(ne+12,0,0,0):!oe&&ne===12?X.setHours(0,0,0,0):X.setHours(ne,0,0,0),X}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(X,re,ne){switch(re){case"H":return parseNumericPattern(numericPatterns.hour23h,X);case"Ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=23}set(X,re,ne){return X.setHours(ne,0,0,0),X}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(X,re,ne){switch(re){case"K":return parseNumericPattern(numericPatterns.hour11h,X);case"Ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.getHours()>=12&&ne<12?X.setHours(ne+12,0,0,0):X.setHours(ne,0,0,0),X}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(X,re,ne){switch(re){case"k":return parseNumericPattern(numericPatterns.hour24h,X);case"ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=24}set(X,re,ne){const oe=ne<=24?ne%24:ne;return X.setHours(oe,0,0,0),X}}class MinuteParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",60);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"m":return parseNumericPattern(numericPatterns.minute,X);case"mo":return ne.ordinalNumber(X,{unit:"minute"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setMinutes(ne,0,0),X}}class SecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",50);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"s":return parseNumericPattern(numericPatterns.second,X);case"so":return ne.ordinalNumber(X,{unit:"second"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setSeconds(ne,0),X}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",30);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re){const ne=oe=>Math.trunc(oe*Math.pow(10,-re.length+3));return mapValue(parseNDigits(re.length,X),ne)}set(X,re,ne){return X.setMilliseconds(ne),X}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","x"])}parse(X,re){switch(re){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"XX":return parseTimezonePattern(timezonePatterns.basic,X);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","X"])}parse(X,re){switch(re){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"xx":return parseTimezonePattern(timezonePatterns.basic,X);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",40);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",20);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(te,J,X,re){var be,_e,we,Se;const ne=getDefaultOptions(),oe=ne.locale??enUS,de=ne.firstWeekContainsDate??((_e=(be=ne.locale)==null?void 0:be.options)==null?void 0:_e.firstWeekContainsDate)??1,ce=ne.weekStartsOn??((Se=(we=ne.locale)==null?void 0:we.options)==null?void 0:Se.weekStartsOn)??0,he={firstWeekContainsDate:de,weekStartsOn:ce,locale:oe},ue=[new DateToSystemTimezoneSetter],pe=J.match(longFormattingTokensRegExp).map(Ce=>{const ye=Ce[0];if(ye in longFormatters){const Ae=longFormatters[ye];return Ae(Ce,oe.formatLong)}return Ce}).join("").match(formattingTokensRegExp),fe=[];for(let Ce of pe){isProtectedWeekYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te),isProtectedDayOfYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te);const ye=Ce[0],Ae=parsers[ye];if(Ae){const{incompatibleTokens:Le}=Ae;if(Array.isArray(Le)){const Me=fe.find(He=>Le.includes(He.token)||He.token===ye);if(Me)throw new RangeError(`The format string mustn't contain \`${Me.fullToken}\` and \`${Ce}\` at the same time`)}else if(Ae.incompatibleTokens==="*"&&fe.length>0)throw new RangeError(`The format string mustn't contain \`${Ce}\` and any other token at the same time`);fe.push({token:ye,fullToken:Ce});const De=Ae.run(te,Ce,oe.match,he);if(!De)return constructFrom(X,NaN);ue.push(De.setter),te=De.rest}else{if(ye.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ye+"`");if(Ce==="''"?Ce="'":ye==="'"&&(Ce=cleanEscapedString(Ce)),te.indexOf(Ce)===0)te=te.slice(Ce.length);else return constructFrom(X,NaN)}}if(te.length>0&&notWhitespaceRegExp.test(te))return constructFrom(X,NaN);const ge=ue.map(Ce=>Ce.priority).sort((Ce,ye)=>ye-Ce).filter((Ce,ye,Ae)=>Ae.indexOf(Ce)===ye).map(Ce=>ue.filter(ye=>ye.priority===Ce).sort((ye,Ae)=>Ae.subPriority-ye.subPriority)).map(Ce=>Ce[0]);let me=toDate(X);if(isNaN(me.getTime()))return constructFrom(X,NaN);const ve={};for(const Ce of ge){if(!Ce.validate(me,he))return constructFrom(X,NaN);const ye=Ce.set(me,ve,he);Array.isArray(ye)?(me=ye[0],Object.assign(ve,ye[1])):me=ye}return constructFrom(X,me)}function cleanEscapedString(te){return te.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}const notFound="data:image/svg+xml,%3csvg%20width='215'%20height='150'%20viewBox='0%200%20215%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.9'%20d='M135.132%2057.43C96.9221%2047.658%2083.3815%20-29.7048%2026.9734%2012.5083C-13.0511%2042.4595%2011.4691%20115.499%2061.6878%20107.019C92.0822%20101.867%2087.3917%20101.341%20113.129%20115.244C139.231%20129.308%20167.972%20136.397%20195.855%20111.436C210.28%2098.5179%20215.939%2067.0352%20201.939%2050.7417C184.388%2030.3592%20158.485%2063.4098%20135.132%2057.43Z'%20fill='%23EFF7FF'/%3e%3cellipse%20cx='120.5'%20cy='143.5'%20rx='52.5'%20ry='3.5'%20fill='%23F5F5F5'/%3e%3cpath%20d='M121.387%2080.2184C121.995%2079.5948%20122.563%2078.953%20123.09%2078.2959L134.396%2089.3383C135.09%2090.0177%20134.851%2091.389%20133.861%2092.4024C132.872%2093.4159%20131.505%2093.6888%20130.811%2093.0094L119.505%2081.967C120.148%2081.424%20120.777%2080.8407%20121.385%2080.2171L121.387%2080.2184Z'%20fill='%231D1D1D'/%3e%3cpath%20opacity='0.6'%20d='M121.127%2079.9896C132.157%2068.6986%20131.888%2050.5485%20120.527%2039.4502C109.166%2028.3519%2091.0149%2028.5081%2079.9849%2039.799C68.955%2051.09%2069.2233%2069.2401%2080.5843%2080.3385C91.9453%2091.4368%20110.097%2091.2806%20121.127%2079.9896Z'%20fill='%238FC2F5'/%3e%3cpath%20d='M78.0382%2083.0622C90.8729%2095.6382%20111.378%2095.4578%20123.835%2082.6609C136.293%2069.8625%20135.986%2049.2932%20123.15%2036.7173C110.316%2024.1413%2089.8107%2024.3217%2077.3538%2037.1186C64.8956%2049.9169%2065.2022%2070.4862%2078.0382%2083.0622ZM80.642%2080.387C69.289%2069.264%2069.0172%2051.0692%2080.037%2039.749C91.0569%2028.4288%20109.194%2028.2694%20120.547%2039.3938C131.9%2050.5182%20132.171%2068.713%20121.152%2080.0332C110.132%2091.3534%2091.9949%2091.5128%2080.642%2080.3884V80.387Z'%20fill='%237BACFC'/%3e%3cpath%20d='M169.953%20128.522L171.714%20126.696C173.474%20124.871%20173.421%20121.964%20171.595%20120.205L135.013%2084.9265C133.187%2083.1661%20130.281%2083.2205%20128.522%2085.0451L126.761%2086.8711C125.001%2088.6957%20125.055%2091.6028%20126.88%2093.3619L163.462%20128.64C165.287%20130.401%20168.194%20130.346%20169.953%20128.522Z'%20fill='%23656565'/%3e%3cpath%20opacity='0.35'%20d='M88.8399%2071.2315C96.506%2079.2245%20101.258%2078.1642%20100.757%2082.4547C100.256%2086.7452%2091.398%2085.7448%2082.7698%2076.0396C74.1415%2066.3344%2075.0893%2054.9166%2079.8491%2055.2485C84.6089%2055.5803%2080.129%2062.1492%2088.8399%2071.2315Z'%20fill='white'/%3e%3c/svg%3e";/**
329
329
  * @license
330
330
  * Copyright 2018 Google LLC
331
331
  * SPDX-License-Identifier: BSD-3-Clause
@@ -340,7 +340,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
340
340
  .items=${te.historyGroups}
341
341
  .renderItem=${(X,re)=>{var ne,oe,de,ce;return ke$1`
342
342
  <div class="visit zIndex${te.historyGroups.length-re}"
343
- data-date=${to(((ne=X==null?void 0:X.items[0])==null?void 0:ne.date)||((de=(oe=X.subGroups[0])==null?void 0:oe.items[0])==null?void 0:de.date))}>
343
+ data-date=${to(((ne=X==null?void 0:X.items[0])==null?void 0:ne.date)||((de=(oe=X==null?void 0:X.subGroups[0])==null?void 0:oe.items[0])==null?void 0:de.date))}>
344
344
  ${visitHeaderTemplate(te,X.items[0]||((ce=X.subGroups[0])==null?void 0:ce.items[0]))}
345
345
  <div class="visit__items">
346
346
  ${Qt(mergeHistoryItemsAndSubgroups(X),he=>he.type==="item"?he.item.id:he.subGroup.id,he=>{if(he.type==="item"){const pe=he.item;return ke$1`
@@ -390,7 +390,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
390
390
  </div>
391
391
  `:D$1,renderProfessionalValues=(te,J)=>{var ne,oe,de,ce,he,ue;if(!J.professional)return D$1;const X=shouldShowRole(J),re=[];return re.push(te.highlighted(J.professional.name)),X&&((oe=(ne=J.professional)==null?void 0:ne.role)!=null&&oe.description)&&re.push(te.highlighted(J.professional.role.description)),(de=J.up)!=null&&de.description&&re.push(te.highlighted(J.up.description)),(he=(ce=J.professional)==null?void 0:ce.speciality)!=null&&he.description&&re.push(te.highlighted(J.professional.speciality.description)),(ue=J.service)!=null&&ue.description&&re.push(te.highlighted(J.service.description)),re.map((pe,fe)=>ke$1`${pe}${fe<re.length-1?" | ":""}`)},diagnosticHeaderTemplate=te=>te&&ke$1`
392
392
  <div class="diagnostics__header">
393
- ${te.diagnostics.filter(J=>J.description!=null&&J.description.trim()!=="").map(J=>{var X;return ke$1`<dss-badge text=${(X=J.description)==null?void 0:X.toUpperCase()} state="info" size="sm" outlined></dss-badge>`})}
393
+ ${te.diagnostics.filter(J=>J.descripcio!=null&&J.descripcio.trim()!=="").map(J=>{var X;return ke$1`<dss-badge text=${(X=J.descripcio)==null?void 0:X.toUpperCase()} state="info" size="sm" outlined></dss-badge>`})}
394
394
  </div>
395
395
  `;/**
396
396
  * @license
@@ -6696,7 +6696,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
6696
6696
  ></dss-alert>
6697
6697
  `:D$1}};Xi.styles=i$A`
6698
6698
  ${r$H(styles)}
6699
- `;let PrimariaCharacterLimitBadge=Xi;__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterCount"),__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterLimit"),__decorateClass([n$x({type:String})],PrimariaCharacterLimitBadge.prototype,"label");const useSharedUI=()=>{t$j("primaria-content-switcher")(PrimariaContentSwitcher),t$j("primaria-nav-item")(PrimariaNavItem),t$j("primaria-rich-text-editor")(PrimariaRichTextEditor),t$j("primaria-nav-tree-menu")(PrimariaNavTreeMenu),t$j("primaria-character-limit-badge")(PrimariaCharacterLimitBadge)},registerLowerNavMenuViews=()=>{shellApi.regionManager.registerView(shellRegions.navigationLowerLeftMenu,{id:"configuration-center",factory:()=>{const te=new PrimariaNavItem({icon:"settings",label:"Centre de configuració",callbackFn:()=>{}});return Promise.resolve(te)}})},getPatientCip=async te=>await te.broker.send("get_patient_cip"),navigateToEcapWithoutClosingWithCip=async te=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish(te,"NO_TANCAR",{CIP:J})},upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>{}},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>{}}]},{id:"unique-petition",icon:"playlist_add",label:"Petitori",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>{}},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>{}},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>{}}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>{}},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>{}},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>{}},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>{}},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>{}}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>{}},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"communication",icon:"3p",label:"Comunicació",type:"tree",sortHint:"0120",actionMenuItems:[{icon:"open_in_new",label:"SMS",callbackFn:async()=>{const te=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:te||"",TipusMissatge:"SMS"})}},{icon:"open_in_new",label:"eConsulta",callbackFn:()=>{}},{icon:"open_in_new",label:"Mail",callbackFn:()=>{}},{icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")},{icon:"open_in_new",label:"Videoconsulta",callbackFn:()=>{}}]},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")},{id:"visor",icon:"window",label:"Visor",type:"item",sortHint:"0140",callbackFn:()=>{}}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerUpperNavMenuViews(),registerLowerNavMenuViews()},useUI=()=>{p$h.registerAdapterFactory("primaria-content-switcher",d$v),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$N.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$v.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));/**
6699
+ `;let PrimariaCharacterLimitBadge=Xi;__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterCount"),__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterLimit"),__decorateClass([n$x({type:String})],PrimariaCharacterLimitBadge.prototype,"label");const useSharedUI=()=>{t$j("primaria-content-switcher")(PrimariaContentSwitcher),t$j("primaria-nav-item")(PrimariaNavItem),t$j("primaria-rich-text-editor")(PrimariaRichTextEditor),t$j("primaria-nav-tree-menu")(PrimariaNavTreeMenu),t$j("primaria-character-limit-badge")(PrimariaCharacterLimitBadge)},registerLowerNavMenuViews=()=>{shellApi.regionManager.registerView(shellRegions.navigationLowerLeftMenu,{id:"configuration-center",factory:()=>{const te=new PrimariaNavItem({icon:"settings",label:"Centre de configuració",callbackFn:()=>{}});return Promise.resolve(te)}})},getPatientCip=async te=>await te.broker.send("get_patient_cip"),navigateToEcapWithoutClosingWithCip=async te=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish(te,"NO_TANCAR",{CIP:J})},upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR")},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>{}}]},{id:"unique-petition",icon:"playlist_add",label:"Petitori",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SEGUIMENT_ANALITIC")},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULTAT_INFORMES")},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>navigateToEcapWithoutClosingWithCip("INFORME_CLINIC_NET")}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>{}},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCIPCIO_ACTIVA")},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ORDRE_TRACTAMENT")},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>navigateToEcapWithoutClosingWithCip("DISPENSACIO_MATERIAL_PACIENT")},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCIPCIO_SOCIAL")}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IMMUNITZACIONS")},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"communication",icon:"3p",label:"Comunicació",type:"tree",sortHint:"0120",actionMenuItems:[{icon:"open_in_new",label:"SMS",callbackFn:async()=>{const te=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:te||"",TipusMissatge:"SMS"})}},{icon:"open_in_new",label:"eConsulta",callbackFn:()=>{}},{icon:"open_in_new",label:"Mail",callbackFn:()=>{}},{icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")},{icon:"open_in_new",label:"Videoconsulta",callbackFn:()=>{}}]},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")},{id:"visor",icon:"window",label:"Visor",type:"item",sortHint:"0140",callbackFn:()=>{}}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerUpperNavMenuViews(),registerLowerNavMenuViews()},useUI=()=>{p$h.registerAdapterFactory("primaria-content-switcher",d$v),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$N.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$v.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));/**
6700
6700
  * @license
6701
6701
  * Copyright 2021 Google LLC
6702
6702
  * SPDX-License-Identifier: BSD-3-Clause