| Current Path : /var/www/homesaver/www/bitrix/updates/update_m1740165413/main/install/js/main/date/ |
| Current File : /var/www/homesaver/www/bitrix/updates/update_m1740165413/main/install/js/main/date/main.date.min.js |
this.BX=this.BX||{};(function(e,t){"use strict";function _(e){if(!t.Type.isStringFilled(e)){return""}return e.replace("YYYY","Y").replace("MMMM","F").replace("MM","m").replace("M","M").replace("DD","d").replace("G","g").replace(/GG/i,"G").replace("H","h").replace(/HH/i,"H").replace("MI","i").replace("SS","s").replace("TT","A").replace("T","a")}const r=new t.Cache.MemoryCache;function s(e){return r.remember(`main.date.format.${e}`,(()=>{let r=t.Extension.getSettings("main.date").get(`formats.${e}`);if(t.Type.isStringFilled(r)&&(e==="FORMAT_DATE"||e==="FORMAT_DATETIME")){r=_(r)}return r}))}let n=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"isAmPmMode",value:function e(t){if(t===true){return this._getMessage("AMPM_MODE")}return this._getMessage("AMPM_MODE")!==false}},{key:"convertToUTC",value:function e(_){if(!t.Type.isDate(_)){return null}return new Date(Date.UTC(_.getFullYear(),_.getMonth(),_.getDate(),_.getHours(),_.getMinutes(),_.getSeconds(),_.getMilliseconds()))}},{key:"getNewDate",value:function e(t){return new Date(this.getBrowserTimestamp(t))}},{key:"getBrowserTimestamp",value:function e(t){t=parseInt(t,10);const _=new Date(t*1e3).getTimezoneOffset()*60;return(parseInt(t,10)+parseInt(this._getMessage("SERVER_TZ_OFFSET"))+_)*1e3}},{key:"getServerTimestamp",value:function e(t){t=parseInt(t,10);const _=new Date(t).getTimezoneOffset()*60;return Math.round(t/1e3-(parseInt(this._getMessage("SERVER_TZ_OFFSET"),10)+parseInt(_,10)))}},{key:"formatLastActivityDate",value:function e(t,_,r){const s=this.isAmPmMode(true);const n=s===this.AM_PM_MODE.LOWER?"g:i a":s===this.AM_PM_MODE.UPPER?"g:i A":"H:i";const a=[["tomorrow","#01#"+n],["now","#02#"],["todayFuture","#03#"+n],["yesterday","#04#"+n],["-",this.convertBitrixFormat(this._getMessage("FORMAT_DATETIME")).replace(/:s/g,"")],["s60","sago"],["i60","iago"],["H5","Hago"],["H24","#03#"+n],["d31","dago"],["m12>1","mago"],["m12>0","dago"],["","#05#"]];let i=this.format(a,t,_,r);let o=null;if((o=/^#(\d+)#(.*)/.exec(i))!=null){switch(o[1]){case"01":i=this._getMessage("FD_LAST_SEEN_TOMORROW").replace("#TIME#",o[2]);break;case"02":i=this._getMessage("FD_LAST_SEEN_NOW");break;case"03":i=this._getMessage("FD_LAST_SEEN_TODAY").replace("#TIME#",o[2]);break;case"04":i=this._getMessage("FD_LAST_SEEN_YESTERDAY").replace("#TIME#",o[2]);break;case"05":i=this._getMessage("FD_LAST_SEEN_MORE_YEAR");break;default:i=o[2];break}}return i}},{key:"_getMessage",value:function e(_){return t.Loc.getMessage(_)}},{key:"parse",value:function e(_,r,s,n){if(t.Type.isStringFilled(_)){if(!s){s=this._getMessage("FORMAT_DATE")}if(!n){n=this._getMessage("FORMAT_DATETIME")}let e="";for(let t=1;t<=12;t++){e=e+"|"+this._getMessage("MON_"+t)}const t=new RegExp("([0-9]+|[a-z]+"+e+")","ig");const a=_.match(t);let i=s.match(/(DD|MI|MMMM|MM|M|YYYY)/gi);const o=[];const D=[];const M={};if(!a){return null}if(a.length>i.length){i=n.match(/(DD|MI|MMMM|MM|M|YYYY|HH|H|SS|TT|T|GG|G)/gi)}for(let e=0,t=a.length;e<t;e++){if(a[e].trim()!==""){o[o.length]=a[e]}}for(let e=0,t=i.length;e<t;e++){if(i[e].trim()!==""){D[D.length]=i[e]}}let O=D.findIndex((e=>e==="MMMM"));if(O>0){o[O]=this.getMonthIndex(o[O]);D[O]="MM"}else{O=D.findIndex((e=>e==="M"));if(O>0){o[O]=this.getMonthIndex(o[O]);D[O]="MM"}}for(let e=0,t=D.length;e<t;e++){const t=D[e].toUpperCase();M[t]=t==="T"||t==="TT"?o[e]:parseInt(o[e],10)}if(M["DD"]>0&&M["MM"]>0&&M["YYYY"]>0){const e=new Date;if(r){e.setUTCDate(1);e.setUTCFullYear(M["YYYY"]);e.setUTCMonth(M["MM"]-1);e.setUTCDate(M["DD"]);e.setUTCHours(0,0,0,0)}else{e.setDate(1);e.setFullYear(M["YYYY"]);e.setMonth(M["MM"]-1);e.setDate(M["DD"]);e.setHours(0,0,0,0)}if((!isNaN(M["HH"])||!isNaN(M["GG"])||!isNaN(M["H"])||!isNaN(M["G"]))&&!isNaN(M["MI"])){if(!isNaN(M["H"])||!isNaN(M["G"])){const e=(M["T"]||M["TT"]||"am").toUpperCase()==="PM",t=parseInt(M["H"]||M["G"]||0,10);if(e){M["HH"]=t+(t===12?0:12)}else{M["HH"]=t<12?t:0}}else{M["HH"]=parseInt(M["HH"]||M["GG"]||0,10)}if(isNaN(M["SS"])){M["SS"]=0}if(r){e.setUTCHours(M["HH"],M["MI"],M["SS"])}else{e.setHours(M["HH"],M["MI"],M["SS"])}}return e}}return null}},{key:"getMonthIndex",value:function e(t){const _=t.toUpperCase();const r=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];const s=["january","february","march","april","may","june","july","august","september","october","november","december"];for(let e=1;e<=12;e++){if(_===this._getMessage("MON_"+e).toUpperCase()||_===this._getMessage("MONTH_"+e).toUpperCase()||_===this._getMessage("MONTH_"+e+"_S").toUpperCase()||_===r[e-1].toUpperCase()||_===s[e-1].toUpperCase()){return e}}return t}},{key:"format",value:function e(_,r,s,n){const a=t.Type.isDate(r)?new Date(r.getTime()):t.Type.isNumber(r)?new Date(r*1e3):new Date;const i=t.Type.isDate(s)?new Date(s.getTime()):t.Type.isNumber(s)?new Date(s*1e3):new Date;const o=!!n;const D=this;if(t.Type.isArray(_)){return T(_,a,i,o)}else{if(!t.Type.isStringFilled(_)){return""}}const M=(_.match(/{{([^{}]*)}}/g)||[]).map((e=>(e.match(/[^{}]+/)||[""])[0]));if(M.length>0){M.forEach(((e,t)=>{_=_.replace("{{"+e+"}}","{{"+t+"}}")}))}const O=/\\?(sago|iago|isago|Hago|dago|mago|Yago|sdiff|idiff|Hdiff|ddiff|mdiff|Ydiff|sshort|ishort|Hshort|dshort|mhort|Yshort|yesterday|today|tommorow|tomorrow|[a-z])/gi;const u={d:()=>g(a).toString().padStart(2,"0"),D:()=>this._getMessage("DOW_"+h(a)),j:()=>g(a),l:()=>this._getMessage("DAY_OF_WEEK_"+h(a)),N:()=>h(a)||7,S:()=>{if(g(a)%10==1&&g(a)!=11){return"st"}else if(g(a)%10==2&&g(a)!=12){return"nd"}else if(g(a)%10==3&&g(a)!=13){return"rd"}else{return"th"}},w:()=>h(a),z:()=>{const e=new Date(c(a),0,1);const t=new Date(c(a),F(a),g(a));return Math.ceil((t-e)/(24*3600*1e3))},W:()=>{const e=new Date(a.getTime());const t=(h(a)+6)%7;A(e,g(e)-t+3);const _=e.getTime();H(e,0,1);if(h(e)!=4){H(e,0,1+(4-h(e)+7)%7)}const r=1+Math.ceil((_-e)/(7*24*3600*1e3));return r.toString().padStart(2,"0")},F:()=>this._getMessage("MONTH_"+(F(a)+1)+"_S"),f:()=>this._getMessage("MONTH_"+(F(a)+1)),m:()=>(F(a)+1).toString().padStart(2,"0"),M:()=>this._getMessage("MON_"+(F(a)+1)),n:()=>F(a)+1,t:()=>{const e=o?new Date(Date.UTC(c(a),F(a)+1,0)):new Date(c(a),F(a)+1,0);return g(e)},L:()=>{const e=c(a);return e%4==0&&e%100!=0||e%400==0?1:0},o:()=>{const e=new Date(a.getTime());A(e,g(e)-(h(a)+6)%7+3);return c(e)},Y:()=>c(a),y:()=>c(a).toString().slice(2),a:()=>E(a)>11?"pm":"am",A:()=>E(a)>11?"PM":"AM",B:()=>{const e=(a.getUTCHours()+1)%24+a.getUTCMinutes()/60+a.getUTCSeconds()/3600;return Math.floor(e*1e3/24).toString().padStart(3,"0")},g:()=>E(a)%12||12,G:()=>E(a),h:()=>(E(a)%12||12).toString().padStart(2,"0"),H:()=>E(a).toString().padStart(2,"0"),i:()=>R(a).toString().padStart(2,"0"),s:()=>m(a).toString().padStart(2,"0"),u:()=>(S(a)*1e3).toString().padStart(6,"0"),e:()=>{if(o){return"UTC"}return""},I:()=>{if(o){return 0}const e=new Date(c(a),0,1);const t=Date.UTC(c(a),0,1);const _=new Date(c(a),6,0);const r=Date.UTC(c(a),6,0);return 0+(e-t!==_-r)},O:()=>{if(o){return"+0000"}const e=a.getTimezoneOffset();const t=Math.abs(e);return(e>0?"-":"+")+(Math.floor(t/60)*100+t%60).toString().padStart(4,"0")},P:function(){if(o){return"+00:00"}const e=this.O();return e.substr(0,3)+":"+e.substr(3)},Z:()=>{if(o){return 0}return-a.getTimezoneOffset()*60},c:()=>"Y-m-d\\TH:i:sP".replace(O,d),r:()=>"D, d M Y H:i:s O".replace(O,d),U:()=>Math.floor(a.getTime()/1e3),sago:()=>p(U((i-a)/1e3),{0:"FD_SECOND_AGO_0",1:"FD_SECOND_AGO_1","10_20":"FD_SECOND_AGO_10_20",MOD_1:"FD_SECOND_AGO_MOD_1",MOD_2_4:"FD_SECOND_AGO_MOD_2_4",MOD_OTHER:"FD_SECOND_AGO_MOD_OTHER"}),sdiff:()=>p(U((i-a)/1e3),{0:"FD_SECOND_DIFF_0",1:"FD_SECOND_DIFF_1","10_20":"FD_SECOND_DIFF_10_20",MOD_1:"FD_SECOND_DIFF_MOD_1",MOD_2_4:"FD_SECOND_DIFF_MOD_2_4",MOD_OTHER:"FD_SECOND_DIFF_MOD_OTHER"}),sshort:()=>this._getMessage("FD_SECOND_SHORT").replace(/#VALUE#/g,U((i-a)/1e3)),iago:()=>p(U((i-a)/60/1e3),{0:"FD_MINUTE_AGO_0",1:"FD_MINUTE_AGO_1","10_20":"FD_MINUTE_AGO_10_20",MOD_1:"FD_MINUTE_AGO_MOD_1",MOD_2_4:"FD_MINUTE_AGO_MOD_2_4",MOD_OTHER:"FD_MINUTE_AGO_MOD_OTHER"}),idiff:()=>p(U((i-a)/60/1e3),{0:"FD_MINUTE_DIFF_0",1:"FD_MINUTE_DIFF_1","10_20":"FD_MINUTE_DIFF_10_20",MOD_1:"FD_MINUTE_DIFF_MOD_1",MOD_2_4:"FD_MINUTE_DIFF_MOD_2_4",MOD_OTHER:"FD_MINUTE_DIFF_MOD_OTHER"}),isago:()=>{const e=U((i-a)/60/1e3);let t=p(e,{0:"FD_MINUTE_0",1:"FD_MINUTE_1","10_20":"FD_MINUTE_10_20",MOD_1:"FD_MINUTE_MOD_1",MOD_2_4:"FD_MINUTE_MOD_2_4",MOD_OTHER:"FD_MINUTE_MOD_OTHER"});t+=" ";const _=U((i-a)/1e3)-e*60;t+=p(_,{0:"FD_SECOND_AGO_0",1:"FD_SECOND_AGO_1","10_20":"FD_SECOND_AGO_10_20",MOD_1:"FD_SECOND_AGO_MOD_1",MOD_2_4:"FD_SECOND_AGO_MOD_2_4",MOD_OTHER:"FD_SECOND_AGO_MOD_OTHER"});return t},ishort:()=>this._getMessage("FD_MINUTE_SHORT").replace(/#VALUE#/g,U((i-a)/60/1e3)),Hago:()=>p(U((i-a)/60/60/1e3),{0:"FD_HOUR_AGO_0",1:"FD_HOUR_AGO_1","10_20":"FD_HOUR_AGO_10_20",MOD_1:"FD_HOUR_AGO_MOD_1",MOD_2_4:"FD_HOUR_AGO_MOD_2_4",MOD_OTHER:"FD_HOUR_AGO_MOD_OTHER"}),Hdiff:()=>p(U((i-a)/60/60/1e3),{0:"FD_HOUR_DIFF_0",1:"FD_HOUR_DIFF_1","10_20":"FD_HOUR_DIFF_10_20",MOD_1:"FD_HOUR_DIFF_MOD_1",MOD_2_4:"FD_HOUR_DIFF_MOD_2_4",MOD_OTHER:"FD_HOUR_DIFF_MOD_OTHER"}),Hshort:()=>this._getMessage("FD_HOUR_SHORT").replace(/#VALUE#/g,U((i-a)/60/60/1e3)),yesterday:()=>this._getMessage("FD_YESTERDAY"),today:()=>this._getMessage("FD_TODAY"),tommorow:()=>this._getMessage("FD_TOMORROW"),tomorrow:()=>this._getMessage("FD_TOMORROW"),dago:()=>p(U((i-a)/60/60/24/1e3),{0:"FD_DAY_AGO_0",1:"FD_DAY_AGO_1","10_20":"FD_DAY_AGO_10_20",MOD_1:"FD_DAY_AGO_MOD_1",MOD_2_4:"FD_DAY_AGO_MOD_2_4",MOD_OTHER:"FD_DAY_AGO_MOD_OTHER"}),ddiff:()=>p(U((i-a)/60/60/24/1e3),{0:"FD_DAY_DIFF_0",1:"FD_DAY_DIFF_1","10_20":"FD_DAY_DIFF_10_20",MOD_1:"FD_DAY_DIFF_MOD_1",MOD_2_4:"FD_DAY_DIFF_MOD_2_4",MOD_OTHER:"FD_DAY_DIFF_MOD_OTHER"}),dshort:()=>this._getMessage("FD_DAY_SHORT").replace(/#VALUE#/g,U((i-a)/60/60/24/1e3)),mago:()=>p(U((i-a)/60/60/24/31/1e3),{0:"FD_MONTH_AGO_0",1:"FD_MONTH_AGO_1","10_20":"FD_MONTH_AGO_10_20",MOD_1:"FD_MONTH_AGO_MOD_1",MOD_2_4:"FD_MONTH_AGO_MOD_2_4",MOD_OTHER:"FD_MONTH_AGO_MOD_OTHER"}),mdiff:()=>p(U((i-a)/60/60/24/31/1e3),{0:"FD_MONTH_DIFF_0",1:"FD_MONTH_DIFF_1","10_20":"FD_MONTH_DIFF_10_20",MOD_1:"FD_MONTH_DIFF_MOD_1",MOD_2_4:"FD_MONTH_DIFF_MOD_2_4",MOD_OTHER:"FD_MONTH_DIFF_MOD_OTHER"}),mshort:()=>this._getMessage("FD_MONTH_SHORT").replace(/#VALUE#/g,U((i-a)/60/60/24/31/1e3)),Yago:()=>p(U((i-a)/60/60/24/365/1e3),{0:"FD_YEARS_AGO_0",1:"FD_YEARS_AGO_1","10_20":"FD_YEARS_AGO_10_20",MOD_1:"FD_YEARS_AGO_MOD_1",MOD_2_4:"FD_YEARS_AGO_MOD_2_4",MOD_OTHER:"FD_YEARS_AGO_MOD_OTHER"}),Ydiff:()=>p(U((i-a)/60/60/24/365/1e3),{0:"FD_YEARS_DIFF_0",1:"FD_YEARS_DIFF_1","10_20":"FD_YEARS_DIFF_10_20",MOD_1:"FD_YEARS_DIFF_MOD_1",MOD_2_4:"FD_YEARS_DIFF_MOD_2_4",MOD_OTHER:"FD_YEARS_DIFF_MOD_OTHER"}),Yshort:()=>p(U((i-a)/60/60/24/365/1e3),{0:"FD_YEARS_SHORT_0",1:"FD_YEARS_SHORT_1","10_20":"FD_YEARS_SHORT_10_20",MOD_1:"FD_YEARS_SHORT_MOD_1",MOD_2_4:"FD_YEARS_SHORT_MOD_2_4",MOD_OTHER:"FD_YEARS_SHORT_MOD_OTHER"}),x:()=>{const e=this.isAmPmMode(true);const t=e===this.AM_PM_MODE.LOWER?"g:i a":e===this.AM_PM_MODE.UPPER?"g:i A":"H:i";return this.format([["tomorrow","tomorrow, "+t],["-",this.convertBitrixFormat(this._getMessage("FORMAT_DATETIME")).replace(/:s/g,"")],["s","sago"],["i","iago"],["today","today, "+t],["yesterday","yesterday, "+t],["",this.convertBitrixFormat(this._getMessage("FORMAT_DATETIME")).replace(/:s/g,"")]],a,i,o)},X:()=>{const e=this.isAmPmMode(true);const t=e===this.AM_PM_MODE.LOWER?"g:i a":e===this.AM_PM_MODE.UPPER?"g:i A":"H:i";const _=this.format([["tomorrow","tomorrow"],["-",this.convertBitrixFormat(this._getMessage("FORMAT_DATE"))],["today","today"],["yesterday","yesterday"],["",this.convertBitrixFormat(this._getMessage("FORMAT_DATE"))]],a,i,o);const r=this.format([["tomorrow",t],["today",t],["yesterday",t],["",""]],a,i,o);if(r.length>0){return this._getMessage("FD_DAY_AT_TIME").replace(/#DAY#/g,_).replace(/#TIME#/g,r)}else{return _}},Q:()=>{const e=U((i-a)/60/60/24/1e3);if(e==0){return this._getMessage("FD_DAY_DIFF_1").replace(/#VALUE#/g,1)}else{return this.format([["d","ddiff"],["m","mdiff"],["","Ydiff"]],a,i)}}};let f=false;if(_[0]&&_[0]=="^"){f=true;_=_.substr(1)}let l=_.replace(O,d);if(f){l=l.replace(/\s*00:00:00\s*/g,"").replace(/(\d\d:\d\d)(:00)/g,"$1").replace(/(\s*00:00\s*)(?!:)/g,"")}if(M.length>0){M.forEach((function(e,t){l=l.replace("{{"+t+"}}",e)}))}return l;function T(e,t,_,r){const s=U((_-t)/1e3);for(let n=0;n<e.length;n++){const a=e[n][0];const i=e[n][1];let o=null;if(a=="s"){if(s<60){return D.format(i,t,_,r)}}else if((o=/^s(\d+)\>?(\d+)?/.exec(a))!=null){if(o[1]&&o[2]){if(s<o[1]&&s>o[2]){return D.format(i,t,_,r)}}else if(s<o[1]){return D.format(i,t,_,r)}}else if(a=="i"){if(s<60*60){return D.format(i,t,_,r)}}else if((o=/^i(\d+)\>?(\d+)?/.exec(a))!=null){if(o[1]&&o[2]){if(s<o[1]*60&&s>o[2]*60){return D.format(i,t,_,r)}}else if(s<o[1]*60){return D.format(i,t,_,r)}}else if(a=="H"){if(s<24*60*60){return D.format(i,t,_,r)}}else if((o=/^H(\d+)\>?(\d+)?/.exec(a))!=null){if(o[1]&&o[2]){if(s<o[1]*60*60&&s>o[2]*60*60){return D.format(i,t,_,r)}}else if(s<o[1]*60*60){return D.format(i,t,_,r)}}else if(a=="d"){if(s<31*24*60*60){return D.format(i,t,_,r)}}else if((o=/^d(\d+)\>?(\d+)?/.exec(a))!=null){if(o[1]&&o[2]){if(s<o[1]*24*60*60&&s>o[2]*24*60*60){return D.format(i,t,_,r)}}else if(s<o[1]*24*60*60){return D.format(i,t,_,r)}}else if(a=="m"){if(s<365*24*60*60){return D.format(i,t,_,r)}}else if((o=/^m(\d+)\>?(\d+)?/.exec(a))!=null){if(o[1]&&o[2]){if(s<o[1]*31*24*60*60&&s>o[2]*31*24*60*60){return D.format(i,t,_,r)}}else if(s<o[1]*31*24*60*60){return D.format(i,t,_,r)}}else if(a=="now"){if(t.getTime()==_.getTime()){return D.format(i,t,_,r)}}else if(a=="today"){const e=c(_);const s=F(_);const n=g(_);const a=r?new Date(Date.UTC(e,s,n,0,0,0,0)):new Date(e,s,n,0,0,0,0);const o=r?new Date(Date.UTC(e,s,n+1,0,0,0,0)):new Date(e,s,n+1,0,0,0,0);if(t>=a&&t<o){return D.format(i,t,_,r)}}else if(a=="todayFuture"){const e=c(_);const s=F(_);const n=g(_);const a=_.getTime();const o=r?new Date(Date.UTC(e,s,n+1,0,0,0,0)):new Date(e,s,n+1,0,0,0,0);if(t>=a&&t<o){return D.format(i,t,_,r)}}else if(a=="yesterday"){const e=c(_);const s=F(_);const n=g(_);const a=r?new Date(Date.UTC(e,s,n-1,0,0,0,0)):new Date(e,s,n-1,0,0,0,0);const o=r?new Date(Date.UTC(e,s,n,0,0,0,0)):new Date(e,s,n,0,0,0,0);if(t>=a&&t<o){return D.format(i,t,_,r)}}else if(a=="tommorow"||a=="tomorrow"){const e=c(_);const s=F(_);const n=g(_);const a=r?new Date(Date.UTC(e,s,n+1,0,0,0,0)):new Date(e,s,n+1,0,0,0,0);const o=r?new Date(Date.UTC(e,s,n+2,0,0,0,0)):new Date(e,s,n+2,0,0,0,0);if(t>=a&&t<o){return D.format(i,t,_,r)}}else if(a=="-"){if(s<0){return D.format(i,t,_,r)}}}return e.length>0?D.format(e[e.length-1][1],t,_,r):""}function c(e){return o?e.getUTCFullYear():e.getFullYear()}function g(e){return o?e.getUTCDate():e.getDate()}function F(e){return o?e.getUTCMonth():e.getMonth()}function E(e){return o?e.getUTCHours():e.getHours()}function R(e){return o?e.getUTCMinutes():e.getMinutes()}function m(e){return o?e.getUTCSeconds():e.getSeconds()}function S(e){return o?e.getUTCMilliseconds():e.getMilliseconds()}function h(e){return o?e.getUTCDay():e.getDay()}function A(e,t){return o?e.setUTCDate(t):e.setDate(t)}function H(e,t,_){return o?e.setUTCMonth(t,_):e.setMonth(t,_)}function p(e,t){const _=e<100?Math.abs(e):Math.abs(e%100);const r=_%10;let s="";if(_==0){s=D._getMessage(t["0"])}else if(_==1){s=D._getMessage(t["1"])}else if(_>=10&&_<=20){s=D._getMessage(t["10_20"])}else if(r==1){s=D._getMessage(t["MOD_1"])}else if(2<=r&&r<=4){s=D._getMessage(t["MOD_2_4"])}else{s=D._getMessage(t["MOD_OTHER"])}return s.replace(/#VALUE#/g,e)}function d(e,t){if(u[e]){return u[e]()}else{return t}}function U(e){return e>=0?Math.floor(e):Math.ceil(e)}}}]);return e}();babelHelpers.defineProperty(n,"AM_PM_MODE",{UPPER:1,LOWER:2,NONE:false});babelHelpers.defineProperty(n,"convertBitrixFormat",_);babelHelpers.defineProperty(n,"getFormat",s);const a=new t.Cache.MemoryCache;const i={get SERVER_TO_UTC(){return a.remember("SERVER_TO_UTC",(()=>t.Text.toInteger(t.Loc.getMessage("SERVER_TZ_OFFSET"))))},get USER_TO_SERVER(){return a.remember("USER_TO_SERVER",(()=>t.Text.toInteger(t.Loc.getMessage("USER_TZ_OFFSET"))))},get BROWSER_TO_UTC(){return a.remember("BROWSER_TO_UTC",(()=>{const e=t.Text.toInteger((new Date).getTimezoneOffset()*60);return-e}))}};Object.freeze(i);function o(e){if(t.Type.isDate(e)){return M(e)}return t.Text.toInteger(e)}function D(e){return new Date(e*1e3)}function M(e){return Math.floor(e.getTime()/1e3)}let O=i;let u=null;function f(){return O}function l(){var e;return(e=u)!==null&&e!==void 0?e:M(new Date)}let T=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"getDate",value:function e(_=null){const r=t.Type.isNumber(_)?_:this.getTimestamp();return D(r)}},{key:"toUserDate",value:function e(t){return D(this.toUser(t))}},{key:"toServerDate",value:function e(t){return D(this.toServer(t))}},{key:"toUser",value:function e(t){return this.toServer(t)+f().USER_TO_SERVER}},{key:"toServer",value:function e(t){return o(t)-f().BROWSER_TO_UTC+f().SERVER_TO_UTC}},{key:"getTimestamp",value:function e(){return l()}}]);return e}();let c=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"getDate",value:function e(_=null){if(t.Type.isNumber(_)){const e=f().SERVER_TO_UTC-f().BROWSER_TO_UTC;return D(_+e)}return T.toServerDate(T.getDate())}},{key:"toUserDate",value:function e(t){return D(this.toUser(t))}},{key:"toBrowserDate",value:function e(t){return D(this.toBrowser(t))}},{key:"toUser",value:function e(t){return o(t)+f().USER_TO_SERVER}},{key:"toBrowser",value:function e(t){return o(t)+f().BROWSER_TO_UTC-f().SERVER_TO_UTC}},{key:"getTimestamp",value:function e(){return T.toServer(T.getTimestamp())}}]);return e}();function g(e,t,_){E(e,t);F(_,"get");return R(e,_)}function F(e,t){if(e===undefined){throw new TypeError("attempted to "+t+" private static field before its declaration")}}function E(e,t){if(e!==t){throw new TypeError("Private static access of wrong provenance")}}function R(e,t){if(t.get){return t.get.call(e)}return t.value}let m=function(){function e(){babelHelpers.classCallCheck(this,e)}babelHelpers.createClass(e,null,[{key:"getDate",value:function _(r=null){if(t.Type.isNumber(r)){return D(r+g(this,e,h))}return D(this.getTimestamp())}},{key:"toBrowserDate",value:function e(t){return D(this.toBrowser(t))}},{key:"toServerDate",value:function e(t){return D(this.toServer(t))}},{key:"toUTCTimestamp",value:function t(_){return o(_)-g(this,e,h)}},{key:"toBrowser",value:function e(t){return o(t)+f().BROWSER_TO_UTC-f().SERVER_TO_UTC-f().USER_TO_SERVER}},{key:"toServer",value:function e(t){return o(t)-f().USER_TO_SERVER}},{key:"getTimestamp",value:function e(){return T.toUser(T.getTimestamp())}}]);return e}();function S(){const e=f().SERVER_TO_UTC+f().USER_TO_SERVER;return e-f().BROWSER_TO_UTC}var h={get:S,set:void 0};const A=n;const H=Object.freeze({Offset:i,BrowserTime:T,UserTime:m,ServerTime:c});e.DateTimeFormat=n;e.Date=A;e.Timezone=H})(this.BX.Main=this.BX.Main||{},BX);
//# sourceMappingURL=main.date.map.js