import{t as e}from"./options-CDt8ZGCW.js";function t(t,r=`medium`,i=`medium`){if(!t)return``;let a=n(e.get(`formattingLocale`)||e.get(`locale`)||navigator.language),o;if(typeof t==`string`||typeof t==`number`)o=new Date(t);else if(t instanceof Date)o=t;else throw TypeError(`Invalid type for the "date" argument.`);if(i!==`none`&&r!==`none`)try{return new Intl.DateTimeFormat(a,{dateStyle:r,timeStyle:i}).format(o)}catch{return new Intl.DateTimeFormat(void 0,{dateStyle:r,timeStyle:i}).format(o)}else if(i===`none`&&r!==`none`)try{return o.toLocaleDateString(a,{dateStyle:r})}catch{return o.toLocaleDateString(void 0,{dateStyle:r})}else if(r===`none`&&i!==`none`)try{return o.toLocaleTimeString(a,{timeStyle:i})}catch{return o.toLocaleTimeString(void 0,{timeStyle:i})}throw Error(`Incorrect state.`)}function n(e){switch(e=e.replaceAll(`_`,`-`),e){case`cn`:return`zh-CN`;case`tw`:return`zh-TW`;default:return e}}export{t};