@anoki/fse-marche-ui
Version:
FSE UI components library
3 lines (2 loc) • 4.19 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index.cjs130.js"),k=require("./index.cjs4.js"),d=require("./index.cjs128.js");function f(e){return typeof e>"u"}function b(e){return typeof e=="number"}function p(e){return typeof e=="number"&&e%1===0}function N(e){return typeof e=="string"}function S(e){return Object.prototype.toString.call(e)==="[object Date]"}function T(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function v(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function D(e){return Array.isArray(e)?e:[e]}function $(e,n,t){if(e.length!==0)return e.reduce((r,o)=>{const u=[n(o),o];return r&&t(r[0],u[0])===r[0]?r:u},null)[1]}function y(e,n){return n.reduce((t,r)=>(t[r]=e[r],t),{})}function h(e,n){return Object.prototype.hasOwnProperty.call(e,n)}function L(e){if(e==null)return null;if(typeof e!="object")throw new s.InvalidArgumentError("Week settings must be an object");if(!a(e.firstDay,1,7)||!a(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(n=>!a(n,1,7)))throw new s.InvalidArgumentError("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function a(e,n,t){return p(e)&&e>=n&&e<=t}function w(e,n){return e-n*Math.floor(e/n)}function i(e,n=2){const t=e<0;let r;return t?r="-"+(""+-e).padStart(n,"0"):r=(""+e).padStart(n,"0"),r}function A(e){if(!(f(e)||e===null||e===""))return parseInt(e,10)}function Y(e){if(!(f(e)||e===null||e===""))return parseFloat(e)}function W(e){if(!(f(e)||e===null||e==="")){const n=parseFloat("0."+e)*1e3;return Math.floor(n)}}function C(e,n,t=!1){const r=10**n;return(t?Math.trunc:Math.round)(e*r)/r}function l(e){return e%4===0&&(e%100!==0||e%400===0)}function I(e){return l(e)?366:365}function F(e,n){const t=w(n-1,12)+1,r=e+(n-t)/12;return t===2?l(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function P(e){let n=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(n=new Date(n),n.setUTCFullYear(e.year,e.month-1,e.day)),+n}function m(e,n,t){return-d.isoWeekdayToLocal(d.dayOfWeek(e,1,n),t)+n-1}function z(e,n=4,t=1){const r=m(e,n,t),o=m(e+1,n,t);return(I(e)-r+o)/7}function B(e){return e>99?e:e>k.twoDigitCutoffYear?1900+e:2e3+e}function E(e,n,t,r=null){const o=new Date(e),u={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(u.timeZone=r);const g={timeZoneName:n,...u},c=new Intl.DateTimeFormat(t,g).formatToParts(o).find(M=>M.type.toLowerCase()==="timezonename");return c?c.value:null}function R(e,n){let t=parseInt(e,10);Number.isNaN(t)&&(t=0);const r=parseInt(n,10)||0,o=t<0||Object.is(t,-0)?-r:r;return t*60+o}function O(e){const n=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(n))throw new s.InvalidArgumentError(`Invalid unit value ${e}`);return n}function U(e,n){const t={};for(const r in e)if(h(e,r)){const o=e[r];if(o==null)continue;t[n(r)]=O(o)}return t}function q(e,n){const t=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(n){case"short":return`${o}${i(t,2)}:${i(r,2)}`;case"narrow":return`${o}${t}${r>0?`:${r}`:""}`;case"techie":return`${o}${i(t,2)}${i(r,2)}`;default:throw new RangeError(`Value format ${n} is out of range for property format`)}}function Z(e){return y(e,["hour","minute","second","millisecond"])}exports.asNumber=O;exports.bestBy=$;exports.daysInMonth=F;exports.daysInYear=I;exports.floorMod=w;exports.formatOffset=q;exports.hasLocaleWeekInfo=v;exports.hasOwnProperty=h;exports.hasRelative=T;exports.integerBetween=a;exports.isDate=S;exports.isInteger=p;exports.isLeapYear=l;exports.isNumber=b;exports.isString=N;exports.isUndefined=f;exports.maybeArray=D;exports.normalizeObject=U;exports.objToLocalTS=P;exports.padStart=i;exports.parseFloating=Y;exports.parseInteger=A;exports.parseMillis=W;exports.parseZoneInfo=E;exports.pick=y;exports.roundTo=C;exports.signedOffset=R;exports.timeObject=Z;exports.untruncateYear=B;exports.validateWeekSettings=L;exports.weeksInWeekYear=z;
//# sourceMappingURL=index.cjs124.js.map