"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("mime");let s;function o(n){s=n}function l(n,a){const t=a.split(",").map(e=>e.trim());for(const e of t){if(e==="*")return!0;if(e.endsWith("/*")){const[p]=e.split("/"),[r]=n.type.split("/");if(p===r)return!0}else if(/^\./.test(e)){if(n.type===i.getType(e))return!0;const p=n.name?.lastIndexOf(".");if(p>-1&&n.name?.slice(p)===e)return!0}else{if(n.type===e)return!0;const p=n.name?.lastIndexOf(".");if(p>-1&&[...i.getAllExtensions(e)||[]].map(c=>`.${c}`).includes(n.name?.slice(p)))return!0}}return!1}function u(n){const a={image:s("ap.apUpload.pictureType"),video:s("ap.apUpload.videoType"),audio:s("ap.apUpload.audioType"),application:s("ap.apUpload.documentType"),"*":s("ap.apUpload.allTypes")};return n.split(",").map(t=>t.trim()).map(t=>{if(t==="*")return a[t];if(t.endsWith("/*")){const[e]=t.split("/");return a[e]||e}else return/^\./.test(t)?t:[...i.getAllExtensions(t)||[]].map(e=>`.${e}`).join(",")||t}).join(",")}exports.fileMatchesAccept=l;exports.getAcceptText=u;exports.injectLocaleToAccept=o;
