{
  "tasks": {
    "rules": "define Target { _id: null, contact: null, deleted: null, type: null, pass: null, date: null, groupBy: null }\ndefine Contact { contact: null, reports: null, tasks: null }\ndefine Task { _id: null, deleted: null, doc: null, contact: null, icon: null, date: null, readyStart: null, readyEnd: null, title: null, fields: null, resolved: null, priority: null, priorityLabel: null, reports: null, actions: null }\nrule GenerateEvents {\n  when { c: Contact } then { !function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(e,'__esModule',{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&'object'==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:e}),2&t&&'string'!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,'a',t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p='',n(n.s=4)}([function(e,t,n){const{DateTime:r}=n(2),i=e=>{const t=s(e),n=o(e,'s_reported.s_reported_date');return t||n&&r.fromFormat(n,'yyyy-MM-dd')||r.fromMillis(parseInt(e&&e.reported_date||0))},o=(e,t)=>['fields',...(t||'').split('.')].reduce((e,t)=>{if(void 0!==e)return e[t]},e),a=e=>e&&o(e,'visited_contact_uuid'),s=e=>{if(!a(e))return!1;const t=o(e,'visited_date');return t?r.fromFormat(t,'yyyy-MM-dd'):r.fromMillis(parseInt(e.reported_date||0))};e.exports={Forms:{HOME_VISIT:'home_visit',ANC_REALIZATION:'anc_followup',PNC_REALIZATION:'pnc_followup',SIMPLECARE_NEWBORN_FOLLOWUP:'newborn_followup',PNC_FOLLOWUP:'postnatal_followup',ANC_FOLLOWUP:'prenatal_followup',PREGNANCY_FAMILY_PLANNING:'pregnancy_family_planning',FAMILY_PLANNING_FOR_MEN:'family_planning_men',PATIENT_ASSESSMENT_UNDER_5:'patient_assessment',MALNUTRITION_FOLLOWUP_UNDER_5:'malnutrition_follow_up',TREATMENT_FOLLOWUP_UNDER_5:'treatment_followup',REFERRAL_FOLLOWUP_UNDER_5:'referral_followup_under_5',COVID19_REFERRAL_FOLLOWUP:'covid19_referral_followup',SELF_ASSESSMENT:'self_assessment',EPI_DAILY_REPORT:'epi_daily_report',PATIENT_ASSESSMENT_OVER_5:'patient_assessment_over_5',TREATMENT_FOLLOWUP_OVER_5:'treatment_followup_over_5',REFERRAL_FOLLOWUP_OVER_5:'referral_followup',SUPERVISOR_CALENDAR:'supervision_calendar',SUPERVISOR_VISIT_REALIZATION:'supervision_visit_realization',SUPERVISOR_WITH_CHW_CONFIRMATION:'supervision_with_chw_confirmation',SUPERVISOR_WITHOUT_CHW_CONFIRMATION:'supervision_without_chw_confirmation',INDIVIDUAL_FEEDBACK_CONFIRMATION:'individual_feedback_confirmation',NOTIFICATION_TO_CHW:'notification_to_chw',REDO_TDR:'redo_tdr',UNMUTE_CLINIC:'unmute_clinic',MUTE_CLINIC:'mute_clinic'},getField:o,getDynamicReportedDate:i,getMostRecentReport:(e,t,n)=>{let r=null;for(const o of e)if(o.form===t&&!o.deleted&&(!n||o.fields&&Utils.fieldsMatch(o,n))){const e=r&&i(r),t=i(o);(!e||t>e)&&(r=o)}return r},filterReportsWithinMusoReportingMonth:(e,t)=>{const{startDate:n,endDate:r}=((e=new Date)=>{const t=new Date(e);t.setHours(0,0,0,0);const n=new Date(e);return n.setHours(23,59,59,999),t.getDate()<26?t.setMonth(t.getMonth()-1):n.setMonth(n.getMonth()+1),t.setDate(26),t.setHours(0,-t.getTimezoneOffset()),n.setDate(25),n.setHours(0,-n.getTimezoneOffset()),{startDate:t,endDate:n}})(t);return e.filter(e=>{const t=i(e);return t>=n&&t<=r})},getReportHomeVisitSubject:a,getReportHomeVisitDate:s,isAlive:e=>{const t=e&&e.contact||e;return!!t&&!t.date_of_death}}},function(e,t,n){const{DateTime:r}=n(2),{getDynamicReportedDate:i,getMostRecentReport:o}=n(0),a=(e,t=0)=>{let n=new Date(e);if(!Utils.isDateValid(n))return;if('string'==typeof e&&e.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)){const e=60*n.getTimezoneOffset()*1e3;n=new Date(n.getTime()+e)}return Utils.addDate(n,t)};e.exports={ageInDays:e=>{let t;if('string'==typeof e)t=r.fromJSDate(new Date(e));else if(e&&e.diffNow)t=e;else{if('object'!=typeof e)return void console.warn('ageInDays is unable to calculate age of contact from '+e);t=r.fromJSDate(e)}return t.diffNow('days').negate().days},findOldestReport:e=>{if(!Array.isArray(e))throw new Error('Invalid argument: reports');if(0===e.length)return!1;const t=Math.min(...e.map(e=>i(e).toMillis()));return e.find(e=>i(e).toMillis()===t)},getMonth:e=>{const t=new Date(e);return Utils.isDateValid(t)?t.toISOString().substring(0,7):''},isSomeReportInWindow:(e,t,n,r)=>{if('string'==typeof t&&(t=[t]),t)return!!e.filter(e=>t.includes(e.form)).find(e=>{const t=i(e);return t>=n&&t<=r})},latestReportHasField:(e,t,n,r,i)=>{const a=o(e.reports,t),s=!i||!a||!a.fields||a.reported_date>i;return a&&!!a.fields&&a.fields[n]===r&&s},toDate:a,toDateString:e=>{const t=a(e);if(!t||!Utils.isDateValid(t))return'';const n=t.getMonth()+1,r=t.getDate();return[t.getFullYear(),(n>9?'':'0')+n,(r>9?'':'0')+r].join('-')}}},function(e,t,n){'use strict';function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,'value'in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(){if('undefined'==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if('function'==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return(c=u()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&s(i,n.prototype),i}).apply(null,arguments)}function l(e){var t='function'==typeof Map?new Map:void 0;return(l=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf('[native code]')))return e;var n;if('function'!=typeof e)throw new TypeError('Super expression must either be null or a function');if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,a(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),s(r,e)})(e)}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e){var t=0;if('undefined'==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if('string'==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return'Object'===n&&e.constructor&&(n=e.constructor.name),'Map'===n||'Set'===n?Array.from(n):'Arguments'===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)))return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError('Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')}return(t=e[Symbol.iterator]()).next.bind(t)}Object.defineProperty(t,'__esModule',{value:!0});var m=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(l(Error)),h=function(e){function t(t){return e.call(this,'Invalid DateTime: '+t.toMessage())||this}return o(t,e),t}(m),p=function(e){function t(t){return e.call(this,'Invalid Interval: '+t.toMessage())||this}return o(t,e),t}(m),_=function(e){function t(t){return e.call(this,'Invalid Duration: '+t.toMessage())||this}return o(t,e),t}(m),y=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(m),v=function(e){function t(t){return e.call(this,'Invalid unit '+t)||this}return o(t,e),t}(m),g=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(m),T=function(e){function t(){return e.call(this,'Zone is an abstract class')||this}return o(t,e),t}(m),O='numeric',E='short',w='long',N={year:O,month:O,day:O},S={year:O,month:E,day:O},I={year:O,month:E,day:O,weekday:E},A={year:O,month:w,day:O},L={year:O,month:w,day:O,weekday:w},R={hour:O,minute:O},D={hour:O,minute:O,second:O},b={hour:O,minute:O,second:O,timeZoneName:E},M={hour:O,minute:O,second:O,timeZoneName:w},k={hour:O,minute:O,hour12:!1},F={hour:O,minute:O,second:O,hour12:!1},U={hour:O,minute:O,second:O,hour12:!1,timeZoneName:E},P={hour:O,minute:O,second:O,hour12:!1,timeZoneName:w},C={year:O,month:O,day:O,hour:O,minute:O},V={year:O,month:O,day:O,hour:O,minute:O,second:O},W={year:O,month:E,day:O,hour:O,minute:O},x={year:O,month:E,day:O,hour:O,minute:O,second:O},j={year:O,month:E,day:O,weekday:E,hour:O,minute:O},Z={year:O,month:w,day:O,hour:O,minute:O,timeZoneName:E},z={year:O,month:w,day:O,hour:O,minute:O,second:O,timeZoneName:E},H={year:O,month:w,day:O,weekday:w,hour:O,minute:O,timeZoneName:w},q={year:O,month:w,day:O,weekday:w,hour:O,minute:O,second:O,timeZoneName:w};function Y(e){return void 0===e}function G(e){return'number'==typeof e}function J(e){return'number'==typeof e&&e%1==0}function B(){try{return'undefined'!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function $(){return!Y(Intl.DateTimeFormat.prototype.formatToParts)}function Q(){try{return'undefined'!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function K(e,t,n){if(0!==e.length)return e.reduce((function(e,r){var i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i}),null)[1]}function X(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}function ee(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function te(e,t,n){return J(e)&&e>=t&&e<=n}function ne(e,t){void 0===t&&(t=2);var n=e<0?'-':'',r=n?-1*e:e;return''+n+(r.toString().length<t?('0'.repeat(t)+r).slice(-t):r.toString())}function re(e){return Y(e)||null===e||''===e?void 0:parseInt(e,10)}function ie(e){if(!Y(e)&&null!==e&&''!==e){var t=1e3*parseFloat('0.'+e);return Math.floor(t)}}function oe(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function ae(e){return e%4==0&&(e%100!=0||e%400==0)}function se(e){return ae(e)?366:365}function ue(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?ae(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function ce(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(t.getUTCFullYear()-1900),+t}function le(e){var t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===r?53:52}function de(e){return e>99?e:e>60?1900+e:2e3+e}function fe(e,t,n,r){void 0===r&&(r=null);var i=new Date(e),o={hour12:!1,year:'numeric',month:'2-digit',day:'2-digit',hour:'2-digit',minute:'2-digit'};r&&(o.timeZone=r);var a=Object.assign({timeZoneName:t},o),s=B();if(s&&$()){var u=new Intl.DateTimeFormat(n,a).formatToParts(i).find((function(e){return'timezonename'===e.type.toLowerCase()}));return u?u.value:null}if(s){var c=new Intl.DateTimeFormat(n,o).format(i);return new Intl.DateTimeFormat(n,a).format(i).substring(c.length).replace(/^[, \\u200e]+/,'')}return null}function me(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function he(e){var t=Number(e);if('boolean'==typeof e||''===e||Number.isNaN(t))throw new g('Invalid unit value '+e);return t}function pe(e,t,n){var r={};for(var i in e)if(ee(e,i)){if(n.indexOf(i)>=0)continue;var o=e[i];if(null==o)continue;r[t(i)]=he(o)}return r}function _e(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?'+':'-';switch(t){case'short':return''+i+ne(n,2)+':'+ne(r,2);case'narrow':return''+i+n+(r>0?':'+r:'');case'techie':return''+i+ne(n,2)+ne(r,2);default:throw new RangeError('Value format '+t+' is out of range for property format')}}function ye(e){return X(e,['hour','minute','second','millisecond'])}var ve=/[A-Za-z_+-]{1,256}(:?\\/[A-Za-z_+-]{1,256}(\\/[A-Za-z_+-]{1,256})?)?/;function ge(e){return JSON.stringify(e,Object.keys(e).sort())}var Te=['January','February','March','April','May','June','July','August','September','October','November','December'],Oe=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],Ee=['J','F','M','A','M','J','J','A','S','O','N','D'];function we(e){switch(e){case'narrow':return Ee;case'short':return Oe;case'long':return Te;case'numeric':return['1','2','3','4','5','6','7','8','9','10','11','12'];case'2-digit':return['01','02','03','04','05','06','07','08','09','10','11','12'];default:return null}}var Ne=['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],Se=['Mon','Tue','Wed','Thu','Fri','Sat','Sun'],Ie=['M','T','W','T','F','S','S'];function Ae(e){switch(e){case'narrow':return Ie;case'short':return Se;case'long':return Ne;case'numeric':return['1','2','3','4','5','6','7'];default:return null}}var Le=['AM','PM'],Re=['Before Christ','Anno Domini'],De=['BC','AD'],be=['B','A'];function Me(e){switch(e){case'narrow':return be;case'short':return De;case'long':return Re;default:return null}}function ke(e,t){for(var n,r='',i=f(e);!(n=i()).done;){var o=n.value;o.literal?r+=o.val:r+=t(o.val)}return r}var Fe={D:N,DD:S,DDD:A,DDDD:L,t:R,tt:D,ttt:b,tttt:M,T:k,TT:F,TTT:U,TTTT:P,f:C,ff:W,fff:Z,ffff:H,F:V,FF:x,FFF:z,FFFF:q},Ue=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n='',r=!1,i=[],o=0;o<e.length;o++){var a=e.charAt(o);'\\''===a?(n.length>0&&i.push({literal:r,val:n}),t=null,n='',r=!r):r||a===t?n+=a:(n.length>0&&i.push({literal:!1,val:n}),n=a,t=a)}return n.length>0&&i.push({literal:r,val:n}),i},e.macroTokenToFormatOpts=function(e){return Fe[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,Object.assign({},this.opts,t)).format()},t.formatDateTime=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,Object.assign({},this.opts,t)).format()},t.formatDateTimeParts=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,Object.assign({},this.opts,t)).formatToParts()},t.resolvedOptions=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,Object.assign({},this.opts,t)).resolvedOptions()},t.num=function(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return ne(e,t);var n=Object.assign({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)},t.formatDateTimeFromString=function(t,n){var r=this,i='en'===this.loc.listingMode(),o=this.loc.outputCalendar&&'gregory'!==this.loc.outputCalendar&&$(),a=function(e,n){return r.loc.extract(t,e,n)},s=function(e){return t.isOffsetFixed&&0===t.offset&&e.allowZ?'Z':t.isValid?t.zone.formatOffset(t.ts,e.format):''},u=function(){return i?function(e){return Le[e.hour<12?0:1]}(t):a({hour:'numeric',hour12:!0},'dayperiod')},c=function(e,n){return i?function(e,t){return we(t)[e.month-1]}(t,e):a(n?{month:e}:{month:e,day:'numeric'},'month')},l=function(e,n){return i?function(e,t){return Ae(t)[e.weekday-1]}(t,e):a(n?{weekday:e}:{weekday:e,month:'long',day:'numeric'},'weekday')},d=function(e){return i?function(e,t){return Me(t)[e.year<0?0:1]}(t,e):a({era:e},'era')};return ke(e.parseFormat(n),(function(n){switch(n){case'S':return r.num(t.millisecond);case'u':case'SSS':return r.num(t.millisecond,3);case's':return r.num(t.second);case'ss':return r.num(t.second,2);case'm':return r.num(t.minute);case'mm':return r.num(t.minute,2);case'h':return r.num(t.hour%12==0?12:t.hour%12);case'hh':return r.num(t.hour%12==0?12:t.hour%12,2);case'H':return r.num(t.hour);case'HH':return r.num(t.hour,2);case'Z':return s({format:'narrow',allowZ:r.opts.allowZ});case'ZZ':return s({format:'short',allowZ:r.opts.allowZ});case'ZZZ':return s({format:'techie',allowZ:r.opts.allowZ});case'ZZZZ':return t.zone.offsetName(t.ts,{format:'short',locale:r.loc.locale});case'ZZZZZ':return t.zone.offsetName(t.ts,{format:'long',locale:r.loc.locale});case'z':return t.zoneName;case'a':return u();case'd':return o?a({day:'numeric'},'day'):r.num(t.day);case'dd':return o?a({day:'2-digit'},'day'):r.num(t.day,2);case'c':return r.num(t.weekday);case'ccc':return l('short',!0);case'cccc':return l('long',!0);case'ccccc':return l('narrow',!0);case'E':return r.num(t.weekday);case'EEE':return l('short',!1);case'EEEE':return l('long',!1);case'EEEEE':return l('narrow',!1);case'L':return o?a({month:'numeric',day:'numeric'},'month'):r.num(t.month);case'LL':return o?a({month:'2-digit',day:'numeric'},'month'):r.num(t.month,2);case'LLL':return c('short',!0);case'LLLL':return c('long',!0);case'LLLLL':return c('narrow',!0);case'M':return o?a({month:'numeric'},'month'):r.num(t.month);case'MM':return o?a({month:'2-digit'},'month'):r.num(t.month,2);case'MMM':return c('short',!1);case'MMMM':return c('long',!1);case'MMMMM':return c('narrow',!1);case'y':return o?a({year:'numeric'},'year'):r.num(t.year);case'yy':return o?a({year:'2-digit'},'year'):r.num(t.year.toString().slice(-2),2);case'yyyy':return o?a({year:'numeric'},'year'):r.num(t.year,4);case'yyyyyy':return o?a({year:'numeric'},'year'):r.num(t.year,6);case'G':return d('short');case'GG':return d('long');case'GGGGG':return d('narrow');case'kk':return r.num(t.weekYear.toString().slice(-2),2);case'kkkk':return r.num(t.weekYear,4);case'W':return r.num(t.weekNumber);case'WW':return r.num(t.weekNumber,2);case'o':return r.num(t.ordinal);case'ooo':return r.num(t.ordinal,3);case'q':return r.num(t.quarter);case'qq':return r.num(t.quarter,2);case'X':return r.num(Math.floor(t.ts/1e3));case'x':return r.num(t.ts);default:return function(n){var i=e.macroTokenToFormatOpts(n);return i?r.formatWithSystemDefault(t,i):n}(n)}}))},t.formatDurationFromString=function(t,n){var r,i=this,o=function(e){switch(e[0]){case'S':return'millisecond';case's':return'second';case'm':return'minute';case'h':return'hour';case'd':return'day';case'M':return'month';case'y':return'year';default:return null}},a=e.parseFormat(n),s=a.reduce((function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)}),[]),u=t.shiftTo.apply(t,s.map(o).filter((function(e){return e})));return ke(a,(r=u,function(e){var t=o(e);return t?i.num(r.get(t),e.length):e}))},e}(),Pe=function(){function e(e,t){this.reason=e,this.explanation=t}return e.prototype.toMessage=function(){return this.explanation?this.reason+': '+this.explanation:this.reason},e}(),Ce=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new T},t.formatOffset=function(e,t){throw new T},t.offset=function(e){throw new T},t.equals=function(e){throw new T},i(e,[{key:'type',get:function(){throw new T}},{key:'name',get:function(){throw new T}},{key:'universal',get:function(){throw new T}},{key:'isValid',get:function(){throw new T}}]),e}(),Ve=null,We=function(e){function t(){return e.apply(this,arguments)||this}o(t,e);var n=t.prototype;return n.offsetName=function(e,t){return fe(e,t.format,t.locale)},n.formatOffset=function(e,t){return _e(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return'local'===e.type},i(t,[{key:'type',get:function(){return'local'}},{key:'name',get:function(){return B()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:'local'}},{key:'universal',get:function(){return!1}},{key:'isValid',get:function(){return!0}}],[{key:'instance',get:function(){return null===Ve&&(Ve=new t),Ve}}]),t}(Ce),xe=RegExp('^'+ve.source+'$'),je={};var Ze={year:0,month:1,day:2,hour:3,minute:4,second:5};var ze={},He=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}o(t,e),t.create=function(e){return ze[e]||(ze[e]=new t(e)),ze[e]},t.resetCache=function(){ze={},je={}},t.isValidSpecifier=function(e){return!(!e||!e.match(xe))},t.isValidZone=function(e){try{return new Intl.DateTimeFormat('en-US',{timeZone:e}).format(),!0}catch(e){return!1}},t.parseGMTOffset=function(e){if(e){var t=e.match(/^Etc\\/GMT([+-]\\d{1,2})$/i);if(t)return-60*parseInt(t[1])}return null};var n=t.prototype;return n.offsetName=function(e,t){return fe(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return _e(this.offset(e),t)},n.offset=function(e){var t,n=new Date(e),r=(t=this.name,je[t]||(je[t]=new Intl.DateTimeFormat('en-US',{hour12:!1,timeZone:t,year:'numeric',month:'2-digit',day:'2-digit',hour:'2-digit',minute:'2-digit',second:'2-digit'})),je[t]),i=r.formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;i<n.length;i++){var o=n[i],a=o.type,s=o.value,u=Ze[a];Y(u)||(r[u]=parseInt(s,10))}return r}(r,n):function(e,t){var n=e.format(t).replace(/\\u200E/g,''),r=/(\\d+)\\/(\\d+)\\/(\\d+),? (\\d+):(\\d+):(\\d+)/.exec(n),i=r[1],o=r[2];return[r[3],i,o,r[4],r[5],r[6]]}(r,n),o=i[0],a=i[1],s=i[2],u=i[3],c=+n,l=c%1e3;return(ce({year:o,month:a,day:s,hour:24===u?0:u,minute:i[4],second:i[5],millisecond:0})-(c-=l>=0?l:1e3+l))/6e4},n.equals=function(e){return'iana'===e.type&&e.name===this.name},i(t,[{key:'type',get:function(){return'iana'}},{key:'name',get:function(){return this.zoneName}},{key:'universal',get:function(){return!1}},{key:'isValid',get:function(){return this.valid}}]),t}(Ce),qe=null,Ye=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}o(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){var n=e.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);if(n)return new t(me(n[1],n[2]))}return null},i(t,null,[{key:'utcInstance',get:function(){return null===qe&&(qe=new t(0)),qe}}]);var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return _e(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return'fixed'===e.type&&e.fixed===this.fixed},i(t,[{key:'type',get:function(){return'fixed'}},{key:'name',get:function(){return 0===this.fixed?'UTC':'UTC'+_e(this.fixed,'narrow')}},{key:'universal',get:function(){return!0}},{key:'isValid',get:function(){return!0}}]),t}(Ce),Ge=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}o(t,e);var n=t.prototype;return n.offsetName=function(){return null},n.formatOffset=function(){return''},n.offset=function(){return NaN},n.equals=function(){return!1},i(t,[{key:'type',get:function(){return'invalid'}},{key:'name',get:function(){return this.zoneName}},{key:'universal',get:function(){return!1}},{key:'isValid',get:function(){return!1}}]),t}(Ce);function Je(e,t){var n;if(Y(e)||null===e)return t;if(e instanceof Ce)return e;if('string'==typeof e){var r=e.toLowerCase();return'local'===r?t:'utc'===r||'gmt'===r?Ye.utcInstance:null!=(n=He.parseGMTOffset(e))?Ye.instance(n):He.isValidSpecifier(r)?He.create(e):Ye.parseSpecifier(r)||new Ge(e)}return G(e)?Ye.instance(e):'object'==typeof e&&e.offset&&'number'==typeof e.offset?e:new Ge(e)}var Be=function(){return Date.now()},$e=null,Qe=null,Ke=null,Xe=null,et=!1,tt=function(){function e(){}return e.resetCaches=function(){ft.resetCache(),He.resetCache()},i(e,null,[{key:'now',get:function(){return Be},set:function(e){Be=e}},{key:'defaultZoneName',get:function(){return e.defaultZone.name},set:function(e){$e=e?Je(e):null}},{key:'defaultZone',get:function(){return $e||We.instance}},{key:'defaultLocale',get:function(){return Qe},set:function(e){Qe=e}},{key:'defaultNumberingSystem',get:function(){return Ke},set:function(e){Ke=e}},{key:'defaultOutputCalendar',get:function(){return Xe},set:function(e){Xe=e}},{key:'throwOnInvalid',get:function(){return et},set:function(e){et=e}}]),e}(),nt={};function rt(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=nt[n];return r||(r=new Intl.DateTimeFormat(e,t),nt[n]=r),r}var it={};var ot={};function at(e,t){void 0===t&&(t={});var n=t,r=(n.base,function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(n,['base'])),i=JSON.stringify([e,r]),o=ot[i];return o||(o=new Intl.RelativeTimeFormat(e,t),ot[i]=o),o}var st=null;function ut(e,t,n,r,i){var o=e.listingMode(n);return'error'===o?null:'en'===o?r(t):i(t)}var ct=function(){function e(e,t,n){if(this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&B()){var r={useGrouping:!1};n.padTo>0&&(r.minimumIntegerDigits=n.padTo),this.inf=function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=it[n];return r||(r=new Intl.NumberFormat(e,t),it[n]=r),r}(e,r)}}return e.prototype.format=function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return ne(this.floor?Math.floor(e):oe(e,3),this.padTo)},e}(),lt=function(){function e(e,t,n){var r;if(this.opts=n,this.hasIntl=B(),e.zone.universal&&this.hasIntl){var i=e.offset/60*-1;i>=-14&&i<=12&&i%1==0?(r=i>=0?'Etc/GMT+'+i:'Etc/GMT'+i,this.dt=e):(r='UTC',n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:lr.fromMillis(e.ts+60*e.offset*1e3))}else'local'===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name);if(this.hasIntl){var o=Object.assign({},this.opts);r&&(o.timeZone=r),this.dtf=rt(t,o)}}var t=e.prototype;return t.format=function(){if(this.hasIntl)return this.dtf.format(this.dt.toJSDate());var e=function(e){switch(ge(X(e,['weekday','era','year','month','day','hour','minute','second','timeZoneName','hour12']))){case ge(N):return'M/d/yyyy';case ge(S):return'LLL d, yyyy';case ge(I):return'EEE, LLL d, yyyy';case ge(A):return'LLLL d, yyyy';case ge(L):return'EEEE, LLLL d, yyyy';case ge(R):return'h:mm a';case ge(D):return'h:mm:ss a';case ge(b):case ge(M):return'h:mm a';case ge(k):return'HH:mm';case ge(F):return'HH:mm:ss';case ge(U):case ge(P):return'HH:mm';case ge(C):return'M/d/yyyy, h:mm a';case ge(W):return'LLL d, yyyy, h:mm a';case ge(Z):return'LLLL d, yyyy, h:mm a';case ge(H):return'EEEE, LLLL d, yyyy, h:mm a';case ge(V):return'M/d/yyyy, h:mm:ss a';case ge(x):return'LLL d, yyyy, h:mm:ss a';case ge(j):return'EEE, d LLL yyyy, h:mm a';case ge(z):return'LLLL d, yyyy, h:mm:ss a';case ge(q):return'EEEE, LLLL d, yyyy, h:mm:ss a';default:return'EEEE, LLLL d, yyyy, h:mm a'}}(this.opts),t=ft.create('en-US');return Ue.create(t).formatDateTimeFromString(this.dt,e)},t.formatToParts=function(){return this.hasIntl&&$()?this.dtf.formatToParts(this.dt.toJSDate()):[]},t.resolvedOptions=function(){return this.hasIntl?this.dtf.resolvedOptions():{locale:'en-US',numberingSystem:'latn',outputCalendar:'gregory'}},e}(),dt=function(){function e(e,t,n){this.opts=Object.assign({style:'long'},n),!t&&Q()&&(this.rtf=at(e,n))}var t=e.prototype;return t.format=function(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n,r){void 0===n&&(n='always'),void 0===r&&(r=!1);var i={years:['year','yr.'],quarters:['quarter','qtr.'],months:['month','mo.'],weeks:['week','wk.'],days:['day','day','days'],hours:['hour','hr.'],minutes:['minute','min.'],seconds:['second','sec.']},o=-1===['hours','minutes','seconds'].indexOf(e);if('auto'===n&&o){var a='days'===e;switch(t){case 1:return a?'tomorrow':'next '+i[e][0];case-1:return a?'yesterday':'last '+i[e][0];case 0:return a?'today':'this '+i[e][0]}}var s=Object.is(t,-0)||t<0,u=Math.abs(t),c=1===u,l=i[e],d=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return s?u+' '+d+' ago':'in '+u+' '+d}(t,e,this.opts.numeric,'long'!==this.opts.style)},t.formatToParts=function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},e}(),ft=function(){function e(e,t,n,r){var i=function(e){var t=e.indexOf('-u-');if(-1===t)return[e];var n,r=e.substring(0,t);try{n=rt(e).resolvedOptions()}catch(e){n=rt(r).resolvedOptions()}var i=n;return[r,i.numberingSystem,i.calendar]}(e),o=i[0],a=i[1],s=i[2];this.locale=o,this.numberingSystem=t||a||null,this.outputCalendar=n||s||null,this.intl=function(e,t,n){return B()?n||t?(e+='-u',n&&(e+='-ca-'+n),t&&(e+='-nu-'+t),e):e:[]}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}e.fromOpts=function(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)},e.create=function(t,n,r,i){void 0===i&&(i=!1);var o=t||tt.defaultLocale;return new e(o||(i?'en-US':function(){if(st)return st;if(B()){var e=(new Intl.DateTimeFormat).resolvedOptions().locale;return st=e&&'und'!==e?e:'en-US'}return st='en-US'}()),n||tt.defaultNumberingSystem,r||tt.defaultOutputCalendar,o)},e.resetCache=function(){st=null,nt={},it={},ot={}},e.fromObject=function(t){var n=void 0===t?{}:t,r=n.locale,i=n.numberingSystem,o=n.outputCalendar;return e.create(r,i,o)};var t=e.prototype;return t.listingMode=function(e){void 0===e&&(e=!0);var t=B()&&$(),n=this.isEnglish(),r=!(null!==this.numberingSystem&&'latn'!==this.numberingSystem||null!==this.outputCalendar&&'gregory'!==this.outputCalendar);return t||n&&r||e?!t||n&&r?'en':'intl':'error'},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(Object.assign({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(Object.assign({},e,{defaultToEN:!1}))},t.months=function(e,t,n){var r=this;return void 0===t&&(t=!1),void 0===n&&(n=!0),ut(this,e,n,we,(function(){var n=t?{month:e,day:'numeric'}:{month:e},i=t?'format':'standalone';return r.monthsCache[i][e]||(r.monthsCache[i][e]=function(e){for(var t=[],n=1;n<=12;n++){var r=lr.utc(2016,n,1);t.push(e(r))}return t}((function(e){return r.extract(e,n,'month')}))),r.monthsCache[i][e]}))},t.weekdays=function(e,t,n){var r=this;return void 0===t&&(t=!1),void 0===n&&(n=!0),ut(this,e,n,Ae,(function(){var n=t?{weekday:e,year:'numeric',month:'long',day:'numeric'}:{weekday:e},i=t?'format':'standalone';return r.weekdaysCache[i][e]||(r.weekdaysCache[i][e]=function(e){for(var t=[],n=1;n<=7;n++){var r=lr.utc(2016,11,13+n);t.push(e(r))}return t}((function(e){return r.extract(e,n,'weekday')}))),r.weekdaysCache[i][e]}))},t.meridiems=function(e){var t=this;return void 0===e&&(e=!0),ut(this,void 0,e,(function(){return Le}),(function(){if(!t.meridiemCache){var e={hour:'numeric',hour12:!0};t.meridiemCache=[lr.utc(2016,11,13,9),lr.utc(2016,11,13,19)].map((function(n){return t.extract(n,e,'dayperiod')}))}return t.meridiemCache}))},t.eras=function(e,t){var n=this;return void 0===t&&(t=!0),ut(this,e,t,Me,(function(){var t={era:e};return n.eraCache[e]||(n.eraCache[e]=[lr.utc(-40,1,1),lr.utc(2017,1,1)].map((function(e){return n.extract(e,t,'era')}))),n.eraCache[e]}))},t.extract=function(e,t,n){var r=this.dtFormatter(e,t).formatToParts().find((function(e){return e.type.toLowerCase()===n}));return r?r.value:null},t.numberFormatter=function(e){return void 0===e&&(e={}),new ct(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new lt(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new dt(this.intl,this.isEnglish(),e)},t.isEnglish=function(){return'en'===this.locale||'en-us'===this.locale.toLowerCase()||B()&&new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith('en-us')},t.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},i(e,[{key:'fastNumbers',get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||'latn'===e.numberingSystem)&&('latn'===e.numberingSystem||!e.locale||e.locale.startsWith('en')||B()&&'latn'===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}();function mt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.reduce((function(e,t){return e+t.source}),'');return RegExp('^'+r+'$')}function ht(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce((function(t,n){var r=t[0],i=t[1],o=t[2],a=n(e,o),s=a[0],u=a[1],c=a[2];return[Object.assign(r,s),i||u,c]}),[{},null,1]).slice(0,2)}}function pt(e){if(null==e)return[null,null];for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i],s=a[0],u=a[1],c=s.exec(e);if(c)return u(c)}return[null,null]}function _t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){var r,i={};for(r=0;r<t.length;r++)i[t[r]]=re(e[n+r]);return[i,null,n+r]}}var yt=/(?:(Z)|([+-]\\d\\d)(?::?(\\d\\d))?)/,vt=/(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/,gt=RegExp(''+vt.source+yt.source+'?'),Tt=RegExp('(?:T'+gt.source+')?'),Ot=_t('weekYear','weekNumber','weekDay'),Et=_t('year','ordinal'),wt=RegExp(vt.source+' ?(?:'+yt.source+'|('+ve.source+'))?'),Nt=RegExp('(?: '+wt.source+')?');function St(e,t,n){var r=e[t];return Y(r)?n:re(r)}function It(e,t){return[{year:St(e,t),month:St(e,t+1,1),day:St(e,t+2,1)},null,t+3]}function At(e,t){return[{hours:St(e,t,0),minutes:St(e,t+1,0),seconds:St(e,t+2,0),milliseconds:ie(e[t+3])},null,t+4]}function Lt(e,t){var n=!e[t]&&!e[t+1],r=me(e[t+1],e[t+2]);return[{},n?null:Ye.instance(r),t+3]}function Rt(e,t){return[{},e[t]?He.create(e[t]):null,t+1]}var Dt=RegExp('^T?'+vt.source+'$'),bt=/^-?P(?:(?:(-?\\d{1,9})Y)?(?:(-?\\d{1,9})M)?(?:(-?\\d{1,9})W)?(?:(-?\\d{1,9})D)?(?:T(?:(-?\\d{1,9})H)?(?:(-?\\d{1,9})M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,9}))?S)?)?)$/;function Mt(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l='-'===t[0],d=function(e){return e&&l?-e:e};return[{years:d(re(n)),months:d(re(r)),weeks:d(re(i)),days:d(re(o)),hours:d(re(a)),minutes:d(re(s)),seconds:d(re(u)),milliseconds:d(ie(c))}]}var kt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ft(e,t,n,r,i,o,a){var s={year:2===t.length?de(re(t)):re(t),month:Oe.indexOf(n)+1,day:re(r),hour:re(i),minute:re(o)};return a&&(s.second=re(a)),e&&(s.weekday=e.length>3?Ne.indexOf(e)+1:Se.indexOf(e)+1),s}var Ut=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;function Pt(e){var t,n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11],m=Ft(n,o,i,r,a,s,u);return t=c?kt[c]:l?0:me(d,f),[m,new Ye(t)]}var Ct=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,Vt=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,Wt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;function xt(e){var t=e[1],n=e[2],r=e[3];return[Ft(t,e[4],r,n,e[5],e[6],e[7]),Ye.utcInstance]}function jt(e){var t=e[1],n=e[2],r=e[3],i=e[4],o=e[5],a=e[6];return[Ft(t,e[7],n,r,i,o,a),Ye.utcInstance]}var Zt=mt(/([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/,Tt),zt=mt(/(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/,Tt),Ht=mt(/(\\d{4})-?(\\d{3})/,Tt),qt=mt(gt),Yt=ht(It,At,Lt),Gt=ht(Ot,At,Lt),Jt=ht(Et,At),Bt=ht(At,Lt);var $t=ht(At);var Qt=mt(/(\\d{4})-(\\d\\d)-(\\d\\d)/,Nt),Kt=mt(wt),Xt=ht(It,At,Lt,Rt),en=ht(At,Lt,Rt);var tn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},nn=Object.assign({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},tn),rn=Object.assign({years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},tn),on=['years','quarters','months','weeks','days','hours','minutes','seconds','milliseconds'],an=on.slice(0).reverse();function sn(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new cn(r)}function un(e,t,n,r,i){var o=e[i][n],a=t[n]/o,s=!(Math.sign(a)===Math.sign(r[i]))&&0!==r[i]&&Math.abs(a)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(a):Math.trunc(a);r[i]+=s,t[n]-=s*o}var cn=function(){function e(e){var t='longterm'===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||ft.create(),this.conversionAccuracy=t?'longterm':'casual',this.invalid=e.invalid||null,this.matrix=t?rn:nn,this.isLuxonDuration=!0}e.fromMillis=function(t,n){return e.fromObject(Object.assign({milliseconds:t},n))},e.fromObject=function(t){if(null==t||'object'!=typeof t)throw new g('Duration.fromObject: argument expected to be an object, got '+(null===t?'null':typeof t));return new e({values:pe(t,e.normalizeUnit,['locale','numberingSystem','conversionAccuracy','zone']),loc:ft.fromObject(t),conversionAccuracy:t.conversionAccuracy})},e.fromISO=function(t,n){var r=function(e){return pt(e,[bt,Mt])}(t)[0];if(r){var i=Object.assign(r,n);return e.fromObject(i)}return e.invalid('unparsable','the input \"'+t+'\" can\\'t be parsed as ISO 8601')},e.fromISOTime=function(t,n){var r=function(e){return pt(e,[Dt,$t])}(t)[0];if(r){var i=Object.assign(r,n);return e.fromObject(i)}return e.invalid('unparsable','the input \"'+t+'\" can\\'t be parsed as ISO 8601')},e.invalid=function(t,n){if(void 0===n&&(n=null),!t)throw new g('need to specify a reason the Duration is invalid');var r=t instanceof Pe?t:new Pe(t,n);if(tt.throwOnInvalid)throw new _(r);return new e({invalid:r})},e.normalizeUnit=function(e){var t={year:'years',years:'years',quarter:'quarters',quarters:'quarters',month:'months',months:'months',week:'weeks',weeks:'weeks',day:'days',days:'days',hour:'hours',hours:'hours',minute:'minutes',minutes:'minutes',second:'seconds',seconds:'seconds',millisecond:'milliseconds',milliseconds:'milliseconds'}[e?e.toLowerCase():e];if(!t)throw new v(e);return t},e.isDuration=function(e){return e&&e.isLuxonDuration||!1};var t=e.prototype;return t.toFormat=function(e,t){void 0===t&&(t={});var n=Object.assign({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?Ue.create(this.loc,n).formatDurationFromString(this,e):'Invalid Duration'},t.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=Object.assign({},this.values);return e.includeConfig&&(t.conversionAccuracy=this.conversionAccuracy,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},t.toISO=function(){if(!this.isValid)return null;var e='P';return 0!==this.years&&(e+=this.years+'Y'),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+'M'),0!==this.weeks&&(e+=this.weeks+'W'),0!==this.days&&(e+=this.days+'D'),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+='T'),0!==this.hours&&(e+=this.hours+'H'),0!==this.minutes&&(e+=this.minutes+'M'),0===this.seconds&&0===this.milliseconds||(e+=oe(this.seconds+this.milliseconds/1e3,3)+'S'),'P'===e&&(e+='T0S'),e},t.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();if(t<0||t>=864e5)return null;e=Object.assign({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:'extended'},e);var n=this.shiftTo('hours','minutes','seconds','milliseconds'),r='basic'===e.format?'hhmm':'hh:mm';e.suppressSeconds&&0===n.seconds&&0===n.milliseconds||(r+='basic'===e.format?'ss':':ss',e.suppressMilliseconds&&0===n.milliseconds||(r+='.SSS'));var i=n.toFormat(r);return e.includePrefix&&(i='T'+i),i},t.toJSON=function(){return this.toISO()},t.toString=function(){return this.toISO()},t.toMillis=function(){return this.as('milliseconds')},t.valueOf=function(){return this.toMillis()},t.plus=function(e){if(!this.isValid)return this;for(var t,n=ln(e),r={},i=f(on);!(t=i()).done;){var o=t.value;(ee(n.values,o)||ee(this.values,o))&&(r[o]=n.get(o)+this.get(o))}return sn(this,{values:r},!0)},t.minus=function(e){if(!this.isValid)return this;var t=ln(e);return this.plus(t.negate())},t.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,r=Object.keys(this.values);n<r.length;n++){var i=r[n];t[i]=he(e(this.values[i],i))}return sn(this,{values:t},!0)},t.get=function(t){return this[e.normalizeUnit(t)]},t.set=function(t){return this.isValid?sn(this,{values:Object.assign(this.values,pe(t,e.normalizeUnit,[]))}):this},t.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.conversionAccuracy,o={loc:this.loc.clone({locale:n,numberingSystem:r})};return i&&(o.conversionAccuracy=i),sn(this,o)},t.as=function(e){return this.isValid?this.shiftTo(e).get(e):NaN},t.normalize=function(){if(!this.isValid)return this;var e=this.toObject();return function(e,t){an.reduce((function(n,r){return Y(t[r])?n:(n&&un(e,t,n,t,r),r)}),null)}(this.matrix,e),sn(this,{values:e},!0)},t.shiftTo=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!this.isValid)return this;if(0===n.length)return this;n=n.map((function(t){return e.normalizeUnit(t)}));for(var i,o,a={},s={},u=this.toObject(),c=f(on);!(o=c()).done;){var l=o.value;if(n.indexOf(l)>=0){i=l;var d=0;for(var m in s)d+=this.matrix[m][l]*s[m],s[m]=0;G(u[l])&&(d+=u[l]);var h=Math.trunc(d);for(var p in a[l]=h,s[l]=d-h,u)on.indexOf(p)>on.indexOf(l)&&un(this.matrix,u,p,a,l)}else G(u[l])&&(s[l]=u[l])}for(var _ in s)0!==s[_]&&(a[i]+=_===i?s[_]:s[_]/this.matrix[i][_]);return sn(this,{values:a},!0).normalize()},t.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);t<n.length;t++){var r=n[t];e[r]=-this.values[r]}return sn(this,{values:e},!0)},t.equals=function(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(var t,n=f(on);!(t=n()).done;){var r=t.value;if(i=this.values[r],o=e.values[r],!(void 0===i||0===i?void 0===o||0===o:i===o))return!1}var i,o;return!0},i(e,[{key:'locale',get:function(){return this.isValid?this.loc.locale:null}},{key:'numberingSystem',get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:'years',get:function(){return this.isValid?this.values.years||0:NaN}},{key:'quarters',get:function(){return this.isValid?this.values.quarters||0:NaN}},{key:'months',get:function(){return this.isValid?this.values.months||0:NaN}},{key:'weeks',get:function(){return this.isValid?this.values.weeks||0:NaN}},{key:'days',get:function(){return this.isValid?this.values.days||0:NaN}},{key:'hours',get:function(){return this.isValid?this.values.hours||0:NaN}},{key:'minutes',get:function(){return this.isValid?this.values.minutes||0:NaN}},{key:'seconds',get:function(){return this.isValid?this.values.seconds||0:NaN}},{key:'milliseconds',get:function(){return this.isValid?this.values.milliseconds||0:NaN}},{key:'isValid',get:function(){return null===this.invalid}},{key:'invalidReason',get:function(){return this.invalid?this.invalid.reason:null}},{key:'invalidExplanation',get:function(){return this.invalid?this.invalid.explanation:null}}]),e}();function ln(e){if(G(e))return cn.fromMillis(e);if(cn.isDuration(e))return e;if('object'==typeof e)return cn.fromObject(e);throw new g('Unknown duration argument '+e+' of type '+typeof e)}var dn='Invalid Interval';function fn(e,t){return e&&e.isValid?t&&t.isValid?t<e?mn.invalid('end before start','The end of an interval must be after its start, but you had start='+e.toISO()+' and end='+t.toISO()):null:mn.invalid('missing or invalid end'):mn.invalid('missing or invalid start')}var mn=function(){function e(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}e.invalid=function(t,n){if(void 0===n&&(n=null),!t)throw new g('need to specify a reason the Interval is invalid');var r=t instanceof Pe?t:new Pe(t,n);if(tt.throwOnInvalid)throw new p(r);return new e({invalid:r})},e.fromDateTimes=function(t,n){var r=dr(t),i=dr(n),o=fn(r,i);return null==o?new e({start:r,end:i}):o},e.after=function(t,n){var r=ln(n),i=dr(t);return e.fromDateTimes(i,i.plus(r))},e.before=function(t,n){var r=ln(n),i=dr(t);return e.fromDateTimes(i.minus(r),i)},e.fromISO=function(t,n){var r=(t||'').split('/',2),i=r[0],o=r[1];if(i&&o){var a,s,u,c;try{s=(a=lr.fromISO(i,n)).isValid}catch(o){s=!1}try{c=(u=lr.fromISO(o,n)).isValid}catch(o){c=!1}if(s&&c)return e.fromDateTimes(a,u);if(s){var l=cn.fromISO(o,n);if(l.isValid)return e.after(a,l)}else if(c){var d=cn.fromISO(i,n);if(d.isValid)return e.before(u,d)}}return e.invalid('unparsable','the input \"'+t+'\" can\\'t be parsed as ISO 8601')},e.isInterval=function(e){return e&&e.isLuxonInterval||!1};var t=e.prototype;return t.length=function(e){return void 0===e&&(e='milliseconds'),this.isValid?this.toDuration.apply(this,[e]).get(e):NaN},t.count=function(e){if(void 0===e&&(e='milliseconds'),!this.isValid)return NaN;var t=this.start.startOf(e),n=this.end.startOf(e);return Math.floor(n.diff(t,e).get(e))+1},t.hasSame=function(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))},t.isEmpty=function(){return this.s.valueOf()===this.e.valueOf()},t.isAfter=function(e){return!!this.isValid&&this.s>e},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},t.set=function(t){var n=void 0===t?{}:t,r=n.start,i=n.end;return this.isValid?e.fromDateTimes(r||this.s,i||this.e):this},t.splitAt=function(){var t=this;if(!this.isValid)return[];for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=r.map(dr).filter((function(e){return t.contains(e)})).sort(),a=[],s=this.s,u=0;s<this.e;){var c=o[u]||this.e,l=+c>+this.e?this.e:c;a.push(e.fromDateTimes(s,l)),s=l,u+=1}return a},t.splitBy=function(t){var n=ln(t);if(!this.isValid||!n.isValid||0===n.as('milliseconds'))return[];for(var r,i,o=this.s,a=[];o<this.e;)i=+(r=o.plus(n))>+this.e?this.e:r,a.push(e.fromDateTimes(o,i)),o=i;return a},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s<e.e},t.abutsStart=function(e){return!!this.isValid&&+this.e==+e.s},t.abutsEnd=function(e){return!!this.isValid&&+e.e==+this.s},t.engulfs=function(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)},t.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},t.intersection=function(t){if(!this.isValid)return this;var n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>r?null:e.fromDateTimes(n,r)},t.union=function(t){if(!this.isValid)return this;var n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return e.fromDateTimes(n,r)},e.merge=function(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var n=e[0],r=e[1];return r?r.overlaps(t)||r.abutsStart(t)?[n,r.union(t)]:[n.concat([r]),t]:[n,t]}),[[],null]),n=t[0],r=t[1];return r&&n.push(r),n},e.xor=function(t){for(var n,r,i=null,o=0,a=[],s=t.map((function(e){return[{time:e.s,type:'s'},{time:e.e,type:'e'}]})),u=f((n=Array.prototype).concat.apply(n,s).sort((function(e,t){return e.time-t.time})));!(r=u()).done;){var c=r.value;1===(o+='s'===c.type?1:-1)?i=c.time:(i&&+i!=+c.time&&a.push(e.fromDateTimes(i,c.time)),i=null)}return e.merge(a)},t.difference=function(){for(var t=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.xor([this].concat(r)).map((function(e){return t.intersection(e)})).filter((function(e){return e&&!e.isEmpty()}))},t.toString=function(){return this.isValid?'['+this.s.toISO()+' – '+this.e.toISO()+')':dn},t.toISO=function(e){return this.isValid?this.s.toISO(e)+'/'+this.e.toISO(e):dn},t.toISODate=function(){return this.isValid?this.s.toISODate()+'/'+this.e.toISODate():dn},t.toISOTime=function(e){return this.isValid?this.s.toISOTime(e)+'/'+this.e.toISOTime(e):dn},t.toFormat=function(e,t){var n=(void 0===t?{}:t).separator,r=void 0===n?' – ':n;return this.isValid?''+this.s.toFormat(e)+r+this.e.toFormat(e):dn},t.toDuration=function(e,t){return this.isValid?this.e.diff(this.s,e,t):cn.invalid(this.invalidReason)},t.mapEndpoints=function(t){return e.fromDateTimes(t(this.s),t(this.e))},i(e,[{key:'start',get:function(){return this.isValid?this.s:null}},{key:'end',get:function(){return this.isValid?this.e:null}},{key:'isValid',get:function(){return null===this.invalidReason}},{key:'invalidReason',get:function(){return this.invalid?this.invalid.reason:null}},{key:'invalidExplanation',get:function(){return this.invalid?this.invalid.explanation:null}}]),e}(),hn=function(){function e(){}return e.hasDST=function(e){void 0===e&&(e=tt.defaultZone);var t=lr.now().setZone(e).set({month:12});return!e.universal&&t.offset!==t.set({month:6}).offset},e.isValidIANAZone=function(e){return He.isValidSpecifier(e)&&He.isValidZone(e)},e.normalizeZone=function(e){return Je(e,tt.defaultZone)},e.months=function(e,t){void 0===e&&(e='long');var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,a=void 0===o?null:o,s=n.outputCalendar,u=void 0===s?'gregory':s;return ft.create(i,a,u).months(e)},e.monthsFormat=function(e,t){void 0===e&&(e='long');var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,a=void 0===o?null:o,s=n.outputCalendar,u=void 0===s?'gregory':s;return ft.create(i,a,u).months(e,!0)},e.weekdays=function(e,t){void 0===e&&(e='long');var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,a=void 0===o?null:o;return ft.create(i,a,null).weekdays(e)},e.weekdaysFormat=function(e,t){void 0===e&&(e='long');var n=void 0===t?{}:t,r=n.locale,i=void 0===r?null:r,o=n.numberingSystem,a=void 0===o?null:o;return ft.create(i,a,null).weekdays(e,!0)},e.meridiems=function(e){var t=(void 0===e?{}:e).locale,n=void 0===t?null:t;return ft.create(n).meridiems()},e.eras=function(e,t){void 0===e&&(e='short');var n=(void 0===t?{}:t).locale,r=void 0===n?null:n;return ft.create(r,null,'gregory').eras(e)},e.features=function(){var e=!1,t=!1,n=!1,r=!1;if(B()){e=!0,t=$(),r=Q();try{n='America/New_York'===new Intl.DateTimeFormat('en',{timeZone:'America/New_York'}).resolvedOptions().timeZone}catch(e){n=!1}}return{intl:e,intlTokens:t,zones:n,relative:r}},e}();function pn(e,t){var n=function(e){return e.toUTC(0,{keepLocalTime:!0}).startOf('day').valueOf()},r=n(t)-n(e);return Math.floor(cn.fromMillis(r).as('days'))}function _n(e,t,n,r){var i=function(e,t,n){for(var r,i,o={},a=0,s=[['years',function(e,t){return t.year-e.year}],['quarters',function(e,t){return t.quarter-e.quarter}],['months',function(e,t){return t.month-e.month+12*(t.year-e.year)}],['weeks',function(e,t){var n=pn(e,t);return(n-n%7)/7}],['days',pn]];a<s.length;a++){var u=s[a],c=u[0],l=u[1];if(n.indexOf(c)>=0){var d;r=c;var f,m=l(e,t);if((i=e.plus(((d={})[c]=m,d)))>t)e=e.plus(((f={})[c]=m-1,f)),m-=1;else e=i;o[c]=m}}return[e,o,i,r]}(e,t,n),o=i[0],a=i[1],s=i[2],u=i[3],c=t-o,l=n.filter((function(e){return['hours','minutes','seconds','milliseconds'].indexOf(e)>=0}));if(0===l.length){var d;if(s<t)s=o.plus(((d={})[u]=1,d));s!==o&&(a[u]=(a[u]||0)+c/(s-o))}var f,m=cn.fromObject(Object.assign(a,r));return l.length>0?(f=cn.fromMillis(c,r)).shiftTo.apply(f,l).plus(m):m}var yn={arab:'[٠-٩]',arabext:'[۰-۹]',bali:'[᭐-᭙]',beng:'[০-৯]',deva:'[०-९]',fullwide:'[０-９]',gujr:'[૦-૯]',hanidec:'[〇|一|二|三|四|五|六|七|八|九]',khmr:'[០-៩]',knda:'[೦-೯]',laoo:'[໐-໙]',limb:'[᥆-᥏]',mlym:'[൦-൯]',mong:'[᠐-᠙]',mymr:'[၀-၉]',orya:'[୦-୯]',tamldec:'[௦-௯]',telu:'[౦-౯]',thai:'[๐-๙]',tibt:'[༠-༩]',latn:'\\\\d'},vn={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},gn=yn.hanidec.replace(/[\\[|\\]]/g,'').split('');function Tn(e,t){var n=e.numberingSystem;return void 0===t&&(t=''),new RegExp(''+yn[n||'latn']+t)}function On(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){var n=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t='';for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(-1!==e[n].search(yn.hanidec))t+=gn.indexOf(e[n]);else for(var i in vn){var o=vn[i],a=o[0],s=o[1];r>=a&&r<=s&&(t+=r-a)}}return parseInt(t,10)}return t}(n))}}}var En='( |'+String.fromCharCode(160)+')',wn=new RegExp(En,'g');function Nn(e){return e.replace(/\\./g,'\\\\.?').replace(wn,En)}function Sn(e){return e.replace(/\\./g,'').replace(wn,' ').toLowerCase()}function In(e,t){return null===e?null:{regex:RegExp(e.map(Nn).join('|')),deser:function(n){var r=n[0];return e.findIndex((function(e){return Sn(r)===Sn(e)}))+t}}}function An(e,t){return{regex:e,deser:function(e){return me(e[1],e[2])},groups:t}}function Ln(e){return{regex:e,deser:function(e){return e[0]}}}var Rn={year:{'2-digit':'yy',numeric:'yyyyy'},month:{numeric:'M','2-digit':'MM',short:'MMM',long:'MMMM'},day:{numeric:'d','2-digit':'dd'},weekday:{short:'EEE',long:'EEEE'},dayperiod:'a',dayPeriod:'a',hour:{numeric:'h','2-digit':'hh'},minute:{numeric:'m','2-digit':'mm'},second:{numeric:'s','2-digit':'ss'}};var Dn=null;function bn(e,t){if(e.literal)return e;var n=Ue.macroTokenToFormatOpts(e.val);if(!n)return e;var r=Ue.create(t,n).formatDateTimeParts((Dn||(Dn=lr.fromMillis(1555555555555)),Dn)).map((function(e){return function(e,t,n){var r=e.type,i=e.value;if('literal'===r)return{literal:!0,val:i};var o=n[r],a=Rn[r];return'object'==typeof a&&(a=a[o]),a?{literal:!1,val:a}:void 0}(e,0,n)}));return r.includes(void 0)?e:r}function Mn(e,t,n){var r=function(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return bn(e,t)})))}(Ue.parseFormat(n),e),i=r.map((function(t){return n=t,i=Tn(r=e),o=Tn(r,'{2}'),a=Tn(r,'{3}'),s=Tn(r,'{4}'),u=Tn(r,'{6}'),c=Tn(r,'{1,2}'),l=Tn(r,'{1,3}'),d=Tn(r,'{1,6}'),f=Tn(r,'{1,9}'),m=Tn(r,'{2,4}'),h=Tn(r,'{4,6}'),p=function(e){return{regex:RegExp((t=e.val,t.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g,'\\\\$&'))),deser:function(e){return e[0]},literal:!0};var t},(_=function(e){if(n.literal)return p(e);switch(e.val){case'G':return In(r.eras('short',!1),0);case'GG':return In(r.eras('long',!1),0);case'y':return On(d);case'yy':return On(m,de);case'yyyy':return On(s);case'yyyyy':return On(h);case'yyyyyy':return On(u);case'M':return On(c);case'MM':return On(o);case'MMM':return In(r.months('short',!0,!1),1);case'MMMM':return In(r.months('long',!0,!1),1);case'L':return On(c);case'LL':return On(o);case'LLL':return In(r.months('short',!1,!1),1);case'LLLL':return In(r.months('long',!1,!1),1);case'd':return On(c);case'dd':return On(o);case'o':return On(l);case'ooo':return On(a);case'HH':return On(o);case'H':return On(c);case'hh':return On(o);case'h':return On(c);case'mm':return On(o);case'm':case'q':return On(c);case'qq':return On(o);case's':return On(c);case'ss':return On(o);case'S':return On(l);case'SSS':return On(a);case'u':return Ln(f);case'a':return In(r.meridiems(),0);case'kkkk':return On(s);case'kk':return On(m,de);case'W':return On(c);case'WW':return On(o);case'E':case'c':return On(i);case'EEE':return In(r.weekdays('short',!1,!1),1);case'EEEE':return In(r.weekdays('long',!1,!1),1);case'ccc':return In(r.weekdays('short',!0,!1),1);case'cccc':return In(r.weekdays('long',!0,!1),1);case'Z':case'ZZ':return An(new RegExp('([+-]'+c.source+')(?::('+o.source+'))?'),2);case'ZZZ':return An(new RegExp('([+-]'+c.source+')('+o.source+')?'),2);case'z':return Ln(/[a-z_+-/]{1,256}?/i);default:return p(e)}}(n)||{invalidReason:'missing Intl.DateTimeFormat.formatToParts support'}).token=n,_;var n,r,i,o,a,s,u,c,l,d,f,m,h,p,_})),o=i.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};var a=function(e){return['^'+e.map((function(e){return e.regex})).reduce((function(e,t){return e+'('+t.source+')'}),'')+'$',e]}(i),s=a[0],u=a[1],c=RegExp(s,'i'),l=function(e,t,n){var r=e.match(t);if(r){var i={},o=1;for(var a in n)if(ee(n,a)){var s=n[a],u=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(r.slice(o,o+u))),o+=u}return[r,i]}return[r,{}]}(t,c,u),d=l[0],f=l[1],m=f?function(e){var t;return t=Y(e.Z)?Y(e.z)?null:He.create(e.z):new Ye(e.Z),Y(e.q)||(e.M=3*(e.q-1)+1),Y(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Y(e.u)||(e.S=ie(e.u)),[Object.keys(e).reduce((function(t,n){var r=function(e){switch(e){case'S':return'millisecond';case's':return'second';case'm':return'minute';case'h':case'H':return'hour';case'd':return'day';case'o':return'ordinal';case'L':case'M':return'month';case'y':return'year';case'E':case'c':return'weekday';case'W':return'weekNumber';case'k':return'weekYear';case'q':return'quarter';default:return null}}(n);return r&&(t[r]=e[n]),t}),{}),t]}(f):[null,null],h=m[0],p=m[1];if(ee(f,'a')&&ee(f,'H'))throw new y('Can\\'t include meridiem when specifying 24-hour format');return{input:t,tokens:r,regex:c,rawMatches:d,matches:f,result:h,zone:p}}var kn=[0,31,59,90,120,151,181,212,243,273,304,334],Fn=[0,31,60,91,121,152,182,213,244,274,305,335];function Un(e,t){return new Pe('unit out of range','you specified '+t+' (of type '+typeof t+') as a '+e+', which is invalid')}function Pn(e,t,n){var r=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===r?7:r}function Cn(e,t,n){return n+(ae(e)?Fn:kn)[t-1]}function Vn(e,t){var n=ae(e)?Fn:kn,r=n.findIndex((function(e){return e<t}));return{month:r+1,day:t-n[r]}}function Wn(e){var t,n=e.year,r=e.month,i=e.day,o=Cn(n,r,i),a=Pn(n,r,i),s=Math.floor((o-a+10)/7);return s<1?s=le(t=n-1):s>le(n)?(t=n+1,s=1):t=n,Object.assign({weekYear:t,weekNumber:s,weekday:a},ye(e))}function xn(e){var t,n=e.weekYear,r=e.weekNumber,i=e.weekday,o=Pn(n,1,4),a=se(n),s=7*r+i-o-3;s<1?s+=se(t=n-1):s>a?(t=n+1,s-=se(n)):t=n;var u=Vn(t,s),c=u.month,l=u.day;return Object.assign({year:t,month:c,day:l},ye(e))}function jn(e){var t=e.year,n=Cn(t,e.month,e.day);return Object.assign({year:t,ordinal:n},ye(e))}function Zn(e){var t=e.year,n=Vn(t,e.ordinal),r=n.month,i=n.day;return Object.assign({year:t,month:r,day:i},ye(e))}function zn(e){var t=J(e.year),n=te(e.month,1,12),r=te(e.day,1,ue(e.year,e.month));return t?n?!r&&Un('day',e.day):Un('month',e.month):Un('year',e.year)}function Hn(e){var t=e.hour,n=e.minute,r=e.second,i=e.millisecond,o=te(t,0,23)||24===t&&0===n&&0===r&&0===i,a=te(n,0,59),s=te(r,0,59),u=te(i,0,999);return o?a?s?!u&&Un('millisecond',i):Un('second',r):Un('minute',n):Un('hour',t)}function qn(e){return new Pe('unsupported zone','the zone \"'+e.name+'\" is not supported')}function Yn(e){return null===e.weekData&&(e.weekData=Wn(e.c)),e.weekData}function Gn(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new lr(Object.assign({},n,t,{old:n}))}function Jn(e,t,n){var r=e-60*t*1e3,i=n.offset(r);if(t===i)return[r,t];r-=60*(i-t)*1e3;var o=n.offset(r);return i===o?[r,i]:[e-60*Math.min(i,o)*1e3,Math.max(i,o)]}function Bn(e,t){var n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function $n(e,t,n){return Jn(ce(e),t,n)}function Qn(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=Object.assign({},e.c,{year:r,month:i,day:Math.min(e.c.day,ue(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),a=cn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as('milliseconds'),s=Jn(ce(o),n,e.zone),u=s[0],c=s[1];return 0!==a&&(u+=a,c=e.zone.offset(u)),{ts:u,o:c}}function Kn(e,t,n,r,i){var o=n.setZone,a=n.zone;if(e&&0!==Object.keys(e).length){var s=t||a,u=lr.fromObject(Object.assign(e,n,{zone:s,setZone:void 0}));return o?u:u.setZone(a)}return lr.invalid(new Pe('unparsable','the input \"'+i+'\" can\\'t be parsed as '+r))}function Xn(e,t,n){return void 0===n&&(n=!0),e.isValid?Ue.create(ft.create('en-US'),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function er(e,t){var n=t.suppressSeconds,r=void 0!==n&&n,i=t.suppressMilliseconds,o=void 0!==i&&i,a=t.includeOffset,s=t.includePrefix,u=void 0!==s&&s,c=t.includeZone,l=void 0!==c&&c,d=t.spaceZone,f=void 0!==d&&d,m=t.format,h=void 0===m?'extended':m,p='basic'===h?'HHmm':'HH:mm';r&&0===e.second&&0===e.millisecond||(p+='basic'===h?'ss':':ss',o&&0===e.millisecond||(p+='.SSS')),(l||a)&&f&&(p+=' '),l?p+='z':a&&(p+='basic'===h?'ZZZ':'ZZ');var _=Xn(e,p);return u&&(_='T'+_),_}var tr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},nr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},rr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ir=['year','month','day','hour','minute','second','millisecond'],or=['weekYear','weekNumber','weekday','hour','minute','second','millisecond'],ar=['year','ordinal','hour','minute','second','millisecond'];function sr(e){var t={year:'year',years:'year',month:'month',months:'month',day:'day',days:'day',hour:'hour',hours:'hour',minute:'minute',minutes:'minute',quarter:'quarter',quarters:'quarter',second:'second',seconds:'second',millisecond:'millisecond',milliseconds:'millisecond',weekday:'weekday',weekdays:'weekday',weeknumber:'weekNumber',weeksnumber:'weekNumber',weeknumbers:'weekNumber',weekyear:'weekYear',weekyears:'weekYear',ordinal:'ordinal'}[e.toLowerCase()];if(!t)throw new v(e);return t}function ur(e,t){for(var n,r=f(ir);!(n=r()).done;){var i=n.value;Y(e[i])&&(e[i]=tr[i])}var o=zn(e)||Hn(e);if(o)return lr.invalid(o);var a=tt.now(),s=$n(e,t.offset(a),t),u=s[0],c=s[1];return new lr({ts:u,zone:t,o:c})}function cr(e,t,n){var r=!!Y(n.round)||n.round,i=function(e,i){return e=oe(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)},o=function(r){return n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r)};if(n.unit)return i(o(n.unit),n.unit);for(var a,s=f(n.units);!(a=s()).done;){var u=a.value,c=o(u);if(Math.abs(c)>=1)return i(c,u)}return i(0,n.units[n.units.length-1])}var lr=function(){function e(e){var t=e.zone||tt.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new Pe('invalid input'):null)||(t.isValid?null:qn(t));this.ts=Y(e.ts)?tt.now():e.ts;var r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];r=o[0],i=o[1]}else{var a=t.offset(this.ts);r=Bn(this.ts,a),r=(n=Number.isNaN(r.year)?new Pe('invalid input'):null)?null:r,i=n?null:a}this._zone=t,this.loc=e.loc||ft.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}e.now=function(){return new e({})},e.local=function(t,n,r,i,o,a,s){return Y(t)?new e({}):ur({year:t,month:n,day:r,hour:i,minute:o,second:a,millisecond:s},tt.defaultZone)},e.utc=function(t,n,r,i,o,a,s){return Y(t)?new e({ts:tt.now(),zone:Ye.utcInstance}):ur({year:t,month:n,day:r,hour:i,minute:o,second:a,millisecond:s},Ye.utcInstance)},e.fromJSDate=function(t,n){void 0===n&&(n={});var r,i=(r=t,'[object Date]'===Object.prototype.toString.call(r)?t.valueOf():NaN);if(Number.isNaN(i))return e.invalid('invalid input');var o=Je(n.zone,tt.defaultZone);return o.isValid?new e({ts:i,zone:o,loc:ft.fromObject(n)}):e.invalid(qn(o))},e.fromMillis=function(t,n){if(void 0===n&&(n={}),G(t))return t<-864e13||t>864e13?e.invalid('Timestamp out of range'):new e({ts:t,zone:Je(n.zone,tt.defaultZone),loc:ft.fromObject(n)});throw new g('fromMillis requires a numerical input, but received a '+typeof t+' with value '+t)},e.fromSeconds=function(t,n){if(void 0===n&&(n={}),G(t))return new e({ts:1e3*t,zone:Je(n.zone,tt.defaultZone),loc:ft.fromObject(n)});throw new g('fromSeconds requires a numerical input')},e.fromObject=function(t){var n=Je(t.zone,tt.defaultZone);if(!n.isValid)return e.invalid(qn(n));var r=tt.now(),i=n.offset(r),o=pe(t,sr,['zone','locale','outputCalendar','numberingSystem']),a=!Y(o.ordinal),s=!Y(o.year),u=!Y(o.month)||!Y(o.day),c=s||u,l=o.weekYear||o.weekNumber,d=ft.fromObject(t);if((c||a)&&l)throw new y('Can\\'t mix weekYear/weekNumber units with year/month/day or ordinals');if(u&&a)throw new y('Can\\'t mix ordinal dates with month/day');var m,h,p=l||o.weekday&&!c,_=Bn(r,i);p?(m=or,h=nr,_=Wn(_)):a?(m=ar,h=rr,_=jn(_)):(m=ir,h=tr);for(var v,g=!1,T=f(m);!(v=T()).done;){var O=v.value;Y(o[O])?o[O]=g?h[O]:_[O]:g=!0}var E=(p?function(e){var t=J(e.weekYear),n=te(e.weekNumber,1,le(e.weekYear)),r=te(e.weekday,1,7);return t?n?!r&&Un('weekday',e.weekday):Un('week',e.week):Un('weekYear',e.weekYear)}(o):a?function(e){var t=J(e.year),n=te(e.ordinal,1,se(e.year));return t?!n&&Un('ordinal',e.ordinal):Un('year',e.year)}(o):zn(o))||Hn(o);if(E)return e.invalid(E);var w=$n(p?xn(o):a?Zn(o):o,i,n),N=new e({ts:w[0],zone:n,o:w[1],loc:d});return o.weekday&&c&&t.weekday!==N.weekday?e.invalid('mismatched weekday','you can\\'t specify both a weekday of '+o.weekday+' and a date of '+N.toISO()):N},e.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return pt(e,[Zt,Yt],[zt,Gt],[Ht,Jt],[qt,Bt])}(e);return Kn(n[0],n[1],t,'ISO 8601',e)},e.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return pt(function(e){return e.replace(/\\([^)]*\\)|[\\n\\t]/g,' ').replace(/(\\s\\s+)/g,' ').trim()}(e),[Ut,Pt])}(e);return Kn(n[0],n[1],t,'RFC 2822',e)},e.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return pt(e,[Ct,xt],[Vt,xt],[Wt,jt])}(e);return Kn(n[0],n[1],t,'HTTP',t)},e.fromFormat=function(t,n,r){if(void 0===r&&(r={}),Y(t)||Y(n))throw new g('fromFormat requires an input string and a format');var i=r,o=i.locale,a=void 0===o?null:o,s=i.numberingSystem,u=void 0===s?null:s,c=function(e,t,n){var r=Mn(e,t,n);return[r.result,r.zone,r.invalidReason]}(ft.fromOpts({locale:a,numberingSystem:u,defaultToEN:!0}),t,n),l=c[0],d=c[1],f=c[2];return f?e.invalid(f):Kn(l,d,r,'format '+n,t)},e.fromString=function(t,n,r){return void 0===r&&(r={}),e.fromFormat(t,n,r)},e.fromSQL=function(e,t){void 0===t&&(t={});var n=function(e){return pt(e,[Qt,Xt],[Kt,en])}(e);return Kn(n[0],n[1],t,'SQL',e)},e.invalid=function(t,n){if(void 0===n&&(n=null),!t)throw new g('need to specify a reason the DateTime is invalid');var r=t instanceof Pe?t:new Pe(t,n);if(tt.throwOnInvalid)throw new h(r);return new e({invalid:r})},e.isDateTime=function(e){return e&&e.isLuxonDateTime||!1};var t=e.prototype;return t.get=function(e){return this[e]},t.resolvedLocaleOpts=function(e){void 0===e&&(e={});var t=Ue.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},t.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(Ye.instance(e),t)},t.toLocal=function(){return this.setZone(tt.defaultZone)},t.setZone=function(t,n){var r=void 0===n?{}:n,i=r.keepLocalTime,o=void 0!==i&&i,a=r.keepCalendarTime,s=void 0!==a&&a;if((t=Je(t,tt.defaultZone)).equals(this.zone))return this;if(t.isValid){var u=this.ts;if(o||s){var c=t.offset(this.ts);u=$n(this.toObject(),c,t)[0]}return Gn(this,{ts:u,zone:t})}return e.invalid(qn(t))},t.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,i=t.outputCalendar;return Gn(this,{loc:this.loc.clone({locale:n,numberingSystem:r,outputCalendar:i})})},t.setLocale=function(e){return this.reconfigure({locale:e})},t.set=function(e){if(!this.isValid)return this;var t,n=pe(e,sr,[]);!Y(n.weekYear)||!Y(n.weekNumber)||!Y(n.weekday)?t=xn(Object.assign(Wn(this.c),n)):Y(n.ordinal)?(t=Object.assign(this.toObject(),n),Y(n.day)&&(t.day=Math.min(ue(t.year,t.month),t.day))):t=Zn(Object.assign(jn(this.c),n));var r=$n(t,this.o,this.zone);return Gn(this,{ts:r[0],o:r[1]})},t.plus=function(e){return this.isValid?Gn(this,Qn(this,ln(e))):this},t.minus=function(e){return this.isValid?Gn(this,Qn(this,ln(e).negate())):this},t.startOf=function(e){if(!this.isValid)return this;var t={},n=cn.normalizeUnit(e);switch(n){case'years':t.month=1;case'quarters':case'months':t.day=1;case'weeks':case'days':t.hour=0;case'hours':t.minute=0;case'minutes':t.second=0;case'seconds':t.millisecond=0}if('weeks'===n&&(t.weekday=1),'quarters'===n){var r=Math.ceil(this.month/3);t.month=3*(r-1)+1}return this.set(t)},t.endOf=function(e){var t;return this.isValid?this.plus((t={},t[e]=1,t)).startOf(e).minus(1):this},t.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?Ue.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):'Invalid DateTime'},t.toLocaleString=function(e){return void 0===e&&(e=N),this.isValid?Ue.create(this.loc.clone(e),e).formatDateTime(this):'Invalid DateTime'},t.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?Ue.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},t.toISO=function(e){return void 0===e&&(e={}),this.isValid?this.toISODate(e)+'T'+this.toISOTime(e):null},t.toISODate=function(e){var t=(void 0===e?{}:e).format,n='basic'===(void 0===t?'extended':t)?'yyyyMMdd':'yyyy-MM-dd';return this.year>9999&&(n='+'+n),Xn(this,n)},t.toISOWeekDate=function(){return Xn(this,'kkkk-\\'W\\'WW-c')},t.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,r=void 0!==n&&n,i=t.suppressSeconds,o=void 0!==i&&i,a=t.includeOffset,s=void 0===a||a,u=t.includePrefix,c=void 0!==u&&u,l=t.format;return er(this,{suppressSeconds:o,suppressMilliseconds:r,includeOffset:s,includePrefix:c,format:void 0===l?'extended':l})},t.toRFC2822=function(){return Xn(this,'EEE, dd LLL yyyy HH:mm:ss ZZZ',!1)},t.toHTTP=function(){return Xn(this.toUTC(),'EEE, dd LLL yyyy HH:mm:ss \\'GMT\\'')},t.toSQLDate=function(){return Xn(this,'yyyy-MM-dd')},t.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,r=void 0===n||n,i=t.includeZone;return er(this,{includeOffset:r,includeZone:void 0!==i&&i,spaceZone:!0})},t.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+' '+this.toSQLTime(e):null},t.toString=function(){return this.isValid?this.toISO():'Invalid DateTime'},t.valueOf=function(){return this.toMillis()},t.toMillis=function(){return this.isValid?this.ts:NaN},t.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},t.toJSON=function(){return this.toISO()},t.toBSON=function(){return this.toJSDate()},t.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=Object.assign({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},t.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},t.diff=function(e,t,n){if(void 0===t&&(t='milliseconds'),void 0===n&&(n={}),!this.isValid||!e.isValid)return cn.invalid(this.invalid||e.invalid,'created by diffing an invalid DateTime');var r,i=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(r=t,Array.isArray(r)?r:[r]).map(cn.normalizeUnit),a=e.valueOf()>this.valueOf(),s=_n(a?this:e,a?e:this,o,i);return a?s.negate():s},t.diffNow=function(t,n){return void 0===t&&(t='milliseconds'),void 0===n&&(n={}),this.diff(e.now(),t,n)},t.until=function(e){return this.isValid?mn.fromDateTimes(this,e):this},t.hasSame=function(e,t){if(!this.isValid)return!1;var n=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t)<=n&&n<=r.endOf(t)},t.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(t){if(void 0===t&&(t={}),!this.isValid)return null;var n=t.base||e.fromObject({zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;return cr(n,this.plus(r),Object.assign(t,{numeric:'always',units:['years','months','days','hours','minutes','seconds']}))},t.toRelativeCalendar=function(t){return void 0===t&&(t={}),this.isValid?cr(t.base||e.fromObject({zone:this.zone}),this,Object.assign(t,{numeric:'auto',units:['years','months','days'],calendary:!0})):null},e.min=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.every(e.isDateTime))throw new g('min requires all arguments be DateTimes');return K(n,(function(e){return e.valueOf()}),Math.min)},e.max=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.every(e.isDateTime))throw new g('max requires all arguments be DateTimes');return K(n,(function(e){return e.valueOf()}),Math.max)},e.fromFormatExplain=function(e,t,n){void 0===n&&(n={});var r=n,i=r.locale,o=void 0===i?null:i,a=r.numberingSystem,s=void 0===a?null:a;return Mn(ft.fromOpts({locale:o,numberingSystem:s,defaultToEN:!0}),e,t)},e.fromStringExplain=function(t,n,r){return void 0===r&&(r={}),e.fromFormatExplain(t,n,r)},i(e,[{key:'isValid',get:function(){return null===this.invalid}},{key:'invalidReason',get:function(){return this.invalid?this.invalid.reason:null}},{key:'invalidExplanation',get:function(){return this.invalid?this.invalid.explanation:null}},{key:'locale',get:function(){return this.isValid?this.loc.locale:null}},{key:'numberingSystem',get:function(){return this.isValid?this.loc.numberingSystem:null}},{key:'outputCalendar',get:function(){return this.isValid?this.loc.outputCalendar:null}},{key:'zone',get:function(){return this._zone}},{key:'zoneName',get:function(){return this.isValid?this.zone.name:null}},{key:'year',get:function(){return this.isValid?this.c.year:NaN}},{key:'quarter',get:function(){return this.isValid?Math.ceil(this.c.month/3):NaN}},{key:'month',get:function(){return this.isValid?this.c.month:NaN}},{key:'day',get:function(){return this.isValid?this.c.day:NaN}},{key:'hour',get:function(){return this.isValid?this.c.hour:NaN}},{key:'minute',get:function(){return this.isValid?this.c.minute:NaN}},{key:'second',get:function(){return this.isValid?this.c.second:NaN}},{key:'millisecond',get:function(){return this.isValid?this.c.millisecond:NaN}},{key:'weekYear',get:function(){return this.isValid?Yn(this).weekYear:NaN}},{key:'weekNumber',get:function(){return this.isValid?Yn(this).weekNumber:NaN}},{key:'weekday',get:function(){return this.isValid?Yn(this).weekday:NaN}},{key:'ordinal',get:function(){return this.isValid?jn(this.c).ordinal:NaN}},{key:'monthShort',get:function(){return this.isValid?hn.months('short',{locale:this.locale})[this.month-1]:null}},{key:'monthLong',get:function(){return this.isValid?hn.months('long',{locale:this.locale})[this.month-1]:null}},{key:'weekdayShort',get:function(){return this.isValid?hn.weekdays('short',{locale:this.locale})[this.weekday-1]:null}},{key:'weekdayLong',get:function(){return this.isValid?hn.weekdays('long',{locale:this.locale})[this.weekday-1]:null}},{key:'offset',get:function(){return this.isValid?+this.o:NaN}},{key:'offsetNameShort',get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:'short',locale:this.locale}):null}},{key:'offsetNameLong',get:function(){return this.isValid?this.zone.offsetName(this.ts,{format:'long',locale:this.locale}):null}},{key:'isOffsetFixed',get:function(){return this.isValid?this.zone.universal:null}},{key:'isInDST',get:function(){return!this.isOffsetFixed&&(this.offset>this.set({month:1}).offset||this.offset>this.set({month:5}).offset)}},{key:'isInLeapYear',get:function(){return ae(this.year)}},{key:'daysInMonth',get:function(){return ue(this.year,this.month)}},{key:'daysInYear',get:function(){return this.isValid?se(this.year):NaN}},{key:'weeksInWeekYear',get:function(){return this.isValid?le(this.weekYear):NaN}}],[{key:'DATE_SHORT',get:function(){return N}},{key:'DATE_MED',get:function(){return S}},{key:'DATE_MED_WITH_WEEKDAY',get:function(){return I}},{key:'DATE_FULL',get:function(){return A}},{key:'DATE_HUGE',get:function(){return L}},{key:'TIME_SIMPLE',get:function(){return R}},{key:'TIME_WITH_SECONDS',get:function(){return D}},{key:'TIME_WITH_SHORT_OFFSET',get:function(){return b}},{key:'TIME_WITH_LONG_OFFSET',get:function(){return M}},{key:'TIME_24_SIMPLE',get:function(){return k}},{key:'TIME_24_WITH_SECONDS',get:function(){return F}},{key:'TIME_24_WITH_SHORT_OFFSET',get:function(){return U}},{key:'TIME_24_WITH_LONG_OFFSET',get:function(){return P}},{key:'DATETIME_SHORT',get:function(){return C}},{key:'DATETIME_SHORT_WITH_SECONDS',get:function(){return V}},{key:'DATETIME_MED',get:function(){return W}},{key:'DATETIME_MED_WITH_SECONDS',get:function(){return x}},{key:'DATETIME_MED_WITH_WEEKDAY',get:function(){return j}},{key:'DATETIME_FULL',get:function(){return Z}},{key:'DATETIME_FULL_WITH_SECONDS',get:function(){return z}},{key:'DATETIME_HUGE',get:function(){return H}},{key:'DATETIME_HUGE_WITH_SECONDS',get:function(){return q}}]),e}();function dr(e){if(lr.isDateTime(e))return e;if(e&&e.valueOf&&G(e.valueOf()))return lr.fromJSDate(e);if(e&&'object'==typeof e)return lr.fromObject(e);throw new g('Unknown datetime argument: '+e+', of type '+typeof e)}t.DateTime=lr,t.Duration=cn,t.FixedOffsetZone=Ye,t.IANAZone=He,t.Info=hn,t.Interval=mn,t.InvalidZone=Ge,t.LocalZone=We,t.Settings=tt,t.VERSION='1.26.0',t.Zone=Ce},function(e,t){e.exports=function(e){var t={};!function e(t,n){var r=Object.keys(t);for(var i in r){var o=r[i];switch(typeof t[o]){case'object':e(t[o],n);break;case'function':t[o]=t[o].bind(n)}}}(e,t),t.definition=function e(t){var n=Object.assign({},t),r=Object.keys(n);for(var i in r){var o=r[i];if(Array.isArray(n[o])){n[o]=n[o].slice(0);for(var a=0;a<n[o].length;++a)'object'==typeof n[o][a]&&(n[o][a]=e(n[o][a]))}else'object'==typeof n[o]&&(n[o]=e(n[o]))}return n}(e)}},function(e,t,n){var r=n(5),i=n(7),o=n(9);n(10)(i,c,Utils,Target,emit),o(r,c,Utils,Task,emit),emit('_complete',{_id:!0})},function(e,t,n){const{Forms:r,getField:i,getMostRecentReport:o,getDynamicReportedDate:a}=n(0),{toDate:s,toDateString:u,findOldestReport:c,latestReportHasField:l,ageInDays:d}=n(1),{indexOfEvent:f,modifyContentClosure_fromPatientAssessment:m,specificTreatmentCount:h,referralTemplate:p,resolveIfClosure_isReportInEventWindow:_,assessmentFollowupEvents:y,dueDateClosure:v,chwReassessTaskTemplate:g,defaultedTaskTemplate:T,covidReferralTemplate:O,selfSpawningTemplate:E,specificTreatmentTemplate:w,supervisorRealizationFollowup:N,supervisorNotificationTaskTemplate:S,selfAssessmentTemplate:I}=n(6);e.exports=[T({sourceForm:r.PREGNANCY_FAMILY_PLANNING,actionForm:r.ANC_FOLLOWUP,appliesTo:'contacts',appliesToType:['person'],appliesIf:function(e){const t=e.reports.filter(e=>e.form===r.PREGNANCY_FAMILY_PLANNING).filter(e=>!!s(i(e,'lmp_date')));return this.pregnancyForm=o(t,r.PREGNANCY_FAMILY_PLANNING),!!this.pregnancyForm},resolvedIf:function(e,t,n,i){return l(e,r.ANC_FOLLOWUP,'close_out','true',a(this.pregnancyForm).toMillis())||_(r.ANC_FOLLOWUP)(e,t,n,i)},events:[{id:'lmp+0',start:0,end:3,dueDate:function(){const{pregnancyForm:e}=this;if(!e)throw new Error('Failed result from findPlanningFormDiscoveringPregnancy');return a(e).toJSDate()}},...[14,28,42,56,70,84,98,112,126,140,154,168,182,196,203,210,217,224,231,238,245,252,259,266,273,280,287].map(e=>({id:'lmp+'+e,start:1,end:3,dueDate:function(){const{pregnancyForm:t}=this;if(!t)throw new Error('Failed result from findPlanningFormDiscoveringPregnancy');return s(t.fields.lmp_date,e)}}))],modifyContent:function(e,t,n,r){const{pregnancyForm:i}=this;e.t_follow_up_count=f(this.definition.events.slice(1),r),e.t_lmp_date=u(i.fields.lmp_date),e.t_cpn_visits='not_first_follow_up',e.t_fp_method=i.fields.fp_method}}),T({sourceForm:r.PREGNANCY_FAMILY_PLANNING,actionForm:r.ANC_REALIZATION,appliesIf:(e,t)=>!!s(i(t,'s_reg_pregnancy.s_anc_date')),events:[{start:1,end:3,dueDate:(e,t,n)=>s(n.fields.s_reg_pregnancy.s_anc_date)}]}),T({sourceForm:r.PNC_FOLLOWUP,actionForm:r.PNC_FOLLOWUP,appliesTo:'contacts',appliesToType:['person'],appliesIf:function(e){const t=e.reports.filter(e=>e.form===r.PNC_FOLLOWUP).filter(e=>'yes'===i(e,'s_first_postnatal_visit.s_first_postnatal')&&e.fields.delivery_date).filter(e=>d(a(e))<100);return this.initialPncReport=c(t),!!this.initialPncReport},resolvedIf:function(e,t,n,i){return l(e,r.PNC_FOLLOWUP,'close_out','true',a(this.initialPncReport).toMillis())||_(r.PNC_FOLLOWUP)(e,t,n,i)},events:[1,2,3,5,12,19,26,33,40,47].map(e=>({id:'delivery_date+'+e,start:e<5?0:1,end:e<5?0:3,dueDate:function(){const{initialPncReport:t}=this;if(!t)throw new Error('Unable to find expected result from findInitialPncReport');return s(t.fields.delivery_date,e)}})),modifyContent:function(e,t,n,r){const{initialPncReport:i}=this;e.t_follow_up_count=f(this.definition.events,r),e.t_delivery_date=u(i.fields.delivery_date)}}),T({sourceForm:r.PNC_FOLLOWUP,actionForm:r.PNC_REALIZATION,appliesIf:(e,t)=>i(t,'pnc_visits')&&!!s(t.fields.pnc_visits.pnc_visit_date),events:[{start:1,end:3,dueDate:(e,t,n)=>s(n.fields.pnc_visits.pnc_visit_date)}]}),p(r.ANC_FOLLOWUP,r.REFERRAL_FOLLOWUP_OVER_5),p(r.PNC_FOLLOWUP,r.REFERRAL_FOLLOWUP_OVER_5),p(r.PATIENT_ASSESSMENT_OVER_5,r.REFERRAL_FOLLOWUP_OVER_5,{events:y([1,2,3])}),p(r.TREATMENT_FOLLOWUP_OVER_5,r.REFERRAL_FOLLOWUP_OVER_5),p(r.TREATMENT_FOLLOWUP_UNDER_5,r.REFERRAL_FOLLOWUP_UNDER_5),p(r.SIMPLECARE_NEWBORN_FOLLOWUP,r.REFERRAL_FOLLOWUP_UNDER_5),p(r.PATIENT_ASSESSMENT_UNDER_5,r.REFERRAL_FOLLOWUP_UNDER_5,{modifyContent:m('referral'),events:y([1,2,3])}),p(r.MALNUTRITION_FOLLOWUP_UNDER_5,r.REFERRAL_FOLLOWUP_UNDER_5),w('malaria','mosquito',[1,2,3]),w('ari','icon-healthcare',[1,2,3,5]),w('diarrhea','icon-healthcare',[5]),T({sourceForm:r.PATIENT_ASSESSMENT_UNDER_5,actionForm:r.TREATMENT_FOLLOWUP_UNDER_5,title:'task.treatment.multiple',appliesIf:(e,t)=>'true'!==i(t,'accompany_to_cscom')&&'true'!==i(t,'refer_to_cscom')&&h(t)>1,resolvedIf:(e,t,n,i)=>{const o=l(e,r.TREATMENT_FOLLOWUP_UNDER_5,'close_out','true',a(t).toMillis()),s=l(e,r.TREATMENT_FOLLOWUP_UNDER_5,'referral','true',a(t).toMillis()),u=_(r.TREATMENT_FOLLOWUP_UNDER_5)(e,t,n,i);return o||s||u},events:[1,2,3,5].map((e,t)=>({id:'+'+e,start:5===e?1:0,end:5===e?3:0,dueDate:v(e,3===t)})),modifyContent:m('multiple')}),T({sourceForm:r.PATIENT_ASSESSMENT_UNDER_5,actionForm:r.MALNUTRITION_FOLLOWUP_UNDER_5,appliesTo:'contacts',appliesToType:['person'],title:'task.treatment.malnutrition',appliesIf:function(e){const t=e.reports.filter(e=>e.form===r.PATIENT_ASSESSMENT_UNDER_5).filter(e=>'true'===i(e,'treat_malnutrition')).filter(e=>d(a(e))<86);return this.patientAssessment=o(t,r.PATIENT_ASSESSMENT_UNDER_5),!!this.patientAssessment},resolvedIf:function(e,t,n,a){let s=!1;const u=o(e.reports,r.MALNUTRITION_FOLLOWUP_UNDER_5);return u&&i(u,'inputs.source_id')===this.patientAssessment._id&&(s='red'===i(u,'shakir_strip_color')||'true'===i(u,'referral')),s||_(r.MALNUTRITION_FOLLOWUP_UNDER_5)(e,t,n,a)},events:[7,14,21,28,42,56,70,84].map((e,t)=>({id:'reported_date+'+e,start:1,end:3,dueDate:function(n,r){const{patientAssessment:i}=this;if(!i)throw new Error('Unable to find expected result from findPatientAssessment');return v(e,7===t)(n,r,i)}})),modifyContent:function(e,t,n,o){const{patientAssessment:a}=this;e.source_id=a._id,e.t_assessment_date=u(i(a,'assessment_date')),e.t_follow_up_count=f(this.definition.events,o);const s=t.reports.filter(e=>e.form===r.MALNUTRITION_FOLLOWUP_UNDER_5&&i(e,'inputs.source_id')===a._id).map(e=>e.fields.shakir_strip_color);let c=0;for(let e=0;e<s.length;e++)c='yellow'===s[e]?c+1:0;e.t_num_yellow_strips=c.toString()}}),T({sourceForm:r.PATIENT_ASSESSMENT_OVER_5,actionForm:r.TREATMENT_FOLLOWUP_OVER_5,icon:'mosquito',title:'task.treatment.general',appliesIf:(e,t)=>'true'!==i(t,'referral')&&'true'===t.fields.treat_malaria,resolvedIf:(e,t,n,i)=>l(e,r.TREATMENT_FOLLOWUP_OVER_5,'close_out','true',a(t).toMillis())||l(e,r.TREATMENT_FOLLOWUP_OVER_5,'referral','true',a(t).toMillis())||_(r.TREATMENT_FOLLOWUP_OVER_5)(e,t,n,i),events:y([1,2,3]),modifyContent:m('malaria')}),E({formName:r.PNC_REALIZATION,icon:'newborn',appliesIf:e=>'yes'===i(e,'next_pnc.s_next_pnc'),dueDate:(e,t,n)=>n.fields.next_pnc.s_next_pnc_date}),E({formName:r.ANC_REALIZATION,icon:'pregnant',appliesIf:e=>'yes'===i(e,'next_anc.s_next_anc'),dueDate:(e,t,n)=>n.fields.next_anc.s_next_anc_date}),T({sourceForm:r.SIMPLECARE_NEWBORN_FOLLOWUP,actionForm:r.SIMPLECARE_NEWBORN_FOLLOWUP,appliesTo:'contacts',appliesToType:['person'],appliesIf:function(e){const t=d(e.contact.date_of_birth);return this.newBornReport=o(e.reports,r.SIMPLECARE_NEWBORN_FOLLOWUP),t<30&&!!this.newBornReport},resolvedIf:function(e,t,n,o){return'true'===i(this.newBornReport,'close_out')||_(r.SIMPLECARE_NEWBORN_FOLLOWUP)(e,t,n,o)},events:[1,2,5,12,19,26].map(e=>({id:'date_of_birth+'+e,start:e<6?0:1,end:1===e?0:e<6?1:3,dueDate:(t,n)=>s(n.contact.date_of_birth,e)})),modifyContent:function(e,t,n,r){e.t_follow_up_count=f(this.definition.events,r),e.t_twin_or_triplet='yes'===i(this.newBornReport,'s_vital_signs.twin_or_triplet')?'yes':'no'}}),O(r.PATIENT_ASSESSMENT_UNDER_5),O(r.PATIENT_ASSESSMENT_OVER_5),T({sourceForm:r.SUPERVISOR_CALENDAR,actionForm:r.SUPERVISOR_VISIT_REALIZATION,appliesIf:(e,t)=>!!s(i(t,'section_supervision_date.supervision_date')),events:[{start:1,end:2,dueDate:(e,t,n)=>s(n.fields.section_supervision_date.supervision_date)}],displayForUserAt:['district_hospital']}),N(r.SUPERVISOR_WITH_CHW_CONFIRMATION,'supervision_with_chw'),N(r.SUPERVISOR_WITHOUT_CHW_CONFIRMATION,'supervision_without_chw'),N(r.INDIVIDUAL_FEEDBACK_CONFIRMATION,'individual_feedback'),S(r.PATIENT_ASSESSMENT_UNDER_5),S(r.PATIENT_ASSESSMENT_OVER_5),g(r.PATIENT_ASSESSMENT_UNDER_5),g(r.PATIENT_ASSESSMENT_OVER_5),I({actionForm:r.SELF_ASSESSMENT,name:'daily_self_assessment',priority:{level:'high',label:'task.priority'},displayForUserAt:['district_hospital','health_center']}),I({actionForm:r.EPI_DAILY_REPORT,name:'epi_daily_report',displayForUserAt:['health_center']})]},function(e,t,n){const{DateTime:r}=n(2),{Forms:i,getField:o,getDynamicReportedDate:a,getMostRecentReport:s,isAlive:u}=n(0),{isSomeReportInWindow:c,latestReportHasField:l,toDate:d,toDateString:f}=n(1),m={[i.ANC_REALIZATION]:'pregnant',[i.PNC_REALIZATION]:'newborn',[i.ANC_FOLLOWUP]:'pregnant',[i.PNC_FOLLOWUP]:'newborn',[i.REFERRAL_FOLLOWUP_UNDER_5]:'treatment',[i.REFERRAL_FOLLOWUP_OVER_5]:'treatment',[i.TREATMENT_FOLLOWUP_UNDER_5]:'icon-healthcare',[i.TREATMENT_FOLLOWUP_OVER_5]:'icon-healthcare',[i.MALNUTRITION_FOLLOWUP_UNDER_5]:'icon-healthcare',[i.COVID19_REFERRAL_FOLLOWUP]:'disease-cancer',[i.SIMPLECARE_NEWBORN_FOLLOWUP]:'newborn',[i.SUPERVISOR_VISIT_REALIZATION]:'newperson',[i.SUPERVISOR_WITH_CHW_CONFIRMATION]:'newperson',[i.SUPERVISOR_WITHOUT_CHW_CONFIRMATION]:'newperson',[i.INDIVIDUAL_FEEDBACK_CONFIRMATION]:'newperson',[i.NOTIFICATION_TO_CHW]:'danger-warning',[i.REDO_TDR]:'danger-warning',[i.SELF_ASSESSMENT]:'people-chw',[i.EPI_DAILY_REPORT]:'followup'},h=e=>(t,n,r,i)=>c(t.reports,e,Utils.addDate(i,-r.start).getTime(),Utils.addDate(i,r.end+1).getTime()),p=(e,t)=>{if(!Array.isArray(e))throw new Error('Invalid argument events. Array expected');return(e.findIndex(e=>t&&e.id===t.id)+1).toString()},_=e=>'task.'+e,y=e=>['treat_malaria','treat_diarrhea','treat_ari'].filter(t=>'true'===o(e,t)).length,v=e=>function(t,n,r,i){t.t_follow_up_type=e,t.t_treat_for_diarrhea=r.fields.treat_diarrhea,t.t_treat_for_malaria=r.fields.treat_malaria,t.t_treat_for_ari=r.fields.treat_ari,t.t_treat_for_cough=r.fields.treat_cough,t.t_fast_breathing=r.fields.fast_breathing,t.t_assessment_date=f(o(r,'assessment_date')),t.t_referral_date=f(o(r,'assessment_date')),t.t_observation=r.fields.observe,t.t_follow_up_count=p(this.definition.events,i)},g=e=>e.map((t,n)=>({id:'+'+t,start:0,end:0,dueDate:T(t,n===e.length-1)})),T=(e,t)=>(n,i,s)=>{const u=(s?a(s):r.fromMillis(parseInt(i.contact.reported_date||0))).plus({days:e});return t&&d(o(s,'assessment_date'),e)<d(s.reported_date)?d(s.reported_date):u.toJSDate()},O=e=>{const t=Object.assign({name:(r=e.sourceForm,i=e.actionForm,o=e.description,`${r}_yields_${i}${o?'_'+o:''}`),icon:(n=e.actionForm,m[n]),title:_(e.actionForm),appliesTo:'reports',appliesToType:[e.sourceForm],resolvedIf:h(e.actionForm),actions:[{form:e.actionForm,modifyContent:e.modifyContent}],displayForUserAt:['health_center']},e);var n,r,i,o;return t.appliesIf=function(n,r){if(!Array.isArray(t.displayForUserAt))throw Error('task attribute \"displayForUserAt\" expected to be an array for '+this.definition.name);const i=user.parent&&t.displayForUserAt.includes(user.parent.type),o=e.appliesIf.bind(this);return(!n.contact||u(n))&&i&&o(n,r)},['name','icon','title','appliesTo','appliesIf','appliesToType','contactLabel','resolvedIf','events','priority','actions'].reduce((e,n)=>(e[n]=t[n],e),{})};e.exports={indexOfEvent:p,modifyContentClosure_fromPatientAssessment:v,specificTreatmentCount:y,referralTemplate:(e,t,n)=>{const r={sourceForm:e,actionForm:t,appliesIf:(e,t)=>['referral','accompany_to_cscom','refer_to_cscom'].some(e=>'true'===o(t,e)),events:[{id:'+1',dueDate:T(1),start:0,end:0},{id:'+2',dueDate:T(2),start:0,end:0},{id:'+3',dueDate:T(3),start:0,end:0}],modifyContent:(e,t,n)=>{e.t_delivery_date=f(n.fields.delivery_date),e.t_lmp_date=f(n.fields.lmp_date),e.t_treat_for_malaria=n.fields.treat_for_malaria,e.t_assessment_date=f(o(n,'assessment_date')),e.t_follow_up_count=n.fields.follow_up_type},priority:{level:'high'}},i=Object.assign({},r,n);return O(i)},resolveIfClosure_isReportInEventWindow:h,assessmentFollowupEvents:g,dueDateClosure:T,chwReassessTaskTemplate:e=>O({sourceForm:e,actionForm:i.REDO_TDR,appliesIf:(e,t)=>Object.hasOwnProperty.call(t,'verified')&&!1===t.verified&&'true'===o(t,'needs_signoff'),events:[{dueDate:T(0),start:0,end:3}],modifyContent:function(e,t,n){e.source_id=n._id}}),defaultedTaskTemplate:O,covidReferralTemplate:e=>O({sourceForm:e,actionForm:i.COVID19_REFERRAL_FOLLOWUP,appliesTo:'reports',title:'task.covid19_referral_followup',icon:'disease-cancer',appliesIf:(e,t)=>'true'===o(t,'covid19_referral'),resolvedIf:(e,t,n,r)=>l(e,i.COVID19_REFERRAL_FOLLOWUP,'close_out','true',t.reported_date)||l(e,i.COVID19_REFERRAL_FOLLOWUP,'referral','true',t.reported_date)||h(i.COVID19_REFERRAL_FOLLOWUP)(e,t,n,r),events:g([1,2,3]),modifyContent:(e,t,n)=>{const r=n.fields.follow_up_count?parseInt(n.fields.follow_up_count,10):1;e.t_follow_up_count=r+1,e.t_delivery_date=n.fields.delivery_date,e.t_assessment_date=f(o(n,'assessment_date'))},priority:{level:'high',label:'task.priority'}}),selfSpawningTemplate:e=>({name:e.formName+'_yields_self',icon:e.icon,title:'task.'+e.formName,appliesTo:'reports',appliesToType:[e.formName],appliesIf:(t,n)=>e.appliesIf(n),resolvedIf:(t,n,r,i)=>{const o=a(n),s=t.reports.filter(e=>a(e)>o);return c(s,e.formName,Utils.addDate(i,-r.start).getTime(),Utils.addDate(i,r.end+1).getTime())},events:e.events||[{start:1,end:3,dueDate:(t,n,r)=>d(e.dueDate(t,n,r))}],actions:[{form:e.formName}]}),specificTreatmentTemplate:(e,t,n)=>O({description:e,sourceForm:i.PATIENT_ASSESSMENT_UNDER_5,actionForm:i.TREATMENT_FOLLOWUP_UNDER_5,title:'task.treatment.general',icon:t,appliesIf:(t,n)=>'true'!==o(n,'accompany_to_cscom')&&'true'!==n.fields.refer_to_cscom&&'true'===n.fields['treat_'+e]&&1===y(n),resolvedIf:(e,t,n,r)=>{const o=l(e,i.TREATMENT_FOLLOWUP_UNDER_5,'close_out','true',a(t).toMillis()),s=l(e,i.TREATMENT_FOLLOWUP_UNDER_5,'referral','true',a(t).toMillis()),u=h(i.TREATMENT_FOLLOWUP_UNDER_5)(e,t,n,r);return o||s||u},events:n.map((e,t)=>({id:'+'+e,start:e<5?0:1,end:e<5?0:3,dueDate:T(e,t===n.length-1)})),modifyContent:v(e)}),supervisorRealizationFollowup:(e,t)=>O({sourceForm:i.SUPERVISOR_VISIT_REALIZATION,actionForm:e,displayForUserAt:['district_hospital'],appliesIf:(e,n)=>!!d(o(n,'confirmation_supervision_visit.which_date'))&&o(n,'confirmation_supervision_visit.which_steps').split(' ').includes(t),events:[{start:1,end:2,dueDate:(e,t,n)=>d(n.fields.confirmation_supervision_visit.which_date)}]}),supervisorNotificationTaskTemplate:e=>O({sourceForm:e,actionForm:i.NOTIFICATION_TO_CHW,appliesTo:'contacts',appliesToType:void 0,displayForUserAt:['district_hospital'],appliesIf:function(t){return this.reportWithErrors=s(t.reports,e),this.reportWithErrors&&!1===this.reportWithErrors.verified},contact:function(){return o(this.reportWithErrors,'inputs.user.fullname')},events:[{start:0,end:3,dueDate:function(){if(this.reportWithErrors)return a(this.reportWithErrors).toJSDate()}}],modifyContent:function(e,t){const n=this.reportWithErrors;e.source_id=n._id,e.contact=t.contact,e.chw_id=n.contact._id,e.chw_name=o(n,'inputs.user.fullname'),e.chw_phone=n.from,e.patient_id=o(n,'patient_id'),e.patient_name=o(n,'patient_name')}}),selfAssessmentTemplate:e=>O({name:e.name,actionForm:e.actionForm,appliesTo:'contacts',appliesToType:['person'],appliesIf:function(t){return this.selfAssessmentReport=s(t.reports,e.actionForm),user._id===t.contact._id},resolvedIf:function(t,n,r,a){let s=!0;return this.selfAssessmentReport&&(s=e.actionForm===i.EPI_DAILY_REPORT?'yes'===o(this.selfAssessmentReport,'completion_date.report_today'):'yes'===o(this.selfAssessmentReport,'s_beginning.s_self_assess_today')),s&&h(e.actionForm)(t,n,r,a)},events:[...Array(8).keys()].map(e=>({id:'daily_assessment_'+e,start:0,end:0,dueDate:function(){return d(Date.now(),e)}})),priority:e.priority,displayForUserAt:e.displayForUserAt})}},function(e,t,n){const{Forms:r,getField:i,getReportHomeVisitSubject:o,getReportHomeVisitDate:a,filterReportsWithinMusoReportingMonth:s}=n(0),{ageInDays:u}=n(1),{didNotAccompanyPatientToCscom:c,getFamilyIdForContact:l,hoursFromIllnessToAssessmentTemplate:d,isDosageIncorrect:f,isPatient:m,basicTemplate:h,errorProtocolTemplate:p,noFollowupTemplate:_}=n(8);e.exports=[h({id:'home_visits',icon:'home-visit',appliesIf:(e,t)=>o(t),idType:(e,t)=>{if(!e||!e.contact)return;return`${l(e)}~${a(t).toFormat('yyyy-MM-dd')}`}}),h({id:'2-home-visits-per-fam',icon:'home-visit',type:'percent',goal:100,appliesTo:'contacts',appliesToType:['clinic','person'],appliesIf:e=>'clinic'===e.contact.type||m(e.contact),groupBy:e=>l(e),passesIfGroupCount:{gte:3},emitCustom:(e,t,n)=>{const r=l(n);for(const i of n.reports){const n=a(i);if(n){e(Object.assign({},t,{_id:`${r}-${n.toFormat('yyyy-MM-dd')}`,pass:!0,date:n.toMillis()}))}}n.contact&&'clinic'===n.contact.type&&e(Object.assign({},t,{_id:r,date:Date.now(),pass:!1}))},idType:'contact'}),h({id:'chv-receive-supervision-visit',icon:'nurse',appliesTo:'contacts',appliesToType:['health_center'],type:'percent',idType:'contact',context:'user.role === \"chw_supervisor\"',goal:100,appliesIf:()=>!0,passesIf:e=>{const t=s(e.reports),n=e=>t.some(t=>t.form===e);return n(r.SUPERVISOR_WITH_CHW_CONFIRMATION)&&n(r.SUPERVISOR_WITHOUT_CHW_CONFIRMATION)&&n(r.INDIVIDUAL_FEEDBACK_CONFIRMATION)},date:'now'}),d(r.PATIENT_ASSESSMENT_UNDER_5,24),d(r.PATIENT_ASSESSMENT_OVER_5,24),h({id:'preg-first-trimester',icon:'pregnant',appliesToType:[r.PREGNANCY_FAMILY_PLANNING],appliesIf:(e,t)=>i(t,'lmp_date'),passesIf:(e,t)=>u(i(t,'lmp_date'))<=98,type:'percent',goal:80}),h({id:'protocol-error-percentage',icon:'danger-warning',type:'percent',goal:100,appliesToType:[r.PATIENT_ASSESSMENT_UNDER_5,r.PATIENT_ASSESSMENT_OVER_5,r.TREATMENT_FOLLOWUP_UNDER_5,r.TREATMENT_FOLLOWUP_OVER_5],appliesIf:()=>!0,passesIf:()=>!0}),h({id:'protocol-error-count',icon:'danger-warning',appliesIf:()=>!1,goal:0}),p({id:'danger-signs-without-accompany',icon:'iccm-danger-sign',appliesIf:(e,t)=>'true'===i(t,'s_acc_danger_signs.has_danger_sign')&&'no'===i(t,'group_diagnosis.s_accompany_refer_CSCOM')}),p({id:'symptoms-of-malaria-without-tdr',icon:'malaria',appliesToType:[r.PATIENT_ASSESSMENT_UNDER_5,r.PATIENT_ASSESSMENT_OVER_5],appliesIf:(e,t)=>'true'===i(t,'s_malaria.has_mal_danger_sign')&&'no'===i(t,'s_malaria.s_malaria_tdr_done')&&'tdr_unavailable'!==i(t,'s_malaria.s_malaria_tdr_not_done')}),p({id:'fever-without-tdr',icon:'fever-danger-sign',appliesToType:[r.PATIENT_ASSESSMENT_UNDER_5,r.PATIENT_ASSESSMENT_OVER_5],appliesIf:(e,t)=>(i(t,'s_temperature.s_child_temperature_pre_chw')>37.5||i(t,'s_temperature.s_child_temperature_pre_chw_retake')>37.5)&&'no'===i(t,'s_malaria.s_malaria_tdr_done')&&'tdr_unavailable'!==i(t,'s_malaria.s_malaria_tdr_not_done')}),p({id:'incorrect-dosage-of-act-based-combination',icon:'malaria',appliesToType:[r.PATIENT_ASSESSMENT_UNDER_5,r.PATIENT_ASSESSMENT_OVER_5],appliesIf:(e,t)=>'yes'===i(t,'group_diagnosis.s_malaria_give_act')&&f(t,'group_diagnosis.s_malaria_act_dosage',[{highAge:36,correctDosage:'2_tablets_act'},{lowAge:37,highAge:84,correctDosage:'4_tablets_act'},{lowAge:85,highAge:144,correctDosage:'6_tablets_act'},{lowAge:145,correctDosage:'8_tablets_act'}])}),p({id:'diarrhea-without-zinc',icon:'medicine',appliesIf:(e,t)=>'yes'===i(t,'s_diarrhea.s_diarrhea_stools_a_day')&&'no'===i(t,'group_diagnosis.s_diarrhea_give_zinc')&&'out_of_stock'!==i(t,'group_diagnosis.s_diarrhea_not_give_zinc')}),p({id:'incorrect-dosage-of-zinc',icon:'medicine',appliesIf:(e,t)=>'yes'===i(t,'group_diagnosis.s_diarrhea_give_zinc')&&f(t,'group_diagnosis.s_diarrhea_zinc_dosage',[{highAge:1,correctDosage:''},{lowAge:2,highAge:5,correctDosage:'c_diarrhea_zinc_dosage_2'},{lowAge:6,highAge:60,correctDosage:'c_diarrhea_zinc_dosage_3'},{lowAge:61,correctDosage:''}])}),p({id:'pneumonia-without-amoxicillin',icon:'pneumonia',appliesIf:(e,t)=>'true'===i(t,'fast_breathing')&&'no'===i(t,'group_diagnosis.s_ari_give_amox')&&'out_of_stock'!==i(t,'group_diagnosis.s_ari_not_give_amox')}),p({id:'incorrect-dosage-of-amoxicillin',icon:'medicine',appliesIf:(e,t)=>'yes'===i(t,'group_diagnosis.s_ari_give_amox')&&f(t,'group_diagnosis.s_ari_give_amox_dosage',[{highAge:1,correctDosage:''},{lowAge:2,highAge:11,correctDosage:'5_ml_amox'},{lowAge:12,highAge:59,correctDosage:'10_ml_amox'},{lowAge:60,correctDosage:''}])}),p({id:'muac-yellow-incomplete-drugs',icon:'home-visit',appliesIf:(e,t)=>'true'===i(t,'treat_malnutrition')&&('yes'!==i(t,'group_diagnosis.s_nutri_give_enriched_flour')||'yes'!==i(t,'group_diagnosis.s_nutri_give_vitaminA')||'yes'!==i(t,'group_diagnosis.s_nutri_give_albendazole'))}),p({id:'incorrect-dosage-of-vitamin-a',icon:'medicine',appliesIf:(e,t)=>'yes'===i(t,'group_diagnosis.s_nutri_give_vitaminA')&&f(t,'group_diagnosis.s_nutri_give_vitaminA_dosage',[{highAge:5,correctDosage:''},{lowAge:6,highAge:11,correctDosage:'blue_capsule_vita'},{lowAge:12,correctDosage:'red_capsule_vita'}])}),p({id:'incorrect-dosage-of-albendazole',icon:'medicine',appliesIf:(e,t)=>'yes'===i(t,'group_diagnosis.s_nutri_give_albendazole')&&f(t,'group_diagnosis.s_nutri_give_albendazole_dosage',[{highAge:5,correctDosage:''},{lowAge:6,highAge:11,correctDosage:'200_mg_albendazole'},{lowAge:12,highAge:59,correctDosage:'400_mg_albendazole'},{lowAge:60,correctDosage:''}])}),p({id:'incorrect-dosage-of-paracetamol',icon:'medicine',appliesIf:(e,t)=>'yes'===i(t,'group_diagnosis.s_give_paracetamol')&&f(t,'group_diagnosis.s_give_paracetamol_dosage',[{highAge:1,correctDosage:''},{lowAge:2,highAge:11,correctDosage:'quarter_tab_paracetamol'},{lowAge:12,highAge:59,correctDosage:'half_tab_paracetamol'},{lowAge:60,highAge:143,correctDosage:'one_tab_paracetamol'},{lowAge:144,highAge:179,correctDosage:'half_tab_paracetamol'},{lowAge:180,correctDosage:'two_tab_paracetamol'}])}),_(['referral','treat_malaria','treat_ari'],1),_(['referral','treat_malaria','treat_ari'],2),_(['referral','treat_malaria','treat_ari'],3),_(['referral','treat_diarrhea','treat_ari'],5),p({id:'aggrevated-no-accompany',icon:'medicine',appliesToType:[r.TREATMENT_FOLLOWUP_UNDER_5,r.TREATMENT_FOLLOWUP_OVER_5],appliesIf:(e,t)=>'aggravated'===i(t,'s_disease_progression.s_how_disease_progressing')&&c(t)}),p({id:'unchanged-no-accompany',icon:'medicine',appliesToType:[r.TREATMENT_FOLLOWUP_UNDER_5,r.TREATMENT_FOLLOWUP_OVER_5],appliesIf:(e,t)=>'no_change'===i(t,'s_disease_progression.s_how_disease_progressing')&&c(t)&&i(t,'follow_up_count')>1}),p({id:'not-improved-3d-no-accompany',icon:'medicine',appliesToType:[r.TREATMENT_FOLLOWUP_UNDER_5,r.TREATMENT_FOLLOWUP_OVER_5],appliesIf:(e,t)=>['aggravated','no_change'].includes(i(t,'s_disease_progression.s_how_disease_progressing'))&&c(t)&&'3'===i(t,'follow_up_count')}),p({id:'not-improved-5d-no-accompany',icon:'medicine',appliesToType:[r.TREATMENT_FOLLOWUP_UNDER_5,r.TREATMENT_FOLLOWUP_OVER_5],appliesIf:(e,t)=>['aggravated','no_change'].includes(i(t,'s_disease_progression.s_how_disease_progressing'))&&c(t)&&'4'===i(t,'follow_up_count')})]},function(e,t,n){const{Forms:r,getField:i,getDynamicReportedDate:o,isAlive:a}=n(0),{ageInDays:s}=n(1),u={[r.PATIENT_ASSESSMENT_UNDER_5]:'treatment',[r.PATIENT_ASSESSMENT_OVER_5]:'treatment'},c=(e,t)=>t?o(t).toMillis():e.reported_date,l=e=>{const t=Object.assign({translation_key:'target.'+e.id,appliesTo:'reports',type:'count',goal:-1,context:'user.role === \"chw\"',date:c,idType:'report'},e);return t.appliesIf=function(t,n){const r=!t.contact||a(t),i=!!t.contact.muted,o=!e.appliesIf||e.appliesIf.bind(this)(t,n);return r&&!i&&o},['id','icon','translation_key','subtitle_translation_key','percentage_count_translation_key','context','type','goal','appliesTo','appliesToType','appliesIf','passesIf','date','idType','groupBy','passesIfGroupCount','emitCustom'].reduce((e,n)=>(e[n]=t[n],e),{})},d=e=>Object.assign(l(e),{appliesToType:[r.PATIENT_ASSESSMENT_UNDER_5],goal:0,emitCustom:(e,t,n,r)=>{e(t),e({_id:r._id+'~protocol-error-count',deleted:!1,contact:t.contact,type:'protocol-error-count',pass:t.pass,date:t.date}),e({_id:r._id+'~protocol-error-percentage',deleted:!1,contact:t.contact,type:'protocol-error-percentage',pass:!1,date:t.date})}},e);e.exports={didNotAccompanyPatientToCscom:e=>'no'===i(e,'group_diagnosis.s_accompany_refer_under5')||'no'===i(e,'group_diagnosis.s_accompany_refer_over5'),getFamilyIdForContact:e=>e.contact&&'clinic'===e.contact.type?e.contact._id:e.contact.parent&&e.contact.parent._id,hoursFromIllnessToAssessmentTemplate:(e,t)=>(e=>{const t=Object.assign(l(e),{icon:(n=e.form,u[n]),appliesToType:[e.form]});var n;return delete t.form,t})({id:`${e}-${t}h`,form:e,goal:65,type:'percent',appliesToType:[e],passesIf:(e,n)=>(e=>(({c_assessment_time_1:8,c_assessment_time_2:12,c_assessment_time_3:16,c_assessment_time_4:20}[i(e,'s_beginning_illness.s_assessment_time')]||20)+({c_when_illness_1:-8,c_when_illness_2:0,c_when_illness_3:6,c_when_illness_4:18,c_when_illness_5:30,c_when_illness_6:42,c_when_illness_7:60,c_when_illness_8:120}[i(e,'s_beginning_illness.s_when_illness')]||120)))(n)<=t,idType:'report'}),isDosageIncorrect:(e,t,n)=>{const r=parseInt(i(e,'patient_age_in_months')),o=i(e,t);if(!o)return!1;return n.some(e=>{return t=e.lowAge,n=e.highAge,(!t||r>=t)&&(!n||r<=n)&&o!==e.correctDosage;var t,n})},isPatient:e=>e&&'person'===e.type&&e.parent&&e.parent.parent&&e.parent.parent.parent,basicTemplate:l,errorProtocolTemplate:d,noFollowupTemplate:(e,t)=>d({id:`no-${24*t}h-follow-up`,icon:'followup',appliesToType:[r.PATIENT_ASSESSMENT_OVER_5,r.PATIENT_ASSESSMENT_UNDER_5],appliesIf:(n,a)=>s(o(a))>=t+1&&e.some(e=>'true'===i(a,e))&&!function(e,t,n){const a=o(t),s=e.reports.filter(e=>o(e)>a).filter(e=>!!t&&!!t._id&&i(e,'inputs.source_id')===t._id).filter(e=>!n||n(e));return{has_malnutrition_follow_up:()=>s.some(e=>e.form===r.MALNUTRITION_FOLLOWUP_UNDER_5),ages_of_followups:()=>new Set(s.filter(e=>[r.TREATMENT_FOLLOWUP_OVER_5,r.TREATMENT_FOLLOWUP_UNDER_5,r.REFERRAL_FOLLOWUP_OVER_5,r.REFERRAL_FOLLOWUP_UNDER_5].includes(e.form)).map(e=>{const n=o(e),r=o(t);return n.diff(r,'days').days}))}}(n,a).ages_of_followups().has(t)})}},function(e,t,n){var r=n(3);function i(e,t,n,r,i,o){var a;if(e.appliesToType){var s;if('contacts'===e.appliesTo){if(!i.contact)return;s='contact'===i.contact.type?i.contact.contact_type:i.contact.type}else{if(!o)return;s=o.form}if(-1===e.appliesToType.indexOf(s))return}if('scheduled_tasks'===e.appliesTo||!e.appliesIf||e.appliesIf(i,o))if('scheduled_tasks'===e.appliesTo){if(o&&e.appliesIf){if(!o.scheduled_tasks)return;for(a=0;a<o.scheduled_tasks.length;a++)e.appliesIf(i,o,a)&&c(a)}}else c();function u(e,t,n){var r;return(r='function'==typeof e.contactLabel?e.contactLabel(t,n):e.contactLabel)?{name:r}:t.contact}function c(a){var s,c,d,f,m=null;for(s=0;s<e.events.length;s++){if((c=e.events[s]).dueDate)m=c.dueDate(c,i,o,a);else if(o)m=void 0!==a?new Date(t.addDate(new Date(o.scheduled_tasks[a].due),c.days)):new Date(t.addDate(new Date(o.reported_date),c.days));else if(c.dueDate)m=c.dueDate(c,i);else{var h=i.contact&&i.contact.reported_date?new Date(i.contact.reported_date):new Date;m=new Date(t.addDate(h,c.days))}t.isTimely(m,c)&&(f={_id:(o?o._id:i.contact&&i.contact._id)+'~'+(c.id||s)+'~'+e.name,deleted:!(!(i.contact&&i.contact.deleted||o)||!o.deleted),doc:i,contact:u(e,i,o),icon:e.icon,date:m,readyStart:c.start||0,readyEnd:c.end||0,title:e.title,resolved:e.resolvedIf(i,o,c,m,a),actions:l(e.actions,c)},void 0!==a&&(f._id+='-'+a),'function'==typeof(d=e.priority)&&(d=d(i,o)),d&&(f.priority=d.level,f.priorityLabel=d.label),r('task',new n(f)))}}function l(t,n){return e.actions.map((function(e){return function(e,t){var n={source:'task',source_id:o?o._id:i.contact&&i.contact._id,contact:i.contact};e.modifyContent&&e.modifyContent(n,i,o,t);return{type:e.type||'report',form:e.form,label:e.label||'Follow up',content:n}}(e,n)}))}}e.exports=function(e,t,n,o,a){if(e)for(var s,u=0;u<e.length;++u)switch(s=e[u],r(s),s.appliesTo){case'reports':case'scheduled_tasks':for(var c=0;c<t.reports.length;++c)i(s,n,o,a,t,t.reports[c]);break;case'contacts':t.contact&&i(s,n,o,a,t);break;default:throw new Error('Unrecognised task.appliesTo: '+s.appliesTo)}}},function(e,t,n){var r=n(3);function i(e,t,n,r,i,o){var a=!!o;if(i.contact){var s='contact'===i.contact.type?i.contact.contact_type:i.contact.type,u=a?o.form:s;if(!(e.appliesToType&&e.appliesToType.indexOf(u)<0)&&(!e.appliesIf||e.appliesIf(i,o)))for(var c=a?o:i.contact,l=function(e,t,n){var r;return r='function'==typeof e.idType?e.idType(t,n):'report'===e.idType?n&&n._id:t.contact&&t.contact._id,Array.isArray(r)||(r=[r]),r}(e,i,o),d=!e.passesIf||!!e.passesIf(i,o),f=function(e,t,n,r){if('function'==typeof e.date)return e.date(n,r);if(void 0===e.date||'now'===e.date)return t.now().getTime();if('reported'===e.date)return r?r.reported_date:n.contact.reported_date;throw new Error('Unrecognised value for target.date: '+e.date)}(e,n,i,o),m=e.groupBy&&e.groupBy(i,o),h=0;h<l.length;++h){var p=new t({_id:l[h]+'~'+e.id,contact:i.contact,deleted:!!c.deleted,type:e.id,pass:d,groupBy:m,date:f});e.emitCustom?e.emitCustom(_,p,i,o):_(p)}}function _(e){r('target',e)}}e.exports=function(e,t,n,o,a){for(var s=0;s<e.length;++s){var u=e[s];switch(r(u),u.appliesTo){case'contacts':i(u,o,n,a,t);break;case'reports':for(var c=0;c<t.reports.length;++c){i(u,o,n,a,t,t.reports[c])}break;default:throw new Error('Unrecognised target.appliesTo: '+u.appliesTo)}}}}]); }\n}",
    "targets": {
      "enabled": true,
      "items": [
        {
          "id": "home_visits",
          "type": "count",
          "goal": -1,
          "translation_key": "target.home_visits",
          "icon": "home-visit",
          "context": "user.role === \"chw\""
        },
        {
          "id": "2-home-visits-per-fam",
          "type": "percent",
          "goal": 100,
          "translation_key": "target.2-home-visits-per-fam",
          "passesIfGroupCount": {
            "gte": 3
          },
          "icon": "home-visit",
          "context": "user.role === \"chw\""
        },
        {
          "id": "chv-receive-supervision-visit",
          "type": "percent",
          "goal": 100,
          "translation_key": "target.chv-receive-supervision-visit",
          "icon": "nurse",
          "context": "user.role === \"chw_supervisor\""
        },
        {
          "id": "patient_assessment-24h",
          "type": "percent",
          "goal": 65,
          "translation_key": "target.patient_assessment-24h",
          "icon": "treatment",
          "context": "user.role === \"chw\""
        },
        {
          "id": "patient_assessment_over_5-24h",
          "type": "percent",
          "goal": 65,
          "translation_key": "target.patient_assessment_over_5-24h",
          "icon": "treatment",
          "context": "user.role === \"chw\""
        },
        {
          "id": "preg-first-trimester",
          "type": "percent",
          "goal": 80,
          "translation_key": "target.preg-first-trimester",
          "icon": "pregnant",
          "context": "user.role === \"chw\""
        },
        {
          "id": "protocol-error-percentage",
          "type": "percent",
          "goal": 100,
          "translation_key": "target.protocol-error-percentage",
          "icon": "danger-warning",
          "context": "user.role === \"chw\""
        },
        {
          "id": "protocol-error-count",
          "type": "count",
          "goal": 0,
          "translation_key": "target.protocol-error-count",
          "icon": "danger-warning",
          "context": "user.role === \"chw\""
        },
        {
          "id": "danger-signs-without-accompany",
          "type": "count",
          "goal": 0,
          "translation_key": "target.danger-signs-without-accompany",
          "icon": "iccm-danger-sign",
          "context": "user.role === \"chw\""
        },
        {
          "id": "symptoms-of-malaria-without-tdr",
          "type": "count",
          "goal": 0,
          "translation_key": "target.symptoms-of-malaria-without-tdr",
          "icon": "malaria",
          "context": "user.role === \"chw\""
        },
        {
          "id": "fever-without-tdr",
          "type": "count",
          "goal": 0,
          "translation_key": "target.fever-without-tdr",
          "icon": "fever-danger-sign",
          "context": "user.role === \"chw\""
        },
        {
          "id": "incorrect-dosage-of-act-based-combination",
          "type": "count",
          "goal": 0,
          "translation_key": "target.incorrect-dosage-of-act-based-combination",
          "icon": "malaria",
          "context": "user.role === \"chw\""
        },
        {
          "id": "diarrhea-without-zinc",
          "type": "count",
          "goal": 0,
          "translation_key": "target.diarrhea-without-zinc",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "incorrect-dosage-of-zinc",
          "type": "count",
          "goal": 0,
          "translation_key": "target.incorrect-dosage-of-zinc",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "pneumonia-without-amoxicillin",
          "type": "count",
          "goal": 0,
          "translation_key": "target.pneumonia-without-amoxicillin",
          "icon": "pneumonia",
          "context": "user.role === \"chw\""
        },
        {
          "id": "incorrect-dosage-of-amoxicillin",
          "type": "count",
          "goal": 0,
          "translation_key": "target.incorrect-dosage-of-amoxicillin",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "muac-yellow-incomplete-drugs",
          "type": "count",
          "goal": 0,
          "translation_key": "target.muac-yellow-incomplete-drugs",
          "icon": "home-visit",
          "context": "user.role === \"chw\""
        },
        {
          "id": "incorrect-dosage-of-vitamin-a",
          "type": "count",
          "goal": 0,
          "translation_key": "target.incorrect-dosage-of-vitamin-a",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "incorrect-dosage-of-albendazole",
          "type": "count",
          "goal": 0,
          "translation_key": "target.incorrect-dosage-of-albendazole",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "incorrect-dosage-of-paracetamol",
          "type": "count",
          "goal": 0,
          "translation_key": "target.incorrect-dosage-of-paracetamol",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "no-24h-follow-up",
          "type": "count",
          "goal": 0,
          "translation_key": "target.no-24h-follow-up",
          "icon": "followup",
          "context": "user.role === \"chw\""
        },
        {
          "id": "no-48h-follow-up",
          "type": "count",
          "goal": 0,
          "translation_key": "target.no-48h-follow-up",
          "icon": "followup",
          "context": "user.role === \"chw\""
        },
        {
          "id": "no-72h-follow-up",
          "type": "count",
          "goal": 0,
          "translation_key": "target.no-72h-follow-up",
          "icon": "followup",
          "context": "user.role === \"chw\""
        },
        {
          "id": "no-120h-follow-up",
          "type": "count",
          "goal": 0,
          "translation_key": "target.no-120h-follow-up",
          "icon": "followup",
          "context": "user.role === \"chw\""
        },
        {
          "id": "aggrevated-no-accompany",
          "type": "count",
          "goal": 0,
          "translation_key": "target.aggrevated-no-accompany",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "unchanged-no-accompany",
          "type": "count",
          "goal": 0,
          "translation_key": "target.unchanged-no-accompany",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "not-improved-3d-no-accompany",
          "type": "count",
          "goal": 0,
          "translation_key": "target.not-improved-3d-no-accompany",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        },
        {
          "id": "not-improved-5d-no-accompany",
          "type": "count",
          "goal": 0,
          "translation_key": "target.not-improved-5d-no-accompany",
          "icon": "medicine",
          "context": "user.role === \"chw\""
        }
      ]
    }
  },
  "contact_summary": "var ContactSummary = {}; !function(e,t){if('object'==typeof exports&&'object'==typeof module)module.exports=t();else if('function'==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)('object'==typeof exports?exports:e)[o]=n[o]}}(ContactSummary,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(e,'__esModule',{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&'object'==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,'default',{enumerable:!0,value:e}),2&t&&'string'!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,'a',t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p='',n(n.s=1)}([function(e,t){const n={ANC_REALIZATION:'anc_followup',PNC_REALIZATION:'pnc_followup',SIMPLECARE_NEWBORN_FOLLOWUP:'newborn_followup',PNC_FOLLOWUP:'postnatal_followup',ANC_FOLLOWUP:'prenatal_followup',PREGNANCY_FAMILY_PLANNING:'pregnancy_family_planning',FAMILY_PLANNING_FOR_MEN:'family_planning_men',PATIENT_ASSESSMENT_UNDER_5:'patient_assessment',MALNUTRITION_FOLLOWUP_UNDER_5:'malnutrition_follow_up',TREATMENT_FOLLOWUP_UNDER_5:'treatment_followup',REFERRAL_FOLLOWUP_UNDER_5:'referral_followup_under_5',PATIENT_ASSESSMENT_OVER_5:'patient_assessment_over_5',TREATMENT_FOLLOWUP_OVER_5:'treatment_followup_over_5',REFERRAL_FOLLOWUP_OVER_5:'referral_followup',SUPERVISOR_CALENDAR:'supervision_calendar',SUPERVISOR_VISIT_REALIZATION:'supervision_visit_realization',SUPERVISOR_WITH_CHW_CONFIRMATION:'supervision_with_chw_confirmation',SUPERVISOR_WITHOUT_CHW_CONFIRMATION:'supervision_without_chw_confirmation',INDIVIDUAL_FEEDBACK_CONFIRMATION:'individual_feedback_confirmation'},o=(e,t)=>['fields',...(t||'').split('.')].reduce((t,n)=>void 0===t?e:t[n],e);e.exports={Forms:n,isReportHomeVisit:e=>!!e&&('home_visit'===e.form||e.form===n.PREGNANCY_FAMILY_PLANNING&&'during_home_visit'===o(e,'s_reg_mode.s_reg_how_found')||e.form===n.FAMILY_PLANNING_FOR_MEN&&'during_home_visit'===o(e,'s_reg_mode.s_reg_how_found')||e.form===n.PATIENT_ASSESSMENT_UNDER_5&&'home_visit'===o(e,'s_registration_mode.s_how_child_found')||e.form===n.PATIENT_ASSESSMENT_OVER_5&&'home_visit'===o(e,'s_registration_mode.s_how_child_found')),getField:o}},function(e,t,n){var o=n(2),i=n(4);e.exports=i(o,contact,reports)},function(e,t,n){const{isReportHomeVisit:o}=n(0),{isUhcEnabled:i,oldestHomeVisitTimestamp:r,numberOfDaysWithHomeVisits:a}=n(3),s={muted:'person'===contact.type&&lineage[0]&&!!lineage[0].muted,hh_contact:lineage[0]&&lineage[0].contact&&lineage[0].contact.name},l=[{appliesToType:'person',label:'contact.age',value:contact.date_of_birth,filter:'age',width:3},{appliesToType:'person',label:'Phone Number',value:contact.phone,filter:'phone',width:3},{appliesToType:'person',label:'contact.sex',value:contact.sex,translate:!0,width:3},{appliesToType:'person',label:'contact.external_id',value:contact.external_id,width:3},{appliesToType:'person',label:'contact.parent',value:lineage,filter:'lineage'},{appliesToType:'clinic',label:'contact.parent',value:lineage,filter:'lineage'}];if(i(lineage)){const e=reports.filter(o);l.push({appliesToType:'person',label:'contacts.results.sort.date.last.visited',value:r(e),filter:'simpleDate',translate:!0}),l.push({appliesToType:'person',appliesIf:()=>e.length>0,label:'contact.last.visit.current.month',value:a(e)})}e.exports={fields:l,cards:[],context:s}},function(e,t,n){const{getField:o}=n(0);e.exports={isUhcEnabled:()=>lineage[0]&&lineage[0].contact&&!!lineage[0].contact.is_uhc_enabled,oldestHomeVisitTimestamp:e=>e.reduce((e,t)=>Math.max(t.reported_date,e),-1),numberOfDaysWithHomeVisits:(e,t)=>{const{startDate:n,endDate:i}=((e=new Date)=>{const t=new Date(e);t.setHours(0,0,0,0);const n=new Date(e);return n.setHours(23,59,59,999),t.getDate()<26?t.setMonth(t.getMonth()-1):n.setMonth(n.getMonth()+1),t.setDate(26),t.setHours(0,-t.getTimezoneOffset()),n.setDate(25),n.setHours(0,-n.getTimezoneOffset()),{startDate:t,endDate:n}})(t),r=e.map(e=>{const t='home_visit'===e.form&&!!o(e,'submit_date.visit_date')&&'no'===o(e,'submit_date.c_choose_date');return new Date(t?o(e,'submit_date.visit_date'):parseInt(e.reported_date))}).filter(e=>e>=n&&e<=i).map(e=>e.getDate());return new Set(r).size}}},function(e,t){function n(e,t,n){if(e.appliesIf(n)){var o='function'==typeof e.fields?e.fields(n):e.fields.filter(function(e){switch(typeof e.appliesIf){case'undefined':return!0;case'function':return e.appliesIf(n);default:return e.appliesIf}}).map(function(e){var t={};return i(e,t,'label'),i(e,t,'value'),i(e,t,'translate'),i(e,t,'filter'),i(e,t,'width'),i(e,t,'icon'),e.context&&(t.context={},i(e.context,t.context,'count'),i(e.context,t.context,'total')),t});return e.modifyContext&&e.modifyContext(t,n),{label:e.label,fields:o}}function i(e,t,o){switch(typeof e[o]){case'undefined':return;case'function':t[o]=e[o](n);break;default:t[o]=e[o]}}}e.exports=function(e,t,o){var i=e.fields||[],r=e.context||{},a=e.cards||[],s={cards:[],fields:i.filter(function(e){if((e.appliesToType===t.type||'!'===e.appliesToType.charAt(0)&&e.appliesToType.slice(1)!==t.type)&&(!e.appliesIf||e.appliesIf()))return delete e.appliesToType,delete e.appliesIf,!0})};return a.forEach(function(e){var i,a,l,p;if('report'===e.appliesToType)for(i=0;i<o.length;++i)a=o[i],!(p=a)||p.errors&&p.errors.length||(l=n(e,r,a))&&s.cards.push(l);else{if(t.type!==e.appliesToType)return;(l=n(e,r))&&s.cards.push(l)}}),s.context=r,s}}])}); return ContactSummary;"
}