{"version":3,"sources":["https://lively-kernel.org/lively4/lively4-mpm-debugging/src/client/mimetypes.js"],"names":["Mimetypes","load","mimetypes","fileToType","typeToFile","split","forEach","line","ea","fileending","replace","description","mimetype","ending","extension"],"mappings":";;;;;;;;AACe,YAAMA,SAAN,CAAgB;;AAE7B;AACA,eAAOC,IAAP,GAAc;AACZ,cAAIC,YACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CADG;;AAyEA,eAAKC,UAAL,GAAkB,EAAlB;AACA,eAAKC,UAAL,GAAkB,EAAlB;;AAEAF,oBAAUG,KAAV,CAAgB,IAAhB,EAAsBC,OAAtB,CAA8BC,QAAQ;AACpC,gBAAIC,KAAKD,KAAKF,KAAL,CAAW,IAAX,CAAT;AACA,gBAAII,aAAaD,GAAG,CAAH,EAAME,OAAN,CAAc,KAAd,EAAoB,EAApB,CAAjB;AACA,gBAAIC,cAAcH,GAAG,CAAH,CAAlB;AACA,gBAAII,WAAWJ,GAAG,CAAH,CAAf;;AAEA,iBAAKL,UAAL,CAAgBM,UAAhB,IAA8BG,QAA9B;AACA,iBAAKR,UAAL,CAAgBQ,QAAhB,IAA6BH,UAA7B;AACD,WARD;AASD;;AAED,eAAOG,QAAP,CAAgBC,MAAhB,EAAwB;AACtB,iBAAO,KAAKV,UAAL,CAAgBU,MAAhB,CAAP;AACD;;AAED,eAAOC,SAAP,CAAiBD,MAAjB,EAAyB;AACvB,iBAAO,KAAKT,UAAL,CAAgBS,MAAhB,CAAP;AACD;AAjG4B;;yBAAVb,S;;;;;;;;;;;;;;;;AAoGrBA,gBAAUC,IAAV","file":"mimetypes.js","sourcesContent":["\nexport default class Mimetypes {\n  \n  // from https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types\n  static load() {\n    var mimetypes = \n`.aac\tAAC audio file\taudio/aac\n.abw\tAbiWord document\tapplication/x-abiword\n.arc\tArchive document (multiple files embedded)\tapplication/octet-stream\n.avi\tAVI: Audio Video Interleave\tvideo/x-msvideo\n.azw\tAmazon Kindle eBook format\tapplication/vnd.amazon.ebook\n.bin\tAny kind of binary data\tapplication/octet-stream\n.bz\tBZip archive\tapplication/x-bzip\n.bz2\tBZip2 archive\tapplication/x-bzip2\n.csh\tC-Shell script\tapplication/x-csh\n.css\tCascading Style Sheets (CSS)\ttext/css\n.csv\tComma-separated values (CSV)\ttext/csv\n.doc\tMicrosoft Word\tapplication/msword\n.docx\tMicrosoft Word (OpenXML)\tapplication/vnd.openxmlformats-officedocument.wordprocessingml.document\n.eot\tMS Embedded OpenType fonts\tapplication/vnd.ms-fontobject\n.epub\tElectronic publication (EPUB)\tapplication/epub+zip\n.gif\tGraphics Interchange Format (GIF)\timage/gif\n.htm\n.html\tHyperText Markup Language (HTML)\ttext/html\n.ico\tIcon format\timage/x-icon\n.ics\tiCalendar format\ttext/calendar\n.jar\tJava Archive (JAR)\tapplication/java-archive\n.jpeg\n.jpg\tJPEG images\timage/jpeg\n.js\tJavaScript (ECMAScript)\tapplication/javascript\n.json\tJSON format\tapplication/json\n.mid\n.midi\tMusical Instrument Digital Interface (MIDI)\taudio/midi\n.mpeg\tMPEG Video\tvideo/mpeg\n.mpkg\tApple Installer Package\tapplication/vnd.apple.installer+xml\n.odp\tOpenDocument presentation document\tapplication/vnd.oasis.opendocument.presentation\n.ods\tOpenDocument spreadsheet document\tapplication/vnd.oasis.opendocument.spreadsheet\n.odt\tOpenDocument text document\tapplication/vnd.oasis.opendocument.text\n.oga\tOGG audio\taudio/ogg\n.ogv\tOGG video\tvideo/ogg\n.ogx\tOGG\tapplication/ogg\n.otf\tOpenType font\tfont/otf\n.png\tPortable Network Graphics\timage/png\n.pdf\tAdobe Portable Document Format (PDF)\tapplication/pdf\n.ppt\tMicrosoft PowerPoint\tapplication/vnd.ms-powerpoint\n.pptx\tMicrosoft PowerPoint (OpenXML)\tapplication/vnd.openxmlformats-officedocument.presentationml.presentation\n.rar\tRAR archive\tapplication/x-rar-compressed\n.rtf\tRich Text Format (RTF)\tapplication/rtf\n.sh\tBourne shell script\tapplication/x-sh\n.svg\tScalable Vector Graphics (SVG)\timage/svg+xml\n.swf\tSmall web format (SWF) or Adobe Flash document\tapplication/x-shockwave-flash\n.tar\tTape Archive (TAR)\tapplication/x-tar\n.tif\n.tiff\tTagged Image File Format (TIFF)\timage/tiff\n.ts\tTypescript file\tapplication/typescript\n.ttf\tTrueType Font\tfont/ttf\n.vsd\tMicrosoft Visio\tapplication/vnd.visio\n.wav\tWaveform Audio Format\taudio/x-wav\n.weba\tWEBM audio\taudio/webm\n.webm\tWEBM video\tvideo/webm\n.webp\tWEBP image\timage/webp\n.woff\tWeb Open Font Format (WOFF)\tfont/woff\n.woff2\tWeb Open Font Format (WOFF)\tfont/woff2\n.xhtml\tXHTML\tapplication/xhtml+xml\n.xls\tMicrosoft Excel\tapplication/vnd.ms-excel\n.xlsx\tMicrosoft Excel (OpenXML)\tapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n.xml\tXML\tapplication/xml\n.xul\tXUL\tapplication/vnd.mozilla.xul+xml\n.zip\tZIP archive\tapplication/zip\n.3gp\t3GPP audio/video container\tvideo/3gpp\naudio/3gpp if it doesn't contain video\n.3g2\t3GPP2 audio/video container\tvideo/3gpp2\naudio/3gpp2 if it doesn't contain video\n.7z\t7-zip archive\tapplication/x-7z-compressed\n.md\tCUSTOM markdown\ttext/markdown\n.txt\tCUSTOM text\ttext/plain\n`\n\n    this.fileToType = {}\n    this.typeToFile = {}\n\n    mimetypes.split(\"\\n\").forEach(line => {\n      var ea = line.split(\"\\t\")\n      var fileending = ea[0].replace(/^\\./,\"\")\n      var description = ea[1]\n      var mimetype = ea[2]\n\n      this.fileToType[fileending] = mimetype\n      this.typeToFile[mimetype] =  fileending\n    })\n  } \n\n  static mimetype(ending) {\n    return this.fileToType[ending]\n  }\n\n  static extension(ending) {\n    return this.typeToFile[ending]\n  }\n}\n\nMimetypes.load()\n\n"]}