PageSourceSearch

https://www.nespresso.com/_ui/generated/crema/vendor.intl-relativeformat.5177ce3ca28d30ab0d43.js

js nespresso.com collected 2026-09-24 08:27:28 UTC 11,442 bytes, 1 lines download raw bytes

1(window.webpackJsonpCrema=window.webpackJsonpCrema||[]).push([[57],{278:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core_1=__webpack_require__(279),en_1=__webpack_require__(282);core_1.default.__addLocaleData(en_1.default),core_1.default.defaultLocale="en",exports.default=core_1.default},279:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var intl_messageformat_1=__webpack_require__(41),diff_1=__webpack_require__(280),es5_1=__webpack_require__(281);exports.default=RelativeFormat;var FIELDS=["second","second-short","minute","minute-short","hour","hour-short","day","day-short","month","month-short","year","year-short"],STYLES=["best fit","numeric"];function RelativeFormat(locales,options){options=options||{},es5_1.isArray(locales)&&(locales=locales.concat()),es5_1.defineProperty(this,"_locale",{value:this._resolveLocale(locales)}),es5_1.defineProperty(this,"_options",{value:{style:this._resolveStyle(options.style),units:this._isValidUnits(options.units)&&options.units}}),es5_1.defineProperty(this,"_locales",{value:locales}),es5_1.defineProperty(this,"_fields",{value:this._findFields(this._locale)}),es5_1.defineProperty(this,"_messages",{value:es5_1.objCreate(null)});var relativeFormat=this;this.format=function(date,options){return relativeFormat._format(date,options)}}es5_1.defineProperty(RelativeFormat,"__localeData__",{value:es5_1.objCreate(null)}),es5_1.defineProperty(RelativeFormat,"__addLocaleData",{value:function(){for(var i=0;i<arguments.length;i++){var datum=arguments[i];if(!datum||!datum.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");RelativeFormat.__localeData__[datum.locale.toLowerCase()]=datum,intl_messageformat_1.default.__addLocaleData(datum)}}}),es5_1.defineProperty(RelativeFormat,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),es5_1.defineProperty(RelativeFormat,"thresholds",{enumerable:!0,value:{second:45,"second-short":45,minute:45,"minute-short":45,hour:22,"hour-short":22,day:26,"day-short":26,month:11,"month-short":11}}),RelativeFormat.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},RelativeFormat.prototype._compileMessage=function(units){var i,locales=this._locales,relativeTime=(this._locale,this._fields[units].relativeTime),future="",past="";for(i in relativeTime.future)relativeTime.future.hasOwnProperty(i)&&(future+=" "+i+" {"+relativeTime.future[i].replace("{0}","#")+"}");for(i in relativeTime.past)relativeTime.past.hasOwnProperty(i)&&(past+=" "+i+" {"+relativeTime.past[i].replace("{0}","#")+"}");var message="{when, select, future {{0, plural, "+future+"}}past {{0, plural, "+past+"}}}";return new intl_messageformat_1.default(message,locales)},RelativeFormat.prototype._getMessage=function(units){var messages=this._messages;return messages[units]||(messages[units]=this._compileMessage(units)),messages[units]},RelativeFormat.prototype._getRelativeUnits=function(diff,units){var field=this._fields[units];if(field.relative)return field.relative[diff]},RelativeFormat.prototype._findFields=function(locale){for(var localeData=RelativeFormat.__localeData__,data=localeData[locale.toLowerCase()];data;){if(data.fields)return data.fields;data=data.parentLocale&&localeData[data.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlRelativeFormat is missing `fields` for :"+locale)},RelativeFormat.prototype._format=function(date,options){var now=options&&void 0!==options.now?options.now:es5_1.dateNow();if(void 0===date&&(date=now),!isFinite(now))throw new RangeError("The `now` option provided to IntlRelativeFormat#format() is not in valid range.");if(!isFinite(date))throw new RangeError("The date value provided to IntlRelativeFormat#format() is not in valid range.");var diffReport=diff_1.default(now,date),units=this._options.units||this._selectUnits(diffReport),diffInUnits=diffReport[units];if("numeric"!==this._options.style){var relativeUnits=this._getRelativeUnits(diffInUnits,units);if(relativeUnits)return relativeUnits}return this._getMessage(units).format({0:Math.abs(diffInUnits),when:diffInUnits<0?"past":"future"})},RelativeFormat.prototype._isValidUnits=function(units){if(!units||es5_1.arrIndexOf.call(FIELDS,units)>=0)return!0;
1if("string"==typeof units){var suggestion=/s$/.test(units)&&units.substr(0,units.length-1);if(suggestion&&es5_1.arrIndexOf.call(FIELDS,suggestion)>=0)throw new Error('"'+units+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+suggestion)}throw new Error('"'+units+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+FIELDS.join('", "')+'"')},RelativeFormat.prototype._resolveLocale=function(locales){"string"==typeof locales&&(locales=[locales]),locales=(locales||[]).concat(RelativeFormat.defaultLocale);var i,len,localeParts,data,localeData=RelativeFormat.__localeData__;for(i=0,len=locales.length;i<len;i+=1)for(localeParts=locales[i].toLowerCase().split("-");localeParts.length;){if(data=localeData[localeParts.join("-")])return data.locale;localeParts.pop()}var defaultLocale=locales.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+locales.join(", ")+", or the default locale: "+defaultLocale)},RelativeFormat.prototype._resolveStyle=function(style){if(!style)return STYLES[0];if(es5_1.arrIndexOf.call(STYLES,style)>=0)return style;throw new Error('"'+style+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+STYLES.join('", "')+'"')},RelativeFormat.prototype._selectUnits=function(diffReport){var i,l,units,fields=FIELDS.filter(function(field){return field.indexOf("-short")<1});for(i=0,l=fields.length;i<l&&(units=fields[i],!(Math.abs(diffReport[units])<RelativeFormat.thresholds[units]));i+=1);return units}},280:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var round=Math.round;function startOfDay(dirtyDate){var date=new Date(dirtyDate);return date.setHours(0,0,0,0),date}exports.default=function(from,to){var dirtyDateRight,startOfDayLeft,startOfDayRight,timestampLeft,timestampRight,millisecond=round((to=+to)-(from=+from)),second=round(millisecond/1e3),minute=round(second/60),hour=round(minute/60),day=(dirtyDateRight=from,startOfDayLeft=startOfDay(to),startOfDayRight=startOfDay(dirtyDateRight),timestampLeft=startOfDayLeft.getTime()-6e4*startOfDayLeft.getTimezoneOffset(),timestampRight=startOfDayRight.getTime()-6e4*startOfDayRight.getTimezoneOffset(),Math.round((timestampLeft-timestampRight)/864e5)),week=round(day/7),rawYears=400*day/146097,month=round(12*rawYears),year=round(rawYears);return{millisecond:millisecond,second:second,"second-short":second,minute:minute,"minute-short":minute,hour:hour,"hour-short":hour,day:day,"day-short":day,week:week,"week-short":week,month:month,"month-short":month,year:year,"year-short":year}}},281:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var hop=Object.prototype.hasOwnProperty,toString=Object.prototype.toString,realDefineProp=function(){try{return!!Object.defineProperty({},"a",{})}catch(e){return!1}}(),defineProperty=(!realDefineProp&&Object.prototype.__defineGetter__,realDefineProp?Object.defineProperty:function(obj,name,desc){"get"in desc&&obj.__defineGetter__?obj.__defineGetter__(name,desc.get):hop.call(obj,name)&&!("value"in desc)||(obj[name]=desc.value)});exports.defineProperty=defineProperty;var objCreate=Object.create||function(proto,props){var obj,k;function F(){}for(k in F.prototype=proto,obj=new F,props)hop.call(props,k)&&defineProperty(obj,k,props[k]);return obj};exports.objCreate=objCreate;var arrIndexOf=Array.prototype.indexOf||function(search,fromIndex){if(!this.length)return-1;for(var i=fromIndex||0,max=this.length;i<max;i++)if(this[i]===search)return i;return-1};exports.arrIndexOf=arrIndexOf;var isArray=Array.isArray||function(obj){return"[object Array]"===toString.call(obj)};exports.isArray=isArray;var dateNow=Date.now||function(){return(new Date).getTime()};exports.dateNow=dateNow},282:function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={locale:"en",pluralRuleFunction:function(n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);return ord?1==n10&&11!=n100?"one":2==n10&&12!=n100?"two":3==n10&&
113!=n100?"few":"other":1==n&&v0?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},"year-short":{displayName:"yr.",relative:{0:"this yr.",1:"next yr.","-1":"last yr."},relativeTime:{future:{one:"in {0} yr.",other:"in {0} yr."},past:{one:"{0} yr. ago",other:"{0} yr. ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},"month-short":{displayName:"mo.",relative:{0:"this mo.",1:"next mo.","-1":"last mo."},relativeTime:{future:{one:"in {0} mo.",other:"in {0} mo."},past:{one:"{0} mo. ago",other:"{0} mo. ago"}}},week:{displayName:"week",relativePeriod:"the week of {0}",relative:{0:"this week",1:"next week","-1":"last week"},relativeTime:{future:{one:"in {0} week",other:"in {0} weeks"},past:{one:"{0} week ago",other:"{0} weeks ago"}}},"week-short":{displayName:"wk.",relativePeriod:"the week of {0}",relative:{0:"this wk.",1:"next wk.","-1":"last wk."},relativeTime:{future:{one:"in {0} wk.",other:"in {0} wk."},past:{one:"{0} wk. ago",other:"{0} wk. ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},"day-short":{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},"hour-short":{displayName:"hr.",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hr.",other:"in {0} hr."},past:{one:"{0} hr. ago",other:"{0} hr. ago"}}},minute:{displayName:"minute",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},"minute-short":{displayName:"min.",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} min.",other:"in {0} min."},past:{one:"{0} min. ago",other:"{0} min. ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}},"second-short":{displayName:"sec.",relative:{0:"now"},relativeTime:{future:{one:"in {0} sec.",other:"in {0} sec."},past:{one:"{0} sec. ago",other:"{0} sec. ago"}}}}}},54:function(module,exports,__webpack_require__){"use strict";var IntlRelativeFormat=__webpack_require__(278).default;__webpack_require__(283),(exports=module.exports=IntlRelativeFormat).default=exports}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.