"use strict";let f=new Map,u=!1;try{u=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let l=!1;try{l=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const c={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class p{format(t){let e="";if(!u&&this.options.signDisplay!=null?e=d(this.numberFormatter,this.options.signDisplay,t):e=this.numberFormatter.format(t),this.options.style==="unit"&&!l){var i;let{unit:a,unitDisplay:s="short",locale:n}=this.resolvedOptions();if(!a)return e;let o=(i=c[a])===null||i===void 0?void 0:i[s];e+=o[n]||o.default}return e}formatToParts(t){return this.numberFormatter.formatToParts(t)}formatRange(t,e){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(t,e);if(e<t)throw new RangeError("End date must be >= start date");return`${this.format(t)} – ${this.format(e)}`}formatRangeToParts(t,e){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(t,e);if(e<t)throw new RangeError("End date must be >= start date");let i=this.numberFormatter.formatToParts(t),a=this.numberFormatter.formatToParts(e);return[...i.map(s=>({...s,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...a.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let t=this.numberFormatter.resolvedOptions();return!u&&this.options.signDisplay!=null&&(t={...t,signDisplay:this.options.signDisplay}),!l&&this.options.style==="unit"&&(t={...t,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),t}constructor(t,e={}){this.numberFormatter=m(t,e),this.options=e}}function m(r,t={}){let{numberingSystem:e}=t;if(e&&r.includes("-nu-")&&(r.includes("-u-")||(r+="-u-"),r+=`-nu-${e}`),t.style==="unit"&&!l){var i;let{unit:n,unitDisplay:o="short"}=t;if(!n)throw new Error('unit option must be provided with style: "unit"');if(!(!((i=c[n])===null||i===void 0)&&i[o]))throw new Error(`Unsupported unit ${n} with unitDisplay = ${o}`);t={...t,style:"decimal"}}let a=r+(t?Object.entries(t).sort((n,o)=>n[0]<o[0]?-1:1).join():"");if(f.has(a))return f.get(a);let s=new Intl.NumberFormat(r,t);return f.set(a,s),s}function d(r,t,e){if(t==="auto")return r.format(e);if(t==="never")return r.format(Math.abs(e));{let i=!1;if(t==="always"?i=e>0||Object.is(e,0):t==="exceptZero"&&(Object.is(e,-0)||Object.is(e,0)?e=Math.abs(e):i=e>0),i){let a=r.format(-e),s=r.format(e),n=a.replace(s,"").replace(/\u200e|\u061C/,"");return[...n].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),a.replace(s,"!!!").replace(n,"+").replace("!!!",s)}else return r.format(e)}}exports.$488c6ddbf4ef74c2$export$cc77c4ff7e8673c5=p;
//# sourceMappingURL=NumberFormatter-DewVDY5w.cjs.js.map
